1#ifndef DIFFUSIONREACTION_def_hpp
2#define DIFFUSIONREACTION_def_hpp
13#include "feddlib/core/FE/Domain.hpp"
14#include "feddlib/core/FE/FE.hpp"
19template<
class SC,
class LO,
class GO,
class NO>
20DiffusionReaction<SC,LO,GO,NO>::DiffusionReaction(
const DomainConstPtr_Type &domain, std::string FEType, ParameterListPtr_Type parameterList, vec2D_dbl_Type diffusionTensor, RhsFunc_Type reactionFunc,
bool vectorDiffusion):
21Problem<SC,LO,GO,NO>(parameterList, domain->getComm()),
22vectorDiffusion_(vectorDiffusion),
28 this->addVariable( domain , FEType ,
"u" , 1);
29 this->dim_ = this->getDomain(0)->getDimension();
31 diffusionTensor_ = diffusionTensor;
33 funcParameter_.push_back(this->parameterList_->sublist(
"Parameter").get(
"E0",1.0));
34 funcParameter_.push_back(this->parameterList_->sublist(
"Parameter").get(
"E1",0.5));
36 reactionFunc_ = reactionFunc;
38 u_rep_ = Teuchos::rcp(
new MultiVector_Type( this->getDomain(0)->getMapRepeated() ) );
44template<
class SC,
class LO,
class GO,
class NO>
45DiffusionReaction<SC,LO,GO,NO>::~DiffusionReaction(){
49template<
class SC,
class LO,
class GO,
class NO>
50void DiffusionReaction<SC,LO,GO,NO>::info(){
58template<
class SC,
class LO,
class GO,
class NO>
62 std::cout <<
"-- Assembly Laplace with Diffusion Tensor ... " << std::flush;
64 A_.reset(
new Matrix_Type( this->getDomain(0)->getMapUnique(), this->getDomain(0)->getApproxEntriesPerRow() ) );
66 this->feFactory_->assemblyLaplaceDiffusion(this->dim_, this->domain_FEType_vec_.at(0), 2, A_, this->diffusionTensor_ );
68 if (this->system_.is_null())
69 this->system_.reset(
new BlockMatrix_Type(1));
71 this->system_->addBlock(A_,0,0);
77 std::cout <<
"done -- " << std::endl;
85template<
class SC,
class LO,
class GO,
class NO>
90 std::cout <<
"-- Assembly Diffusion ... " << std::endl;
94 std::cout <<
"done -- " << std::endl;
102template<
class SC,
class LO,
class GO,
class NO>
103typename DiffusionReaction<SC,LO,GO,NO>::MatrixPtr_Type DiffusionReaction<SC,LO,GO,NO>::getMassMatrix()
const{
106 A = Teuchos::rcp(
new Matrix_Type( this->domainPtr_vec_.at(0)->getMapUnique(), this->getDomain(0)->getApproxEntriesPerRow() ) );
107 this->feFactory_->assemblyMass(this->dim_,this->domain_FEType_vec_.at(0),
"Scalar", A);
virtual void assemble(std::string type="") const
Definition DiffusionReaction_def.hpp:86
void assembleConstantMatrices(std::string type="") const
assemble constant matrices, that remain the same
Definition DiffusionReaction_def.hpp:59
Definition Problem_decl.hpp:42
Adaptive Mesh Refinement.
Definition AdaptiveMeshRefinement_decl.hpp:36