Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
MCGIDI::Functions::FunctionBase Class Referenceabstract

#include <MCGIDI_functions.hpp>

Inheritance diagram for MCGIDI::Functions::FunctionBase:

Public Member Functions

LUPI_HOST_DEVICE FunctionBase ()
LUPI_HOST FunctionBase (GIDI::Functions::FunctionForm const &a_function)
LUPI_HOST_DEVICE FunctionBase (int a_dimension, double a_domainMin, double a_domainMax, Interpolation a_interpolation, double a_outerDomainValue=0)
virtual LUPI_HOST_DEVICE ~FunctionBase ()=0
LUPI_HOST_DEVICE Interpolation interpolation () const
LUPI_HOST_DEVICE double domainMin () const
LUPI_HOST_DEVICE double domainMax () const
LUPI_HOST_DEVICE double outerDomainValue () const
LUPI_HOST_DEVICE void serialize (LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode)

Detailed Description

Definition at line 35 of file MCGIDI_functions.hpp.

Constructor & Destructor Documentation

◆ FunctionBase() [1/3]

LUPI_HOST_DEVICE MCGIDI::Functions::FunctionBase::FunctionBase ( )

Definition at line 23 of file MCGIDI_functions.cc.

23 :
24 m_dimension( 0 ),
25 m_domainMin( 0.0 ),
26 m_domainMax( 0.0 ),
27 m_interpolation( Interpolation::LINLIN ),
28 m_outerDomainValue( 0.0 ) {
29
30}

Referenced by MCGIDI::Functions::Function1d::Function1d(), MCGIDI::Functions::Function2d::Function2d(), MCGIDI::Probabilities::ProbabilityBase::ProbabilityBase(), and MCGIDI::Probabilities::ProbabilityBase::ProbabilityBase().

◆ FunctionBase() [2/3]

LUPI_HOST MCGIDI::Functions::FunctionBase::FunctionBase ( GIDI::Functions::FunctionForm const & a_function)

Definition at line 34 of file MCGIDI_functions.cc.

34 :
35 m_dimension( a_function.dimension( ) ),
36 m_domainMin( a_function.domainMin( ) ),
37 m_domainMax( a_function.domainMax( ) ),
38 m_interpolation( GIDI2MCGIDI_interpolation( a_function.interpolation( ) ) ),
39 m_outerDomainValue( a_function.outerDomainValue( ) ) {
40
41}
LUPI_HOST_DEVICE Interpolation GIDI2MCGIDI_interpolation(ptwXY_interpolation a_interpolation)

◆ FunctionBase() [3/3]

LUPI_HOST_DEVICE MCGIDI::Functions::FunctionBase::FunctionBase ( int a_dimension,
double a_domainMin,
double a_domainMax,
Interpolation a_interpolation,
double a_outerDomainValue = 0 )

Definition at line 45 of file MCGIDI_functions.cc.

45 :
46 m_dimension( a_dimension ),
47 m_domainMin( a_domainMin ),
48 m_domainMax( a_domainMax ),
49 m_interpolation( a_interpolation ),
50 m_outerDomainValue( a_outerDomainValue ) {
51
52}

◆ ~FunctionBase()

LUPI_HOST_DEVICE MCGIDI::Functions::FunctionBase::~FunctionBase ( )
pure virtual

Definition at line 57 of file MCGIDI_functions.cc.

57 {
58
59}

Member Function Documentation

◆ domainMax()

◆ domainMin()

◆ interpolation()

◆ outerDomainValue()

◆ serialize()

LUPI_HOST_DEVICE void MCGIDI::Functions::FunctionBase::serialize ( LUPI::DataBuffer & a_buffer,
LUPI::DataBuffer::Mode a_mode )

This method serializes this for broadcasting as needed for MPI and GPUs. The method can count the number of required bytes, pack this or unpack this depending on a_mode.

Parameters
a_buffer[in] The buffer to read or write data to depending on a_mode.
a_mode[in] Specifies the action of this method.

Definition at line 69 of file MCGIDI_functions.cc.

69 {
70
71 DATA_MEMBER_INT( m_dimension, a_buffer, a_mode );
72 DATA_MEMBER_DOUBLE( m_domainMin, a_buffer, a_mode );
73 DATA_MEMBER_DOUBLE( m_domainMax, a_buffer, a_mode );
74
75 int interpolation = 0;
76 if( a_mode != LUPI::DataBuffer::Mode::Unpack ) {
77 switch( m_interpolation ) {
79 break;
81 interpolation = 1;
82 break;
84 interpolation = 2;
85 break;
87 interpolation = 3;
88 break;
90 interpolation = 4;
91 break;
93 interpolation = 5;
94 break;
95 }
96 }
97 DATA_MEMBER_INT( interpolation, a_buffer, a_mode );
98 if( a_mode == LUPI::DataBuffer::Mode::Unpack ) {
99 switch( interpolation ) {
100 case 0 :
101 m_interpolation = Interpolation::FLAT;
102 break;
103 case 1 :
104 m_interpolation = Interpolation::LINLIN;
105 break;
106 case 2 :
107 m_interpolation = Interpolation::LINLOG;
108 break;
109 case 3 :
110 m_interpolation = Interpolation::LOGLIN;
111 break;
112 case 4 :
113 m_interpolation = Interpolation::LOGLOG;
114 break;
115 case 5 :
116 m_interpolation = Interpolation::OTHER;
117 break;
118 }
119 }
120
121 DATA_MEMBER_DOUBLE( m_outerDomainValue, a_buffer, a_mode );
122}
#define DATA_MEMBER_DOUBLE(member, buf, mode)
#define DATA_MEMBER_INT( member, buf, mode)
LUPI_HOST_DEVICE Interpolation interpolation() const

Referenced by MCGIDI::Functions::Function1d::serialize(), MCGIDI::Functions::Function2d::serialize(), and MCGIDI::Probabilities::ProbabilityBase::serialize().


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