5 #ifndef _LINEARIZEINTERFACEJUMP_H_
6 #define _LINEARIZEINTERFACEJUMP_H_
23 template<
class X,
class Diag,
class OffDiag>
56 const XArray& xCell =
dynamic_cast<const XArray&
>(xField[cVarIndex]);
60 XArray& rCell =
dynamic_cast<XArray&
>(rField[cVarIndex]);
72 XArray& rParentCell =
dynamic_cast<XArray&
>(rField[cVarIndexParent]);
81 XArray& rOtherCell =
dynamic_cast<XArray&
>(rField[cVarIndexOther]);
85 for (
int f=0; f<faces.
getCount(); f++)
88 int c0p = parentFaceCells(f,0);
89 int c1p = parentFaceCells(f,1);
99 const X leftFlux = rParentCell[c1p];
100 const OffDiag dRC0dXC3 = parentmatrix.
getCoeff(c1p, c0p);
101 const Diag dRC0dXC0 = parentdiag[c1p];
104 int c0o = otherFaceCells(f,0);
105 int c1o = otherFaceCells(f,1);
115 const X rightFlux = rOtherCell[c1o];
116 const OffDiag dRC0dXC2 = othermatrix.
getCoeff(c1o, c0o);
117 const OffDiag dRC0dXC1 = otherdiag[c1o];
122 const int c1 = cellCells(f,0);
123 const int c2 = cellCells(f,1);
124 const int c3 = cellCells(f,2);
127 OffDiag& offdiagC0_C1 = matrix.
getCoeff(c0, c1);
128 OffDiag& offdiagC0_C2 = matrix.
getCoeff(c0, c2);
129 OffDiag& offdiagC0_C3 = matrix.
getCoeff(c0, c3);
131 rCell[c0] = rightFlux + leftFlux;
132 offdiagC0_C1 = dRC0dXC1;
133 offdiagC0_C3 = dRC0dXC3;
134 offdiagC0_C2 = dRC0dXC2;
138 OffDiag& offdiagC1_C0 = matrix.
getCoeff(c1, c0);
145 OffDiag& offdiagC1_C2 = matrix.
getCoeff(c1, c2);
146 OffDiag& offdiagC1_C3 = matrix.
getCoeff(c1, c3);
152 cout << xCell[c0] <<
" " << xCell[c1] <<
" " << xCell[c2] <<
" " << xCell[c3] << endl;
Matrix & getMatrix(const Index &rowIndex, const Index &colIndex)
const StorageSite & getParentFaceGroupSite() const
LinearizeInterfaceJump(const T_Scalar A_coeff, const X B_coeff, Field &varField)
OffDiag & getCoeff(const int i, const int j)
Array< VectorT3 > VectorT3Array
CCMatrix::DiagArray DiagArray
Array< Diag > & getDiag()
const StorageSite & getOtherFaceGroupSite() const
pair< const Field *, const StorageSite * > ArrayIndex
CRMatrix< Diag, OffDiag, X > CCMatrix
const CRConnectivity & getCellCells() const
const StorageSite & getCells() const
Vector< T_Scalar, 3 > VectorT3
SquareTensor< T_Scalar, 2 > SquareTensorT2
const CRConnectivity & getFaceCells(const StorageSite &site) const
NumTypeTraits< X >::T_Scalar T_Scalar
void discretize(const Mesh &mesh, const Mesh &parentMesh, const Mesh &otherMesh, MultiFieldMatrix &mfmatrix, MultiField &xField, MultiField &rField)