5 #ifndef _LINEARIZEDIELECTRIC_H_
6 #define _LINEARIZEDIELECTRIC_H_
23 template<
class X,
class Diag,
class OffDiag>
37 const Field& dielectric_constant,
57 const TArray& faceAreaMag =
60 const XArray& xCell =
dynamic_cast<const XArray&
>(xField[cVarIndex]);
70 XArray& rCell =
dynamic_cast<XArray&
>(rField[cVarIndex]);
76 for (
int c=0; c<nCells; c++)
79 const int nb = cellCells.
getCount(c);
81 throw CException(
"invalid connectivity in shellMesh");
88 rCell[c0] += src*volume;
91 for (
int i=0; i<nb; i++){
93 const int c1 = cellCells(c,i);
95 OffDiag& offdiag = matrix.
getCoeff(c0, c1);
97 VectorT3 ds=cellCentroid[c1]-cellCentroid[c0];
104 const X dFlux = diffCoeff*(xCell[c1]-xCell[c0]);
110 diag[c0] -= diffCoeff;
int getCount(const int i) const
Matrix & getMatrix(const Index &rowIndex, const Index &colIndex)
T harmonicAverage(const T &x0, const T &x1)
const GeomFields & _geomFields
const StorageSite & getParentFaceGroupSite() const
CCMatrix::DiagArray DiagArray
NumTypeTraits< X >::T_Scalar T_Scalar
OffDiag & getCoeff(const int i, const int j)
T mag(const Vector< T, 3 > &a)
Array< Diag > & getDiag()
Array< VectorT3 > VectorT3Array
const Field & _dielectric_constant
const T_Scalar _dielectric_thickness
pair< const Field *, const StorageSite * > ArrayIndex
CRMatrix< Diag, OffDiag, X > CCMatrix
const CRConnectivity & getCellCells() const
Vector< T_Scalar, 3 > VectorT3
const StorageSite & getCells() const
void discretize(const Mesh &mesh, MultiFieldMatrix &mfmatrix, MultiField &xField, MultiField &rField)
LinearizeDielectric(const GeomFields &geomFields, const Field &dielectric_constant, const T_Scalar dielectric_thickness, Field &varField, const T_Scalar source=0.0)