1#ifndef DIFFUSIONREACTION_def_hpp
2#define DIFFUSIONREACTION_def_hpp
3#include "DiffusionReaction_decl.hpp"
15template<
class SC,
class LO,
class GO,
class NO>
16DiffusionReaction<SC,LO,GO,NO>::DiffusionReaction(
const DomainConstPtr_Type &domain, std::string FEType, ParameterListPtr_Type parameterList, vec2D_dbl_Type diffusionTensor, RhsFunc_Type reactionFunc,
bool vectorDiffusion):
17Problem<SC,LO,GO,NO>(parameterList, domain->getComm()),
18vectorDiffusion_(vectorDiffusion),
24 this->addVariable( domain , FEType ,
"u" , 1);
25 this->dim_ = this->getDomain(0)->getDimension();
27 diffusionTensor_ = diffusionTensor;
29 funcParameter_.push_back(this->parameterList_->sublist(
"Parameter").get(
"E0",1.0));
30 funcParameter_.push_back(this->parameterList_->sublist(
"Parameter").get(
"E1",0.5));
32 reactionFunc_ = reactionFunc;
34 u_rep_ = Teuchos::rcp(
new MultiVector_Type( this->getDomain(0)->getMapRepeated() ) );
40template<
class SC,
class LO,
class GO,
class NO>
41DiffusionReaction<SC,LO,GO,NO>::~DiffusionReaction(){
45template<
class SC,
class LO,
class GO,
class NO>
46void DiffusionReaction<SC,LO,GO,NO>::info(){
54template<
class SC,
class LO,
class GO,
class NO>
58 std::cout <<
"-- Assembly Laplace with Diffusion Tensor ... " << std::flush;
60 A_.reset(
new Matrix_Type( this->getDomain(0)->getMapUnique(), this->getDomain(0)->getApproxEntriesPerRow() ) );
62 this->feFactory_->assemblyLaplaceDiffusion(this->dim_, this->domain_FEType_vec_.at(0), 2, A_, this->diffusionTensor_ );
64 if (this->system_.is_null())
65 this->system_.reset(
new BlockMatrix_Type(1));
67 this->system_->addBlock(A_,0,0);
73 std::cout <<
"done -- " << std::endl;
81template<
class SC,
class LO,
class GO,
class NO>
86 std::cout <<
"-- Assembly Diffusion ... " << std::endl;
90 std::cout <<
"done -- " << std::endl;
98template<
class SC,
class LO,
class GO,
class NO>
99typename DiffusionReaction<SC,LO,GO,NO>::MatrixPtr_Type DiffusionReaction<SC,LO,GO,NO>::getMassMatrix()
const{
102 A = Teuchos::rcp(
new Matrix_Type( this->domainPtr_vec_.at(0)->getMapUnique(), this->getDomain(0)->getApproxEntriesPerRow() ) );
103 this->feFactory_->assemblyMass(this->dim_,this->domain_FEType_vec_.at(0),
"Scalar", A);
virtual void assemble(std::string type="") const
Definition DiffusionReaction_def.hpp:82
void assembleConstantMatrices(std::string type="") const
assemble constant matrices, that remain the same
Definition DiffusionReaction_def.hpp:55
Definition Problem_decl.hpp:38
Adaptive Mesh Refinement.
Definition AdaptiveMeshRefinement.cpp:5