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