36 #ifndef ABSTRACTFEASSEMBLERINTERFACE_HPP_
37 #define ABSTRACTFEASSEMBLERINTERFACE_HPP_
50 template <
bool CAN_ASSEMBLE_VECTOR,
bool CAN_ASSEMBLE_MATRIX>
131 assert(CAN_ASSEMBLE_MATRIX);
142 assert(CAN_ASSEMBLE_VECTOR);
156 template <
bool CAN_ASSEMBLE_VECTOR,
bool CAN_ASSEMBLE_MATRIX>
158 : mVectorToAssemble(nullptr),
159 mMatrixToAssemble(nullptr),
160 mZeroMatrixBeforeAssembly(true),
161 mZeroVectorBeforeAssembly(true)
163 assert(CAN_ASSEMBLE_VECTOR || CAN_ASSEMBLE_MATRIX);
166 template <
bool CAN_ASSEMBLE_VECTOR,
bool CAN_ASSEMBLE_MATRIX>
169 assert(rMatToAssemble);
170 MatGetOwnershipRange(rMatToAssemble, &mOwnershipRangeLo, &mOwnershipRangeHi);
172 mMatrixToAssemble = rMatToAssemble;
173 mZeroMatrixBeforeAssembly = zeroMatrixBeforeAssembly;
176 template <
bool CAN_ASSEMBLE_VECTOR,
bool CAN_ASSEMBLE_MATRIX>
179 assert(rVecToAssemble);
180 VecGetOwnershipRange(rVecToAssemble, &mOwnershipRangeLo, &mOwnershipRangeHi);
182 mVectorToAssemble = rVecToAssemble;
183 mZeroVectorBeforeAssembly = zeroVectorBeforeAssembly;
186 #endif // ABSTRACTFEASSEMBLERINTERFACE_HPP_
bool mZeroVectorBeforeAssembly
bool mZeroMatrixBeforeAssembly
virtual void DoAssemble()=0
PetscInt mOwnershipRangeLo
virtual ~AbstractFeAssemblerInterface()
PetscInt mOwnershipRangeHi
AbstractFeAssemblerInterface()
void SetMatrixToAssemble(Mat &rMatToAssemble, bool zeroMatrixBeforeAssembly=true)
void SetVectorToAssemble(Vec &rVecToAssemble, bool zeroVectorBeforeAssembly)