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

#include <MCGIDI_functions.hpp>

Inheritance diagram for MCGIDI::Functions::Function2d:

Public Member Functions

LUPI_HOST_DEVICE Function2d ()
LUPI_HOST Function2d (double a_domainMin, double a_domainMax, Interpolation a_interpolation, double a_outerDomainValue=0)
LUPI_HOST_DEVICE ~Function2d ()
LUPI_HOST_DEVICE Function2dType type () const
LUPI_HOST_DEVICE String typeString () const
LUPI_HOST_DEVICE MCGIDI_VIRTUAL_FUNCTION double evaluate (double a_x2, double a_x1) const MCGIDI_TRUE_VIRTUAL
LUPI_HOST_DEVICE void serialize (LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode)
Public Member Functions inherited from MCGIDI::Functions::FunctionBase
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)

Protected Attributes

Function2dType m_type

Detailed Description

Definition at line 265 of file MCGIDI_functions.hpp.

Constructor & Destructor Documentation

◆ Function2d() [1/2]

LUPI_HOST_DEVICE MCGIDI::Functions::Function2d::Function2d ( )

◆ Function2d() [2/2]

LUPI_HOST MCGIDI::Functions::Function2d::Function2d ( double a_domainMin,
double a_domainMax,
Interpolation a_interpolation,
double a_outerDomainValue = 0 )

Definition at line 886 of file MCGIDI_functions.cc.

886 :
887 FunctionBase( 2, a_domainMin, a_domainMax, a_interpolation, a_outerDomainValue ),
889
890}

◆ ~Function2d()

LUPI_HOST_DEVICE MCGIDI::Functions::Function2d::~Function2d ( )

Definition at line 895 of file MCGIDI_functions.cc.

895 {
896
897}

Member Function Documentation

◆ evaluate()

LUPI_HOST_DEVICE double MCGIDI::Functions::Function2d::evaluate ( double a_x2,
double a_x1 ) const

Returns the value of the function f(x2, x1) at x2 = a_x2 and x1 = a_x1.

Parameters
a_x2[in] The x2 value.
a_x1[in] The x1 value.
Returns
The value of the function at a_x1.

Definition at line 930 of file MCGIDI_functions.cc.

930 {
931
932 return( static_cast<XYs2d const *>( this )->evaluate( a_x2, a_x1 ) );
933}
LUPI_HOST_DEVICE MCGIDI_VIRTUAL_FUNCTION double evaluate(double a_x2, double a_x1) const MCGIDI_TRUE_VIRTUAL

Referenced by evaluate().

◆ serialize()

LUPI_HOST_DEVICE void MCGIDI::Functions::Function2d::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 943 of file MCGIDI_functions.cc.

943 {
944
945 FunctionBase::serialize( a_buffer, a_mode );
946
947 int type = 0;
948 if( a_mode != LUPI::DataBuffer::Mode::Unpack ) {
949 switch( m_type ) {
951 break;
953 type = 1;
954 break;
955 }
956 }
957 DATA_MEMBER_INT( type, a_buffer, a_mode );
958 if( a_mode == LUPI::DataBuffer::Mode::Unpack ) {
959 switch( type ) {
960 case 0 :
962 break;
963 case 1 :
965 break;
966 }
967 }
968}
#define DATA_MEMBER_INT( member, buf, mode)
LUPI_HOST_DEVICE Function2dType type() const
LUPI_HOST_DEVICE void serialize(LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode)

Referenced by MCGIDI::Functions::XYs2d::serialize().

◆ type()

LUPI_HOST_DEVICE Function2dType MCGIDI::Functions::Function2d::type ( ) const
inline

Definition at line 275 of file MCGIDI_functions.hpp.

275{ return m_type; }

Referenced by MCGIDI::Function2dClass(), and serialize().

◆ typeString()

LUPI_HOST_DEVICE String MCGIDI::Functions::Function2d::typeString ( ) const

Returns a String representation of the Function2d type of this.

Returns
A String instance.

Definition at line 905 of file MCGIDI_functions.cc.

905 {
906
907 String typeStr( "Function2d::" );
908
909 switch( m_type ) {
911 typeStr += "none";
912 break;
914 typeStr += "XYs";
915 break;
916 }
917
918 return( typeStr );
919}

Member Data Documentation

◆ m_type

Function2dType MCGIDI::Functions::Function2d::m_type
protected

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