43 typedef Teuchos::RCP<const Domain_Type> DomainConstPtr_Type;
44 typedef std::vector<DomainConstPtr_Type> DomainConstPtr_vec_Type;
47 typedef Teuchos::RCP<Matrix_Type> MatrixPtr_Type;
49 typedef typename Matrix_Type::Map_Type Map_Type;
50 typedef typename Matrix_Type::MapPtr_Type MapPtr_Type;
51 typedef typename Matrix_Type::MapConstPtr_Type MapConstPtr_Type;
54 typedef Teuchos::RCP<BlockMatrix_Type> BlockMatrixPtr_Type;
55 typedef Teuchos::RCP<const BlockMatrix_Type> BlockMatrixConstPtr_Type;
58 typedef Teuchos::RCP<MultiVector_Type> MultiVectorPtr_Type;
59 typedef Teuchos::RCP<const MultiVector_Type> MultiVectorConstPtr_Type;
62 typedef Teuchos::RCP<BlockMultiVector_Type> BlockMultiVectorPtr_Type;
63 typedef Teuchos::RCP<const BlockMultiVector_Type> BlockMultiVectorConstPtr_Type;
66 typedef Teuchos::RCP<Preconditioner_Type> PreconditionerPtr_Type;
67 typedef Teuchos::RCP<const Preconditioner_Type> PreconditionerConstPtr_Type;
70 typedef Teuchos::RCP<BC_Type> BCPtr_Type;
71 typedef Teuchos::RCP<const BC_Type> BCConstPtr_Type;
74 typedef Teuchos::RCP<FEFac_Type> FEFacPtr_Type;
75 typedef Teuchos::RCP<const FEFac_Type> FEFacConstPtr_Type;
77 typedef Teuchos::ParameterList ParameterList_Type;
78 typedef Teuchos::RCP<ParameterList_Type> ParameterListPtr_Type;
80 typedef Teuchos::RCP<Stratimikos::DefaultLinearSolverBuilder > LinSolverBuilderPtr_Type;
81 typedef Teuchos::RCP<const Stratimikos::DefaultLinearSolverBuilder > LinSolverBuilderConstPtr_Type;
83 typedef Teuchos::Comm<int> Comm_Type;
84 typedef Teuchos::RCP<const Comm_Type> CommConstPtr_Type;
86 typedef Teuchos::ArrayRCP<GO> GOVecPtr;
88 typedef std::vector<std::string> string_vec_Type;
90 typedef Teuchos::RCP<Thyra::PreconditionerBase<SC> > ThyraPrecPtr_Type;
91 typedef Teuchos::RCP<Thyra::LinearOpBase<SC> > ThyraLinOpPtr_Type;
93 Problem(CommConstPtr_Type comm);
95 Problem(ParameterListPtr_Type ¶meterList, CommConstPtr_Type comm);
97 virtual ~Problem() =
default;
99 virtual void info() = 0;
103 void addVariable(
const DomainConstPtr_Type &domain, std::string FEType, std::string name,
int dofsPerNode);
120 virtual void assemble( std::string type )
const = 0;
126 void assembleSourceTerm(
double time = 0. )
const;
128 void assembleVolumeTerm(
double time )
const;
130 void assembleSurfaceTerm(
double time )
const;
132 bool hasSourceTerm()
const;
134 int solve( BlockMultiVectorPtr_Type rhs = Teuchos::null );
136 void setupPreconditioner( std::string type=
"Monolithic" )
const;
138 void initializePreconditioner( std::string type=
"Monolithic" )
const;
140 void addBoundaries(
const BCConstPtr_Type &bcFactory);
142 void setBoundaries(
double time=.0)
const;
144 void setBoundariesRHS(
double time=.0)
const;
146 void setAllDirichletZero( BlockMultiVectorPtr_Type rhs)
const;
148 void setBoundariesSystem()
const;
150 void initializeProblem(
int nmbVectors=1);
152 void initializeVectors(
int nmbVectors=1);
154 BlockMultiVectorPtr_Type getRhs();
156 BlockMultiVectorPtr_Type getRhs()
const;
158 BlockMultiVectorPtr_Type getSolution();
160 BlockMatrixPtr_Type getSystem()
const;
162 PreconditionerPtr_Type getPreconditioner();
164 PreconditionerConstPtr_Type getPreconditionerConst()
const;
166 void setPreconditionerThyraFromLinOp( ThyraLinOpPtr_Type precLinOp );
168 void initializeSolverBuilder()
const;
170 bool getVerbose()
const;
172 FEFacConstPtr_Type getFEFactory();
174 BCConstPtr_Type getBCFactory();
176 DomainConstPtr_Type getDomain(
int i)
const;
178 DomainConstPtr_vec_Type getDomainVector()
const{
179 return domainPtr_vec_;
182 std::string getFEType(
int i)
const;
184 std::string getVariableName(
int i)
const;
186 int getDofsPerNode(
int i)
const;
188 ParameterListPtr_Type getParameterList()
const;
190 void addToRhs(BlockMultiVectorPtr_Type x)
const;
192 BlockMultiVectorPtr_Type getSourceTerm();
194 void initSolutionWithVector(MultiVector_Type& mv);
196 LinSolverBuilderPtr_Type getLinearSolverBuilder()
const{
return linearSolverBuilder_;};
198 CommConstPtr_Type getComm()
const{
return comm_;};
200 virtual void getValuesOfInterest( vec_dbl_Type& values ) = 0 ;
202 virtual void computeValuesOfInterestAndExport() = 0;
204 void addParemeterRhs(
double para){ parasSourceFunc_.push_back( para ); }
207 double calculateH1Norm(MultiVectorConstPtr_Type mv,
int blockId1=0,
int blockId2=0,
int domainInd=0);
209 double calculateL2Norm(MultiVectorConstPtr_Type mv,
int domainInd=0);
213 mutable CommConstPtr_Type comm_;
214 mutable BlockMatrixPtr_Type system_;
215 mutable BlockMultiVectorPtr_Type rhs_;
216 mutable BlockMultiVectorPtr_Type solution_;
217 PreconditionerPtr_Type preconditioner_;
218 LinSolverBuilderPtr_Type linearSolverBuilder_;
222 std::vector<RhsFunc_Type> rhsFuncVec_;
223 vec_dbl_Type parasSourceFunc_;
227 mutable ParameterListPtr_Type parameterList_;
228 mutable DomainConstPtr_vec_Type domainPtr_vec_;
229 string_vec_Type domain_FEType_vec_;
230 string_vec_Type variableName_vec_;
231 mutable BCConstPtr_Type bcFactory_;
233 FEFacPtr_Type feFactory_;
234 std::vector<int> dofsPerNode_vec_;
240 TimePtr_Type solveProblemTimer_;
241 TimePtr_Type bcMatrixTimer_;
242 TimePtr_Type bcRHSTimer_;
Definition Domain_decl.hpp:20