TURTLE
Loading...
Searching...
No Matches
Public Member Functions | Data Fields | Private Attributes
code_base Class Referenceabstract

Defines basic timer and method to check stopping condition. More...

#include <code_base.hpp>

Inheritance diagram for code_base:
Inheritance graph
[legend]

Public Member Functions

 code_base (const MPI_Comm COMMUNICATOR, const std::string &simulation_name)
 
virtual ~code_base () noexcept(false)
 
int check_stopping_condition (void)
 
int start_simple_timer (void)
 
int print_simple_timer (const std::string operation_name)
 
MPI_Comm get_communicator () const
 
int get_nx () const
 
int get_ny () const
 
int get_nz () const
 
virtual int read_parameters (void)
 
virtual int initialize (void)=0
 
virtual int main_loop (void)=0
 
virtual int finalize (void)=0
 

Data Fields

int myrank
 
int nprocs
 
MPI_Comm comm
 
std::string simname
 
int iteration
 
bool stop_code_now
 
int nx
 
int ny
 
int nz
 
int dealias_type
 
double dkx
 
double dky
 
double dkz
 

Private Attributes

std::chrono::time_point< std::chrono::steady_clock > time0
 
std::chrono::time_point< std::chrono::steady_clock > time1
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ code_base()

code_base::code_base ( const MPI_Comm COMMUNICATOR,
const std::string & simulation_name )

◆ ~code_base()

virtual code_base::~code_base ( )
inlinevirtual

Member Function Documentation

◆ check_stopping_condition()

int code_base::check_stopping_condition ( void )

◆ finalize()

virtual int code_base::finalize ( void )
pure virtual

◆ get_communicator()

MPI_Comm code_base::get_communicator ( ) const
inline

◆ get_nx()

int code_base::get_nx ( ) const
inline

◆ get_ny()

int code_base::get_ny ( ) const
inline

◆ get_nz()

int code_base::get_nz ( ) const
inline

◆ initialize()

virtual int code_base::initialize ( void )
pure virtual

◆ main_loop()

virtual int code_base::main_loop ( void )
pure virtual

◆ print_simple_timer()

int code_base::print_simple_timer ( const std::string operation_name)
inline

◆ read_parameters()

int code_base::read_parameters ( void )
virtual

◆ start_simple_timer()

int code_base::start_simple_timer ( void )
inline

Field Documentation

◆ comm

MPI_Comm code_base::comm

◆ dealias_type

int code_base::dealias_type

◆ dkx

double code_base::dkx

◆ dky

double code_base::dky

◆ dkz

double code_base::dkz

◆ iteration

int code_base::iteration

◆ myrank

int code_base::myrank

◆ nprocs

int code_base::nprocs

◆ nx

int code_base::nx

◆ ny

int code_base::ny

◆ nz

int code_base::nz

◆ simname

std::string code_base::simname

◆ stop_code_now

bool code_base::stop_code_now

◆ time0

std::chrono::time_point<std::chrono::steady_clock> code_base::time0
private

◆ time1

std::chrono::time_point<std::chrono::steady_clock> code_base::time1
private

The documentation for this class was generated from the following files: