5 #ifndef __UNITTRIANGLEINTEGRATORSHELLFE_H 6 #define __UNITTRIANGLEINTEGRATORSHELLFE_H 15 template <
typename ConfiguratorType,
typename Imp>
39 for (
int q = 0; q < numQuadPoints; ++q )
40 nl_cache[q] = this->
asImp().getNonlinearity ( El, q );
44 for (
int dof = 0; dof < numLocalDofs; ++dof ) {
47 for (
int q = 0; q < numQuadPoints; ++q )
58 throw std::invalid_argument(
aol::strprintf (
"Called the interface function. In File %s at line %d.", __FILE__, __LINE__ ).c_str() );
59 return this->
asImp().getNonlinearity ( El, QuadPoint );
64 inline Imp&
asImp() {
return static_cast<Imp&
> ( *this ); }
65 inline const Imp&
asImp()
const {
return static_cast<const Imp&
> ( *this ); }
75 template <
typename ConfiguratorType,
typename Imp >
89 LocalMatrixType localMatrix;
93 this->
asImp().prepareLocalMatrix ( El, localMatrix );
102 template <
typename SparseMatrixType>
104 std::vector<TripletType> tripletList;
105 assembleTripletList ( tripletList, Factor );
106 Dest.setFromTriplets( tripletList.cbegin(), tripletList.cend() );
109 template <
typename SparseMatrixType>
112 std::vector<TripletType> tripletList;
113 assembleTripletList ( tripletList, Factor );
115 std::vector<TripletType> tripletListMasked;
118 for(
unsigned iter=0; iter < tripletList.size(); ++iter ){
119 if( (boundaryMask[tripletList[iter].row()]) || (boundaryMask[tripletList[iter].col()]) ){
122 tripletListMasked.push_back( tripletList[iter] );
127 if ( boundaryMask[i] )
128 tripletListMasked.push_back( TripletType( i, i, 1.0 ) );
131 Dest.setFromTriplets( tripletListMasked.begin(), tripletListMasked.end() );
136 inline Imp&
asImp() {
return static_cast<Imp&
> ( *this ); }
137 inline const Imp&
asImp()
const {
return static_cast<const Imp&
> ( *this ); }
149 template <
typename ConfiguratorType,
typename Imp >
162 _config ( Config ) {}
167 Matrix22 &Matrix )
const {
168 this->
asImp().getCoeffMatrix ( El, QuadPoint, Matrix );
173 LocalMatrixType &LocalMatrix )
const {
176 for (
int i = 0; i < numDofs; ++i )
177 for (
int j = 0; j < numDofs; ++j )
178 LocalMatrix(i,j) = 0.;
190 inline Imp &
asImp() {
return static_cast<Imp&
> ( *this ); }
191 inline const Imp &
asImp()
const {
return static_cast<const Imp&
> ( *this ); }
DataTypeContainer::MaskType MaskType
Provides an easy interface to Finite Element operators of the form , where is an ASYMMETRIC coeffici...
DataTypeContainer::VectorType VectorType
ConfiguratorType::Matrix22 Matrix22
ConfiguratorType::MaskType MaskType
void prepareLocalMatrix(const typename ConfiguratorType::ElementType &El, LocalMatrixType &LocalMatrix) const
Computes the numerical quadrature of the bilinear form and saves the values locally.
const TriangleType & getTriang(const int num) const
ConfiguratorType::RealType RealType
const ConfiguratorType & _config
void assembleDirichlet(SparseMatrixType &Dest, const MaskType &boundaryMask, const RealType Factor=1.0) const
Integrator for , of some scalar valued function .
RealType evaluate(int BaseFuncNum, const DomVecType &RefCoord) const
Evaluates a base function at.
int numQuadPoints() const
Returns the number of quadrature points.
const ConfiguratorType & _config
Eigen::Matrix< RealType, maxNumLocalDofs, maxNumLocalDofs > LocalMatrixType
int maxNumQuadPoints() const
Returns the maximum number of quadrature points per element.
DataTypeContainer::DomVecType DomVecType
DataTypeContainer::RealType RealType
RealType getWeight(int QuadPoint) const
Returns the quadrature weight at QuadPointa quadrature point.
const Imp & asImp() const
int getNumTriangs() const
DataTypeContainer::Matrix22 Matrix22
void assembleTripletList(std::vector< TripletType > &tripletList, const RealType Factor) const
RealType getNonlinearity(const typename ConfiguratorType::ElementType &El, int QuadPoint) const
interface function, has to be provided in derived classes.
int getNumLocalDofs(const ElementType &) const
Get The number of local degrees of freedom on an element.
void assemble(SparseMatrixType &Dest, const RealType Factor=1.0) const
ConfiguratorType::LocalMatrixType LocalMatrixType
ConfiguratorType::ElementType ElementType
General interface for matrix valued integrators.
MatrixValuedIntegratorBase(const ConfiguratorType &conf)
ConfiguratorType::TripletType TripletType
virtual ~UnitTriangleFENonlinOpIntegratorShellFE()
string strprintf(const char *format,...)
Give back formatted string, analogously to sprintf, but save the long way 'round with char arrays...
int localToGlobal(const ElementType &T, int localIndex) const
Returns global index of the dof with number localIndex.
const InitType & getInitializer() const
Returns the mesh.
int getNumGlobalDofs() const
Returns the number of global degrees of freedom.
ConfiguratorType::RealType RealType
ConfiguratorType::DomVecType DomVecType
ConfiguratorType::ElementType ElementType
ConfiguratorType::RealType RealType
ConfiguratorType::LocalMatrixType LocalMatrixType
void assembleAdd(VectorType &Dest) const
ConfiguratorType::SparseMatrixType SparseMatrixType
void getCoeffMatrix(const typename ConfiguratorType::ElementType &El, int QuadPoint, Matrix22 &Matrix) const
This function has to be provided in the implementation (derived class) of the interface.
static const int maxNumLocalDofs
Configurator for Finite Elements.
const Imp & asImp() const
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
UnitTriangleFELinWeightedStiffIntegrator(const ConfiguratorType &Config)
UnitTriangleFENonlinOpIntegratorShellFE(const ConfiguratorType &Conf)
DataTypeContainer::TripletType TripletType
const ConfiguratorType & _config
const Imp & asImp() const