Chi-Tech
Chi Class Reference

#include <chi_runtime.h>

Data Structures

class  RecoverableException
 
class  run_time
 

Public Member Functions

 Chi ()=delete
 
 Chi (const Chi &)=delete
 
Chi operator= (const Chi &)=delete
 

Static Public Member Functions

static int RunInteractive (int argc, char **argv)
 
static int RunBatch (int argc, char **argv)
 
static int Initialize (int argc, char **argv, MPI_Comm communicator)
 
static void Finalize ()
 
static void Exit (int error_code)
 
static chi::RegistryStatuses GetStatusOfRegistries ()
 
static std::string GetVersionStr ()
 
template<class R , class T >
static R & GetStackItem (std::vector< std::shared_ptr< T > > &stack, const size_t handle, const std::string &calling_function_name="Unknown")
 
template<class T , class P >
static std::shared_ptr< T > GetStackItemPtrAsType (std::vector< std::shared_ptr< P > > &stack, const size_t handle, const std::string &calling_function_name="Unknown")
 
template<class T >
static std::shared_ptr< T > & GetStackItemPtr (std::vector< std::shared_ptr< T > > &stack, const size_t handle, const std::string &calling_function_name="Unknown")
 

Static Public Attributes

static chi::MPI_Infompi = chi::MPI_Info::GetInstance()
 
static chi::Timer program_timer
 
static chi::Consoleconsole = chi::Console::GetInstance()
 
static chi::ChiLoglog = chi::ChiLog::GetInstance()
 
static std::vector< chi_mesh::MeshHandlerPtrmeshhandler_stack
 
static int current_mesh_handler = -1
 
static std::vector< chi_mesh::SurfaceMeshPtrsurface_mesh_stack
 
static std::vector< chi_mesh::FFInterpPtrfield_func_interpolation_stack
 
static std::vector< chi_mesh::UnpartMeshPtrunpartitionedmesh_stack
 
static std::vector< chi_physics::MaterialPtrmaterial_stack
 
static std::vector< chi_physics::MultiGroupXSPtrmultigroup_xs_stack
 
static std::vector< chi_physics::FieldFunctionPtrfield_function_stack
 
static std::vector< chi_math::AngularQuadraturePtrangular_quadrature_stack
 
static std::vector< ChiObjectPtrobject_stack
 
static std::vector< chi_math::SpatialDiscretizationPtrsdm_stack
 
static std::vector< chi::PostProcessorPtrpostprocessor_stack
 
static const size_t SIZE_T_INVALID = ((size_t)-1)
 

Detailed Description

General utilities in ChiTech

Definition at line 75 of file chi_runtime.h.

Constructor & Destructor Documentation

◆ Chi() [1/2]

Chi::Chi ( )
delete

◆ Chi() [2/2]

Chi::Chi ( const Chi )
delete

Member Function Documentation

◆ Exit()

void Chi::Exit ( int  error_code)
static

Exits the program appropriately.

Definition at line 342 of file chi_runtime.cc.

◆ Finalize()

void Chi::Finalize ( )
static

Finalizes ChiTech.

Definition at line 216 of file chi_runtime.cc.

◆ GetStackItem()

template<class R , class T >
static R & Chi::GetStackItem ( std::vector< std::shared_ptr< T > > &  stack,
const size_t  handle,
const std::string &  calling_function_name = "Unknown" 
)
inlinestatic

Attempts to retrieve an object of base-type shared_ptr<T> at the given handle. It then attempts to cast it to type shared_ptr<R> and, if successful, will return a reference of type R&.

Example usage:

const auto& surf_mesh = Chi::GetStackItem<chi_mesh::SurfaceMesh>(
Chi::object_stack, surface_hndl);
// Returns chi_mesh::SurfaceMesh&
static std::vector< ChiObjectPtr > object_stack
Definition: chi_runtime.h:96

Definition at line 183 of file chi_runtime.h.

◆ GetStackItemPtr()

template<class T >
static std::shared_ptr< T > & Chi::GetStackItemPtr ( std::vector< std::shared_ptr< T > > &  stack,
const size_t  handle,
const std::string &  calling_function_name = "Unknown" 
)
inlinestatic

Attempts to obtain object of type shared_ptr<T> at the given handle of a stack ALSO OF TYPE T.

Example usage:

auto surf_mesh_ptr = Chi::GetStackItemPtr(
Chi::object_stack, surf_mesh_hndle, fname);
// Returns std::shared_ptr<ChiObject>
static std::shared_ptr< T > & GetStackItemPtr(std::vector< std::shared_ptr< T > > &stack, const size_t handle, const std::string &calling_function_name="Unknown")
Definition: chi_runtime.h:258

Definition at line 258 of file chi_runtime.h.

◆ GetStackItemPtrAsType()

template<class T , class P >
static std::shared_ptr< T > Chi::GetStackItemPtrAsType ( std::vector< std::shared_ptr< P > > &  stack,
const size_t  handle,
const std::string &  calling_function_name = "Unknown" 
)
inlinestatic

Attempts to obtain object of type shared_ptr<T> at the given handle of a stack with parent type P.

Example usage:

auto surf_mesh_ptr =
Chi::GetStackItemPtrAsType<chi_mesh::SurfaceMesh>(
Chi::object_stack, surf_mesh_hndle, fname);
// Returns std::shared_ptr<chi_mesh::SurfaceMesh>

Definition at line 220 of file chi_runtime.h.

◆ GetStatusOfRegistries()

chi::RegistryStatuses Chi::GetStatusOfRegistries ( )
static

Builds a RegistryStatuses structure

Definition at line 350 of file chi_runtime.cc.

◆ GetVersionStr()

std::string Chi::GetVersionStr ( )
static

Gets the ChiTech-version string.

Definition at line 346 of file chi_runtime.cc.

◆ Initialize()

int Chi::Initialize ( int  argc,
char **  argv,
MPI_Comm  communicator 
)
static

Initializes all necessary items for ChiTech.

Parameters
argcint Number of arguments supplied.
argvchar** Array of strings representing each argument.
communicatorMPI_Comm The main communicator, used system wide.

Definition at line 173 of file chi_runtime.cc.

◆ operator=()

Chi Chi::operator= ( const Chi )
delete

◆ RunBatch()

int Chi::RunBatch ( int  argc,
char **  argv 
)
static

Runs ChiTech in pure batch mode. Start then finish.

Definition at line 285 of file chi_runtime.cc.

◆ RunInteractive()

int Chi::RunInteractive ( int  argc,
char **  argv 
)
static

Runs the interactive chitech engine

Definition at line 239 of file chi_runtime.cc.

Field Documentation

◆ angular_quadrature_stack

std::vector< chi_math::AngularQuadraturePtr > Chi::angular_quadrature_stack
static

Definition at line 94 of file chi_runtime.h.

◆ console

chi::Console & Chi::console = chi::Console::GetInstance()
static

Definition at line 80 of file chi_runtime.h.

◆ current_mesh_handler

int Chi::current_mesh_handler = -1
static

Definition at line 84 of file chi_runtime.h.

◆ field_func_interpolation_stack

std::vector< chi_mesh::FFInterpPtr > Chi::field_func_interpolation_stack
static

Definition at line 87 of file chi_runtime.h.

◆ field_function_stack

std::vector< chi_physics::FieldFunctionPtr > Chi::field_function_stack
static

Definition at line 92 of file chi_runtime.h.

◆ log

chi::ChiLog & Chi::log = chi::ChiLog::GetInstance()
static

Definition at line 81 of file chi_runtime.h.

◆ material_stack

std::vector< chi_physics::MaterialPtr > Chi::material_stack
static

Definition at line 90 of file chi_runtime.h.

◆ meshhandler_stack

std::vector< chi_mesh::MeshHandlerPtr > Chi::meshhandler_stack
static

Global stack of handlers

Definition at line 83 of file chi_runtime.h.

◆ mpi

Definition at line 78 of file chi_runtime.h.

◆ multigroup_xs_stack

std::vector< chi_physics::MultiGroupXSPtr > Chi::multigroup_xs_stack
static

Definition at line 91 of file chi_runtime.h.

◆ object_stack

std::vector< ChiObjectPtr > Chi::object_stack
static

Definition at line 96 of file chi_runtime.h.

◆ postprocessor_stack

std::vector< chi::PostProcessorPtr > Chi::postprocessor_stack
static

Definition at line 98 of file chi_runtime.h.

◆ program_timer

chi::Timer Chi::program_timer
static

Definition at line 79 of file chi_runtime.h.

◆ sdm_stack

std::vector< chi_math::SpatialDiscretizationPtr > Chi::sdm_stack
static

Definition at line 97 of file chi_runtime.h.

◆ SIZE_T_INVALID

const size_t Chi::SIZE_T_INVALID = ((size_t)-1)
static

Definition at line 100 of file chi_runtime.h.

◆ surface_mesh_stack

std::vector< chi_mesh::SurfaceMeshPtr > Chi::surface_mesh_stack
static

Definition at line 86 of file chi_runtime.h.

◆ unpartitionedmesh_stack

std::vector< chi_mesh::UnpartMeshPtr > Chi::unpartitionedmesh_stack
static

Definition at line 88 of file chi_runtime.h.


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