[cig-commits] commit: Set up some infrastructure for computing v in a general manner. Also
Mercurial
hg at geodynamics.org
Wed Mar 21 16:14:19 PDT 2012
changeset: 104:ce3129de86ff
user: Walter Landry <wlandry at caltech.edu>
date: Wed Mar 21 04:26:49 2012 -0700
files: compute_v_on_interface/compute_dv_dtt.cxx compute_v_on_interface/compute_v_on_interface.cxx
description:
Set up some infrastructure for computing v in a general manner. Also
remove the no longer used dzy_yx_jump and dzx_yx_jump functions.
diff -r 1ca7a2a82be9 -r ce3129de86ff compute_v_on_interface/compute_dv_dtt.cxx
--- a/compute_v_on_interface/compute_dv_dtt.cxx Wed Mar 21 03:47:38 2012 -0700
+++ b/compute_v_on_interface/compute_dv_dtt.cxx Wed Mar 21 04:26:49 2012 -0700
@@ -23,7 +23,9 @@ void compute_dv_dtt(const double zx[Nx+1
FTensor::Tensor1<double,2> &ddv,
FTensor::Tensor1<double,2> &ddv_dv,
FTensor::Tensor1<double,2> &dv,
- FTensor::Tensor1<double,2> &dv_dv)
+ FTensor::Tensor1<double,2> &dv_dv,
+ FTensor::Tensor1<double,2> &v,
+ FTensor::Tensor1<double,2> &v_dv)
{
const int max_r=4;
@@ -218,26 +220,26 @@ void compute_dv_dtt(const double zx[Nx+1
{
std::vector<Valid> derivs[2];
/* First derivative */
- for(auto &v: d_valid(d0))
+ for(auto &V: d_valid(d0))
{
- if(v.valid)
+ if(V.valid)
{
- const int pm=(v.sign==-1 ? 0 : 1);
+ const int pm=(V.sign==-1 ? 0 : 1);
switch(derivs[pm].size())
{
default:
break;
case 0:
case 1:
- derivs[pm].push_back(v);
+ derivs[pm].push_back(V);
break;
case 2:
Valid &v0(derivs[pm][0]);
Valid &v1(derivs[pm][1]);
- if(!((v0.i==v1.i && v1.i==v.i)
- || (v0.j==v1.j && v1.j==v.j)))
+ if(!((v0.i==v1.i && v1.i==V.i)
+ || (v0.j==v1.j && v1.j==V.j)))
{
- derivs[pm].push_back(v);
+ derivs[pm].push_back(V);
if(d==0)
compute_1st_derivs(0,derivs[pm],d0,Nx+1,
zx,log_etax,dv_pm[pm]);
@@ -252,18 +254,18 @@ void compute_dv_dtt(const double zx[Nx+1
/* Second derivative */
for(int d1=d0;d1<2;++d1)
{
- for(auto &v: dd_valid(d0,d1))
+ for(auto &V: dd_valid(d0,d1))
{
for(int pm=0;pm<2;++pm)
{
- if(v.sign==(pm==0 ? -1 : 1) && v.valid && !is_set(pm,d0,d1))
+ if(V.sign==(pm==0 ? -1 : 1) && V.valid && !is_set(pm,d0,d1))
{
is_set(pm,d0,d1)=true;
if(d==0)
- compute_2nd_derivs(0,v,d0,d1,Nx+1,zx,log_etax,
+ compute_2nd_derivs(0,V,d0,d1,Nx+1,zx,log_etax,
ddv_pm[pm],eta_pm[pm]);
else
- compute_2nd_derivs(1,v,d0,d1,Nx,zy,log_etay,
+ compute_2nd_derivs(1,V,d0,d1,Nx,zy,log_etay,
ddv_pm[pm],eta_pm[pm]);
}
}
diff -r 1ca7a2a82be9 -r ce3129de86ff compute_v_on_interface/compute_v_on_interface.cxx
--- a/compute_v_on_interface/compute_v_on_interface.cxx Wed Mar 21 03:47:38 2012 -0700
+++ b/compute_v_on_interface/compute_v_on_interface.cxx Wed Mar 21 04:26:49 2012 -0700
@@ -36,19 +36,9 @@ double compute_v(const double z[][ny],
}
/* For now, hard code the solCx answer */
-double dzy_yx_jump(const double &dvx_yy)
-{
- return -eta_jump*dvx_yy;
-}
-
double dzx_x_jump(const double &dvy_y)
{
return -eta_jump*dvy_y;
-}
-
-double dzx_yx_jump(const double &dvy_yy)
-{
- return -eta_jump*dvy_yy;
}
double dzy_x_jump(const double &dvx_y)
@@ -69,7 +59,9 @@ void compute_dv_dtt(const double zx[Nx+1
FTensor::Tensor1<double,2> &ddv,
FTensor::Tensor1<double,2> &ddv_dv,
FTensor::Tensor1<double,2> &dv,
- FTensor::Tensor1<double,2> &dv_dv);
+ FTensor::Tensor1<double,2> &dv_dv,
+ FTensor::Tensor1<double,2> &v,
+ FTensor::Tensor1<double,2> &v_dv);
void compute_v_on_interface(const double zx[Nx+1][Ny],
const double zy[Nx][Ny+1],
@@ -125,9 +117,9 @@ void compute_v_on_interface(const double
tangent(0)=-norm(1);
tangent(1)=norm(0);
- FTensor::Tensor1<double,2> ddv_dv_temp,dv_dv_temp;
- compute_dv_dtt(zx,zy,log_etax,log_etay,distx,disty,pos,
- norm,tangent,i,j,ddv,ddv_dv_temp,dv,dv_dv_temp);
+ FTensor::Tensor1<double,2> ddv_dv_temp,dv_dv_temp,v_temp,v_dv_temp;
+ compute_dv_dtt(zx,zy,log_etax,log_etay,distx,disty,pos,norm,tangent,
+ i,j,ddv,ddv_dv_temp,dv,dv_dv_temp,v,v_dv_temp);
v(0)=compute_v(zx,log_etax,dzx_x_jump(dv(1)),dx_i,ix,j);
v(1)=0;
@@ -171,9 +163,9 @@ void compute_v_on_interface(const double
tangent(0)=-norm(1);
tangent(1)=norm(0);
- FTensor::Tensor1<double,2> ddv_temp, ddv_dv_temp,dv_dv_temp;
- compute_dv_dtt(zx,zy,log_etax,log_etay,distx,disty,pos,
- norm,tangent,i,j,ddv,ddv_dv_temp,dv,dv_dv_temp);
+ FTensor::Tensor1<double,2> ddv_dv_temp,dv_dv_temp,v_temp,v_dv_temp;
+ compute_dv_dtt(zx,zy,log_etax,log_etay,distx,disty,pos,norm,tangent,
+ i,j,ddv,ddv_dv_temp,dv,dv_dv_temp,v_temp,v_dv_temp);
v(1)=compute_v(zy,log_etay,dzy_x_jump(dv(0)),dx_j,iy,j);
v(0)=0;
More information about the CIG-COMMITS
mailing list