Line |
Branch |
Exec |
Source |
1 |
|
|
// ______ ______ _ _ _____ ______ |
2 |
|
|
// | ____| ____| | (_)/ ____| | ____| |
3 |
|
|
// | |__ | |__ | | _| (___ ___| |__ |
4 |
|
|
// | __| | __| | | | |\___ \ / __| __| |
5 |
|
|
// | | | |____| |____| |____) | (__| |____ |
6 |
|
|
// |_| |______|______|_|_____/ \___|______| |
7 |
|
|
// Finite Elements for Life Sciences and Engineering |
8 |
|
|
// |
9 |
|
|
// License: LGL2.1 License |
10 |
|
|
// FELiScE default license: LICENSE in root folder |
11 |
|
|
// |
12 |
|
|
// Main authors: Julien Castelneau, Dominique Chapelle, Miguel Fernandez |
13 |
|
|
// |
14 |
|
|
|
15 |
|
|
#ifndef _NSCONTINUATIONMODEL_HPP |
16 |
|
|
#define _NSCONTINUATIONMODEL_HPP |
17 |
|
|
|
18 |
|
|
// System includes |
19 |
|
|
|
20 |
|
|
// External includes |
21 |
|
|
|
22 |
|
|
// Project includes |
23 |
|
|
#include <Model/model.hpp> |
24 |
|
|
#include <Core/felisceParam.hpp> |
25 |
|
|
#include <Solver/bdf.hpp> |
26 |
|
|
#include <Solver/linearProblemNSContinuation.hpp> |
27 |
|
|
|
28 |
|
|
namespace felisce { |
29 |
|
|
class NSContinuationModel:public Model{ |
30 |
|
|
public: |
31 |
|
|
//!Constructor. |
32 |
|
|
NSContinuationModel(); |
33 |
|
|
//!Destructor. |
34 |
|
✗ |
~NSContinuationModel() override= default; |
35 |
|
|
|
36 |
|
|
void initializeDerivedModel() override; |
37 |
|
|
void postAssemblingMatrixRHS(size_t iProblem=0) override; |
38 |
|
|
void preAssemblingMatrixRHS(size_t iProblem=0) override; |
39 |
|
|
|
40 |
|
|
void setExternalVec() override; |
41 |
|
|
|
42 |
|
|
//! Manage time iteration. |
43 |
|
|
virtual void prepareForward(); |
44 |
|
|
virtual void solveContinuation(); |
45 |
|
|
void forward() override; |
46 |
|
|
|
47 |
|
|
|
48 |
|
|
inline PetscVector& displacement() { return m_dispSeq;} |
49 |
|
|
|
50 |
|
|
|
51 |
|
|
protected: |
52 |
|
|
void firstIteration(); |
53 |
|
|
|
54 |
|
|
LinearProblemNSContinuation * m_lpb; |
55 |
|
|
|
56 |
|
|
ChronoInstance chronoAssemble, chronoSolve; |
57 |
|
|
|
58 |
|
|
PetscVector m_disp, m_dispSeq; |
59 |
|
|
|
60 |
|
|
std::vector<PetscInt> m_petscToGlobal; |
61 |
|
|
PetscScalar m_displTimeStep; |
62 |
|
|
|
63 |
|
|
//! ALE |
64 |
|
|
void computeALEterms(); |
65 |
|
|
void UpdateMeshByDisplacement(); |
66 |
|
|
void solveHarmExt(); |
67 |
|
|
void updateMesh(); |
68 |
|
|
|
69 |
|
|
//! ALE |
70 |
|
|
PetscScalar m_tau; |
71 |
|
|
PetscVector m_dispMesh; |
72 |
|
|
PetscVector m_velMesh; |
73 |
|
|
PetscVector m_solDispl; |
74 |
|
|
PetscVector m_solDispl_0; |
75 |
|
|
std::vector<PetscScalar> m_dispMeshVector; |
76 |
|
|
int m_numDofExtensionProblem; |
77 |
|
|
std::vector<PetscScalar> m_tmpDisp; // used to extract the values of m_dispMesh |
78 |
|
|
|
79 |
|
|
|
80 |
|
|
}; |
81 |
|
|
} |
82 |
|
|
|
83 |
|
|
#endif |
84 |
|
|
|