44 string EGS_StackGeometry::type =
"EGS_StackGeometry";
48 if (geoms.size() < 2)
egsFatal(
"EGS_StackGeometry::EGS_StackGeometry: "
49 " less than 2 geometries is not mermitted\n");
54 for (
int j=0; j<ng; j++) {
66 for (
int j=0; j<ng; j++) {
81 EGS_StackGeometry::~EGS_StackGeometry() {
82 for (
int j=0; j<ng; j++)
89 void EGS_StackGeometry::printInfo()
const {
93 g[j]->
getName().c_str(),g[j]->getType().c_str());
95 "=======================================================\n");
98 void EGS_StackGeometry::setMedia(
EGS_Input *,
int,
const int *) {
99 egsWarning(
"EGS_StackGeometry::setMedia: don't use this method. Use the\n"
100 " setMedia() methods of the geometry objects that make up this geometry\n");
103 void EGS_StackGeometry::setRelativeRho(
int start,
int end, EGS_Float rho) {
107 void EGS_StackGeometry::setRelativeRho(
EGS_Input *) {
108 egsWarning(
"EGS_StackGeometry::setRelativeRho(): don't use this method.\n"
109 " Use the setRelativeRho methods of the geometry objects that make up"
113 void EGS_StackGeometry::setBScaling(
int start,
int end, EGS_Float rho) {
117 void EGS_StackGeometry::setBScaling(
EGS_Input *) {
118 egsWarning(
"EGS_StackGeometry::setBScaling(): don't use this method.\n"
119 " Use the setBScaling methods of the geometry objects that make up"
127 egsWarning(
"createGeometry(stack): null input?\n");
130 vector<string> gnames;
131 vector<EGS_BaseGeometry *> geoms;
132 int err = input->
getInput(
"geometries",gnames);
133 if (err || gnames.size() < 2) {
134 egsWarning(
"createGeometry(stack): missing/wrong 'geometries' input\n");
137 for (
unsigned int j=0; j<gnames.size(); j++) {
139 if (!gj)
egsWarning(
"createGeometry(stack): no geometry named %s "
140 " defined\n",gnames[j].c_str());
145 if (geoms.size() < 2) {
146 egsWarning(
"createGeometry(stack): must have at least 2 geometries\n");
154 err = input->
getInput(
"tolerance",tol);
162 void EGS_StackGeometry::getLabelRegions(
const string &str, vector<int> ®s) {
164 vector<int> local_regs;
167 for (
int i=0; i<ng; i++) {
170 for (
int j=0; j<local_regs.size(); j++) {
171 regs.push_back(i*nmax + local_regs[j]);
int regions() const
Returns the number of local regions in this geometry.
int deref()
Decrease the reference count to this geometry.
virtual void printInfo() const
Print information about this geometry.
int setLabels(EGS_Input *input)
Set the labels from an input block.
bool hasRhoScaling() const
Does this geometry object have a mass density scaling feature?
Global egspp functions header file.
EGS_GLIB_EXPORT EGS_BaseGeometry * createGeometry(EGS_Input *input)
Base geometry class. Every geometry class must be derived from EGS_BaseGeometry.
void setBoundaryTolerance(EGS_Input *inp)
Set the value of the boundary tolerance from the input inp.
A geometry stack: header.
static EGS_BaseGeometry * getGeometry(const string &Name)
Get a pointer to the geometry named Name.
EGS_InfoFunction EGS_EXPORT egsFatal
Always use this function for reporting fatal errors.
virtual void getLabelRegions(const string &str, vector< int > ®s)
Get the list of all regions labeled with str.
EGS_InfoFunction EGS_EXPORT egsInformation
Always use this function for reporting the progress of a simulation and any other type of information...
bool is_convex
Is this geometry convex?
bool hasBScaling() const
Does this geometry object have a B field scaling feature?
void setName(EGS_Input *inp)
Set the name of the geometry from the input inp.
EGS_StackGeometry(const vector< EGS_BaseGeometry * > &geoms, const string &Name="")
Construct a geometry stack from the vector of geometries geom.
bool has_rho_scaling
Does this geometry have relative mass density scvaling?
int ref()
Increase the reference count to this geometry.
const EGS_Float epsilon
The epsilon constant for floating point comparisons.
const string & getName() const
Get the name of this geometry.
int nreg
Number of local regions in this geometry.
bool has_B_scaling
Does this geometry has B field scaling factor?
EGS_InfoFunction EGS_EXPORT egsWarning
Always use this function for reporting warnings.