DUNE-FEM (unstable)

Write a self contained tex table for eoc runs with timing information. More...

#include <dune/fem/misc/femeoc.hh>

Static Public Member Functions

static void clear ()
 close file and allow FemEoc to used for a second run
 
static void initialize (const std::string &path, const std::string &name, const std::string &descript)
 open file path/name and write a description string into tex file
 
static void initialize (const std::string &name, const std::string &descript)
 open file name and write description string into tex file
 
template<class StrVectorType >
static size_t addEntry (const StrVectorType &descript, size_t size)
 add a vector of new eoc values More...
 
template<class StrVectorType >
static size_t addEntry (const StrVectorType &descript)
 add a vector of new eoc values More...
 
static size_t addEntry (const std::string &descript)
 add a single new eoc output More...
 
static size_t addEntry (const char *descript)
 add a single new eoc output More...
 
template<class VectorType >
static void setErrors (size_t id, const VectorType &err, int size)
 add a vector of error values for the given id (returned by addEntry) More...
 
template<class VectorType >
static void setErrors (size_t id, const VectorType &err)
 add a vector of error values for the given id (returned by addEntry) More...
 
template<int SIZE>
static void setErrors (size_t id, const FieldVector< double, SIZE > &err)
 add a vector in a FieldVector of error values for the given id (returned by addEntry)
 
static void setErrors (size_t id, const double &err)
 add a single error value for the given id (returned by addEntry)
 
static void write (double h, double size, double time, int counter)
 commit a line to the eoc file More...
 
static void write (const double h, const double size, const double time, const int counter, std::ostream &out)
 commit a line to the eoc file More...
 
static void write (const double h, const double size, const double time, const int counter, const double avgTimeStep, const double minTimeStep, const double maxTimeStep, const int newton_iterations, const int ils_iterations, const int max_newton_iterations, const int max_ils_iterations)
 commit a line to the eoc file More...
 
static void write (const double h, const double size, const double time, const int counter, const std::vector< DoublePairType > &doubleValues, const std::vector< IntPairType > &intValues)
 commit a line to the eoc file More...
 
static void write (const double h, const double size, const double time, const int counter, const double avgTimeStep, const double minTimeStep, const double maxTimeStep, const int newton_iterations, const int ils_iterations, const int max_newton_iterations, const int max_ils_iterations, std::ostream &out)
 commit a line to the eoc file More...
 
static void write (const double h, const double size, const double time, const int counter, const std::vector< DoublePairType > &doubleValues, const std::vector< IntPairType > &intValues, std::ostream &out)
 commit a line to the eoc file More...
 

Detailed Description

Write a self contained tex table for eoc runs with timing information.

Constructor takes base file name for the tex file and generates two files: filename_timestamp_main.tex and filename_timestamp_body.tex or without the time stamp (by default) in the name depending on the parameter fem.io.eocFileTimeStamp. A time stamp is added to the base file name to prevent the overwriting of a valuable eoc data from the previous simulation. The file filename_timestamp_body.tex holds the actual body of the eoc table which is included in filename_timestamp_main.tex but can also be used to combine e.g. runs with different parameters or for plotting using gnuplot.

The class is singleton and thus new errors for eoc computations can be added in any part of the program. To add a new entry for eoc computations use one of the addEntry methods. These return a unique unsigned int which can be used to add error values to the table with the setErrors methods. The method write is used to write a single line to the eoc table.

Member Function Documentation

◆ addEntry() [1/4]

static size_t Dune::Fem::FemEoc::addEntry ( const char *  descript)
inlinestatic

add a single new eoc output

Returns
a unique index used to add the error values

References addEntry().

◆ addEntry() [2/4]

static size_t Dune::Fem::FemEoc::addEntry ( const std::string &  descript)
inlinestatic

add a single new eoc output

Returns
a unique index used to add the error values

References Dune::Fem::Singleton< Object >::instance().

◆ addEntry() [3/4]

template<class StrVectorType >
static size_t Dune::Fem::FemEoc::addEntry ( const StrVectorType &  descript)
inlinestatic

add a vector of new eoc values

Template Parameters
StrVectorTypea vector type with size() and operator[] returning a string
Returns
a unique index used to add the error values

References Dune::Fem::Singleton< Object >::instance().

◆ addEntry() [4/4]

template<class StrVectorType >
static size_t Dune::Fem::FemEoc::addEntry ( const StrVectorType &  descript,
size_t  size 
)
inlinestatic

add a vector of new eoc values

Template Parameters
StrVectorTypea vector type with operator[] returning a string (a C style array can be used) the size of the vector is given as parameter
Returns
a unique index used to add the error values

References Dune::Fem::Singleton< Object >::instance(), and Dune::size().

Referenced by addEntry().

◆ setErrors() [1/2]

template<class VectorType >
static void Dune::Fem::FemEoc::setErrors ( size_t  id,
const VectorType &  err 
)
inlinestatic

add a vector of error values for the given id (returned by addEntry)

Template Parameters
VectorTypea vector type with a size() and an operator[] returning a double

References Dune::Fem::Singleton< Object >::instance().

◆ setErrors() [2/2]

template<class VectorType >
static void Dune::Fem::FemEoc::setErrors ( size_t  id,
const VectorType &  err,
int  size 
)
inlinestatic

add a vector of error values for the given id (returned by addEntry)

Template Parameters
VectorTypea vector type with an operator[] returning a double (C style array can be used)

References Dune::Fem::Singleton< Object >::instance(), and Dune::size().

◆ write() [1/6]

static void Dune::Fem::FemEoc::write ( const double  h,
const double  size,
const double  time,
const int  counter,
const double  avgTimeStep,
const double  minTimeStep,
const double  maxTimeStep,
const int  newton_iterations,
const int  ils_iterations,
const int  max_newton_iterations,
const int  max_ils_iterations 
)
inlinestatic

commit a line to the eoc file

Parameters
hgrid width (e.g. given by GridWith utility class)
sizenumber of grid elements
timecomputational time
counternumber of time steps
avgTimeStepaverage time step for the ODE solver
minTimeStepminimal time step for the ODE solver
maxTimeStepmaximal time step for the ODE solver
newton_iterationsnumber of newton iterations
ils_iterationsnumber of iteration of the iterative linear solver
max_newton_iterationsmaximal number of newton iterations
max_ils_iterationsmaximal number of iteration of the iterative linear solver

References Dune::Fem::Singleton< Object >::instance(), and Dune::size().

◆ write() [2/6]

static void Dune::Fem::FemEoc::write ( const double  h,
const double  size,
const double  time,
const int  counter,
const double  avgTimeStep,
const double  minTimeStep,
const double  maxTimeStep,
const int  newton_iterations,
const int  ils_iterations,
const int  max_newton_iterations,
const int  max_ils_iterations,
std::ostream &  out 
)
inlinestatic

commit a line to the eoc file

Parameters
hgrid width (e.g. given by GridWith utility class)
sizenumber of grid elements
timecomputational time
counternumber of time steps
avgTimeStepaverage time step for the ODE solver
minTimeStepminimal time step for the ODE solver
maxTimeStepmaximal time step for the ODE solver
newton_iterationsnumber of newton iterations
ils_iterationsnumber of iteration of the iterative linear solver
max_newton_iterationsmaximal number of newton iterations
max_ils_iterationsmaximal number of iteration of the iterative linear solver

References Dune::Fem::Singleton< Object >::instance(), and Dune::size().

◆ write() [3/6]

static void Dune::Fem::FemEoc::write ( const double  h,
const double  size,
const double  time,
const int  counter,
const std::vector< DoublePairType > &  doubleValues,
const std::vector< IntPairType > &  intValues 
)
inlinestatic

commit a line to the eoc file

Parameters
hgrid width (e.g. given by GridWith utility class)
sizenumber of grid elements
timecomputational time
counternumber of time steps
doubleValueslist of extra double values to be written
intValueslist of extra int values to be written

References Dune::Fem::Singleton< Object >::instance(), and Dune::size().

◆ write() [4/6]

static void Dune::Fem::FemEoc::write ( const double  h,
const double  size,
const double  time,
const int  counter,
const std::vector< DoublePairType > &  doubleValues,
const std::vector< IntPairType > &  intValues,
std::ostream &  out 
)
inlinestatic

commit a line to the eoc file

Parameters
hgrid width (e.g. given by GridWith utility class)
sizenumber of grid elements
timecomputational time
counternumber of time steps
avgTimeStepaverage time step for the ODE solver
minTimeStepminimal time step for the ODE solver
maxTimeStepmaximal time step for the ODE solver
newton_iterationsnumber of newton iterations
ils_iterationsnumber of iteration of the iterative linear solver
max_newton_iterationsmaximal number of newton iterations
max_ils_iterationsmaximal number of iteration of the iterative linear solver

References Dune::Fem::Singleton< Object >::instance(), and Dune::size().

◆ write() [5/6]

static void Dune::Fem::FemEoc::write ( const double  h,
const double  size,
const double  time,
const int  counter,
std::ostream &  out 
)
inlinestatic

commit a line to the eoc file

Parameters
hgrid width (e.g. given by GridWith utitlity class)
sizenumber of elements in the grid or number of dofs...
timecomputational time
counternumber of timesteps or iterations for a solver...
outstd::ostream to print data to (e.g. std::cout)

References Dune::Fem::Singleton< Object >::instance(), and Dune::size().

◆ write() [6/6]

static void Dune::Fem::FemEoc::write ( double  h,
double  size,
double  time,
int  counter 
)
inlinestatic

commit a line to the eoc file

Parameters
hgrid width (e.g. given by GridWith utitlity class)
sizenumber of elements in the grid or number of dofs...
timecomputational time
counternumber of timesteps or iterations for a solver...

References Dune::Fem::Singleton< Object >::instance(), and Dune::size().


The documentation for this class was generated from the following file:
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 20, 23:30, 2024)