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 |
|
|
// System includes |
16 |
|
|
|
17 |
|
|
// External includes |
18 |
|
|
|
19 |
|
|
// Project includes |
20 |
|
|
#include "Model/poissonContinuationModel.hpp" |
21 |
|
|
|
22 |
|
|
namespace felisce { |
23 |
|
4 |
PoissonContinuationModel::PoissonContinuationModel():Model() { |
24 |
1/2
✓ Branch 1 taken 4 times.
✗ Branch 2 not taken.
|
4 |
m_name = "PoissonContinuation"; |
25 |
|
4 |
} |
26 |
|
|
|
27 |
|
|
// Called in Model::initializeLinearProblem, just after the mesh partitioning. |
28 |
|
4 |
void PoissonContinuationModel::initializeDerivedModel() { |
29 |
|
|
// Saving the lpb pointer after the static cast |
30 |
|
4 |
m_lpb = static_cast<LinearProblemPoissonContinuation*>(m_linearProblem[0]); |
31 |
|
|
|
32 |
|
|
// Initializing the PetscVectors |
33 |
|
4 |
m_lpb->initPetscVectors(); |
34 |
|
4 |
} |
35 |
|
|
|
36 |
|
4 |
void PoissonContinuationModel::prepareForward() { |
37 |
|
4 |
printNewTimeIterationBanner(); |
38 |
|
4 |
} |
39 |
|
|
|
40 |
|
|
|
41 |
|
4 |
void PoissonContinuationModel::forward() { |
42 |
|
4 |
prepareForward(); |
43 |
|
|
|
44 |
|
|
// Zero-ing the solution |
45 |
|
4 |
m_lpb->solution().zeroEntries(); |
46 |
|
|
|
47 |
|
|
// Reading the data (generated from the forward problem) |
48 |
|
4 |
m_lpb->readData(*io(), 0); |
49 |
|
|
|
50 |
|
|
// Assemble the stabilization terms |
51 |
|
4 |
m_lpb->assembleFaceOrientedStabilization(); |
52 |
|
|
|
53 |
|
|
// Assemble the linear system |
54 |
|
4 |
m_lpb->assembleMatrixRHS(MpiInfo::rankProc(), FlagMatrixRHS::matrix_and_rhs); |
55 |
|
|
|
56 |
|
|
//Apply boundary conditions for the dual variable |
57 |
|
4 |
m_lpb->finalizeEssBCTransient(); |
58 |
|
4 |
m_lpb->applyBC(FelisceParam::instance().essentialBoundaryConditionsMethod, MpiInfo::rankProc()); |
59 |
|
|
|
60 |
|
|
// Solve the linear system |
61 |
|
4 |
m_lpb->solve(MpiInfo::rankProc(), MpiInfo::numProc()); |
62 |
|
4 |
} |
63 |
|
|
} |
64 |
|
|
|