[cig-commits] r5496 - in long/3D/Gale/trunk/src/StGermain: .
Discretisation/Utils/src
walter at geodynamics.org
walter at geodynamics.org
Thu Dec 7 14:11:26 PST 2006
Author: walter
Date: 2006-12-07 14:11:25 -0800 (Thu, 07 Dec 2006)
New Revision: 5496
Modified:
long/3D/Gale/trunk/src/StGermain/
long/3D/Gale/trunk/src/StGermain/Discretisation/Utils/src/Operator.c
long/3D/Gale/trunk/src/StGermain/Discretisation/Utils/src/Operator.h
Log:
r3193 at earth: boo | 2006-12-07 14:10:37 -0800
r3189 at earth (orig r3896): JulianGiordani | 2006-11-19 20:59:16 -0800
* Adding a new function called TensorInvariant, so the invariant of fulltensors can be found.
* Also renaming a function ...
Operator_TensorInnerProduct ---> Operator_SymmetricTensorInnerProduct
because it should only act on a SymmetricTensor.
Property changes on: long/3D/Gale/trunk/src/StGermain
___________________________________________________________________
Name: svk:merge
- 1ef209d2-b310-0410-a72d-e20c9eb0015c:/cig:3181
afb6c753-b9d0-0310-b4e7-dbd8d91cdd35:/trunk/StGermain:3890
+ 1ef209d2-b310-0410-a72d-e20c9eb0015c:/cig:3193
afb6c753-b9d0-0310-b4e7-dbd8d91cdd35:/trunk/StGermain:3896
Modified: long/3D/Gale/trunk/src/StGermain/Discretisation/Utils/src/Operator.c
===================================================================
--- long/3D/Gale/trunk/src/StGermain/Discretisation/Utils/src/Operator.c 2006-12-07 22:09:17 UTC (rev 5495)
+++ long/3D/Gale/trunk/src/StGermain/Discretisation/Utils/src/Operator.c 2006-12-07 22:11:25 UTC (rev 5496)
@@ -393,11 +393,12 @@
TensorArray_GetTrace( velocityGradient, self->dim, result );
}
-void Operator_TensorInnerProduct( void* operator, double* operand0, double* operand1, double* result ) {
+void Operator_SymmetricTensorInnerProduct( void* operator, double* operand0, double* operand1, double* result ) {
Operator* self = (Operator*)operator;
Operator_FirewallBinary( self );
+ // Must be symmetric Tensors
if( self->dim == 2 ) {
*result = operand0[0] * operand1[0] + operand0[1] * operand1[1] + ( 2 * operand0[2] * operand1[2] );
} else {
@@ -408,8 +409,15 @@
}
}
+void Operator_TensorInvariant( void* operator, double* operand0, double* result ) {
+ Operator* self = (Operator*)operator;
+ Operator_FirewallUnary( self );
+ // Must be a full Tensor
+ *result = TensorArray_2ndInvariant( operand0, self->dim );
+}
+
/* HACK - This function isn't extensible */
Operator* Operator_NewFromName(
Name name,
@@ -503,8 +511,13 @@
else if ( ! strcasecmp( name, "TensorInnerProduct" ) ){
resultDofs = 1;
numberOfOperands = 2;
- _carryOut = Operator_TensorInnerProduct;
+ _carryOut = Operator_SymmetricTensorInnerProduct;
}
+ else if ( ! strcasecmp( name, "TensorInvariant" ) ){
+ resultDofs = 1;
+ numberOfOperands = 1;
+ _carryOut = Operator_TensorInvariant;
+ }
else if ( ! strcasecmp( name, "HorizontalDivergence" ) ){
resultDofs = 1;
numberOfOperands = 1;
Modified: long/3D/Gale/trunk/src/StGermain/Discretisation/Utils/src/Operator.h
===================================================================
--- long/3D/Gale/trunk/src/StGermain/Discretisation/Utils/src/Operator.h 2006-12-07 22:09:17 UTC (rev 5495)
+++ long/3D/Gale/trunk/src/StGermain/Discretisation/Utils/src/Operator.h 2006-12-07 22:11:25 UTC (rev 5496)
@@ -106,7 +106,7 @@
void Operator_HorizontalDivergence( void* operatorObject, double* velocityGradient, double* result ) ;
void Operator_VerticalVorticity( void* operatorObject, double* velocityGradient, double* result ) ;
void Operator_Divergence( void* operatorObject, double* velocityGradient, double* result ) ;
- void Operator_TensorInnerProduct( void* operatorOject, double* operand0, double* operand1, double* result );
+ void Operator_TensorInnerProduct( void* operatorObject, double* operand0, double* operand1, double* result );
Operator* Operator_NewFromName(
Name name,
More information about the cig-commits
mailing list