[cig-commits] commit: Implement corner fix. Untested.
Mercurial
hg at geodynamics.org
Wed Mar 28 02:44:23 PDT 2012
changeset: 119:488d465c637a
user: Walter Landry <wlandry at caltech.edu>
date: Sun Mar 25 20:21:23 2012 -0700
files: compute_Cxyz.cxx
description:
Implement corner fix. Untested.
diff -r dadba81bf86f -r 488d465c637a compute_Cxyz.cxx
--- a/compute_Cxyz.cxx Sun Mar 25 20:02:27 2012 -0700
+++ b/compute_Cxyz.cxx Sun Mar 25 20:21:23 2012 -0700
@@ -61,10 +61,10 @@ void compute_Cxyz(const double zx[Nx+1][
compute_jumps(v,dv,ddv,z_jump,dz_jump,ddz_jump,p_jump,dp_jump);
double dz_dd_correction=
- -xyz(a)*(z_jump(a) + dz_jump(a,b)*dx(b)
- + ddz_jump(a,b,c)*dx(b)*dx(c)/2)/(h*h);
+ xyz(a)*(z_jump(a) + dz_jump(a,b)*dx(b)
+ + ddz_jump(a,b,c)*dx(b)*dx(c)/2)/(h*h);
- const int dz_dd_factor((pos(dd)>interface.pos[dd](dd) ? -1 : 1)
+ const int dz_dd_factor(sign(pos(dd)-interface.pos[dd](dd))
*(d==dd ? 2 : 1));
C+=dz_dd_factor*dz_dd_correction;
@@ -110,5 +110,21 @@ void compute_Cxyz(const double zx[Nx+1][
interface.corner_pos[dd][ee],d,
v,dv,ddv);
+ FTensor::Tensor1<double,2> z_jump;
+ FTensor::Tensor2<double,2,2> dz_jump;
+ FTensor::Tensor3_christof<double,2,2> ddz_jump;
+ double p_jump;
+ FTensor::Tensor1<double,2> dp_jump;
+
+ compute_jumps(v,dv,ddv,z_jump,dz_jump,ddz_jump,p_jump,dp_jump);
+
+ FTensor::Tensor1<double,2> dx;
+ for(int aa=0;aa<2;++aa)
+ dx(aa)=pos(aa) - interface.corner_pos[dd][ee](aa)
+ - (h/2)*sign(pos(aa) - interface.corner_pos[dd][ee](aa));
+
+ C+=-sign(dx(0))*sign(dx(1))*xyz(a)
+ *(z_jump(a) + dz_jump(a,b)*dx(b)
+ + ddz_jump(a,b,c)*dx(b)*dx(c)/2)/(h*h);
}
}
More information about the CIG-COMMITS
mailing list