Skip to content
Snippets Groups Projects
Commit 078c6bff authored by Chichi Lalescu's avatar Chichi Lalescu
Browse files

begin basic documentation

parent 90bf56e3
No related branches found
No related tags found
1 merge request!21Bugfix/nansampling
Pipeline #
...@@ -35,6 +35,20 @@ ...@@ -35,6 +35,20 @@
#define FIELD_HPP #define FIELD_HPP
/** \class field
* \brief Holds field data, performs FFTs and HDF5 I/O operations.
*
* The purpose of this class is to manage memory for field data, create/destroy
* FFT plans for them, and compute HDF5 input/output operations.
*
* FFTW recommendations are to create different plans for different arrays,
* hence the plans are member variables.
* All plans are for in-place transforms, since even with out-of-place transforms
* there are no guarantees that input data is not messed up by an inverse FFT, so
* there's no point in wasting the memory.
*
*
*/
template <typename rnumber, template <typename rnumber,
field_backend be, field_backend be,
...@@ -42,19 +56,18 @@ template <typename rnumber, ...@@ -42,19 +56,18 @@ template <typename rnumber,
class field class field
{ {
private: private:
/* data arrays */ rnumber *__restrict__ data; /**< data array */
rnumber *__restrict__ data;
public: public:
hsize_t npoints; hsize_t npoints; /**< total number of grid points. Useful for normalization. */
bool real_space_representation; bool real_space_representation; /**< `true` if field is in real space representation. */
/* basic MPI information */
int myrank, nprocs; int myrank, nprocs; /**< basic MPI information. */
MPI_Comm comm; MPI_Comm comm; /**< MPI communicator this fields lives in. */
/* descriptions of field layout and distribution */ /* descriptions of field layout and distribution */
/* for the FFTW backend, at least, the real space field requires more /* for the FFTW backend, at least, the real space field requires more
* space to be allocated than strictly needed for the data, hence the * space to be allocated than strictly needed for the data, hence the
* two layout descriptors. * two real space layout descriptors.
* */ * */
field_layout<fc> *clayout, *rlayout, *rmemlayout; field_layout<fc> *clayout, *rlayout, *rmemlayout;
......
...@@ -32,6 +32,21 @@ ...@@ -32,6 +32,21 @@
#include <sys/stat.h> #include <sys/stat.h>
#include "base.hpp" #include "base.hpp"
/** \class code_base
* \brief Defines basic timer and method to check stopping condition.
*
* Any computational task will consist of a loop over temporal snapshots, be it
* a simulation or a postprocessing job.
* This class declares the three required methods (initialize, step and finalize
* functionalities).
* Implementation should be done in children classes, since it will be different
* for simulations or postprocessing jobs.
*
* What the class actually implements is a basic timer (calls to system clock),
* and a method to check for a stopping condition.
* These are meant to be used by children classes as needed.
*/
class code_base class code_base
{ {
private: private:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment