CepsLocationFlag
DataLocation: an enum that will be used by various elements of the code (pde, readers,...
@ Point
Data is defined on each point.
CepsOutputFormat
Style of output files.
std::basic_string< CepsChar > CepsString
C++ format string.
CepsIndex CepsUnknownIndex
For unknowns.
std::set< _Type, _Compare, _Alloc > CepsSet
C++ set.
std::vector< _Type, _Alloc > CepsVector
C++ vector.
float CepsReal
Need single precision floating point.
constexpr CepsAttribute CepsUniversal
This attribute means "everywhere".
Abstract Class for all numerical method (FE, FD, FV etc)
Base class for creating PDEs to solve.
CepsString m_name
Name of the problem.
CepsOutputFormat getOutputFormat() const
Tells if output is binary or ascii.
CepsVector< Unknown * > getSpatialUnknowns() const
A vector of all unknowns of pb defined on cells or points.
ScalarFunction * getAnalyticSolution() const
Pointer on analytic or refScalarFunction solution.
virtual void defineUnknowns()=0
Define all the unknowns of the problem here. Must be overriden, and call all necessary addUnknown,...
CepsBool hasAnalyticSolution() const
Tells if there is an analytic or reference solution.
void setProblemName(const CepsString &name)
Set the name of the problem.
virtual void defineBoundaryConditions()
Define the boundary conditions. Should be defined in derived classes. Default is no BC.
CepsString getOutputFileBase() const
Output file name includes the directory.
virtual CepsReal getSnapshotTime() const
Returns 0. Here for compatibility.
CepsBool m_ownedDiscr
True if instance used new to create discretization.
virtual void setupWithParameters(InputParameters *params)
Set attributes from input file. Parameters are passed as arguments in case one wants to use other par...
const CepsVector< UnknownInteraction * > & getUnknownsInteractions() const
All the interactions between unknowns.
FunctionDictionary * getFunctionDictionary() const
Get functions manager.
SourceTermManager * getSourceTermManager() const
Get boundary condition manager.
virtual void defineAnalyticSolution()
Set directly the analytic function, default sets no solution, unless there is a collection of referen...
CepsString m_outputFileBase
File names prefix.
CepsVector< CepsReal3D > getProbePoints() const
Returns points where single data output should be written.
CepsString m_refSolFiles
base name of reference solution file, if any
AbstractDiscretization * m_discr
Discretization method (eg FE for now)
AbstractPdeProblem(Geometry *geom, InputParameters *params=nullptr)
Constructor with geometry and optional parameters.
void setFunctionDictionary(FunctionDictionary *)
Set functions manager.
SourceTermManager * m_sourceTerms
All source terms.
virtual ~AbstractPdeProblem()
destructor
CepsReal m_refSolSnapDt
reference solution output period
void addUnknown(const CepsString &label, CepsSet< CepsAttribute > attrs={}, CepsLocationFlag flag=CepsLocationFlag::Point, const CepsString &unit="")
Register a new unknown.
CepsBool ignoreZeroDUnknownsForError() const
Tells if 0D must not be taken into account in error computation.
ceps::Function< CepsReal(CepsStandardArgs)> ScalarFunction
Typedef for analytic solution.
CepsString getProblemName() const
Get the name of the problem.
void setOutputFormat(CepsOutputFormat opt)
Enable/disable binary output.
void addZeroDUnknown(CepsString label, const CepsString &unit="")
Register a new unknown, defined outside of geometry.
CepsVector< UnknownInteraction * > m_unknownsInteractions
Describes how unknowns interact.
AbstractPdeProblem & operator=(const AbstractPdeProblem &that)=delete
No assignment operator.
CepsBool m_ignoreZeroDError
Ignore 0D unknowns when computing errors.
void addUnknownInteraction(CepsString label1, CepsString label2, CepsSet< CepsAttribute > attrs={})
Register interaction between unknowns. Also sets the interaction within Unknown instances label1 and ...
CepsBool unknownsInteract(Unknown *u1, Unknown *u2, const CepsSet< CepsAttribute > &attrs={CepsUniversal}) const
Tells if unknowns interact on an entity with attributes.
AbstractDiscretization * getSpatialDiscretization() const
Link to the spatial discretization (FE, FV, etc)
InputParameters * getParameters() const
Text parameters.
CepsOutputFormat m_outputFormat
Output format selector.
CepsVector< Unknown * > m_unknowns
All maths unknowns of the problem.
CepsBool usesReferenceSolution() const
Tells if analytic solution and if it is loaded from files.
Unknown * getUnknown(const CepsString &label) const
Get an unknown by its name.
CepsVector< CepsReal3D > m_probePoints
Single point data outputs.
CepsBool writesGlobalIndices() const
Tells if global indices are written on top of solution.
virtual void run()
Computes the solution to the problem. Default does nothing, override it !
InputParameters * m_parameters
Input file data.
CepsBool m_ownedSrcs
True if instance used new to create src term manager.
void setOutputFileBase(CepsString fileName)
Output file name includes the directory.
virtual void initializeEquation()
Initializes equations (unknowns, bc, source term) and creates the spatial discretization This method ...
CepsReal getReferenceSolutionOutputPeriod() const
Output dt of reference.
CepsBool m_ownedRefSol
Flag for reference ownership.
Geometry * m_geom
Link to geometry on which the pb is defined.
void setSpatialDiscretization(AbstractDiscretization *discr)
Link to the spatial discretization (FE, FV, etc)
void writeGlobalIndices(CepsBool opt)
Activate/deactivate global indices writing.
AbstractPdeProblem(const AbstractPdeProblem &that)=delete
No copy constructor.
BoundaryConditionManager * getBoundaryConditionManager() const
Get boundary condition manager.
virtual void defineSourceTerms()
Define the source terms. Should be defined in derived classes. Default is no src term.
void setSourceTermManager(SourceTermManager *stm)
Set boundary condition manager.
virtual CepsReal getStartTime() const
Returns 0. Here for compatibility.
void createSpatialDiscretization()
Compute the discretization structure.
Geometry * getGeometry() const
Link to geometry on which the pb is defined.
virtual CepsReal getEndTime() const
Returns 0. Here for compatibility.
ScalarFunction * m_analyticSolution
analytic or reference solution
CepsBool m_ownedBCs
True if instance used new to create BC manager.
BoundaryConditionManager * m_boundaryConditions
All BCs should be there.
CepsBool m_ownedFunctions
True if instance used new to create dictionary.
FunctionDictionary * m_functions
Collection of custom functions.
CepsVector< Unknown * > getZeroDUnknowns() const
A vector of all zeroD unknowns of the pb.
void setBoundaryConditionManager(BoundaryConditionManager *bcm)
Set boundary condition manager.
void setReferenceSolution(const CepsString &baseFiles, CepsReal snapDt)
Externally define the referece solution from files. Can be used for convergence tests.
CepsBool m_writeGlobalIDs
Writes CEPS indices as well.
const CepsVector< Unknown * > & getUnknowns() const
List of unknowns of the pb.
Boundary condition to manage Dirichlet, Neumann and Robin conditions.
Base class for other (big) CEPS classes. All classes can get a pointer to this base class and also co...
FunctionDictionary that holds functions which can be used to define source terms, boundary conditions...
Encapsulates all the geometrical data.
Source term manager to create and manage SourceTerm objects.
A class used to defined an unknown of a PDE problem The unknown can be defined on a specific region,...
Structure used to pass arguments to SAFunc (see pde directory) The flags of the SAFunc allows extract...
function caller : abstract base, only contains an variadic operator()