47 typedef Teuchos::RCP<Domain_Type> DomainPtr_Type;
48 typedef Teuchos::RCP<const Domain_Type> DomainConstPtr_Type;
49 typedef std::vector<DomainConstPtr_Type> DomainConstPtr_vec_Type;
52 typedef Teuchos::RCP<Matrix_Type> MatrixPtr_Type;
54 typedef typename Matrix_Type::Map_Type Map_Type;
55 typedef typename Matrix_Type::MapPtr_Type MapPtr_Type;
56 typedef typename Matrix_Type::MapConstPtr_Type MapConstPtr_Type;
59 typedef Teuchos::RCP<BlockMatrix_Type> BlockMatrixPtr_Type;
60 typedef Teuchos::RCP<const BlockMatrix_Type> BlockMatrixConstPtr_Type;
63 typedef Teuchos::RCP<MultiVector_Type> MultiVectorPtr_Type;
64 typedef Teuchos::RCP<const MultiVector_Type> MultiVectorConstPtr_Type;
67 typedef Teuchos::RCP<BlockMultiVector_Type> BlockMultiVectorPtr_Type;
68 typedef Teuchos::RCP<const BlockMultiVector_Type> BlockMultiVectorConstPtr_Type;
71 typedef Teuchos::RCP<Preconditioner_Type> PreconditionerPtr_Type;
72 typedef Teuchos::RCP<const Preconditioner_Type> PreconditionerConstPtr_Type;
75 typedef Teuchos::RCP<BC_Type> BCPtr_Type;
76 typedef Teuchos::RCP<const BC_Type> BCConstPtr_Type;
79 typedef Teuchos::RCP<FEFac_Type> FEFacPtr_Type;
80 typedef Teuchos::RCP<const FEFac_Type> FEFacConstPtr_Type;
82 typedef Teuchos::ParameterList ParameterList_Type;
83 typedef Teuchos::RCP<ParameterList_Type> ParameterListPtr_Type;
85 typedef Teuchos::RCP<Stratimikos::DefaultLinearSolverBuilder > LinSolverBuilderPtr_Type;
86 typedef Teuchos::RCP<const Stratimikos::DefaultLinearSolverBuilder > LinSolverBuilderConstPtr_Type;
88 typedef Teuchos::Comm<int> Comm_Type;
89 typedef Teuchos::RCP<const Comm_Type> CommConstPtr_Type;
91 typedef Teuchos::ArrayRCP<GO> GOVecPtr;
93 typedef std::vector<std::string> string_vec_Type;
95 typedef Teuchos::RCP<Thyra::PreconditionerBase<SC> > ThyraPrecPtr_Type;
97 using ThyraLinOpPtr_Type = Teuchos::RCP<typename ThyraTypes::ThyraOp_Type>;
99 Problem(CommConstPtr_Type comm);
101 Problem(ParameterListPtr_Type ¶meterList, CommConstPtr_Type comm);
103 virtual ~Problem() =
default;
105 virtual void info() = 0;
114 void infoParameter(
bool full =
true, std::string =
"empty");
116 void addVariable(
const DomainConstPtr_Type &domain, std::string FEType, std::string name,
int dofsPerNode);
133 virtual void assemble( std::string type )
const = 0;
139 void assembleSourceTerm(
double time = 0. )
const;
141 void assembleVolumeTerm(
double time )
const;
143 void assembleSurfaceTerm(
double time )
const;
145 bool hasSourceTerm()
const;
147 int solve( BlockMultiVectorPtr_Type rhs = Teuchos::null );
149 void setupPreconditioner( std::string type=
"Monolithic" )
const;
151 void initializePreconditioner( std::string type=
"Monolithic" )
const;
153 void addBoundaries(
const BCConstPtr_Type &bcFactory);
155 void setBoundaries(
double time=.0)
const;
157 void setBoundariesRHS(
double time=.0)
const;
159 void setAllDirichletZero( BlockMultiVectorPtr_Type rhs)
const;
161 void setBoundariesSystem()
const;
163 void initializeProblem(
int nmbVectors=1);
165 void initializeVectors(
int nmbVectors=1);
167 BlockMultiVectorPtr_Type getRhs();
169 BlockMultiVectorPtr_Type getRhs()
const;
171 BlockMultiVectorPtr_Type getSolution();
173 BlockMatrixPtr_Type getSystem()
const;
175 PreconditionerPtr_Type getPreconditioner();
177 PreconditionerConstPtr_Type getPreconditionerConst()
const;
179 void setPreconditionerThyraFromLinOp( ThyraLinOpPtr_Type precLinOp );
181 void initializeSolverBuilder()
const;
183 bool getVerbose()
const;
185 FEFacConstPtr_Type getFEFactory();
187 BCConstPtr_Type getBCFactory();
189 DomainConstPtr_Type getDomain(
int i)
const;
191 DomainConstPtr_vec_Type getDomainVector()
const{
192 return domainPtr_vec_;
195 std::string getFEType(
int i)
const;
197 std::string getVariableName(
int i)
const;
199 int getDofsPerNode(
int i)
const;
201 ParameterListPtr_Type getParameterList()
const;
203 void addToRhs(BlockMultiVectorPtr_Type x)
const;
205 BlockMultiVectorPtr_Type getSourceTerm();
207 void initSolutionWithVector(MultiVector_Type& mv);
209 LinSolverBuilderPtr_Type getLinearSolverBuilder()
const{
return linearSolverBuilder_;}
211 CommConstPtr_Type getComm()
const{
return comm_;}
213 virtual void getValuesOfInterest( vec_dbl_Type& values ) = 0 ;
215 virtual void computeValuesOfInterestAndExport() = 0;
217 void addParemeterRhs(
double para){ parasSourceFunc_.push_back( para ); }
219 void changeAssFELinearization(std::string linearization);
221 double calculateH1Norm(MultiVectorConstPtr_Type mv,
int blockId1=0,
int blockId2=0,
int domainInd=0);
223 double calculateL2Norm(MultiVectorConstPtr_Type mv,
int domainInd=0);
227 mutable CommConstPtr_Type comm_;
228 mutable BlockMatrixPtr_Type system_;
229 mutable BlockMultiVectorPtr_Type rhs_;
230 mutable BlockMultiVectorPtr_Type solution_;
231 PreconditionerPtr_Type preconditioner_;
232 LinSolverBuilderPtr_Type linearSolverBuilder_;
236 std::vector<RhsFunc_Type> rhsFuncVec_;
237 vec_dbl_Type parasSourceFunc_;
241 mutable ParameterListPtr_Type parameterList_;
242 mutable DomainConstPtr_vec_Type domainPtr_vec_;
243 string_vec_Type domain_FEType_vec_;
244 string_vec_Type variableName_vec_;
245 mutable BCConstPtr_Type bcFactory_;
247 FEFacPtr_Type feFactory_;
248 std::vector<int> dofsPerNode_vec_;
254 TimePtr_Type solveProblemTimer_;
255 TimePtr_Type bcMatrixTimer_;
256 TimePtr_Type bcRHSTimer_;
Definition Domain_decl.hpp:20