File size: 2,436 Bytes
5070096 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
standard library package TensorCalculations {
doc
/*
* This package package defines calculations for the construction of and computations on TensorQuantityValues.
*/
private import ScalarValues::Boolean;
private import ScalarValues::Number;
private import Quantities::ScalarQuantityValue;
private import Quantities::VectorQuantityValue;
private import Quantities::TensorQuantityValue;
private import MeasurementReferences::TensorMeasurementReference;
private import MeasurementReferences::CoordinateTransformation;
calc def '[' specializes BaseFunctions::'[' {
in elements: Number[1..n] ordered;
in mRef: TensorMeasurementReference[1];
return quantity: TensorQuantityValue[1];
private attribute n = mRef.flattenedSize;
}
calc def isZeroTensorQuantity {
in x : TensorQuantityValue[1];
return : Boolean[1];
}
calc def isUnitTensorQuantity {
in x : TensorQuantityValue[1];
return : Boolean[1];
}
/* Addition and subtraction */
calc def '+' :> DataFunctions::'+' { in : TensorQuantityValue[1]; in : TensorQuantityValue[1]; return : TensorQuantityValue[1]; }
calc def '-' :> DataFunctions::'-' { in : TensorQuantityValue[1]; in : TensorQuantityValue[1]; return : TensorQuantityValue[1]; }
/* Multiplication and division */
calc def scalarTensorMult { in : Number[1]; in : TensorQuantityValue[1]; return : TensorQuantityValue[1]; }
calc def TensorScalarMult { in : TensorQuantityValue[1]; in : Number[1]; return : TensorQuantityValue[1]; }
calc def scalarQuantityTensorMult { in : ScalarQuantityValue[1]; in : TensorQuantityValue[1]; return : TensorQuantityValue[1]; }
calc def TensorScalarQuantityMult { in : TensorQuantityValue[1]; in : ScalarQuantityValue[1]; return : TensorQuantityValue[1]; }
calc def tensorVectorMult { in : TensorQuantityValue[1]; in : VectorQuantityValue[1]; return : VectorQuantityValue[1]; }
calc def vectorTensorMult { in : VectorQuantityValue[1]; in : TensorQuantityValue[1]; return : VectorQuantityValue[1]; }
calc def tensorTensorMult { in : TensorQuantityValue[1]; in : TensorQuantityValue[1]; return : TensorQuantityValue[1]; }
/* Tensor transformation */
calc def transform {
in transformation : CoordinateTransformation;
in sourceTensor : TensorQuantityValue;
return targetTensor : TensorQuantityValue;
}
} |