https://mooseframework.inl.gov
Classes | Typedefs | Enumerations | Functions | Variables
CSG Namespace Reference

Classes

class  CSGBase
 CSGBase creates an internal representation of a Constructive Solid Geometry (CSG) model. More...
 
class  CSGCartesianLattice
 CSGCartesianLattice is the class for constructing regular Cartesian lattices of CSGUniverses. More...
 
class  CSGCell
 CSGCell creates an internal representation of a Constructive Solid Geometry (CSG) cell, which represents a region of space filled by a material or void. More...
 
class  CSGCellList
 CSGCellList creates a container for CSGCell objects to pass to CSGBase object. More...
 
class  CSGHexagonalLattice
 CSGHexagonalLattice is the class for constructing hexagonal lattices of CSGUniverses arranged in concentric hexagonal rings. More...
 
class  CSGLattice
 CSGLattice is the abstract class for defining lattices. More...
 
class  CSGLatticeList
 CSGLatticeList creates a container for CSGLattice objects to pass to CSGBase. More...
 
class  CSGPlane
 CSGPlane creates an internal representation of a Constructive Solid Geometry (CSG) plane, represented in the form aX + bY + cZ = d. More...
 
class  CSGRegion
 CSGRegions creates an internal representation of a CSG region, which can refer to an intersection, union, complement, or half-space. More...
 
class  CSGSphere
 CSGSphere creates an internal representation of a Constructive Solid Geometry (CSG) sphere, represented in the form (x - x0)^2 + (y - y0)^2 + (z - z0)^2 = r^2. More...
 
class  CSGSurface
 CSGSurface creates an internal representation of a Constructive Solid Geometry (CSG) surface, represented as some polynomial in x, y, and z. More...
 
class  CSGSurfaceList
 CSGSurfaceList is a container for storing CSGSurface objects in the CSGBase object. More...
 
class  CSGTransformationHelper
 Class for managing transformations in CSG objects. More...
 
class  CSGUniverse
 CSGUniverse creates an internal representation of a Constructive Solid Geometry (CSG) universe, which represents a collection of cells that can be defined repeatedly within a separate container of cells. More...
 
class  CSGUniverseList
 CSGUniverseList creates a container for CSGUniverse objects to pass to CSGBase. More...
 
class  CSGXCylinder
 CSGXCylinder creates an internal representation of a Constructive Solid Geometry (CSG) x-axis aligned cylinder, represented in the following form (y - y0)^2 + (z - z0)^2 = r^2. More...
 
class  CSGYCylinder
 CSGYCylinder creates an internal representation of a Constructive Solid Geometry (CSG) y-axis aligned cylinder, represented in the following form (x - x0)^2 + (z - z0)^2 = r^2. More...
 
class  CSGZCylinder
 CSGZCylinder creates an internal representation of a Constructive Solid Geometry (CSG) z-axis aligned cylinder, represented in the following form (x - x0)^2 + (y - y0)^2 = r^2. More...
 

Typedefs

typedef std::variant< std::reference_wrapper< const CSGSurface >, std::reference_wrapper< const CSGCell >, std::reference_wrapper< const CSGUniverse >, std::reference_wrapper< const CSGRegion >, std::reference_wrapper< const CSGLattice > > CSGObjectVariant
 Define a variant type that can hold references to different CSG object types. More...
 
typedef std::variant< std::reference_wrapper< const CSGUniverse >, std::string > OuterVariant
 Type definition for a variant that can hold either a CSGUniverse reference or a string for use as the outer parameter in lattice constructors. More...
 

Enumerations

enum  RotationAxisType { RotationAxisType::X = 0, RotationAxisType::Y = 1, RotationAxisType::Z = 2 }
 Enumeration of axis types for rotations. More...
 
enum  TransformationType { TransformationType::TRANSLATION = 0, TransformationType::ROTATION = 1, TransformationType::SCALE = 2 }
 Enumeration of transformation types that can be applied to CSG objects. More...
 

Functions

unsigned int nRowToRing (int nrow)
 methods to help convert between number of rows and rings get the total number of rings from the number of rows More...
 
unsigned int nRingToRow (int nring)
 get the total number of rows from the number of rings More...
 
const CSGRegion operator+ (const CSGSurface &surf)
 Operation overloads for operation based region construction. More...
 
const CSGRegion operator- (const CSGSurface &surf)
 Overload for creating a region from the negative half-space (-) of a surface. More...
 
const CSGRegion operator & (const CSGRegion &region_a, const CSGRegion &region_b)
 Overload for creating a region from the the intersection (&) of two regions. More...
 
const CSGRegion operator| (const CSGRegion &region_a, const CSGRegion &region_b)
 Overload for creating a region from the union (|) of two regions. More...
 
const CSGRegion operator~ (const CSGRegion &region)
 Overload for creating a region from the complement (~) of another region. More...
 
const CSGRegion operator & (const CSGRegion &region_a, const CSGRegion &region_b)
 Overload for creating a region from the the intersection (&) of two regions. More...
 

Variables

static const MooseEnum transformation_type_enum {"TRANSLATION=0 ROTATION=1 SCALE=2"}
 MooseEnum for transformation types, matching the TransformationType enum values. More...
 

Typedef Documentation

◆ CSGObjectVariant

typedef std::variant<std::reference_wrapper<const CSGSurface>, std::reference_wrapper<const CSGCell>, std::reference_wrapper<const CSGUniverse>, std::reference_wrapper<const CSGRegion>, std::reference_wrapper<const CSGLattice> > CSG::CSGObjectVariant

Define a variant type that can hold references to different CSG object types.

Definition at line 45 of file CSGBase.h.

◆ OuterVariant

typedef std::variant<std::reference_wrapper<const CSGUniverse>, std::string> CSG::OuterVariant

Type definition for a variant that can hold either a CSGUniverse reference or a string for use as the outer parameter in lattice constructors.

Definition at line 29 of file CSGLattice.h.

Enumeration Type Documentation

◆ RotationAxisType

enum CSG::RotationAxisType
strong

Enumeration of axis types for rotations.

Enumerator

Definition at line 30 of file CSGBase.h.

31 {
32  X = 0, // X axis
33  Y = 1, // Y axis
34  Z = 2 // Z axis
35 };

◆ TransformationType

Enumeration of transformation types that can be applied to CSG objects.

Enumerator
TRANSLATION 
ROTATION 
SCALE 

Definition at line 21 of file CSGTransformationHelper.h.

22 {
23  TRANSLATION = 0, // Translation in x, y, z directions
24  ROTATION = 1, // Rotation in the form of euler angles (phi, theta, psi)
25  SCALE = 2 // Scaling in x, y, z directions
26 };

Function Documentation

◆ nRingToRow()

unsigned int CSG::nRingToRow ( int  nring)

get the total number of rows from the number of rings

Definition at line 253 of file CSGHexagonalLattice.C.

254 {
255  if (nring == 0) // special case
256  return 0;
257  if (nring < 0)
258  mooseError("Cannot convert number of rings " + std::to_string(nring) +
259  " to number of rows in hexagonal lattice. Number of rings must be >= 0.");
260  return 2 * nring - 1;
261 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:311

◆ nRowToRing()

unsigned int CSG::nRowToRing ( int  nrow)

methods to help convert between number of rows and rings get the total number of rings from the number of rows

convenience functions for converting between number of rows and number of rings

Definition at line 239 of file CSGHexagonalLattice.C.

Referenced by CSG::CSGHexagonalLattice::setUniverses().

240 {
241  if (nrow == 0) // special case
242  return 0;
243  std::string base_msg = "Cannot convert number of rows " + std::to_string(nrow) +
244  " to number of rings in hexagonal lattice. ";
245  if (nrow < 0)
246  mooseError(base_msg + "Number of rows must be >= 0.");
247  if (nrow % 2 == 0)
248  mooseError(base_msg + "Number of rows must be odd.");
249  return (nrow + 1) / 2;
250 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:311

◆ operator &() [1/2]

const CSGRegion CSG::operator& ( const CSGRegion region_a,
const CSGRegion region_b 
)

Overload for creating a region from the the intersection (&) of two regions.

Definition at line 310 of file CSGRegion.C.

311 {
312  return CSGRegion(region_a, region_b, "INTERSECTION");
313 }

◆ operator &() [2/2]

const CSGRegion CSG::operator& ( const CSGRegion region_a,
const CSGRegion region_b 
)

Overload for creating a region from the the intersection (&) of two regions.

Definition at line 310 of file CSGRegion.C.

311 {
312  return CSGRegion(region_a, region_b, "INTERSECTION");
313 }

◆ operator+()

const CSGRegion CSG::operator+ ( const CSGSurface surf)

Operation overloads for operation based region construction.

Overload for creating a region from the positive half-space (+) of a surface

Definition at line 296 of file CSGRegion.C.

297 {
298  return CSGRegion(surf, CSGSurface::Halfspace::POSITIVE);
299 }

◆ operator-()

const CSGRegion CSG::operator- ( const CSGSurface surf)

Overload for creating a region from the negative half-space (-) of a surface.

Definition at line 303 of file CSGRegion.C.

304 {
305  return CSGRegion(surf, CSGSurface::Halfspace::NEGATIVE);
306 }

◆ operator|()

const CSGRegion CSG::operator| ( const CSGRegion region_a,
const CSGRegion region_b 
)

Overload for creating a region from the union (|) of two regions.

Definition at line 317 of file CSGRegion.C.

318 {
319  return CSGRegion(region_a, region_b, "UNION");
320 }

◆ operator~()

const CSGRegion CSG::operator~ ( const CSGRegion region)

Overload for creating a region from the complement (~) of another region.

Definition at line 324 of file CSGRegion.C.

325 {
326  return CSGRegion(region, "COMPLEMENT");
327 }

Variable Documentation

◆ transformation_type_enum

const MooseEnum CSG::transformation_type_enum {"TRANSLATION=0 ROTATION=1 SCALE=2"}
static

MooseEnum for transformation types, matching the TransformationType enum values.

Definition at line 29 of file CSGTransformationHelper.h.

Referenced by CSG::CSGTransformationHelper::getTransformationTypeString().