Geophysical Inversion and Modelling Library  v1.5.1
GIMLI::ElementMatrix< ValueType > Class Template Reference
+ Collaboration diagram for GIMLI::ElementMatrix< ValueType >:

Public Member Functions

 ElementMatrix (Index dof=0)
 
const Vector< ValueType > & operator[] (Index row) const
 
void resize (Index rows, Index cols=0)
 
ElementMatrix< ValueType > & operator+= (const ElementMatrix< ValueType > &E)
 
Index size () const
 
Index rows () const
 
Index cols () const
 
const ValueType & getVal (Index i, Index j) const
 
void setVal (Index i, Index j, const ValueType &v)
 
void addVal (Index i, Index j, const ValueType &v)
 
void setMat (const Matrix< ValueType > &m)
 
Matrix< ValueType > * pMat ()
 
const Matrix< ValueType > & mat () const
 
const Vector< ValueType > & row (Index i) const
 
Vector< ValueType > col (Index i) const
 
void fillIds (const MeshEntity &ent, Index nC=1)
 
void setIds (const IndexArray &idsR, const IndexArray &idsC)
 
void setIds (const IndexArray &ids)
 
const IndexArrayids () const
 
const IndexArrayrowIDs () const
 
const IndexArraycolIDs () const
 
const Index idx (Index i) const
 
ElementMatrix< ValueType > & u (const MeshEntity &ent)
 
ElementMatrix< ValueType > & u2 (const MeshEntity &ent)
 
void getWeightsAndPoints (const MeshEntity &ent, const RVector *&w, const PosVector *&x, int order)
 
Vector< ValueType > stress (const MeshEntity &ent, const Matrix< ValueType > &C, const RVector &u, bool voigtNotation=false)
 
const Matrix< ValueType > & gradientBase () const
 
void fillGradientBase (const MeshEntity &ent, const RVector &w, const PosVector &x, Index nC, bool voigtNotation)
 
ElementMatrix< ValueType > & gradU (const Cell &cell, Index nC, bool voigtNotation=false)
 
ElementMatrix< ValueType > & gradU (const MeshEntity &ent, const RVector &w, const PosVector &x, Index nC, bool voigtNotation=false)
 
ElementMatrix< ValueType > & gradU2 (const Cell &cell, const Matrix< ValueType > &C, bool voigtNotation=false)
 
ElementMatrix< ValueType > & gradU2 (const Cell &cell, ValueType c)
 
ElementMatrix< ValueType > & gradU2 (const MeshEntity &ent, const Matrix< ValueType > &C, const RVector &w, const PosVector &x, bool voigtNotation=false)
 
ElementMatrix< ValueType > & ux2uy2uz2 (const Cell &cell, bool useCache=false)
 
ElementMatrix< ValueType > & u (const MeshEntity &ent, const RVector &w, const PosVector &x, bool verbose=false)
 
ElementMatrix< ValueType > & u2 (const MeshEntity &ent, const RVector &w, const PosVector &x, bool verbose=false)
 
ElementMatrix< ValueType > & ux2 (const MeshEntity &ent, const RVector &w, const PosVector &x, bool verbose=false)
 
ElementMatrix< ValueType > & ux2uy2 (const MeshEntity &ent, const RVector &w, const PosVector &x, bool verbose=false)
 
ElementMatrix< ValueType > & ux2uy2uz2 (const MeshEntity &ent, const RVector &w, const PosVector &x, bool verbose=false)
 
ElementMatrix< double > & dudi (const MeshEntity &ent, const RVector &w, const PosVector &x, Index i, bool verbose=false)
 
ElementMatrix< double > & ux (const MeshEntity &ent, const RVector &w, const PosVector &x, bool verbose=false)
 
ElementMatrix< double > & uy (const MeshEntity &ent, const RVector &w, const PosVector &x, bool verbose=false)
 
ElementMatrix< double > & uz (const MeshEntity &ent, const RVector &w, const PosVector &x, bool verbose=false)
 
Vector< ValueType > mult (const Vector< ValueType > &v)
 
void mult (const Vector< ValueType > &a, Vector< ValueType > &ret)
 
ValueType mult (const Vector< ValueType > &a, const Vector< ValueType > &b)
 
template<class Val >
Val mult_ (const Vector< Val > &a, const Vector< Val > &b, const Vector< Val > &m, const Vector< Val > &n)
 
double mult (const RVector &a, const RVector &b, const RVector &m, const RVector &n)
 
Complex mult (const CVector &a, const CVector &b, const CVector &m, const CVector &n)
 
 ElementMatrix (Index nCoeff, Index dofPerCoeff, Index dofOffset)
 
 ElementMatrix (const ElementMatrix< ValueType > &E)
 
void copyFrom (const ElementMatrix< ValueType > &E, bool withMat=true)
 
void init (Index nCoeff, Index dofPerCoeff, Index dofOffset)
 
ElementMatrix< ValueType > & pot (const MeshEntity &ent, Index order, bool sum, Index nCoeff, Index dof, Index dofOffset)
 
ElementMatrix< ValueType > & pot (const MeshEntity &ent, Index order, bool sum=false)
 
ElementMatrix< ValueType > & grad (const MeshEntity &ent, Index order, bool elastic, bool sum, bool div, Index nCoeff, Index dof, Index dofOffset, bool kelvin=false)
 
ElementMatrix< ValueType > & grad (const MeshEntity &ent, Index order, bool elastic=false, bool sum=false, bool div=false, bool kelvin=false)
 
void integrate () const
 
const std::vector< Matrix< ValueType > > & matX () const
 
std::vector< Matrix< ValueType > > * pMatX ()
 
const MeshEntityentity () const
 
const PosVectorx () const
 
const RVectorw () const
 
Index order () const
 
Index nCoeff () const
 
Index dofPerCoeff () const
 
Index dofOffset () const
 
void setDiv (bool div)
 
bool isDiv () const
 
bool isIntegrated () const
 
void integrated (bool i)
 
bool valid () const
 
void setValid (bool v)
 
bool elastic () const
 
bool oldStyle () const
 
DLLEXPORT ElementMatrix< double > & u (const MeshEntity &ent, const RVector &w, const PosVector &x, bool verbose)
 
DLLEXPORT ElementMatrix< double > & u2 (const MeshEntity &ent, const RVector &w, const PosVector &x, bool verbose)
 
DLLEXPORT ElementMatrix< double > & dudi (const MeshEntity &ent, const RVector &w, const PosVector &x, Index dim, bool verbose)
 
DLLEXPORT ElementMatrix< double > & ux2 (const MeshEntity &ent, const RVector &w, const PosVector &x, bool verbose)
 
ElementMatrix< double > &DLLEXPORT ux2uy2 (const MeshEntity &ent, const RVector &w, const PosVector &x, bool verbose)
 
DLLEXPORT ElementMatrix< double > & ux2uy2uz2 (const MeshEntity &ent, const RVector &w, const PosVector &x, bool verbose)
 
DLLEXPORT void fillGradientBase (const MeshEntity &ent, const RVector &w, const PosVector &x, Index nC, bool voigtNotation)
 
DLLEXPORT ElementMatrix< double > & gradU (const MeshEntity &ent, const RVector &w, const PosVector &x, Index nC, bool voigtNotation)
 
DLLEXPORT ElementMatrix< double > & gradU (const Cell &cell, Index nC, bool voigtNotation)
 
DLLEXPORT RVector stress (const MeshEntity &ent, const RMatrix &C, const RVector &u, bool voigtNotation)
 
DLLEXPORT ElementMatrix< double > & gradU2 (const MeshEntity &ent, const Matrix< double > &C, const RVector &w, const PosVector &x, bool voigtNotation)
 
DLLEXPORT ElementMatrix< double > & gradU2 (const Cell &cell, const Matrix< double > &C, bool voigtNotation)
 
DLLEXPORT ElementMatrix< double > & u (const MeshEntity &ent)
 
DLLEXPORT ElementMatrix< double > & u2 (const MeshEntity &ent)
 
DLLEXPORT ElementMatrix< double > & ux2uy2uz2 (const Cell &cell, bool useCache)
 
DLLEXPORT ElementMatrix (Index nCoeff, Index dofPerCoeff, Index dofOffset)
 
DLLEXPORT ElementMatrix (const ElementMatrix< double > &E)
 
DLLEXPORT void init (Index nCoeff, Index dofPerCoeff, Index dofOffset)
 
DLLEXPORT void copyFrom (const ElementMatrix< double > &E, bool withMat)
 
DLLEXPORT void integrate () const
 
DLLEXPORT ElementMatrix< double > & pot (const MeshEntity &ent, Index order, bool sum)
 
DLLEXPORT ElementMatrix< double > & pot (const MeshEntity &ent, Index order, bool sum, Index nCoeff, Index dof, Index dofOffset)
 
DLLEXPORT ElementMatrix< double > & grad (const MeshEntity &ent, Index order, bool elastic, bool sum, bool div, bool kelvin)
 
DLLEXPORT ElementMatrix< double > & grad (const MeshEntity &ent, Index order, bool elastic, bool sum, bool div, Index nCoeff, Index dof, Index dofOffset, bool kelvin)
 
DLLEXPORT void copyFrom (const ElementMatrix< double > &E, bool withMat)
 
DLLEXPORT void init (Index nCoeff, Index dofPerCoeff, Index dofOffset)
 

Protected Attributes

Matrix< ValueType > mat_
 
IndexArray _ids
 
IndexArray _idsC
 
IndexArray _idsR
 
std::map< uint, RVectoruCache_
 
std::map< uint, Matrix< ValueType > > u2Cache_
 
std::vector< Matrix< ValueType > > _B
 
Matrix< ValueType > _grad
 
Index _nDof
 
RMatrix dNdr_
 
RMatrix dNds_
 
RMatrix dNdt_
 
RMatrix dNdx_
 
RMatrix dNdy_
 
RMatrix dNdz_
 
RMatrix _abaTmp
 
Index _order
 
Index _nCoeff
 
Index _dofPerCoeff
 
Index _dofOffset
 
const MeshEntity_ent
 
const RVector_w
 
const PosVector_x
 
std::vector< Matrix< ValueType > > _matX
 
bool _newStyle
 
bool _div
 
bool _valid
 
bool _elastic
 
bool _integrated
 

Constructor & Destructor Documentation

◆ ElementMatrix()

template<class ValueType >
GIMLI::ElementMatrix< ValueType >::ElementMatrix ( Index  dof = 0)
inline

If dof != 0 then scalar field approximation is to be supposed. For vector field solution give a dof, means be the number of nodes of the current mesh.

Member Function Documentation

◆ col()

template<class ValueType >
Vector< ValueType > GIMLI::ElementMatrix< ValueType >::col ( Index  i) const
inline

Return data for col i.

Referenced by GIMLI::Vector< ValueType >::add().

◆ colIDs()

template<class ValueType >
const IndexArray& GIMLI::ElementMatrix< ValueType >::colIDs ( ) const
inline

Return all column node indices.

◆ entity()

template<class ValueType >
const MeshEntity& GIMLI::ElementMatrix< ValueType >::entity ( ) const
inline

Return const reference to the last active entity.

◆ fillGradientBase()

template<class ValueType >
void GIMLI::ElementMatrix< ValueType >::fillGradientBase ( const MeshEntity ent,
const RVector w,
const PosVector x,
Index  nC,
bool  voigtNotation 
)

Fill Element Gradients Matrix for all integration points.

◆ fillIds()

template<class ValueType >
template void GIMLI::ElementMatrix< ValueType >::fillIds ( const MeshEntity ent,
Index  nC = 1 
)

Fill the node ids with a number of coefficents. For vector field approximation give field dimension 2 or 3. Please note that you need to give the number of nodes to the ElementMatrix constructor.

◆ getWeightsAndPoints()

template<class ValueType >
template void GIMLI::ElementMatrix< ValueType >::getWeightsAndPoints ( const MeshEntity ent,
const RVector *&  w,
const PosVector *&  x,
int  order 
)

Get integration weights and points for the entity.

References GIMLI::Singleton< IntegrationRules >::instance(), and GIMLI::x().

◆ grad() [1/2]

template<class ValueType >
ElementMatrix< ValueType >& GIMLI::ElementMatrix< ValueType >::grad ( const MeshEntity ent,
Index  order,
bool  elastic,
bool  sum,
bool  div,
Index  nCoeff,
Index  dof,
Index  dofOffset,
bool  kelvin = false 
)

Fill this ElementMatrix with value (u for scalar, v for vector values) basis. Cache the matrix in entity

◆ grad() [2/2]

template<class ValueType >
ElementMatrix< ValueType >& GIMLI::ElementMatrix< ValueType >::grad ( const MeshEntity ent,
Index  order,
bool  elastic = false,
bool  sum = false,
bool  div = false,
bool  kelvin = false 
)

Fill this ElementMatrix with gradient of ent.

◆ gradientBase()

template<class ValueType >
const Matrix< ValueType >& GIMLI::ElementMatrix< ValueType >::gradientBase ( ) const
inline

Return gradient base for the last entity, i.e., integrate over gradient u over the cell.

◆ gradU() [1/2]

template<class ValueType >
ElementMatrix< ValueType >& GIMLI::ElementMatrix< ValueType >::gradU ( const Cell cell,
Index  nC,
bool  voigtNotation = false 
)

Fill this element matrix with int_domain C * grad u

◆ gradU() [2/2]

template<class ValueType >
ElementMatrix< ValueType >& GIMLI::ElementMatrix< ValueType >::gradU ( const MeshEntity ent,
const RVector w,
const PosVector x,
Index  nC,
bool  voigtNotation = false 
)

Fill this element matrix with int_domain C * grad u

◆ gradU2() [1/3]

template<class ValueType >
ElementMatrix< ValueType >& GIMLI::ElementMatrix< ValueType >::gradU2 ( const Cell cell,
const Matrix< ValueType > &  C,
bool  voigtNotation = false 
)

Fill this element matrix with int_domain C * grad u * grad u. For scalar field approximation define C.size() = (1x1) isotropic or anisotropic C.size() = (cell.dim() x cell.dim()) parameter. For vector field approximation create the ElementMatrix with appropriate dof and C can be of size = (1x1) for isotropic, (cell.dim() x cell.dim()) for anisotropic, or (3x3) for 2D elastic and (6x6) 3D elastic parameter. Notation for elastic parameters Kelvin notation as default and can be Voigt's notation if needed.

◆ gradU2() [2/3]

template<class ValueType >
ElementMatrix< ValueType >& GIMLI::ElementMatrix< ValueType >::gradU2 ( const Cell cell,
ValueType  c 
)
inline

Fill this element matrix with int_domain C * grad u * grad u.

◆ gradU2() [3/3]

template<class ValueType >
ElementMatrix< ValueType >& GIMLI::ElementMatrix< ValueType >::gradU2 ( const MeshEntity ent,
const Matrix< ValueType > &  C,
const RVector w,
const PosVector x,
bool  voigtNotation = false 
)

Fill this element matrix with int_domain C * grad u * grad u.

◆ ids()

template<class ValueType >
const IndexArray& GIMLI::ElementMatrix< ValueType >::ids ( ) const
inline

Return all node indices.

Referenced by GIMLI::Vector< ValueType >::add().

◆ idx()

template<class ValueType >
const Index GIMLI::ElementMatrix< ValueType >::idx ( Index  i) const
inline

Return the node index for node i.

Referenced by GIMLI::CreateSensitivityColMT< ValueType >::calc1().

◆ integrate()

template<class ValueType >
void GIMLI::ElementMatrix< ValueType >::integrate ( ) const

Integrate, i.e., sum over quadrature matrices.

Referenced by GIMLI::Vector< ValueType >::add(), and GIMLI::mult().

◆ mat()

template<class ValueType >
const Matrix< ValueType >& GIMLI::ElementMatrix< ValueType >::mat ( ) const
inline

Return data for row i.

◆ matX()

template<class ValueType >
const std::vector< Matrix < ValueType > >& GIMLI::ElementMatrix< ValueType >::matX ( ) const
inline

Return reference to all matrices per quadrature point.

Referenced by GIMLI::mult().

◆ mult() [1/2]

template<class ValueType >
ValueType GIMLI::ElementMatrix< ValueType >::mult ( const Vector< ValueType > &  a,
const Vector< ValueType > &  b 
)
inline

Return (S * a) * b

◆ mult() [2/2]

template<class ValueType >
void GIMLI::ElementMatrix< ValueType >::mult ( const Vector< ValueType > &  a,
Vector< ValueType > &  ret 
)
inline

Return S * a

◆ mult_()

template<class ValueType >
template<class Val >
Val GIMLI::ElementMatrix< ValueType >::mult_ ( const Vector< Val > &  a,
const Vector< Val > &  b,
const Vector< Val > &  m,
const Vector< Val > &  n 
)
inline

Return (S * (a-b)) * (m-n) TODO Check if its the same like mult(a-b, m-n)

◆ pMat()

template<class ValueType >
Matrix< ValueType >* GIMLI::ElementMatrix< ValueType >::pMat ( )
inline

Return data matrix.

◆ pot() [1/2]

template<class ValueType >
ElementMatrix< ValueType >& GIMLI::ElementMatrix< ValueType >::pot ( const MeshEntity ent,
Index  order,
bool  sum,
Index  nCoeff,
Index  dof,
Index  dofOffset 
)

Fill this ElementMatrix with value (u for scalar, v for vector values) basis. Cache the matrix in entity

◆ pot() [2/2]

template<class ValueType >
ElementMatrix< ValueType >& GIMLI::ElementMatrix< ValueType >::pot ( const MeshEntity ent,
Index  order,
bool  sum = false 
)

Fill this ElementMatrix with value (u for scalar, v for vector values) basis.

◆ row()

template<class ValueType >
const Vector< ValueType >& GIMLI::ElementMatrix< ValueType >::row ( Index  i) const
inline

Return data for row i.

Referenced by GIMLI::Vector< ValueType >::add().

◆ rowIDs()

template<class ValueType >
const IndexArray& GIMLI::ElementMatrix< ValueType >::rowIDs ( ) const
inline

Return all row node indices.

Referenced by GIMLI::Vector< ValueType >::add().

◆ setIds() [1/2]

template<class ValueType >
void GIMLI::ElementMatrix< ValueType >::setIds ( const IndexArray ids)
inline

Set all node indices.

◆ setIds() [2/2]

template<class ValueType >
void GIMLI::ElementMatrix< ValueType >::setIds ( const IndexArray idsR,
const IndexArray idsC 
)
inline

Set all node indices for row and columns. Can be unsymmetric.

◆ setMat()

template<class ValueType >
void GIMLI::ElementMatrix< ValueType >::setMat ( const Matrix< ValueType > &  m)
inline

Set data matrix.

◆ stress()

template<class ValueType >
Vector< ValueType > GIMLI::ElementMatrix< ValueType >::stress ( const MeshEntity ent,
const Matrix< ValueType > &  C,
const RVector u,
bool  voigtNotation = false 
)

Return the stress matrix for this entity.

◆ u()

template<class ValueType >
ElementMatrix< ValueType >& GIMLI::ElementMatrix< ValueType >::u ( const MeshEntity ent)

Fill this element matrix with int_boundary C * u

◆ u2()

template<class ValueType >
ElementMatrix< ValueType >& GIMLI::ElementMatrix< ValueType >::u2 ( const MeshEntity ent)

Fill this element matrix with int_domain C * u * u

◆ w()

template<class ValueType >
const RVector& GIMLI::ElementMatrix< ValueType >::w ( ) const
inline

Return const reference to the last quadrature weights.

◆ x()

template<class ValueType >
const PosVector& GIMLI::ElementMatrix< ValueType >::x ( ) const
inline

Return const reference to the last quadrature points.

Referenced by GIMLI::mult().