EGSnrc C++ class library  Report PIRS-898 (2021)
Iwan Kawrakow, Ernesto Mainegra-Hing, Frederic Tessier, Reid Townson and Blake Walters
Macros | Functions | Variables
egs_advanced_application.cpp File Reference

EGS_AdvancedApplication implementation. More...

#include "egs_advanced_application.h"
#include "egs_functions.h"
#include "egs_interface2.h"
#include "egs_run_control.h"
#include "egs_base_source.h"
#include "egs_input.h"
#include "egs_interpolator.h"
#include "egs_rndm.h"
#include "egs_math.h"
#include "egs_ausgab_object.h"
#include <string>
#include <cstdio>
#include <cstdarg>
#include <cstdlib>
#include <cstring>

Go to the source code of this file.

Macros

#define CHECK_GET_APPLICATION(a, b)    EGS_Application *a = EGS_Application::activeApplication();
 
#define egsGetRNGPointers   F77_OBJ_(egs_get_rng_pointers,EGS_GET_RNG_POINTERS)
 
#define egsGetRNGArray   F77_OBJ_(egs_get_rng_array,EGS_GET_RNG_ARRAY)
 
#define egsSetRNGState   F77_OBJ_(egs_set_rng_state,EGS_SET_RNG_STATE)
 
#define egsGetSteps   F77_OBJ_(egs_get_steps,EGS_GET_STEPS)
 
#define egsSetSteps   F77_OBJ_(egs_set_steps,EGS_SET_STEPS)
 
#define egsOpenUnits   F77_OBJ_(egs_open_units,EGS_OPEN_UNITS)
 
#define egsGetElectronData   F77_OBJ_(egs_get_electron_data,EGS_GET_ELECTRON_DATA)
 
#define egsGetPhotonData   F77_OBJ_(egs_get_photon_data,EGS_GET_PHOTON_DATA)
 

Functions

__extc__ void egsGetRNGPointers (EGS_I32 *, EGS_I32 *)
 
__extc__ void egsGetRNGArray (EGS_Float *)
 
__extc__ void egsSetRNGState (const EGS_I32 *, const EGS_Float *)
 
__extc__ void egsGetSteps (double *, double *)
 
__extc__ void egsSetSteps (const double *, const double *)
 
__extc__ void egsOpenUnits (const EGS_I32 *)
 
__extc__ void egsGetElectronData (void(*func)(EGS_I32 *, EGS_Float *, EGS_Float *, EGS_Float *, EGS_Float *), const EGS_I32 *, const EGS_I32 *)
 
__extc__ void egsGetPhotonData (void(*func)(EGS_I32 *, EGS_Float *, EGS_Float *, EGS_Float *, EGS_Float *), const EGS_I32 *, const EGS_I32 *)
 
__extc__ void F77_OBJ_ (egs_write_string, EGS_WRITE_STRING)(int *
 
void EGS_LOCAL __write_to_fortran_file (const char *msg,...)
 
void EGS_LOCAL __write_to_fortran_file_and_exit (const char *msg,...)
 
__extc__ void F77_OBJ_ (egs_set_defaults, EGS_SET_DEFAULTS)()
 
__extc__ void F77_OBJ_ (egs_init1, EGS_INIT1)()
 
void F77_OBJ_ (set_elastic_parameter, SET_ELASTIC_PARAMETER)()
 
__extc__ void egsHowfar ()
 
__extc__ void egsHownear (EGS_Float *tperp)
 Calculate minimum perpendicular distance to any surrounding boundary and return it in tperp. More...
 
__extc__ void egsFillRandomArray (const EGS_I32 *n, EGS_Float *rarray)
 Get n random numbers stored in the array pointed to by rarray. More...
 
__extc__ void egsAusgab (EGS_I32 *iarg)
 User scoring function. More...
 
__extc__ void egsStartParticle ()
 

Variables

__extc__ void const char int
 

Detailed Description

EGS_AdvancedApplication implementation.

Author
Iwan Kawrakow, NRC

Also provides implementations of the C-style functions needed to link against the mortran back-end egsHowfar(), egsHownear(), egsAusgab(), and egsStartParticle().

Definition in file egs_advanced_application.cpp.

Function Documentation

◆ egsHownear()

__extc__ void egsHownear ( EGS_Float *  tperp)

Calculate minimum perpendicular distance to any surrounding boundary and return it in tperp.

This function must be implemented by user codes written in C (implementation is automatically provided for C++ applications deriving from EGS_SimpleApplication or EGS_AdvancedApplication). If it is impossible to calculate tperp, you must set tperp to 0. In this case the transport will be determined by the setings of EGS_EtControl::transport_algorithm, EGS_EtControl::bca_algorithm and EGS_EtControl::skin_depth_for_bca (see PIRS-701 for details).

Definition at line 1398 of file egs_advanced_application.cpp.

◆ egsFillRandomArray()

__extc__ void egsFillRandomArray ( const EGS_I32 *  n,
EGS_Float *  rarray 
)

Get n random numbers stored in the array pointed to by rarray.

This function should only be used from the C interface after the RNG has been initialized using egsRandomInit() or egsRandomDefaultInit(). C++ objects should use EGS_RandomGenerator objetcs instead, either EGS_SimpleApplication::rndm or EGS_AdvancedApplication::rndm or their own RNG object.

Definition at line 1406 of file egs_advanced_application.cpp.

◆ egsAusgab()

__extc__ void egsAusgab ( EGS_I32 *  iarg)

User scoring function.

This function must be implemented by user codes written in C to perform the actual scoring. The value of iarg depends on the event that triggered the call (see PIRS-701 for details). C++ applications deriving from EGS_SimpleApplication or EGS_AdvancedApplication must implement the respective ausgab() virtual function.

Definition at line 1415 of file egs_advanced_application.cpp.