OPAL (Object Oriented Parallel Accelerator Library) 2024.2
OPAL
BoundaryGeometry.cpp File Reference
#include "Structure/BoundaryGeometry.h"
#include <algorithm>
#include <cmath>
#include <ctime>
#include <filesystem>
#include <fstream>
#include <string>
#include "H5hut.h"
#include <cfloat>
#include "AbstractObjects/OpalData.h"
#include "Algorithms/PartBunchBase.h"
#include "Expressions/SRefExpr.h"
#include "Elements/OpalBeamline.h"
#include "Physics/Physics.h"
#include "Utilities/OpalException.h"
#include "Utilities/Options.h"
#include <gsl/gsl_sys.h>
#include <boost/filesystem.hpp>
Include dependency graph for BoundaryGeometry.cpp:

Go to the source code of this file.

Classes

class  Triangle
class  Ray
class  Voxel

Namespaces

namespace  cmp_diff
namespace  cmp_ulp_obsolete
namespace  cmp_ulp

Macros

#define SQR(x)
#define PointID(triangle_id, vertex_id)
#define Point(triangle_id, vertex_id)
#define FUNC_EQ(x, y)
#define FUNC_EQ_ZERO(x)
#define FUNC_LE(x, y)
#define FUNC_LE_ZERO(x)
#define FUNC_LT(x, y)
#define FUNC_LT_ZERO(x)
#define FUNC_GE(x, y)
#define FUNC_GE_ZERO(x)
#define FUNC_GT(x, y)
#define FUNC_GT_ZERO(x)
#define INSIDE   0
#define OUTSIDE   1
#define LERP(a, b, t)
#define mapPoint2VoxelIndices(pt, i, j, k)

Functions

bool cmp_diff::almost_eq (double A, double B, double maxDiff=1e-15, double maxRelDiff=DBL_EPSILON)
bool cmp_diff::almost_eq_zero (double A, double maxDiff=1e-15)
bool cmp_diff::eq (double x, double y)
bool cmp_diff::eq_zero (double x)
bool cmp_diff::le (double x, double y)
bool cmp_diff::le_zero (double x)
bool cmp_diff::lt (double x, double y)
bool cmp_diff::lt_zero (double x)
bool cmp_diff::ge (double x, double y)
bool cmp_diff::ge_zero (double x)
bool cmp_diff::gt (double x, double y)
bool cmp_diff::gt_zero (double x)
bool cmp_ulp_obsolete::almost_eq (double A, double B, double maxDiff=1e-20, int maxUlps=1000)
bool cmp_ulp_obsolete::almost_eq_zero (double A, double maxDiff=1e-15)
bool cmp_ulp_obsolete::eq (double x, double y)
bool cmp_ulp_obsolete::eq_zero (double x)
bool cmp_ulp_obsolete::le (double x, double y)
bool cmp_ulp_obsolete::le_zero (double x)
bool cmp_ulp_obsolete::lt (double x, double y)
bool cmp_ulp_obsolete::lt_zero (double x)
bool cmp_ulp_obsolete::ge (double x, double y)
bool cmp_ulp_obsolete::ge_zero (double x)
bool cmp_ulp_obsolete::gt (double x, double y)
bool cmp_ulp_obsolete::gt_zero (double x)
bool cmp_ulp::almost_eq (double A, double B, double maxDiff=1e-20, int maxUlps=1000)
bool cmp_ulp::almost_eq_zero (double A, double maxDiff=1e-15)
bool cmp_ulp::eq (double x, double y)
bool cmp_ulp::eq_zero (double x)
bool cmp_ulp::le (double x, double y)
bool cmp_ulp::le_zero (double x)
bool cmp_ulp::lt (double x, double y)
bool cmp_ulp::lt_zero (double x)
bool cmp_ulp::ge (double x, double y)
bool cmp_ulp::ge_zero (double x)
bool cmp_ulp::gt (double x, double y)
bool cmp_ulp::gt_zero (double x)

Variables

Informgmsg
constexpr double EPS = 10e-15

Macro Definition Documentation

◆ FUNC_EQ

#define FUNC_EQ ( x,
y )
Value:
inline bool eq(double x, double y) { \
return almost_eq(x, y); \
}
PETE_TBTree< OpEQ, Index::PETE_Expr_t, PETE_Scalar< double > > eq(const Index &idx, double x)

Definition at line 63 of file BoundaryGeometry.cpp.

◆ FUNC_EQ_ZERO

#define FUNC_EQ_ZERO ( x)
Value:
inline bool eq_zero(double x) { \
return almost_eq_zero(x); \
}

Definition at line 67 of file BoundaryGeometry.cpp.

◆ FUNC_GE

#define FUNC_GE ( x,
y )
Value:
inline bool ge(double x, double y) { \
if (almost_eq(x, y)) { \
return true; \
} \
return x > y; \
}
PETE_TBTree< OpGE, Index::PETE_Expr_t, PETE_Scalar< double > > ge(const Index &idx, double x)

Definition at line 99 of file BoundaryGeometry.cpp.

◆ FUNC_GE_ZERO

#define FUNC_GE_ZERO ( x)
Value:
inline bool ge_zero(double x) { \
if (almost_eq_zero(x)) { \
return true; \
} \
return x > 0.0; \
}

Definition at line 106 of file BoundaryGeometry.cpp.

◆ FUNC_GT

#define FUNC_GT ( x,
y )
Value:
inline bool gt(double x, double y) { \
if (almost_eq(x, y)) { \
return false; \
} \
return x > y; \
}
PETE_TBTree< OpGT, Index::PETE_Expr_t, PETE_Scalar< double > > gt(const Index &idx, double x)

Definition at line 113 of file BoundaryGeometry.cpp.

◆ FUNC_GT_ZERO

#define FUNC_GT_ZERO ( x)
Value:
inline bool gt_zero(double x) { \
if (almost_eq_zero(x)) { \
return false; \
} \
return x > 0.0; \
}

Definition at line 120 of file BoundaryGeometry.cpp.

◆ FUNC_LE

#define FUNC_LE ( x,
y )
Value:
inline bool le(double x, double y) { \
if (almost_eq(x, y)) { \
return true; \
} \
return x < y; \
}
PETE_TBTree< OpLE, Index::PETE_Expr_t, PETE_Scalar< double > > le(const Index &idx, double x)

Definition at line 71 of file BoundaryGeometry.cpp.

◆ FUNC_LE_ZERO

#define FUNC_LE_ZERO ( x)
Value:
inline bool le_zero(double x) { \
if (almost_eq_zero(x)) { \
return true; \
} \
return x < 0.0; \
}

Definition at line 78 of file BoundaryGeometry.cpp.

◆ FUNC_LT

#define FUNC_LT ( x,
y )
Value:
inline bool lt(double x, double y) { \
if (almost_eq(x, y)) { \
return false; \
} \
return x < y; \
}
PETE_TBTree< OpLT, Index::PETE_Expr_t, PETE_Scalar< double > > lt(const Index &idx, double x)

Definition at line 85 of file BoundaryGeometry.cpp.

◆ FUNC_LT_ZERO

#define FUNC_LT_ZERO ( x)
Value:
inline bool lt_zero(double x) { \
if (almost_eq_zero(x)) { \
return false; \
} \
return x < 0.0; \
}

Definition at line 92 of file BoundaryGeometry.cpp.

◆ INSIDE

#define INSIDE   0

Definition at line 415 of file BoundaryGeometry.cpp.

Referenced by BoundaryGeometry::computeMeshVoxelization().

◆ LERP

#define LERP ( a,
b,
t )
Value:
(a + t * (b - a))
std::complex< double > a

◆ mapPoint2VoxelIndices

#define mapPoint2VoxelIndices ( pt,
i,
j,
k )
Value:
{ \
i = floor ((pt[0] - voxelMesh_m.minExtent [0]) / voxelMesh_m.sizeOfVoxel[0]); \
j = floor ((pt[1] - voxelMesh_m.minExtent [1]) / voxelMesh_m.sizeOfVoxel[1]); \
k = floor ((pt[2] - voxelMesh_m.minExtent [2]) / voxelMesh_m.sizeOfVoxel[2]); \
if (!(0 <= i && i < voxelMesh_m.nr_m[0] && \
0 <= j && j < voxelMesh_m.nr_m[1] && \
0 <= k && k < voxelMesh_m.nr_m[2])) { \
*gmsg << level2 \
<< "* " << __func__ << ":" \
<< " WARNING: pt=" << pt \
<< " is outside the bbox" \
<< " i=" << i \
<< " j=" << j \
<< " k=" << k \
<< endl; \
} \
}
Inform * gmsg
Definition Main.cpp:70
PETE_TUTree< FnFloor, typename T::PETE_Expr_t > floor(const PETE_Expr< T > &l)
Definition PETE.h:733
Inform & level2(Inform &inf)
Definition Inform.cpp:46
Inform & endl(Inform &inf)
Definition Inform.cpp:42

Definition at line 1543 of file BoundaryGeometry.cpp.

Referenced by BoundaryGeometry::computeMeshVoxelization(), BoundaryGeometry::intersectLineSegmentBoundary(), and BoundaryGeometry::intersectTinyLineSegmentBoundary().

◆ OUTSIDE

#define OUTSIDE   1

Definition at line 416 of file BoundaryGeometry.cpp.

◆ Point

#define Point ( triangle_id,
vertex_id )

◆ PointID

#define PointID ( triangle_id,
vertex_id )
Value:
Triangles_m[triangle_id][vertex_id]

Definition at line 48 of file BoundaryGeometry.cpp.

Referenced by BoundaryGeometry::initialize(), and BoundaryGeometry::writeGeomToVtk().

◆ SQR

#define SQR ( x)
Value:
((x)*(x))

Definition at line 47 of file BoundaryGeometry.cpp.

Referenced by BoundaryGeometry::initialize().

Variable Documentation

◆ EPS

double EPS = 10e-15
constexpr

Definition at line 594 of file BoundaryGeometry.cpp.

◆ gmsg

Inform* gmsg
extern

Definition at line 70 of file Main.cpp.