CEPS  24.01
Cardiac ElectroPhysiology Simulator
AbstractPdeSolver.hpp
Go to the documentation of this file.
1 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2  This file is part of CEPS.
3 
4  CEPS is free software: you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation, either version 3 of the License, or
7  (at your option) any later version.
8 
9  CEPS is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with CEPS (see file LICENSE at root of project).
16  If not, see <https://www.gnu.org/licenses/>.
17 
18 
19  Copyright 2019-2024 Inria, Universite de Bordeaux
20 
21  Authors, in alphabetical order:
22 
23  Pierre-Elliott BECUE, Florian CARO, Yves COUDIERE(*), Andjela DAVIDOVIC,
24  Charlie DOUANLA-LONTSI, Marc FUENTES, Mehdi JUHOOR, Michael LEGUEBE(*),
25  Pauline MIGERDITICHAN, Valentin PANNETIER(*), Nejib ZEMZEMI.
26  * : currently active authors
27 
28 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
30 #pragma once
31 
32 #include "common/CepsCommon.hpp"
38 
39 // Forward declarations
40 class AbstractPdeProblem;
41 class AbstractAssembler;
42 
45 {
46 
47  public:
48 
50  AbstractPdeSolver() = delete;
51 
54 
56  AbstractPdeSolver(const AbstractPdeSolver &that) = delete;
57 
60  operator=(const AbstractPdeSolver &that) = delete;
61 
63  ~AbstractPdeSolver() override;
64 
67  virtual void
69 
70  // ---------------------------------------------------------------------------------------------
71  // Solving
72 
77  virtual void
78  solve() = 0;
79 
80  // ---------------------------------------------------------------------------------------------
81  // Output
82 
84  void
85  disableOutput();
86 
88  void
89  enableOutput();
90 
92  virtual CepsUInt
94 
96  TimeWriter*
97  getTimeWriter() const;
98 
99  // ---------------------------------------------------------------------------------------------
100  // Error
101 
103  void
105 
106 
107  protected:
108 
110  virtual void
112 
115  virtual void
117 
119  virtual void
121 
123  virtual void
125 
126 
127  protected:
128  // ---------------------------------------------------------------------
129  // Links to structures
130 
133 
134  // ---------------------------------------------------------------------
135  // Matrices and system
136 
140 
143 
147 
150 
153 
155 
156  // ---------------------------------------------------------------------
157  // Output
158 
160 
162  // MeditSolutionWriter *m_writer; ///< Writer for the regular solution
164 
165  // ---------------------------------------------------------------------
166  // Error
167 
170 
171 };
bool CepsBool
Booleans.
Definition: CepsTypes.hpp:124
std::make_unsigned_t< CepsInt > CepsUInt
Unsigned version on CepsInt.
Definition: CepsTypes.hpp:109
std::shared_ptr< DistributedMatrix > DMatPtr
Short typedef for pointer on dist matrix.
std::shared_ptr< DistributedVector > DVecPtr
Short typedef for pointer on distributed vector.
Common elements for linear system assembly.
Abstract Class for all numerical method (FE, FD, FV etc)
Base class for creating PDEs to solve.
Base class for PDE solving.
virtual void initializeWriter()
Creates the solution writer.
virtual void initializeAssemblers()=0
Creates the right type of assemblers for LHS and BCs. Needs to be overriden.
TimeWriter * getTimeWriter() const
Access to Time Writer to be able to add data.
VtkWriter * m_writer
Manages output.
DMatPtr m_lhs
Left hand side of the system.
AbstractAssembler * m_lapSrcAsb
Assembler for laplace source terms.
~AbstractPdeSolver() override
Destructor.
virtual void assembleAndSolve()=0
Main routine used during solving, perform one single step on time problem or solve directly in static...
virtual void updateAssemblers()=0
Update assemblers and recompute everything is needed.
DVecPtr m_rhs
Right hand side of the system.
DMatPtr m_bcMat
Matrix of boundary conditions.
virtual void setupWithParameters(InputParameters *params)
Set attributes from input file. Parameters are passed as arguments in case one wants to use other par...
virtual CepsUInt getExpectedNumberOfOutputs() const =0
Gives the number of outputs.
CepsBool m_hasRegSrc
Flag telling if there are regular source terms.
AbstractDiscretization * m_discretization
Link to PDE discretization.
AbstractAssembler * m_bcAsb
Assembler for Robin and Neumann BCs.
void disableOutput()
Stops output.
void enableOutput()
Starts output.
PdeErrorCalculator * m_errors
Error computation.
LinearSystem * m_linearSystem
Linear system.
AbstractPdeSolver & operator=(const AbstractPdeSolver &that)=delete
No assignment.
AbstractPdeSolver()=delete
Deleted default constructor.
CepsBool m_doOutput
Enables/disables outputs.
CepsBool m_useMassLumping
Put the mass on the diagonal of the matrix.
DMatPtr m_opMat
Matrix of operator.
AbstractPdeSolver(const AbstractPdeSolver &that)=delete
No copy.
TimeWriter * m_timeWriter
Writer for time dependant data (even for static problems...)
void disableErrorComputation()
Sets the comparison with analytic solution.
DVecPtr m_bcVec
Vector of boundary conditions.
AbstractAssembler * m_opAsb
Assembler for the operator matrix.
CepsBool m_hasLapSrc
Flag telling if there are Delta f source terms.
AbstractPdeProblem * m_problem
Link to PDE to solve.
virtual void solve()=0
Main method of the solver class that computes a solution vector.
CepsBool m_doError
Compute error wrt analytic solution or reference.
DMatPtr m_lapSrcMat
Matrix used for laplace source terms.
Base class for other (big) CEPS classes. All classes can get a pointer to this base class and also co...
Definition: CepsObject.hpp:40
Reads and stores simulation configuration.
Linear system Ax=b to be solved.
Utility to measure distance with respect to analytic solution or given vectors.
A class that enables the output of binary parallel VTK format files.
Definition: VtkWriter.hpp:69