milupHPC documentation
Public Member Functions | Public Attributes | List of all members
MaterialHandler Class Reference

Material class handler. More...

#include "material_handler.h"

+ Collaboration diagram for MaterialHandler:
Collaboration graph

Public Member Functions

 MaterialHandler (integer numMaterials)
 Constructor. More...
 
 MaterialHandler (const char *material_cfg)
 Constructor from config file. More...
 
 MaterialHandler (integer numMaterials, integer ID, integer interactions, real alpha, real beta)
 Constructor. More...
 
 ~MaterialHandler ()
 Destructor. More...
 
void copy (To::Target target, integer index=-1)
 
void communicate (int from, int to, bool fromDevice=false, bool toDevice=true)
 
void broadcast (int root=0, bool fromDevice=false, bool toDevice=true)
 

Public Attributes

integer numMaterials
 number of materials or rather material instances More...
 
Material * h_materials
 host instance of material class More...
 
Material * d_materials
 device instance of material class More...
 

Detailed Description

Material class handler.

  • handling host and device instances
  • initializing values using LibConfigReader
  • copying instances/values between MPI processes and/or device and host

Definition at line 53 of file material_handler.h.

Constructor & Destructor Documentation

◆ MaterialHandler() [1/3]

MaterialHandler::MaterialHandler ( integer  numMaterials)

Constructor.

Parameters
numMaterials

Definition at line 55 of file material_handler.cpp.

+ Here is the call graph for this function:

◆ MaterialHandler() [2/3]

MaterialHandler::MaterialHandler ( const char *  material_cfg)

Constructor from config file.

Parameters
material_cfgConfig file name/path

Definition at line 66 of file material_handler.cpp.

+ Here is the call graph for this function:

◆ MaterialHandler() [3/3]

MaterialHandler::MaterialHandler ( integer  numMaterials,
integer  ID,
integer  interactions,
real  alpha,
real  beta 
)

Constructor.

Parameters
numMaterials
ID
interactions
alpha
beta

Definition at line 105 of file material_handler.cpp.

+ Here is the call graph for this function:

◆ ~MaterialHandler()

MaterialHandler::~MaterialHandler ( )

Destructor.

Definition at line 118 of file material_handler.cpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ broadcast()

void MaterialHandler::broadcast ( int  root = 0,
bool  fromDevice = false,
bool  toDevice = true 
)

Broadcast material instances to all MPI processes from a root

Parameters
rootroot to broadcast from (default: MPI process 0)
fromDeviceflag whether start from device
toDeviceflag whether start from device

Definition at line 159 of file material_handler.cpp.

+ Here is the call graph for this function:

◆ communicate()

void MaterialHandler::communicate ( int  from,
int  to,
bool  fromDevice = false,
bool  toDevice = true 
)

Communicate material instances between MPI processes and in addition from and/or to the device(s).

Warning
it is not possible to send it from device to device via CUDA-aware MPI, since serialize functionality not usable on device
Parameters
fromMPI process source
toMPI process target
fromDeviceflag whether start from device
toDeviceflag whether start from device

Definition at line 136 of file material_handler.cpp.

+ Here is the call graph for this function:

◆ copy()

void MaterialHandler::copy ( To::Target  target,
integer  index = -1 
)

Copy material instance(s) from host to device or vice-versa.

Parameters
targettarget: host or device
indexmaterial instance index to be copied, if -1 copy all instances

Definition at line 125 of file material_handler.cpp.

+ Here is the call graph for this function:

Member Data Documentation

◆ d_materials

Material* MaterialHandler::d_materials

device instance of material class

Definition at line 61 of file material_handler.h.

◆ h_materials

Material* MaterialHandler::h_materials

host instance of material class

Definition at line 59 of file material_handler.h.

◆ numMaterials

integer MaterialHandler::numMaterials

number of materials or rather material instances

Definition at line 57 of file material_handler.h.


The documentation for this class was generated from the following files:
  • include/materials/material_handler.h
  • src/materials/material_handler.cpp

milupHPC - MaterialHandler Class Reference
Generated on Wed Aug 31 2022 12:16:53 by Doxygen 1.9.3