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

#include <MCGIDI_functions.hpp>

Inheritance diagram for MCGIDI::Functions::Constant1d:

Public Member Functions

LUPI_HOST_DEVICE Constant1d ()
LUPI_HOST_DEVICE Constant1d (double a_domainMin, double a_domainMax, double a_value, double a_outerDomainValue=0)
LUPI_HOST Constant1d (GIDI::Functions::Constant1d const &a_constant1d)
LUPI_HOST_DEVICE ~Constant1d ()
LUPI_HOST_DEVICE double evaluate (LUPI_maybeUnused double a_x1) const
LUPI_HOST_DEVICE void serialize (LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode)
Public Member Functions inherited from MCGIDI::Functions::Function1d_d2
LUPI_HOST_DEVICE Function1d_d2 ()
LUPI_HOST_DEVICE Function1d_d2 (double a_domainMin, double a_domainMax, Interpolation a_interpolation, double a_outerDomainValue=0)
LUPI_HOST_DEVICE double evaluate (double a_x1) const
Public Member Functions inherited from MCGIDI::Functions::Function1d_d1
LUPI_HOST_DEVICE Function1d_d1 ()
LUPI_HOST_DEVICE Function1d_d1 (double a_domainMin, double a_domainMax, Interpolation a_interpolation, double a_outerDomainValue=0)
LUPI_HOST_DEVICE double evaluate (double a_x1) const
Public Member Functions inherited from MCGIDI::Functions::Function1d
LUPI_HOST_DEVICE Function1d ()
LUPI_HOST_DEVICE Function1d (double a_domainMin, double a_domainMax, Interpolation a_interpolation, double a_outerDomainValue=0)
LUPI_HOST_DEVICE ~Function1d ()
LUPI_HOST_DEVICE Function1dType type () const
LUPI_HOST_DEVICE String typeString () const
template<typename RNG>
LUPI_HOST_DEVICE MCGIDI_VIRTUAL_FUNCTION int sampleBoundingInteger (double a_x1, RNG &&a_rng) const
LUPI_HOST_DEVICE MCGIDI_VIRTUAL_FUNCTION double evaluate (double a_x1) const MCGIDI_TRUE_VIRTUAL
LUPI_HOST_DEVICE void serialize (LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode)
template<typename RNG>
LUPI_HOST_DEVICE int sampleBoundingInteger (double a_x1, RNG &&a_rng) const
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)

Additional Inherited Members

Protected Attributes inherited from MCGIDI::Functions::Function1d
Function1dType m_type

Detailed Description

Definition at line 118 of file MCGIDI_functions.hpp.

Constructor & Destructor Documentation

◆ Constant1d() [1/3]

LUPI_HOST_DEVICE MCGIDI::Functions::Constant1d::Constant1d ( )

Definition at line 385 of file MCGIDI_functions.cc.

385 :
386 m_value( 0.0 ) {
387
389}

◆ Constant1d() [2/3]

LUPI_HOST_DEVICE MCGIDI::Functions::Constant1d::Constant1d ( double a_domainMin,
double a_domainMax,
double a_value,
double a_outerDomainValue = 0 )

Definition at line 393 of file MCGIDI_functions.cc.

393 :
394 Function1d_d2( a_domainMin, a_domainMax, Interpolation::FLAT, a_outerDomainValue ),
395 m_value( a_value ) {
396
398}

◆ Constant1d() [3/3]

LUPI_HOST MCGIDI::Functions::Constant1d::Constant1d ( GIDI::Functions::Constant1d const & a_constant1d)

Definition at line 402 of file MCGIDI_functions.cc.

402 :
403 Function1d_d2( a_form1d.domainMin( ), a_form1d.domainMax( ), Interpolation::FLAT, a_form1d.outerDomainValue( ) ),
404 m_value( a_form1d.value( ) ) {
405
407}

◆ ~Constant1d()

LUPI_HOST_DEVICE MCGIDI::Functions::Constant1d::~Constant1d ( )

Definition at line 412 of file MCGIDI_functions.cc.

412 {
413
414}

Member Function Documentation

◆ evaluate()

double GIDI::Functions::Constant1d::evaluate ( LUPI_maybeUnused double a_x1) const
inline

Returns the value of the constant function.

Parameters
a_x1[in] This is ignored a the function is a constant.
Returns
The value of the constant.

Definition at line 129 of file MCGIDI_functions.hpp.

129{ return( m_value ); }

◆ serialize()

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

424 {
425
426 Function1d::serialize( a_buffer, a_mode );
427 DATA_MEMBER_DOUBLE( m_value, a_buffer, a_mode );
428}
#define DATA_MEMBER_DOUBLE(member, buf, mode)
LUPI_HOST_DEVICE void serialize(LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode)

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