GCC Code Coverage Report


Directory: ./
File: Solver/linearProblemNSFracStepAdvDiff.hpp
Date: 2024-04-14 07:32:34
Exec Total Coverage
Lines: 4 4 100.0%
Branches: 0 0 -%

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: J-F. Gerbeau
13 //
14
15 #ifndef _LinearProblemNSFracStepAdvDiff_HPP
16 #define _LinearProblemNSFracStepAdvDiff_HPP
17
18 // System includes
19
20 // External includes
21
22 // Project includes
23 #include "Solver/linearProblem.hpp"
24 #include "Core/felisceParam.hpp"
25 #include "Solver/bdf.hpp"
26 #include "FiniteElement/elementField.hpp"
27
28 namespace felisce {
29 /*!
30 \class LinearProblemNSFracStepAdvDiff
31 \author J-F. Gerbeau
32 \date 25/11/2011
33 \brief Advection-Diffusion step of a fractional step algorithm for the Navier-Stokes equations
34 */
35 class LinearProblemNSFracStepAdvDiff:
36 public LinearProblem {
37 public:
38 LinearProblemNSFracStepAdvDiff();
39 ~LinearProblemNSFracStepAdvDiff() override;
40 void initialize(std::vector<GeometricMeshRegion::Pointer>& mesh, FelisceTransient::Pointer fstransient, MPI_Comm& comm, bool doUseSNES) override;
41
42 void initPerElementType(ElementType eltType, FlagMatrixRHS flagMatrixRHS = FlagMatrixRHS::matrix_and_rhs) override;
43 void computeElementArray(const std::vector<Point*>& elemPoint, const std::vector<felInt>& elemIdPoint, felInt& iel, FlagMatrixRHS flagMatrixRHS = FlagMatrixRHS::matrix_and_rhs) override;
44
45 void gatherVectorBeforeAssembleMatrixRHS() override;
46 void computeElementArrayBoundaryCondition(const std::vector<Point*>& elemPoint, const std::vector<felInt>& elemIdPoint, felInt& iel, FlagMatrixRHS flagMatrixRHS) override;
47 // Time scheme (bdf):
48 8 void initializeTimeScheme(Bdf* bdf) override {
49 8 m_bdf = bdf;
50 8 }
51 void initExtrapol(PetscVector& V_1) override;
52 void updateExtrapol(PetscVector& V_1) override;
53
54 void copyMatrixRHS() override;
55 void addMatrixRHS() override;
56
57 4 inline int& pressureFWI() { return m_pressureFWI; }
58
59 protected:
60 CurrentFiniteElement* m_feVel;
61 CurrentFiniteElement* m_feVelAdv;
62 CurrentFiniteElement* m_fePres;
63 Variable* m_velocity;
64 Variable* m_velocityAdvection;
65 Variable* m_pressure;
66 Variable* m_displacement;
67 felInt m_iVelocity;
68 felInt m_iVelocityAdvection;
69 felInt m_iPressure;
70 felInt m_iDisplacement;
71 double m_viscosity;
72 double m_density;
73 int m_explicitAdvection;
74 bool m_useSymmetricStress;
75 // bdf:
76 PetscVector m_seqBdfRHS;
77 PetscVector m_solExtrapol;
78
79 ElementField m_elemFieldRHS;
80 private:
81 ElementField m_elemFieldAdv;
82 ElementField m_elemFieldPres;
83 int m_pressureFWI;
84
85 // bdf:
86 ElementField m_elemFieldRHSbdf;
87 ElementField m_elemFieldExt;
88 PetscMatrix m_matrix;
89 bool m_buildTeporaryMatrix;
90 // bdf:
91 Bdf* m_bdf;
92 bool allocateSeqVec;
93 bool allocateSeqVecExt;
94
95 // Incremental version
96 bool allocateSeqVecIncremental;
97 PetscVector m_seqPressure0;
98 PetscVector m_seqPressureDelta;
99 ElementField m_elemFieldPresDelta;
100
101 //ALE
102 ElementField m_elemFieldVelMesh;
103 PetscVector m_beta;
104 int numDofExtensionProblem;
105
106 std::vector<PetscInt> m_petscToGlobal1;
107 std::vector<PetscInt> m_petscToGlobal2;
108 std::vector<PetscScalar> m_auxvec;
109 };
110 }
111
112 #endif
113