48 for (
Unknown* u: discr->getProblem()->getZeroDUnknowns())
56 for (
Unknown* u : discr->getProblem()->getSpatialUnknowns())
60 discr->findClosestDof(point,u,dofId,owner);
75 "Cannot add custom data to TimeWriter after write() has been called"
97 data->releaseLocalData();
101 m_file << std::setprecision(16);
119 m_file <<
"# Time dependant data generated by CEPS\n"
120 <<
"# Columns are:\n"
126 m_file <<
"# " << i <<
". " << u->getName() <<
"\n";
132 m_file <<
"# " << i <<
". " << u->getName() <<
" at closest point to (" << point[0]
133 <<
"," << point[1] <<
"," << point[2] <<
")" <<
"\n";
138 m_file <<
"# " << i <<
". " << cn <<
"\n";
#define CEPS_ABORT_IF(condition, message)
Stops the execution with a message if condition is true. If testing is enabled, only throws a runtime...
std::basic_string< CepsChar > CepsString
C++ format string.
std::vector< _Type, _Alloc > CepsVector
C++ vector.
CepsGlobalIndex CepsDofGlobalIndex
Indices of degrees of freedom.
std::make_unsigned_t< CepsInt > CepsUInt
Unsigned version on CepsInt.
float CepsReal
Need single precision floating point.
CepsUInt CepsProcId
For CPU indices.
CepsArray3< CepsReal > CepsReal3D
Three real scalars, used like this for compatibility in polynomials.
std::shared_ptr< DistributedHaloVector > DHVecPtr
Typedef for pointer on Distributed Halo CepsVector.
Abstract Class for all numerical method (FE, FD, FV etc)
AbstractPdeProblem * getProblem() const
Return link to pde problem.
CepsVector< Unknown * > getSpatialUnknowns() const
A vector of all unknowns of pb defined on cells or points.
CepsVector< Unknown * > getZeroDUnknowns() const
A vector of all zeroD unknowns of the pb.
A degree of freedom for any kind of problem The dof can be associated to a geometrical element or not...
Enables the writing of files.
void open()
Creates file or cleans previous content.
std::ofstream m_file
corresponding stream
CepsVector< CepsString > m_customNames
Custom data name, printed in header.
CepsVector< CepsReal3D > m_points
Points location.
CepsBool m_canAddData
Prevents addition of data after header is written.
CepsBool hasSomethingToWrite() const
Tells if some data must be written. If not, why bother ?
AbstractDiscretization * m_discr
Link to descretization (and problem within)
void write(CepsReal t, DHVecPtr data)
Writes the content of data at indices set in constructor.
TimeWriter(const CepsString &fileName, const CepsVector< CepsReal3D > &points, AbstractDiscretization *discr)
Constructor.
CepsVector< CepsDofGlobalIndex > m_dofIndices
Points IDs.
void writeHeader()
Writes comment lines to indicate what are the variables.
void addCustomData(const CepsString &name, CepsReal *data)
Add a custom data to be written in the outputfile. Custom data cannot be added after header has been ...
CepsVector< CepsReal * > m_customData
Custom data, careful with ptr handling.
A class used to defined an unknown of a PDE problem The unknown can be defined on a specific region,...
const CepsGlobalIndex & getGlobalIndex() const
Get the index
const CepsProcId & getOwner() const
Get owner (processus id) of this entity.
CepsUInt getRank()
Returns current processor rank.
MPI_Comm getCommunicator()
Get the communicator.