45 typedef Teuchos::RCP<Domain_Type> DomainPtr_Type;
46 typedef Teuchos::RCP<const Domain_Type> DomainConstPtr_Type;
47 typedef std::vector<DomainConstPtr_Type> DomainConstPtr_vec_Type;
50 typedef Teuchos::RCP<Matrix_Type> MatrixPtr_Type;
52 typedef typename Matrix_Type::Map_Type Map_Type;
53 typedef typename Matrix_Type::MapPtr_Type MapPtr_Type;
54 typedef typename Matrix_Type::MapConstPtr_Type MapConstPtr_Type;
57 typedef Teuchos::RCP<BlockMatrix_Type> BlockMatrixPtr_Type;
58 typedef Teuchos::RCP<const BlockMatrix_Type> BlockMatrixConstPtr_Type;
61 typedef Teuchos::RCP<MultiVector_Type> MultiVectorPtr_Type;
62 typedef Teuchos::RCP<const MultiVector_Type> MultiVectorConstPtr_Type;
65 typedef Teuchos::RCP<BlockMultiVector_Type> BlockMultiVectorPtr_Type;
66 typedef Teuchos::RCP<const BlockMultiVector_Type> BlockMultiVectorConstPtr_Type;
69 typedef Teuchos::RCP<Preconditioner_Type> PreconditionerPtr_Type;
70 typedef Teuchos::RCP<const Preconditioner_Type> PreconditionerConstPtr_Type;
73 typedef Teuchos::RCP<BC_Type> BCPtr_Type;
74 typedef Teuchos::RCP<const BC_Type> BCConstPtr_Type;
77 typedef Teuchos::RCP<FEFac_Type> FEFacPtr_Type;
78 typedef Teuchos::RCP<const FEFac_Type> FEFacConstPtr_Type;
80 typedef Teuchos::ParameterList ParameterList_Type;
81 typedef Teuchos::RCP<ParameterList_Type> ParameterListPtr_Type;
83 typedef Teuchos::RCP<Stratimikos::DefaultLinearSolverBuilder > LinSolverBuilderPtr_Type;
84 typedef Teuchos::RCP<const Stratimikos::DefaultLinearSolverBuilder > LinSolverBuilderConstPtr_Type;
86 typedef Teuchos::Comm<int> Comm_Type;
87 typedef Teuchos::RCP<const Comm_Type> CommConstPtr_Type;
89 typedef Teuchos::ArrayRCP<GO> GOVecPtr;
91 typedef std::vector<std::string> string_vec_Type;
93 typedef Teuchos::RCP<Thyra::PreconditionerBase<SC> > ThyraPrecPtr_Type;
94 typedef Teuchos::RCP<Thyra::LinearOpBase<SC> > ThyraLinOpPtr_Type;
96 Problem(CommConstPtr_Type comm);
98 Problem(ParameterListPtr_Type ¶meterList, CommConstPtr_Type comm);
100 virtual ~Problem() =
default;
102 virtual void info() = 0;
106 void infoParameter();
108 void addVariable(
const DomainConstPtr_Type &domain, std::string FEType, std::string name,
int dofsPerNode);
125 virtual void assemble( std::string type )
const = 0;
131 void assembleSourceTerm(
double time = 0. )
const;
133 void assembleVolumeTerm(
double time )
const;
135 void assembleSurfaceTerm(
double time )
const;
137 bool hasSourceTerm()
const;
139 int solve( BlockMultiVectorPtr_Type rhs = Teuchos::null );
141 void setupPreconditioner( std::string type=
"Monolithic" )
const;
143 void initializePreconditioner( std::string type=
"Monolithic" )
const;
145 void addBoundaries(
const BCConstPtr_Type &bcFactory);
147 void setBoundaries(
double time=.0)
const;
149 void setBoundariesRHS(
double time=.0)
const;
151 void setAllDirichletZero( BlockMultiVectorPtr_Type rhs)
const;
153 void setBoundariesSystem()
const;
155 void initializeProblem(
int nmbVectors=1);
157 void initializeVectors(
int nmbVectors=1);
159 BlockMultiVectorPtr_Type getRhs();
161 BlockMultiVectorPtr_Type getRhs()
const;
163 BlockMultiVectorPtr_Type getSolution();
165 BlockMatrixPtr_Type getSystem()
const;
167 PreconditionerPtr_Type getPreconditioner();
169 PreconditionerConstPtr_Type getPreconditionerConst()
const;
171 void setPreconditionerThyraFromLinOp( ThyraLinOpPtr_Type precLinOp );
173 void initializeSolverBuilder()
const;
175 bool getVerbose()
const;
177 FEFacConstPtr_Type getFEFactory();
179 BCConstPtr_Type getBCFactory();
181 DomainConstPtr_Type getDomain(
int i)
const;
183 DomainConstPtr_vec_Type getDomainVector()
const{
184 return domainPtr_vec_;
187 std::string getFEType(
int i)
const;
189 std::string getVariableName(
int i)
const;
191 int getDofsPerNode(
int i)
const;
193 ParameterListPtr_Type getParameterList()
const;
195 void addToRhs(BlockMultiVectorPtr_Type x)
const;
197 BlockMultiVectorPtr_Type getSourceTerm();
199 void initSolutionWithVector(MultiVector_Type& mv);
201 LinSolverBuilderPtr_Type getLinearSolverBuilder()
const{
return linearSolverBuilder_;}
203 CommConstPtr_Type getComm()
const{
return comm_;}
205 virtual void getValuesOfInterest( vec_dbl_Type& values ) = 0 ;
207 virtual void computeValuesOfInterestAndExport() = 0;
209 void addParemeterRhs(
double para){ parasSourceFunc_.push_back( para ); }
212 double calculateH1Norm(MultiVectorConstPtr_Type mv,
int blockId1=0,
int blockId2=0,
int domainInd=0);
214 double calculateL2Norm(MultiVectorConstPtr_Type mv,
int domainInd=0);
218 mutable CommConstPtr_Type comm_;
219 mutable BlockMatrixPtr_Type system_;
220 mutable BlockMultiVectorPtr_Type rhs_;
221 mutable BlockMultiVectorPtr_Type solution_;
222 PreconditionerPtr_Type preconditioner_;
223 LinSolverBuilderPtr_Type linearSolverBuilder_;
227 std::vector<RhsFunc_Type> rhsFuncVec_;
228 vec_dbl_Type parasSourceFunc_;
232 mutable ParameterListPtr_Type parameterList_;
233 mutable DomainConstPtr_vec_Type domainPtr_vec_;
234 string_vec_Type domain_FEType_vec_;
235 string_vec_Type variableName_vec_;
236 mutable BCConstPtr_Type bcFactory_;
238 FEFacPtr_Type feFactory_;
239 std::vector<int> dofsPerNode_vec_;
245 TimePtr_Type solveProblemTimer_;
246 TimePtr_Type bcMatrixTimer_;
247 TimePtr_Type bcRHSTimer_;
Definition Domain_decl.hpp:20