36 m_writeInitialGuess(false)
122 if (immediateWriting)
152 for (
CepsUInt norm=0; norm<3; norm++)
165 return ceps::runtimeCast<AbstractStaticPdeProblem*>(
m_problem);
#define CEPS_SAYS(message)
Writes a message in the debug log and in the terminal (stdio).
#define CEPS_SAYS_NOENDL(message)
Writes a message in the debug log and in the terminal (stdio).
#define CEPS_SAYS_INLINE(message)
Writes a message in the debug log and in the terminal (stdio).
#define CEPS_SEPARATOR
Writes a separator in the debug log and in the terminal.
CepsArray< _Type, 2U > CepsArray2
C++ array, 2 elements.
std::make_unsigned_t< CepsInt > CepsUInt
Unsigned version on CepsInt.
std::shared_ptr< DistributedHaloVector > DHVecPtr
Typedef for pointer on Distributed Halo CepsVector.
void addFieldValuesTo(ScalarField< _SupportType > &f, DistributedVector *vec, CepsReal t=0.)
Add values to a distributed vector. Exclusive to scalar fields. Field data may be evaluated on the fl...
void setMatrix(DistributedMatrix *mat)
The matrix to assemble.
void setScaleFactor(CepsReal scaleFactor)
Factor that multiplies all coefficients to put in linear system.
void setVector(DistributedVector *vec)
The vector to assemble.
virtual void assemble(CepsReal t=0., CepsBool finalize=true)=0
The main routine to call to assemble linear system.
DHVecPtr newDofHaloVector() const
Get a new vector from the factory, with halo data.
void evaluateFunctionOnDofs(ceps::Function< CepsReal(CepsStandardArgs)> *func, DHVecPtr v, CepsReal t=0.) const
Fills vector v with values of function func at owned and halo dofs and time t.
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.
CepsBool hasAnalyticSolution() const
Tells if there is an analytic or reference solution.
CepsString getOutputFileBase() const
Output file name includes the directory.
SourceTermManager * getSourceTermManager() const
Get boundary condition manager.
CepsVector< CepsReal3D > getProbePoints() const
Returns points where single data output should be written.
CepsString getProblemName() const
Get the name of the problem.
AbstractDiscretization * getSpatialDiscretization() const
Link to the spatial discretization (FE, FV, etc)
InputParameters * getParameters() const
Text parameters.
const CepsVector< Unknown * > & getUnknowns() const
List of unknowns of the pb.
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.
VtkWriter * m_writer
Manages output.
AbstractAssembler * m_lapSrcAsb
Assembler for laplace source terms.
virtual void assembleAndSolve()=0
Main routine used during solving, perform one single step on time problem or solve directly in static...
DMatPtr m_bcMat
Matrix of boundary conditions.
AbstractDiscretization * m_discretization
Link to PDE discretization.
AbstractAssembler * m_bcAsb
Assembler for Robin and Neumann BCs.
PdeErrorCalculator * m_errors
Error computation.
CepsBool m_doOutput
Enables/disables outputs.
DMatPtr m_opMat
Matrix of operator.
TimeWriter * m_timeWriter
Writer for time dependant data (even for static problems...)
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.
CepsBool m_doError
Compute error wrt analytic solution or reference.
DMatPtr m_lapSrcMat
Matrix used for laplace source terms.
Astract Problem which does not depend on time.
AbstractStaticPdeProblem * getStaticProblem() const
Returns a pointer with the appropriate type of pb.
virtual ~AbstractStaticPdeSolver()
Destructor.
void updateAssemblers() override
Update assemblers and recompute everything is needed.
void enableErrorComputation()
Sets the comparison with analytic solution.
CepsUInt getExpectedNumberOfOutputs() const final
Number of files written.
void solve() override
Solves the whole PDE in time.
DHVecPtr getSolution() const
Returns a copy of the distributed vector containing the current solution.
virtual void output(DHVecPtr solution, CepsBool immediateWriting=true)
Prints the solution and flush the writer if immediateWriting is true.
DHVecPtr m_solution
The actual vector with the solution.
CepsBool m_writeInitialGuess
Flag for outputs.
AbstractStaticPdeSolver(AbstractStaticPdeProblem *pb)
Constructor with problem.
void setupWithParameters(InputParameters *params) override
Set attributes from input file. Parameters are passed as arguments in case one wants to use other par...
CepsArray2< CepsArray3< CepsReal > > getErrors() const
Gets the currently computed errors. First index selects absolute(0) orrelative(1) second index is L-i...
CepsReal getAbsoluteErrorNow(CepsInt px) const
Get norm of difference at current time.
CepsReal getRelativeErrorNow(CepsInt px) const
Get relative norm of difference at current time.
void compute(DHVecPtr num, CepsReal time=0.)
Compute the error at current time and add to total.
Manager *const getManager() const
Get a map of all source terms.
CepsBool hasSomethingToWrite() const
Tells if some data must be written. If not, why bother ?
void write(CepsReal t, DHVecPtr data)
Writes the content of data at indices set in constructor.
A class used to defined an unknown of a PDE problem The unknown can be defined on a specific region,...
void addScalarData(const DHVecPtr &v, const CepsVector< CepsString > &fieldNames, const CepsVector< Unknown * > &us)
Set multiple scalar fields to be output by this writer. addScalarData for several unknowns.
void write(CepsReal time=0., CepsBool writeXmlEntry=true)
Write all stored data.
void destroyObject(_Type &)
Destroy[delete] any type.