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 |
|
|
// System includes |
16 |
|
|
|
17 |
|
|
// External includes |
18 |
|
|
|
19 |
|
|
// Project includes |
20 |
|
|
#include "Model/fkppModel.hpp" |
21 |
|
|
|
22 |
|
|
namespace felisce { |
23 |
|
✗ |
FkppModel::FkppModel():Model() { |
24 |
|
✗ |
m_name = "FKPP"; |
25 |
|
|
} |
26 |
|
|
|
27 |
|
✗ |
FkppModel::~FkppModel() |
28 |
|
|
= default; |
29 |
|
|
|
30 |
|
✗ |
void FkppModel::forward() { |
31 |
|
|
// Write solution for postprocessing (if required) |
32 |
|
✗ |
writeSolution(); |
33 |
|
|
|
34 |
|
|
// Advance time step. |
35 |
|
✗ |
updateTime(FlagMatrixRHS::only_rhs); |
36 |
|
|
|
37 |
|
|
// Print time information |
38 |
|
✗ |
printNewTimeIterationBanner(); |
39 |
|
|
|
40 |
|
|
//Assembly loop on elements. |
41 |
|
✗ |
if (m_fstransient->iteration == 1) { |
42 |
|
✗ |
m_linearProblem[0]->assembleMatrixRHS(MpiInfo::rankProc(), FlagMatrixRHS::matrix_and_rhs); |
43 |
|
|
} |
44 |
|
|
else { |
45 |
|
✗ |
m_linearProblem[0]->assembleMatrixRHS(MpiInfo::rankProc(), FlagMatrixRHS::only_rhs); |
46 |
|
|
} |
47 |
|
|
//Apply boundary conditions. |
48 |
|
✗ |
m_linearProblem[0]->finalizeEssBCTransient(); |
49 |
|
✗ |
if (m_fstransient->iteration == 1) { |
50 |
|
✗ |
m_linearProblem[0]->applyBC(FelisceParam::instance().essentialBoundaryConditionsMethod, MpiInfo::rankProc(), FlagMatrixRHS::matrix_and_rhs, FlagMatrixRHS::matrix_and_rhs); |
51 |
|
|
} else { |
52 |
|
✗ |
m_linearProblem[0]->applyBC(FelisceParam::instance().essentialBoundaryConditionsMethod, MpiInfo::rankProc(), FlagMatrixRHS::only_rhs, FlagMatrixRHS::only_rhs); |
53 |
|
|
} |
54 |
|
|
|
55 |
|
|
//Solve linear system. |
56 |
|
✗ |
m_linearProblem[0]->solve(MpiInfo::rankProc(), MpiInfo::numProc()); |
57 |
|
|
} |
58 |
|
|
|
59 |
|
|
} |
60 |
|
|
|