36 #ifndef MASSMATRIXASSEMBLER_HPP_ 37 #define MASSMATRIXASSEMBLER_HPP_ 39 #include "AbstractFeVolumeIntegralAssembler.hpp" 50 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
76 c_matrix<double,1*(ELEMENT_DIM+1),1*(ELEMENT_DIM+1)>
78 c_vector<double, ELEMENT_DIM+1> &rPhi,
79 c_matrix<double, SPACE_DIM, ELEMENT_DIM+1> &rGradPhi,
81 c_vector<double,1> &rU,
82 c_matrix<double, 1, SPACE_DIM> &rGradU ,
85 c_matrix<double, ELEMENT_DIM+1, ELEMENT_DIM+1> mass_matrix;
86 mass_matrix = outer_prod(rPhi, rPhi);
90 for (
unsigned row=0; row<ELEMENT_DIM+1; row++)
92 for (
unsigned column=0; column<ELEMENT_DIM+1; column++)
96 mass_matrix(row,row) += mass_matrix(row,column);
97 mass_matrix(row,column) = 0.0;
103 return mScaleFactor*mass_matrix;
115 mScaleFactor(scaleFactor),
116 mUseMassLumping(useMassLumping)
c_matrix< double, 1 *(ELEMENT_DIM+1), 1 *(ELEMENT_DIM+1)> ComputeMatrixTerm(c_vector< double, ELEMENT_DIM+1 > &rPhi, c_matrix< double, SPACE_DIM, ELEMENT_DIM+1 > &rGradPhi, ChastePoint< SPACE_DIM > &rX, c_vector< double, 1 > &rU, c_matrix< double, 1, SPACE_DIM > &rGradU, Element< ELEMENT_DIM, SPACE_DIM > *pElement)
MassMatrixAssembler(AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > *pMesh, bool useMassLumping=false, double scaleFactor=1.0)