GCC Code Coverage Report


Directory: ./
File: Model/stokesContinuationModel.cpp
Date: 2024-04-14 07:32:34
Exec Total Coverage
Lines: 24 24 100.0%
Branches: 1 2 50.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: Julien Castelneau, Dominique Chapelle, Miguel Fernandez
13 //
14
15 // System includes
16
17 // External includes
18
19 // Project includes
20 #include <Model/stokesContinuationModel.hpp>
21
22 namespace felisce {
23 4 StokesContinuationModel::StokesContinuationModel():Model() {
24
1/2
✓ Branch 1 taken 4 times.
✗ Branch 2 not taken.
4 m_name = "StokesContinuation";
25 4 }
26
27 // Called in Model::initializeLinearProblem, just after the mesh partitioning.
28 4 void StokesContinuationModel::initializeDerivedModel() {
29 // Saving the lpb pointer after the static cast
30 4 m_lpb = static_cast<LinearProblemStokesContinuation*>(m_linearProblem[0]);
31
32 // Initializing the PetscVectors
33 4 m_lpb->initPetscVectors();
34 4 }
35
36 20 void StokesContinuationModel::prepareForward() {
37
38 20 writeSolution();
39
40 20 updateTime(); //Here the matrix(0), the non constant one, is cleared and the rhs also.
41
42 20 printNewTimeIterationBanner();
43
44 20 m_lpb->gatherVectorBeforeAssembleMatrixRHS();
45
46 20 m_lpb->readData(*io(), m_fstransient->time);
47 20 }
48
49 // this function is written for the time-independent case
50 20 void StokesContinuationModel::forward() {
51 20 prepareForward();
52
53 // Zero-ing the solution
54 20 m_lpb->solution().zeroEntries();
55
56 // Assemble the stabilization terms
57 20 m_lpb->assembleCIPStabilization();
58
59 // Assemble the linear system
60 20 m_lpb->assembleMatrixRHS(MpiInfo::rankProc(), FlagMatrixRHS::matrix_and_rhs);
61
62 //Apply boundary conditions for the dual variable
63 20 m_lpb->finalizeEssBCTransient();
64 20 m_lpb->applyBC(FelisceParam::instance().essentialBoundaryConditionsMethod, MpiInfo::rankProc());
65
66 // Solve the linear system
67 20 m_lpb->solve(MpiInfo::rankProc(), MpiInfo::numProc());
68
69 20 m_lpb->gatherSolution();
70 20 }
71 }
72