00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef ABSTRACTASSEMBLERSOLVERHYBRID_HPP_
00031 #define ABSTRACTASSEMBLERSOLVERHYBRID_HPP_
00032
00033 #include "AbstractFeObjectAssembler.hpp"
00034 #include "AbstractLinearPdeSolver.hpp"
00035
00036
00046 template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM, InterpolationLevel INTERPOLATION_LEVEL>
00047 class AbstractAssemblerSolverHybrid
00048 : public AbstractFeObjectAssembler<ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM, true, true, INTERPOLATION_LEVEL>
00049
00050 {
00051 public :
00059 AbstractAssemblerSolverHybrid(AbstractTetrahedralMesh<ELEMENT_DIM,SPACE_DIM>* pMesh,
00060 BoundaryConditionsContainer<ELEMENT_DIM,SPACE_DIM,PROBLEM_DIM>* pBoundaryConditions,
00061 unsigned numQuadPoints = 2)
00062 : AbstractFeObjectAssembler<ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM, true, true, INTERPOLATION_LEVEL>(pMesh,numQuadPoints)
00063 {
00064 if(pBoundaryConditions)
00065 {
00066 this->SetApplyNeummanBoundaryConditionsToVector(pBoundaryConditions);
00067 }
00068 }
00069
00073 virtual ~AbstractAssemblerSolverHybrid()
00074 {
00075 }
00076
00089 void SetupGivenLinearSystem(Vec currentSolution, bool computeMatrix, LinearSystem* pLinearSystem);
00090
00091
00092 };
00093
00094 template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM, InterpolationLevel INTERPOLATION_LEVEL>
00095 void AbstractAssemblerSolverHybrid<ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM, INTERPOLATION_LEVEL>::SetupGivenLinearSystem(Vec currentSolution, bool computeMatrix, LinearSystem* pLinearSystem)
00096 {
00097
00098
00099
00100
00101 assert(this->mpBoundaryConditions!=NULL);
00102
00103 assert(pLinearSystem->rGetLhsMatrix() != NULL);
00104 assert(pLinearSystem->rGetRhsVector() != NULL);
00105
00106
00107 this->SetMatrixToAssemble(pLinearSystem->rGetLhsMatrix());
00108 this->SetVectorToAssemble(pLinearSystem->rGetRhsVector(), true);
00109
00110 if(currentSolution!=NULL)
00111 {
00112 this->SetCurrentSolution(currentSolution);
00113 }
00114
00115 if(computeMatrix)
00116 {
00117 this->Assemble();
00118 }
00119 else
00120 {
00121 this->AssembleVector();
00122 }
00123
00124 pLinearSystem->AssembleRhsVector();
00125 pLinearSystem->AssembleIntermediateLhsMatrix();
00126
00127 this->mpBoundaryConditions->ApplyDirichletToLinearProblem(*pLinearSystem, true);
00128
00129 pLinearSystem->AssembleRhsVector();
00130 pLinearSystem->AssembleFinalLhsMatrix();
00131 }
00132
00133
00134
00135 #endif