Programming tasks to Scientific Computing I
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
shellFE::MatrixValuedIntegratorBase< ConfiguratorType, Imp > Class Template Reference

General interface for matrix valued integrators. More...

#include <unityTriangleIntegratorShellFE.h>

Public Types

typedef ConfiguratorType::RealType RealType
 
typedef ConfiguratorType::LocalMatrixType LocalMatrixType
 
typedef ConfiguratorType::TripletType TripletType
 
typedef ConfiguratorType::ElementType ElementType
 
typedef ConfiguratorType::MaskType MaskType
 

Public Member Functions

 MatrixValuedIntegratorBase (const ConfiguratorType &conf)
 
template<typename SparseMatrixType >
void assemble (SparseMatrixType &Dest, const RealType Factor=1.0) const
 
template<typename SparseMatrixType >
void assembleDirichlet (SparseMatrixType &Dest, const MaskType &boundaryMask, const RealType Factor=1.0) const
 

Protected Member Functions

void assembleTripletList (std::vector< TripletType > &tripletList, const RealType Factor) const
 
Imp & asImp ()
 
const Imp & asImp () const
 

Protected Attributes

const ConfiguratorType_config
 

Detailed Description

template<typename ConfiguratorType, typename Imp>
class shellFE::MatrixValuedIntegratorBase< ConfiguratorType, Imp >

General interface for matrix valued integrators.

Definition at line 76 of file unityTriangleIntegratorShellFE.h.

Member Typedef Documentation

template<typename ConfiguratorType, typename Imp>
typedef ConfiguratorType::ElementType shellFE::MatrixValuedIntegratorBase< ConfiguratorType, Imp >::ElementType

Definition at line 81 of file unityTriangleIntegratorShellFE.h.

template<typename ConfiguratorType, typename Imp>
typedef ConfiguratorType::LocalMatrixType shellFE::MatrixValuedIntegratorBase< ConfiguratorType, Imp >::LocalMatrixType

Definition at line 79 of file unityTriangleIntegratorShellFE.h.

template<typename ConfiguratorType, typename Imp>
typedef ConfiguratorType::MaskType shellFE::MatrixValuedIntegratorBase< ConfiguratorType, Imp >::MaskType

Definition at line 82 of file unityTriangleIntegratorShellFE.h.

template<typename ConfiguratorType, typename Imp>
typedef ConfiguratorType::RealType shellFE::MatrixValuedIntegratorBase< ConfiguratorType, Imp >::RealType

Definition at line 78 of file unityTriangleIntegratorShellFE.h.

template<typename ConfiguratorType, typename Imp>
typedef ConfiguratorType::TripletType shellFE::MatrixValuedIntegratorBase< ConfiguratorType, Imp >::TripletType

Definition at line 80 of file unityTriangleIntegratorShellFE.h.

Constructor & Destructor Documentation

template<typename ConfiguratorType, typename Imp>
shellFE::MatrixValuedIntegratorBase< ConfiguratorType, Imp >::MatrixValuedIntegratorBase ( const ConfiguratorType conf)
inlineexplicit

Definition at line 84 of file unityTriangleIntegratorShellFE.h.

84 : _config ( conf ) {}

Member Function Documentation

template<typename ConfiguratorType, typename Imp>
Imp& shellFE::MatrixValuedIntegratorBase< ConfiguratorType, Imp >::asImp ( )
inlineprotected

Definition at line 136 of file unityTriangleIntegratorShellFE.h.

136 { return static_cast<Imp&> ( *this ); }
template<typename ConfiguratorType, typename Imp>
const Imp& shellFE::MatrixValuedIntegratorBase< ConfiguratorType, Imp >::asImp ( ) const
inlineprotected

Definition at line 137 of file unityTriangleIntegratorShellFE.h.

137 { return static_cast<const Imp&> ( *this ); }
template<typename ConfiguratorType, typename Imp>
template<typename SparseMatrixType >
void shellFE::MatrixValuedIntegratorBase< ConfiguratorType, Imp >::assemble ( SparseMatrixType Dest,
const RealType  Factor = 1.0 
) const
inline

Definition at line 103 of file unityTriangleIntegratorShellFE.h.

103  {
104  std::vector<TripletType> tripletList;
105  assembleTripletList ( tripletList, Factor );
106  Dest.setFromTriplets( tripletList.cbegin(), tripletList.cend() );
107  }
void assembleTripletList(std::vector< TripletType > &tripletList, const RealType Factor) const
template<typename ConfiguratorType, typename Imp>
template<typename SparseMatrixType >
void shellFE::MatrixValuedIntegratorBase< ConfiguratorType, Imp >::assembleDirichlet ( SparseMatrixType Dest,
const MaskType boundaryMask,
const RealType  Factor = 1.0 
) const
inline

Definition at line 110 of file unityTriangleIntegratorShellFE.h.

110  {
111 
112  std::vector<TripletType> tripletList;
113  assembleTripletList ( tripletList, Factor );
114 
115  std::vector<TripletType> tripletListMasked;
116  tripletListMasked.reserve(_config.getInitializer().getNumTriangs() * aol::Sqr( _config.getNumLocalDofs() ) );
117 
118  for( unsigned iter=0; iter < tripletList.size(); ++iter ){
119  if( (boundaryMask[tripletList[iter].row()]) || (boundaryMask[tripletList[iter].col()]) ){
120  //Boundary node!
121  } else {
122  tripletListMasked.push_back( tripletList[iter] );
123  }
124  }
125 
126  for ( int i = 0; i < _config.getNumGlobalDofs(); ++i ){
127  if ( boundaryMask[i] )
128  tripletListMasked.push_back( TripletType( i, i, 1.0 ) );
129  }
130 
131  Dest.setFromTriplets( tripletListMasked.begin(), tripletListMasked.end() );
132  }
T Sqr(const T a)
Definition: aol.h:134
int getNumTriangs() const
Definition: triangMesh.h:46
void assembleTripletList(std::vector< TripletType > &tripletList, const RealType Factor) const
int getNumLocalDofs(const ElementType &) const
Get The number of local degrees of freedom on an element.
const InitType & getInitializer() const
Returns the mesh.
int getNumGlobalDofs() const
Returns the number of global degrees of freedom.
template<typename ConfiguratorType, typename Imp>
void shellFE::MatrixValuedIntegratorBase< ConfiguratorType, Imp >::assembleTripletList ( std::vector< TripletType > &  tripletList,
const RealType  Factor 
) const
inlineprotected

Definition at line 87 of file unityTriangleIntegratorShellFE.h.

87  {
88  tripletList.reserve(_config.getInitializer().getNumTriangs() * aol::Sqr( _config.getNumLocalDofs() ) );
89  LocalMatrixType localMatrix;
90  int globalDofs[ ConfiguratorType::maxNumLocalDofs ];
91  for ( int elementIdx = 0; elementIdx < _config.getInitializer().getNumTriangs(); ++elementIdx){
92  const ElementType& El ( _config.getInitializer().getTriang( elementIdx ) );
93  this->asImp().prepareLocalMatrix ( El, localMatrix );
94  const int numLocalDofs = _config.getNumLocalDofs ( El );
95 
96  // Part of exercise 1
97  }
98  }
const TriangleType & getTriang(const int num) const
Definition: triangMesh.h:87
T Sqr(const T a)
Definition: aol.h:134
int getNumTriangs() const
Definition: triangMesh.h:46
int getNumLocalDofs(const ElementType &) const
Get The number of local degrees of freedom on an element.
const InitType & getInitializer() const
Returns the mesh.
ConfiguratorType::LocalMatrixType LocalMatrixType

Member Data Documentation

template<typename ConfiguratorType, typename Imp>
const ConfiguratorType& shellFE::MatrixValuedIntegratorBase< ConfiguratorType, Imp >::_config
protected

Definition at line 139 of file unityTriangleIntegratorShellFE.h.


The documentation for this class was generated from the following file: