Finite Element Domain Decomposition Library
FEDDLib
Loading...
Searching...
No Matches
DAESolverInTime_decl.hpp
1#ifndef DAESOLVERINTIME_DECL_hpp
2#define DAESOLVERINTIME_DECL_hpp
3
4#include "feddlib/core/FEDDCore.hpp"
5#include "feddlib/problems/problems_config.h"
6#include "feddlib/core/General/DefaultTypeDefs.hpp"
7#include "feddlib/core/General/ExporterParaView.hpp"
8#include "feddlib/core/General/ExporterTxt.hpp"
9
10
11
12#include "NonLinearSolver.hpp"
13#include "TimeSteppingTools.hpp"
14
23
24namespace FEDD {
25
26template <class SC = default_sc, class LO = default_lo, class GO = default_go, class NO = default_no>
27class DAESolverInTime {
28
29public:
30 typedef Problem<SC,LO,GO,NO> Problem_Type;
31 typedef Teuchos::RCP<Problem_Type> ProblemPtr_Type;
32 typedef typename Problem_Type::CommConstPtr_Type CommConstPtr_Type;
33 typedef typename Problem_Type::MapConstPtr_Type MapConstPtr_Type;
34 typedef typename Problem_Type::MultiVector_Type MultiVector_Type;
35 typedef typename Problem_Type::MultiVectorPtr_Type MultiVectorPtr_Type;
36 typedef typename Problem_Type::MultiVectorConstPtr_Type MultiVectorConstPtr_Type;
37 typedef typename Problem_Type::BlockMatrix_Type BlockMatrix_Type;
38 typedef typename Problem_Type::BlockMatrixPtr_Type BlockMatrixPtr_Type;
39 typedef typename Problem_Type::BlockMultiVector_Type BlockMultiVector_Type;
40 typedef typename Problem_Type::BlockMultiVectorPtr_Type BlockMultiVectorPtr_Type;
41 typedef Teuchos::Array<MultiVectorPtr_Type> MultiVectorPtrArray_Type;
42 typedef Teuchos::Array<MultiVectorConstPtr_Type> MultiVectorConstPtrArray_Type;
43 typedef Teuchos::Array<BlockMultiVectorPtr_Type> BlockMultiVectorPtrArray_Type;
44 typedef typename Problem_Type::FEFacPtr_Type FEFacPtr_Type;
45 typedef typename Problem_Type::DomainConstPtr_Type DomainConstPtr_Type;
46 typedef typename Problem_Type::Matrix_Type Matrix_Type;
47 typedef typename Problem_Type::MatrixPtr_Type MatrixPtr_Type;
48
49 typedef NonLinearProblem<SC,LO,GO,NO> NonLinProb_Type;
50 typedef Teuchos::RCP<NonLinProb_Type> NonLinProbPtr_Type;
51 typedef TimeProblem<SC,LO,GO,NO> TimeProblem_Type;
52 typedef Teuchos::RCP<TimeProblem_Type> TimeProblemPtr_Type;
53
54 typedef ExporterParaView<SC,LO,GO,NO> Exporter_Type;
55 typedef Teuchos::RCP<Exporter_Type> ExporterPtr_Type;
56 typedef Teuchos::RCP<ExporterTxt> ExporterTxtPtr_Type;
57
58 typedef FSI<SC,LO,GO,NO> FSIProblem_Type;
59 typedef Teuchos::RCP<FSIProblem_Type> FSIProblemPtr_Type;
60
61 typedef Domain<SC,LO,GO,NO> Domain_Type;
62 typedef Teuchos::RCP<Domain_Type > DomainPtr_Type;
63 typedef typename Domain_Type::Mesh_Type Mesh_Type;
64 typedef typename Domain_Type::MeshPtr_Type MeshPtr_Type;
65
66
67 typedef MeshUnstructured<SC,LO,GO,NO> MeshUnstr_Type;
68 typedef Teuchos::RCP<MeshUnstr_Type> MeshUnstrPtr_Type;
69
70 DAESolverInTime(CommConstPtr_Type comm);
71
72 DAESolverInTime(ParameterListPtr_Type &parameterList, CommConstPtr_Type comm);
73
74 DAESolverInTime(SmallMatrix<int> &timeStepDef, ParameterListPtr_Type &parameterList, CommConstPtr_Type comm);
75
76 ~DAESolverInTime();
77
78// void setProblem(NonLinearProblem_Type &problem);
79
80 void setProblem(Problem_Type &problem);
81
82 void defineTimeStepping(SmallMatrix<int> &timeStepDef);
83
84 void setupTimeStepping();
85
86 void advanceInTime();
87
88 void advanceWithLoadStepping();
89
90 void advanceInTimeLinear();
91
92 void advanceInTimeNonLinear();
93
94 // Newmark-Verfahren (fuer lineare Probleme)
95 void advanceInTimeLinearNewmark();
96
97 // Newmkar-Verfahren (fuer nichtlineare Probleme)
98 void advanceInTimeNonLinearNewmark();
99
100 // Wendet die Zeitdiskretisierung separat auf Fluid und Struktur an und
101 // schreibe dann vor dem nlSolve() alles in das FSI-System hinein
102 void advanceInTimeFSI();
103
104 void advanceInTimeLinearMultistep();
105
106 void advanceInTimeNonLinearMultistep();
107
108 void advanceInTimeLinearExternal();
109
110 void advanceInTimeNonLinearExternal();
111
112 void setTimeStep(double dt);
113
114 void setFinalTime(double T);
115
116 void checkTimeSteppingDef();
117
118 void exportTimestep();
119
120 void exportTimestep(BlockMultiVectorPtr_Type& solShort);
121
122 void setupExporter();
123
124 void setupExporter(BlockMultiVectorPtr_Type& solShort);
125
126 void closeExporter();
127
128 void addRhsDAE(SmallMatrix<double> coeff, BlockMatrixPtr_Type bMat, BlockMultiVectorPtr_Type vec);
129
130 void addRhsDAE(SmallMatrix<double> coeff, BlockMultiVectorPtr_Type vec);
131
132// void addRhsDAE(SmallMatrix<double> coeff, MultiVector_Type &vec);
133//
134// void addRhsDAE(SmallMatrix<double> coeff, BE_ptr_vec_Type &bENl, MultiVector_Type &vec, MultiVector_Type &sourceTerm);
135//
136// void addRhsDAE(SmallMatrix<double> coeff, MultiVector_Type &vec, MultiVector_Type &sourceTerm);
137
138 void addSourceTermToRHS(double coeff);
139
140 void getMassCoefficients(SmallMatrix<double> &massCoeff);
141
142 void getMultiStageCoefficients(SmallMatrix<double> &problemCoeff, int stage, int stagePrior, bool forRhs = false);
143
144 void buildMultiStageRhs( int stage, Teuchos::Array<BlockMatrixPtr_Type>& matrixPrevStages, BlockMultiVectorPtrArray_Type& solutionPrevStages );
145
146 CommConstPtr_Type comm_;
147 bool verbose_;
148 ParameterListPtr_Type parameterList_;
149 bool isTimeSteppingDefined_;
150
151 ProblemPtr_Type problem_;
152 TimeProblemPtr_Type problemTime_;
153
154 SmallMatrix<int> timeStepDef_;
155 Teuchos::RCP<TimeSteppingTools> timeSteppingTool_;
156 FEFacPtr_Type feFactory_;
157
158 std::vector<ExporterPtr_Type> exporter_vector_;
159 MultiVectorConstPtrArray_Type export_solution_vector_;
160 bool boolExporterSetup_;
161
162private:
163
164#ifdef FEDD_TIMER
165 TimePtr_Type solveProblemTimer_;
166#endif
167#ifdef FEDD_TIMER
168 TimePtr_Type reassmbleAddInterfaceRHSTimer_;
169 TimePtr_Type reassmbleUpdateMeshDisplacementTimer_;
170 TimePtr_Type reassmbleSolveGeometryTimer_;
171 TimePtr_Type reassmbleMoveMeshTimer_;
172 TimePtr_Type reassmbleSolidMassAndRHSTimer_;
173 TimePtr_Type reassmbleForTimeTimer_;
174 TimePtr_Type reassmbleUpdateFluidInTimeTimer_;
175#endif
176};
177}
178#endif
Definition Domain_decl.hpp:20
Definition ExporterParaView_decl.hpp:44
Definition FSI_decl.hpp:26
Definition MeshUnstructured_decl.hpp:31
Definition NonLinearProblem_decl.hpp:24
Definition Problem_decl.hpp:38
This class represents a templated small Matrix of type T. Primarily created for 2x2 and 3x3 matrices....
Definition SmallMatrix.hpp:22
Definition TimeProblem_decl.hpp:33
Adaptive Mesh Refinement.
Definition AdaptiveMeshRefinement.cpp:5