Added TriLinearPoly to common/pmmc.h
This commit is contained in:
parent
a45e23d9d5
commit
39f0ac6394
@ -306,12 +306,19 @@ class TriLinearPoly{
|
||||
* Values are provided at the corners in CubeValues
|
||||
* x,y,z must be defined on [0,1] where the length of the cube edge is one
|
||||
*/
|
||||
int ic,jc,kc,
|
||||
double a,b,c,d,e,f,g,h;
|
||||
double x,y,z;
|
||||
DoubleArray CubeValues;
|
||||
public:
|
||||
TriLinearPoly(DoubleArray &A, int i, int j, int k){
|
||||
TriLinearPoly(){
|
||||
CubeValues.New(2,2,2);
|
||||
}
|
||||
|
||||
void assign(DoubleArray &A, int i, int j, int k){
|
||||
|
||||
ic=i; jc=j; kc=k
|
||||
|
||||
CubeValues(0,0,0) = A(i,j,k);
|
||||
CubeValues(1,0,0) = A(i+1,j,k);
|
||||
CubeValues(0,1,0) = A(i,j+1,k);
|
||||
@ -331,8 +338,11 @@ public:
|
||||
h = CubeValues(1,1,1)-a-b-c-d-e-f-g;
|
||||
}
|
||||
|
||||
double eval(double x, double y, double z){
|
||||
double eval(Point P){
|
||||
double returnValue;
|
||||
x = P.x - 1.0*ic;
|
||||
y = P.y - 1.0*jc;
|
||||
z = P.z - 1.0*kc;
|
||||
returnValue = a + b*x + c*y+d*z + e*x*y + f*x*z + g*y*z + h*x*y*z;
|
||||
return returnValue;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user