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

EGS_SimpleApplication implementation. More...

#include "egs_simple_application.h"
#include "egs_input.h"
#include "egs_base_source.h"
#include "egs_timer.h"
#include "egs_rndm.h"
#include "egs_interface2.h"
#include <cstring>
#include <cstdlib>

Go to the source code of this file.

Functions

void _null_terminate (char *s, int len)
 
__extc__ void egsHowfar ()
 
__extc__ void egsAusgab (EGS_I32 *iarg)
 User scoring function. More...
 
__extc__ void egsHownear (EGS_Float *tperp)
 Calculate minimum perpendicular distance to any surrounding boundary and return it in tperp. More...
 
__extc__ void egsStartParticle ()
 
__extc__ void egsFillRandomArray (const EGS_I32 *n, EGS_Float *rarray)
 Get n random numbers stored in the array pointed to by rarray. More...
 

Variables

const char fs = '/'
 

Detailed Description

EGS_SimpleApplication implementation.

Author
Iwan Kawrakow, NRC

Also provides C-style functions needed to link with the mortran back-end.

Definition in file egs_simple_application.cpp.

Function Documentation

◆ 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 379 of file egs_simple_application.cpp.

◆ 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 383 of file egs_simple_application.cpp.

References EGS_Stack::ir, EGS_Stack::np, and the_stack.

◆ 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 397 of file egs_simple_application.cpp.