1 #ifndef __DISCRETEFUNCTIONSHELLFE_H 2 #define __DISCRETEFUNCTIONSHELLFE_H 5 #include <initializer_list> 9 template <
typename ConfiguratorType,
typename VectorType,
typename NLTYPE >
13 const int bfNum,
const NLTYPE &bfValue, NLTYPE &aux ) {
21 template <
typename ConfiguratorType,
typename VectorType =
typename ConfiguratorType::VectorType >
38 RealType
evaluate (
const ElementType &El,
const DomVecType& RefCoord )
const {
42 for (
int b = 0; b < static_cast<int> ( _conf.
getNumLocalDofs ( El ) ); ++b ) {
54 for (
int b = 0; b < static_cast<int> ( _conf.
getNumLocalDofs ( El ) ); ++b ) {
62 void evaluateGradient (
const ElementType &El,
const DomVecType& RefCoord, DomVecType& Grad )
const {
66 for (
int b = 0; b < static_cast<int> ( _conf.
getNumLocalDofs ( El ) ); ++b ) {
77 for (
int b = 0; b < static_cast<int> ( _conf.
getNumLocalDofs ( El ) ); ++b ) {
89 template <
typename ConfiguratorType>
104 mutable std::vector<Eigen::Ref<const VectorType> >
_refs;
110 _numComponents ( numComponents )
113 _refs.reserve( _numComponents );
114 _discrFuncs.reserve( _numComponents );
116 _refs.push_back ( Dofs.segment( 0, numGlobalDofs) );
117 _refs.push_back ( Dofs.segment( numGlobalDofs, numGlobalDofs) );
118 _refs.push_back ( Dofs.segment( 2 * numGlobalDofs, numGlobalDofs) );
120 _discrFuncs.push_back ( DiscFuncType ( Configurator, _refs[0] ) );
121 _discrFuncs.push_back ( DiscFuncType ( Configurator, _refs[1] ) );
122 _discrFuncs.push_back ( DiscFuncType ( Configurator, _refs[2] ) );
125 void evaluate(
const ElementType &El,
const DomVecType& RefCoord, TangentVecType &Value )
const {
126 for (
int c = 0; c < 3; ++c )
127 Value[c] = _discrFuncs[c].evaluate ( El, RefCoord );
131 for (
int c = 0; c < 3; ++c )
132 Value[c] = _discrFuncs[c].evaluateAtQuadPoint ( El, QuadPoint );
135 void evaluateGradient (
const ElementType &El,
const DomVecType& RefCoord, Matrix32 &Dx )
const {
137 for (
int c = 0; c < 3; c++ ) {
138 _discrFuncs[c].evaluateGradient ( El, RefCoord, v );
146 for (
int c = 0; c < 3; ++c ) {
147 _discrFuncs[c].evaluateGradientAtQuadPoint ( El, QuadPoint, v );
155 evaluateGradient( El, RefCoord, Dx );
156 g = Dx.transpose() * Dx;
162 evaluateGradientAtQuadPoint( El, QuadPoint, Dx );
163 g = Dx.transpose() * Dx;
167 g = Dx.transpose() * Dx;
173 evaluateGradientAtQuadPoint ( El, QuadPoint, Dx );
174 TangentVecType unNormalizedNormal ( (Dx.col(0)).cross(Dx.col(1)) );
175 normal = unNormalizedNormal.normalized();
179 TangentVecType unNormalizedNormal ( (Dx.col(0)).cross(Dx.col(1)) );
180 normal = unNormalizedNormal.normalized();
184 const DiscFuncType& operator[] (
int i )
const {
return _discrFuncs[i];}
185 DiscFuncType& operator[] (
int i ) {
return _discrFuncs[i];}
Helper class to evaluate a discrete nodal function on a given mesh.
DataTypeContainer::VectorType VectorType
void evaluateAtQuadPoint(const ElementType &El, int QuadPoint, TangentVecType &Value) const
ConfiguratorType::TangentVecType TangentVecType
ConfiguratorType::ElementType ElementType
RealType evaluate(int BaseFuncNum, const DomVecType &RefCoord) const
Evaluates a base function at.
DiscreteFunctionDefaultShellFE(const ConfiguratorType &config, const VectorType &Dofs)
void evaluate(const ElementType &El, const DomVecType &RefCoord, TangentVecType &Value) const
ConfiguratorType::RealType RealType
ConfiguratorType::ElementType ElementType
DiscreteVectorFunctionDefaultShellFE(const ConfiguratorType &Configurator, const VectorType &Dofs, const int numComponents)
DataTypeContainer::Matrix32 Matrix32
DataTypeContainer::DomVecType DomVecType
const VectorType & getDofs() const
DataTypeContainer::RealType RealType
RealType evaluateAtQuadPoint(const ElementType &El, int QuadPoint) const
void evaluateGradient(int BaseFuncNum, const DomVecType &, DomVecType &Gradient) const
Evaluates the gradient of a base function at RefCoord.
ConfiguratorType::Matrix32 Matrix32
DataTypeContainer::Matrix22 Matrix22
void evaluateGradient(const ElementType &El, const DomVecType &RefCoord, DomVecType &Grad) const
ConfiguratorType::Matrix33 Matrix33
void evaluateGradientAtQuadPoint(const ElementType &El, int QuadPoint, DomVecType &Grad) const
RealType evaluate(const ElementType &El, const DomVecType &RefCoord) const
int getNumLocalDofs(const ElementType &) const
Get The number of local degrees of freedom on an element.
const ConfiguratorType & _conf
ConfiguratorType::RealType RealType
void evaluateGradientAtQuadPoint(const ElementType &El, int QuadPoint, Matrix32 &Dx) const
Helper class to evaluate a discrete vector-valued nodal function on a given mesh. ...
void evaluateFirstFundamentalForm(const ElementType &El, const DomVecType &RefCoord, Matrix22 &g) const
DataTypeContainer::TangentVecType TangentVecType
void evaluateNormal(const Matrix32 &Dx, TangentVecType &normal) const
ConfiguratorType::DomVecType DomVecType
void evaluateFirstFundamentalFormAtQuadPoint(const ElementType &El, int QuadPoint, Matrix22 &g) const
int localToGlobal(const ElementType &T, int localIndex) const
Returns global index of the dof with number localIndex.
ConfiguratorType::BaseFuncSetType BaseFuncSetType
std::vector< DiscFuncType > _discrFuncs
int getNumGlobalDofs() const
Returns the number of global degrees of freedom.
ConfiguratorType::VectorType VectorType
ConfiguratorType::TangentVecType TangentVecType
ConfiguratorType::DomVecType DomVecType
void evaluateNormalAtQuadPointOnShell(const ElementType &El, int QuadPoint, TangentVecType &normal) const
std::vector< Eigen::Ref< const VectorType > > _refs
void evaluateFirstFundamentalForm(const Matrix32 &Dx, Matrix22 &g) const
void evaluateGradient(const ElementType &El, const DomVecType &RefCoord, Matrix32 &Dx) const
DataTypeContainer::Matrix33 Matrix33
ConfiguratorType::Matrix22 Matrix22
Eigen typedefs for use with the TriangleMesh.
DiscreteFunctionDefaultShellFE< ConfiguratorType, Eigen::Ref< const VectorType > > DiscFuncType
ConfiguratorType::Matrix22 Matrix22
Configurator for Finite Elements.
void getLocalDof(const ConfiguratorType &conf, const VectorType &dofs, const typename ConfiguratorType::ElementType &El, const int bfNum, const NLTYPE &bfValue, NLTYPE &aux)
Triangle which has a tangent space at each node.
const BaseFuncSetType & getBaseFunctionSet(const ElementType &) const
Returns the base funcitons set for an element.
ConfiguratorType::VectorType VectorType