[cig-commits] r4319 - in long/3D/Gale/trunk/src/StGermain: .
Discretisation/Geometry/src
walter at geodynamics.org
walter at geodynamics.org
Thu Aug 17 17:16:50 PDT 2006
Author: walter
Date: 2006-08-17 17:16:49 -0700 (Thu, 17 Aug 2006)
New Revision: 4319
Modified:
long/3D/Gale/trunk/src/StGermain/
long/3D/Gale/trunk/src/StGermain/Discretisation/Geometry/src/ComplexVectorMath.c
long/3D/Gale/trunk/src/StGermain/Discretisation/Geometry/src/ComplexVectorMath.h
Log:
r2697 at earth: boo | 2006-08-17 17:14:15 -0700
r2651 at earth (orig r3732): KathleenHumble | 2006-08-01 00:28:19 -0700
Updated comments in files, mainly just making sure comments were
readable by doxygen
Property changes on: long/3D/Gale/trunk/src/StGermain
___________________________________________________________________
Name: svk:merge
- 1ef209d2-b310-0410-a72d-e20c9eb0015c:/cig:2696
afb6c753-b9d0-0310-b4e7-dbd8d91cdd35:/trunk/StGermain:3731
+ 1ef209d2-b310-0410-a72d-e20c9eb0015c:/cig:2697
afb6c753-b9d0-0310-b4e7-dbd8d91cdd35:/trunk/StGermain:3732
Modified: long/3D/Gale/trunk/src/StGermain/Discretisation/Geometry/src/ComplexVectorMath.c
===================================================================
--- long/3D/Gale/trunk/src/StGermain/Discretisation/Geometry/src/ComplexVectorMath.c 2006-08-18 00:16:46 UTC (rev 4318)
+++ long/3D/Gale/trunk/src/StGermain/Discretisation/Geometry/src/ComplexVectorMath.c 2006-08-18 00:16:49 UTC (rev 4319)
@@ -54,6 +54,7 @@
dest[2][REAL_PART] = set[2][REAL_PART];
dest[2][IMAG_PART] = set[2][IMAG_PART];
}
+
/**(Assumes 3D), Set complex numbers to entries of function.
One drawback, scalars must already be defined as complex numbers */
void ComplexVector_SetScalar( Cmplx a, Cmplx b, Cmplx c, CoordC dest ) {
@@ -67,21 +68,21 @@
}
- /** (Assumes 3D), Add two complex vectors: dest = a + b */
+/** (Assumes 3D), Add two complex vectors: dest = a + b */
void ComplexVector_Add( CoordC a, CoordC b, CoordC dest ) {
Cmplx_Add( a[0], b[0], dest[0] );
Cmplx_Add( a[1], b[1], dest[1] );
Cmplx_Add( a[2], b[2], dest[2] );
}
- /* (Assumes 3D), Subtract two complex vectors: dest = a - b */
+/** (Assumes 3D), Subtract two complex vectors: dest = a - b */
void ComplexVector_Sub( CoordC a, CoordC b, CoordC dest ) {
Cmplx_Subtract( a[0], b[0], dest[0] );
Cmplx_Subtract( a[1], b[1], dest[1] );
Cmplx_Subtract( a[2], b[2], dest[2] );
}
- /*(Assumes 3D), Returns the dot product of two complex vectors, a and b */
+/** (Assumes 3D), Returns the dot product of two complex vectors, a and b */
void ComplexVector_Dot(CoordC a, CoordC b, Cmplx destSum ) {
CoordC dest;
@@ -92,12 +93,14 @@
Cmplx_Add(destSum, dest[2], destSum);
}
- /** (Assumes 3D), Multiply two complex vectors: dest = a * s */
+
+/** (Assumes 3D), Multiply two complex vectors: dest = a * s */
void ComplexVector_Mult(CoordC a, Cmplx s, CoordC dest ) {
Cmplx_Multiply(a[0], s, dest[0]);
Cmplx_Multiply(a[1], s, dest[1]);
Cmplx_Multiply(a[2], s, dest[2]);
}
+
/** (Assumes 3D), Multiply complex vector by real number */
void ComplexVector_MultReal(CoordC a, double valueReal, CoordC dest ) {
Cmplx value;
@@ -108,7 +111,7 @@
Cmplx_Multiply(a[2], value, dest[2]);
}
- /** (Assumes 3D), Returns the magnitude of complex vector a */
+/** (Assumes 3D), Returns the magnitude of complex vector a */
double ComplexVector_Mag(CoordC a ) {
double a_0, a_1, a_2;
a_0 = Cmplx_Modulus(a[0]);
@@ -116,7 +119,8 @@
a_2 = Cmplx_Modulus(a[2]);
return sqrt(a_0*a_0 + a_1*a_1 + a_2*a_2);
}
- /** (Assumes 3D), vector projection of a onto b, store result in dest */
+
+/** (Assumes 3D), complexVector projection of a onto b, store result in dest */
void ComplexVector_Proj(CoordC a, CoordC b, CoordC dest ) {
/* Calculate norm of b */
Cmplx tmp;
@@ -126,7 +130,7 @@
ComplexVector_Mult( dest, tmp, dest );
}
-/** (Assumes 3D), Calculates cross product of two vectors */
+/** (Assumes 3D), Calculates cross product of two complex vectors */
void ComplexVector_Cross( CoordC a, CoordC b, CoordC dest ) {
Cmplx ans1, ans2;
@@ -145,7 +149,7 @@
}
-/** (Assumes 3D), Divide Complex vector by complex number */
+/** (Assumes 3D), Divide complex vector by complex number */
void ComplexVector_Div( CoordC a, Cmplx s, CoordC dest )
{
Cmplx inv, one;
@@ -198,7 +202,6 @@
See:
http://mathworld.wolfram.com/EulerAngles.html
http://mathworld.wolfram.com/EulerParameters.html */
-
void StGermain_RotateComplexVector(Cmplx* vector, double alpha, double beta,
double gama, Cmplx* rotatedVector) {
double rotationMatrix[3][3]; /* Indicies [Column][Row][Real or Imag] */
@@ -293,7 +296,7 @@
}
}
-/** Subtracts one vector from another -
+/** Subtracts one complex vector from another -
destination = vector1 - vector2
Destination vector may be the same as either of the other two input vectors
Function is optimised for 1-3 dimensions but will work for any dimension */
@@ -351,7 +354,7 @@
return sqrt(Cmplx_Modulus(dotProduct));
}
-/* StGermain_ComplexVectorDotProduct calculates the complex valued dot product of two
+/** StGermain_ComplexVectorDotProduct calculates the complex valued dot product of two
complex vectors
*/
void StGermain_ComplexVectorDotProduct(Cmplx* vector1, Cmplx* vector2, Dimension_Index dim, Cmplx dotProduct) {
@@ -438,7 +441,7 @@
}
-/* StGermain_ComplexVectorNormalise calculates the magnitude of a vector
+/** StGermain_ComplexVectorNormalise calculates the magnitude of a vector
\hat v = frac{v} / {|v|}
This function uses function StGermain_VectorDotProduct to calculate v . v.
Vector has to be of size dim Cmplx */
@@ -470,9 +473,8 @@
#define STGERMAIN_COMPLEXVECTOR_ONE_THIRD 0.3333333333333333333
-/*StGermain_ComplexTriangleCentroid Calculates the position vector to the centroid of a triangle whose verticies are given by position vectors
+/** StGermain_ComplexTriangleCentroid Calculates the position vector to the centroid of a triangle whose verticies are given by position vectors
Position vectors have to be of size dim Cmplx */
-
void StGermain_ComplexTriangleCentroid( Cmplx* centroid, Cmplx* pos0, Cmplx* pos1, Cmplx* pos2, Index dim) {
Cmplx tmp;
switch (dim) {
@@ -520,6 +522,7 @@
Journal_Printf( stream, "%g + i %g}\n", vector[d][REAL_PART], vector[d][IMAG_PART] );
}
+
/** Converts ComplexVector into a vector,
but only if there are no non-zero imaginary values. */
void ComplexVector_ToVector(CoordC complexVector, Dimension_Index dim, Coord vector) {
@@ -534,6 +537,7 @@
}
}
}
+
/** Converts vector into Complex vector, seting all imaginary
parts to zero */
void Vector_ToComplexVector(Coord vector, Dimension_Index dim, CoordC complexVector) {
Modified: long/3D/Gale/trunk/src/StGermain/Discretisation/Geometry/src/ComplexVectorMath.h
===================================================================
--- long/3D/Gale/trunk/src/StGermain/Discretisation/Geometry/src/ComplexVectorMath.h 2006-08-18 00:16:46 UTC (rev 4318)
+++ long/3D/Gale/trunk/src/StGermain/Discretisation/Geometry/src/ComplexVectorMath.h 2006-08-18 00:16:49 UTC (rev 4319)
@@ -87,8 +87,9 @@
void StGermain_PrintComplexVector( Stream* stream, Cmplx* vector, Index dim ) ;
-
- #define StGermain_PrintNamedComplexVector(stream, vector, dim) \
+
+/** Prints a named ComplexVector */
+#define StGermain_PrintNamedComplexVector(stream, vector, dim) \
do { \
Journal_Printf( stream, #vector " - " ); \
StGermain_PrintComplexVector( stream, vector, dim ); \
More information about the cig-commits
mailing list