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: |
13 |
|
|
// |
14 |
|
|
|
15 |
|
|
#ifndef _LinearProblemFSINitscheXFEMSolid_HPP |
16 |
|
|
#define _LinearProblemFSINitscheXFEMSolid_HPP |
17 |
|
|
|
18 |
|
|
// System includes |
19 |
|
|
#include <vector> |
20 |
|
|
|
21 |
|
|
// External includes |
22 |
|
|
|
23 |
|
|
// Project includes |
24 |
|
|
#include "Solver/linearProblem.hpp" |
25 |
|
|
#include "Solver/linearProblemFSINitscheXFEMFluid.hpp" |
26 |
|
|
#include "Core/felisceParam.hpp" |
27 |
|
|
#include "Core/felisceTransient.hpp" |
28 |
|
|
#include "FiniteElement/elementField.hpp" |
29 |
|
|
#include "DegreeOfFreedom/duplicateSupportDof.hpp" |
30 |
|
|
#include "Solver/bdf.hpp" |
31 |
|
|
|
32 |
|
|
namespace felisce { |
33 |
|
|
/*! |
34 |
|
|
\file linearProblemFSINitscheXFEMSolid.hpp |
35 |
|
|
\authors B. Fabreges |
36 |
|
|
\date February 2013 |
37 |
|
|
\brief Matrix and rhs for the elastic std::string solver. |
38 |
|
|
*/ |
39 |
|
|
|
40 |
|
|
template<class SolidPrb> class LinearProblemFSINitscheXFEMSolid: |
41 |
|
|
public SolidPrb { |
42 |
|
|
public: |
43 |
|
|
LinearProblemFSINitscheXFEMSolid(); |
44 |
|
|
~LinearProblemFSINitscheXFEMSolid(); |
45 |
|
|
|
46 |
|
|
void initialize(std::vector<GeometricMeshRegion::Pointer>& mesh, FelisceTransient::Pointer fstransient, MPI_Comm& comm, bool doUseSNES) override; |
47 |
|
|
|
48 |
|
|
|
49 |
|
|
void initPerElementTypeBD(GeometricMeshRegion::ElementType eltType, FlagMatrixRHS flagMatrixRHS = FlagMatrixRHS::matrix_and_rhs) override; |
50 |
|
|
|
51 |
|
|
void computeElementArrayBD(const std::vector<Point*>& elemPoint, const std::vector<felInt>& elemIdPoint, felInt& iel, FlagMatrixRHS flagMatrixRHS = FlagMatrixRHS::matrix_and_rhs) override; |
52 |
|
|
void computeElementArrayBD(const std::vector<Point*>& elemPoint, const std::vector<felInt>& elemIdPoint, const std::vector<Point*>& elemNormal, const std::vector< std::vector<Point*> >& elemTangent, felInt& iel, FlagMatrixRHS flagMatrixRHS = FlagMatrixRHS::matrix_and_rhs) override; |
53 |
|
|
|
54 |
|
|
void setDuplicateSupportObject(DuplicateSupportDof* object); |
55 |
|
|
|
56 |
|
|
void setFluidLinPrb(LinearProblemFSINitscheXFEMFluid* pLinPrb); |
57 |
|
|
|
58 |
|
|
void setFluidFiniteElement(CurrentFiniteElement* velFE, CurrentFiniteElement* preFE); |
59 |
|
|
|
60 |
|
|
void setUserBoundaryCondition(); |
61 |
|
|
|
62 |
|
|
void gatherSeqLastTimeSol(PetscVector& parStrucLastSol); |
63 |
|
|
void gatherSeqLastTimeVelSol(PetscVector& parStrucLastVelSol); |
64 |
|
|
void gatherStabExplicitFluidExtrapol(std::vector<PetscVector>& parFluidExtrapol); |
65 |
|
|
void gatherStabExplicitFluidExtrapol(PetscVector& parFluidExtrapol); |
66 |
|
|
void gatherRNStructExtrapol(PetscVector& parRNStrucExtrapol); |
67 |
|
|
void setStabExplicitFluidExtrapol(PetscVector& seqFluidExtrapol); |
68 |
|
|
void initStabExplicitFluidExtrapol(felInt order); |
69 |
|
|
|
70 |
|
|
void isAssemblingOfSolidProblemTerms(bool isit); |
71 |
|
|
|
72 |
|
|
void isStrucOperatorExplicitlyComputed(bool isit); |
73 |
|
✗ |
inline bool isStrucOperatorExplicitlyComputed() { |
74 |
|
✗ |
return m_isStrucOperatorExplicitlyComputed; |
75 |
|
|
} |
76 |
|
|
|
77 |
|
|
void deleteDynamicData(); |
78 |
|
|
|
79 |
|
40 |
void setUseCurrentFluidSolution(bool useCurFluidSol) { m_useCurrentFluidSolution = useCurFluidSol;} |
80 |
|
✗ |
bool getUseCurrentFluidSolution() { return m_useCurrentFluidSolution;} |
81 |
|
|
|
82 |
|
|
double computeL2Norm(PetscVector& inputVec); |
83 |
|
|
|
84 |
|
|
/** |
85 |
|
|
* @brief Assembly loop on elements pre-defined as crack if crack model |
86 |
|
|
*/ |
87 |
|
20 |
virtual void userComputeCrackStress() {}; |
88 |
|
|
|
89 |
|
|
protected: |
90 |
|
|
virtual void userSetDirichletBC(); |
91 |
|
|
|
92 |
|
|
felInt m_leftSide; // 0 (default) to add the contribution of the left side, 1 to remove it. |
93 |
|
|
felInt m_rightSide; // 0 (default) to add the contribution of the right side, 1 to remove it. |
94 |
|
|
|
95 |
|
|
// to std::set the DIrichlet BC for extremeties of the solid that are not front points |
96 |
|
|
std::vector<std::vector<double> >m_valBC; |
97 |
|
|
std::vector<bool> m_applyDirichletBC; |
98 |
|
|
|
99 |
|
|
private: |
100 |
|
|
// functions |
101 |
|
|
void updateFluidVel(felInt ielSupportDof, const PetscVector& fluidSol, felInt iold=0); |
102 |
|
|
void computeIntegrationPoints(std::vector<Point*>& ptElem); |
103 |
|
|
void computeFluidVelOnSubStructure(const std::vector<double>& strucNormal); |
104 |
|
|
void computeFluidNormalDerivativeJump(double sideCoeff, const std::vector<double>& strucNormal, const std::vector<double>& strucNormalInit); |
105 |
|
|
|
106 |
|
|
void assembleNitscheXFEMTerms(const std::vector<Point*>& elemPoint, const std::vector<felInt>& elemIdPoint, felInt& iel, FlagMatrixRHS flagMatrixRHS); |
107 |
|
|
|
108 |
|
|
// variables |
109 |
|
|
double m_massVel; |
110 |
|
|
felInt m_numSolidComponent; |
111 |
|
|
|
112 |
|
|
ElementField m_dispLastSol; |
113 |
|
|
ElementField m_elemNitscheXFEMSolidRHS; |
114 |
|
|
|
115 |
|
|
std::vector<ElementField> m_fluidDofSol; |
116 |
|
|
|
117 |
|
|
DuplicateSupportDof* m_duplicateSupportElements; |
118 |
|
|
LinearProblemFSINitscheXFEMFluid* m_pLinFluid; |
119 |
|
|
|
120 |
|
|
std::vector<std::vector<felInt> > m_idDofBCVertices; |
121 |
|
|
|
122 |
|
|
CurrentFiniteElement *m_feFluid; |
123 |
|
|
CurrentFiniteElement *m_fePres; |
124 |
|
|
|
125 |
|
|
std::vector<Point> m_intPoints; |
126 |
|
|
|
127 |
|
|
bool m_isSeqLastTimeSolAllocated; |
128 |
|
|
PetscVector m_seqLastTimeSol; |
129 |
|
|
|
130 |
|
|
bool m_isSeqLastTimeVelSolAllocated; |
131 |
|
|
PetscVector m_seqLastTimeVelSol; |
132 |
|
|
|
133 |
|
|
bool m_isSeqStabExplicitFluidExtrapolAllocated; |
134 |
|
|
std::vector<PetscVector> m_seqStabExplicitFluidExtrapol; |
135 |
|
|
|
136 |
|
|
bool m_isSeqRNStrucExtrapolAllocated; |
137 |
|
|
PetscVector m_seqRNStrucExtrapol; |
138 |
|
|
|
139 |
|
|
ElementFieldDynamicValue *m_elemFieldTimeSchemeType; |
140 |
|
|
felInt m_timeSchemeType; |
141 |
|
|
|
142 |
|
|
std::size_t m_numVerPerSolidElt; |
143 |
|
|
std::vector<Point*> m_subItfPts; |
144 |
|
|
|
145 |
|
|
bool m_assemblingOfSolidProblemTerms; |
146 |
|
|
|
147 |
|
|
felInt m_useCurrentFluidSolution; |
148 |
|
|
|
149 |
|
|
bool m_isStrucOperatorExplicitlyComputed; |
150 |
|
|
|
151 |
|
|
std::vector<double> m_betaRN; |
152 |
|
|
|
153 |
|
|
PetscVector m_seqVecL2Norm; |
154 |
|
|
|
155 |
|
|
felInt m_iDisplacement; |
156 |
|
|
}; |
157 |
|
|
} |
158 |
|
|
|
159 |
|
|
#include "linearProblemFSINitscheXFEMSolid.hxx" |
160 |
|
|
|
161 |
|
|
#endif |
162 |
|
|
|