Advanced Multi-Physics (AMP)
On-Line Documentation
Public Member Functions | Static Public Member Functions | Protected Types | Protected Attributes | Private Member Functions | List of all members
AMP::Geometry::SquareFrustum Class Referencefinal

A geometry for a square frustum. More...

#include <SquareFrustum.h>

Inheritance diagram for AMP::Geometry::SquareFrustum:
Inheritance graph
[legend]

Public Member Functions

std::pair< Point, Pointbox () const override final
 Return the bounding box.
 
Point centroid () const override final
 Return the centroid.
 
std::unique_ptr< AMP::Geometry::Geometryclone () const override final
 Clone the object.
 
void displace (const double *x) override final
 Displace the entire geometry.
 
double distance (const Point &pos, const Point &dir) const override final
 Calculate the distance to the object given a ray.
 
uint8_t getDim () const
 Get the number of dimensions for the object.
 
AMP::Mesh::GeomType getGeomType () const override final
 Get the geometric type for the geometry.
 
virtual uint64_t getID () const
 Return a unique hash id.
 
uint8_t getLogicalDim () const
 Return the number of logical dimensions.
 
ArraySize getLogicalGridSize (const ArraySize &x) const override final
 Return the logical grid size.
 
ArraySize getLogicalGridSize (const std::vector< double > &res) const override final
 Return the logical grid size.
 
const auto & getLogicalSurfaceIds () const
 Return the surface ids for the logical boundaries.
 
std::string getName () const override final
 Get the name of the geometry.
 
std::array< bool, 3 > getPeriodicDim () const
 Return the logical grid periodic dimensions.
 
bool inside (const Point &pos) const override final
 Is the point in the geometry.
 
bool isConvex () const override final
 Is the object convex.
 
Point logical (const Point &x) const override final
 Return the logical position.
 
Point nearest (const Point &pos) const override final
 Calculate the nearest point on the surface.
 
int NSurface () const override final
 Get the number of surfaces.
 
bool operator!= (const Geometry &rhs) const
 Check if two geometries are not equal.
 
bool operator== (const Geometry &rhs) const override final
 Check if two geometries are equal.
 
Point physical (const Point &x) const override final
 Return the physical position.
 
virtual void registerChildObjects (AMP::IO::RestartManager *manager) const
 Register child objects.
 
 SquareFrustum (const std::vector< double > &range, int dir, double height)
 Construct a SquareFrustum geometry.
 
 SquareFrustum (int64_t)
 Construct from restart.
 
 SquareFrustum (std::shared_ptr< const AMP::Database > db)
 Construct a SquareFrustum geometry.
 
int surface (const Point &x) const override final
 Get the surface id.
 
Point surfaceNorm (const Point &x) const override final
 Return the outward normal to a surface.
 
double volume () const override final
 Return the volume.
 
void writeRestart (int64_t) const override
 Write restart data to file.
 

Static Public Member Functions

static std::shared_ptr< AMP::Geometry::GeometrybuildGeometry (std::shared_ptr< const AMP::Database > db)
 Create a geometry.
 

Protected Types

using FaceNormal = std::array< Point, 6 >
 
using FacePoints = std::array< std::array< Point, 4 >, 6 >
 

Protected Attributes

Point d_centroid
 
uint8_t d_dir
 
FacePoints d_face
 
const std::array< int, 6 > d_ids
 
const uint8_t d_logicalDim
 
FaceNormal d_normal
 
const uint8_t d_physicalDim
 
std::array< double, 3 > d_pyramid_size
 
std::array< double, 6 > d_range
 
double d_scale_height
 
double d_volume
 

Private Member Functions

void initialize (const std::vector< double > &range, int dir, double height)
 
 SquareFrustum ()
 

Detailed Description

A geometry for a square frustum.

This class provides routines for reading, accessing and writing geometries.

Definition at line 17 of file SquareFrustum.h.

Member Typedef Documentation

◆ FaceNormal

using AMP::Geometry::SquareFrustum::FaceNormal = std::array<Point, 6>
protected

Definition at line 60 of file SquareFrustum.h.

◆ FacePoints

using AMP::Geometry::SquareFrustum::FacePoints = std::array<std::array<Point, 4>, 6>
protected

Definition at line 61 of file SquareFrustum.h.

Constructor & Destructor Documentation

◆ SquareFrustum() [1/4]

AMP::Geometry::SquareFrustum::SquareFrustum ( std::shared_ptr< const AMP::Database db)
explicit

Construct a SquareFrustum geometry.

Parameters
dbInput database

◆ SquareFrustum() [2/4]

AMP::Geometry::SquareFrustum::SquareFrustum ( const std::vector< double > &  range,
int  dir,
double  height 
)
explicit

Construct a SquareFrustum geometry.

Parameters
rangeThe range of the SquareFrustum [xmin, xmax, ymin, ymax, zmin, zmax, ...]
dirThe direction of the pyramid { -x, x, -y, y, -z, z }
heightThe height of the pyramid

◆ SquareFrustum() [3/4]

AMP::Geometry::SquareFrustum::SquareFrustum ( int64_t  )

Construct from restart.

◆ SquareFrustum() [4/4]

AMP::Geometry::SquareFrustum::SquareFrustum ( )
private

Member Function Documentation

◆ box()

std::pair< Point, Point > AMP::Geometry::SquareFrustum::box ( ) const
finaloverridevirtual

Return the bounding box.

This function will return the bounding box of the object

Returns
Returns the bounding box [lb,ub]

Implements AMP::Geometry::Geometry.

◆ buildGeometry()

static std::shared_ptr< AMP::Geometry::Geometry > AMP::Geometry::Geometry::buildGeometry ( std::shared_ptr< const AMP::Database db)
staticinherited

Create a geometry.

This function will create a geometry based on the input database.

Parameters
[in]dbParameters for constructing a geometry from an input database

◆ centroid()

Point AMP::Geometry::SquareFrustum::centroid ( ) const
finaloverridevirtual

Return the centroid.

This function will return the centroid of the object. The centroid is equivalent to the center of mass of object of uniform density.

Returns
Returns the physical coordinates

Implements AMP::Geometry::Geometry.

◆ clone()

std::unique_ptr< AMP::Geometry::Geometry > AMP::Geometry::SquareFrustum::clone ( ) const
finaloverridevirtual

Clone the object.

Implements AMP::Geometry::Geometry.

◆ displace()

void AMP::Geometry::SquareFrustum::displace ( const double *  x)
finaloverridevirtual

Displace the entire geometry.

This function will displace the entire geometry by a scalar value. The displacement vector should be the size of the physical dimension.

Parameters
[in]xDisplacement vector

Implements AMP::Geometry::Geometry.

◆ distance()

double AMP::Geometry::SquareFrustum::distance ( const Point pos,
const Point dir 
) const
finaloverridevirtual

Calculate the distance to the object given a ray.

This function computes the distance to the object given a ray. If the ray is inside the object, this distance is negitive. If the ray will never intersect the object, this distance is inf.

Parameters
[in]posCurrent position of ray
[in]dirDirection of ray (should be normalized for most uses)
Returns
Returns the distance to the nearest surface (intersection = pos + dir*distance)

Implements AMP::Geometry::Geometry.

◆ getDim()

uint8_t AMP::Geometry::Geometry::getDim ( ) const
inlineinherited

Get the number of dimensions for the object.

This function returns the number of physical dimensions for the geometry

Returns
Returns the number of physical dimensions

Definition at line 42 of file Geometry.h.

References AMP::Geometry::Geometry::d_physicalDim.

◆ getGeomType()

AMP::Mesh::GeomType AMP::Geometry::LogicalGeometry::getGeomType ( ) const
finaloverridevirtualinherited

Get the geometric type for the geometry.

This function returns the largest geometric type supported by the geometry

Returns
Returns the geometric dimensions

Reimplemented from AMP::Geometry::Geometry.

◆ getID()

virtual uint64_t AMP::Geometry::Geometry::getID ( ) const
virtualinherited

Return a unique hash id.

◆ getLogicalDim()

uint8_t AMP::Geometry::LogicalGeometry::getLogicalDim ( ) const
inlineinherited

Return the number of logical dimensions.

This function will return the number of logical dimensions of the underlying geometry. If the geometry is not logically rectangular this function should return 0.

Definition at line 44 of file LogicalGeometry.h.

References AMP::Geometry::LogicalGeometry::d_logicalDim.

◆ getLogicalGridSize() [1/2]

ArraySize AMP::Geometry::SquareFrustum::getLogicalGridSize ( const ArraySize x) const
finaloverridevirtual

Return the logical grid size.

This function will return the dimensions of a logical grid given a size that makes sense for the object.

Parameters
[in]xInput size
Returns
Return the logical grid size

Implements AMP::Geometry::LogicalGeometry.

◆ getLogicalGridSize() [2/2]

ArraySize AMP::Geometry::SquareFrustum::getLogicalGridSize ( const std::vector< double > &  res) const
finaloverridevirtual

Return the logical grid size.

This function will return the dimensions of a logical grid given a desired resolution

Parameters
[in]resDesired resolution
Returns
Return the logical grid size

Implements AMP::Geometry::LogicalGeometry.

◆ getLogicalSurfaceIds()

const auto & AMP::Geometry::LogicalGeometry::getLogicalSurfaceIds ( ) const
inlineinherited

Return the surface ids for the logical boundaries.

This function will return the surface ids for each logical boundary. If a logical boundary is periodic, it will return -1. If a logical boundary maps to another point on the boundary, it will return -2. If a logical boundary is not periodic, is not physical, and does not map to another point on the boundary (i.e. unused dimensions), it will return -3. Note: The returned array may be larger than the number of dimensions

Returns
Return the logical boundary ids (2*logicalDim)

Definition at line 83 of file LogicalGeometry.h.

References AMP::Geometry::LogicalGeometry::d_ids.

◆ getName()

std::string AMP::Geometry::SquareFrustum::getName ( ) const
inlinefinaloverridevirtual

Get the name of the geometry.

Implements AMP::Geometry::Geometry.

Definition at line 38 of file SquareFrustum.h.

◆ getPeriodicDim()

std::array< bool, 3 > AMP::Geometry::LogicalGeometry::getPeriodicDim ( ) const
inherited

Return the logical grid periodic dimensions.

This function will return a vector indicating which logical grid dimensions are periodic. Note: The returned array may be larger than the number of dimensions

Returns
Return the periodic dimensions

◆ initialize()

void AMP::Geometry::SquareFrustum::initialize ( const std::vector< double > &  range,
int  dir,
double  height 
)
private

◆ inside()

bool AMP::Geometry::SquareFrustum::inside ( const Point pos) const
finaloverridevirtual

Is the point in the geometry.

This function checks if the ray is in the geometry. If it is on the surface, it will return true.

Parameters
[in]posCurrent position
Returns
Returns true if the point is inside the geometry (or on the surface)

Implements AMP::Geometry::Geometry.

◆ isConvex()

bool AMP::Geometry::SquareFrustum::isConvex ( ) const
inlinefinaloverridevirtual

Is the object convex.

Check if the geometric object is convex

Returns
Returns true if the object is convex

Implements AMP::Geometry::Geometry.

Definition at line 39 of file SquareFrustum.h.

◆ logical()

Point AMP::Geometry::SquareFrustum::logical ( const Point x) const
finaloverridevirtual

Return the logical position.

This function will return logical coordinate given the physical coordinates

Parameters
[in]xPhysical coordinate of the point
Returns
Returns the logical coordinates

Implements AMP::Geometry::LogicalGeometry.

◆ nearest()

Point AMP::Geometry::SquareFrustum::nearest ( const Point pos) const
finaloverridevirtual

Calculate the nearest point on the surface.

This function computes the nearest point on the surface

Parameters
[in]posCurrent position of ray
Returns
Returns the nearest surface point

Implements AMP::Geometry::Geometry.

◆ NSurface()

int AMP::Geometry::SquareFrustum::NSurface ( ) const
inlinefinaloverridevirtual

Get the number of surfaces.

This function will return the number of unique surfaces

Returns
Returns the number of unique surfaces

Implements AMP::Geometry::Geometry.

Definition at line 43 of file SquareFrustum.h.

◆ operator!=()

bool AMP::Geometry::Geometry::operator!= ( const Geometry rhs) const
inlineinherited

Check if two geometries are not equal.

Definition at line 151 of file Geometry.h.

References AMP::Geometry::Geometry::operator==().

◆ operator==()

bool AMP::Geometry::SquareFrustum::operator== ( const Geometry rhs) const
finaloverridevirtual

Check if two geometries are equal.

Implements AMP::Geometry::Geometry.

◆ physical()

Point AMP::Geometry::SquareFrustum::physical ( const Point x) const
finaloverridevirtual

Return the physical position.

This function will return physical coordinate given the logical coordinates

Parameters
[in]xLogical coordinate of the point
Returns
Returns the physical coordinates

Implements AMP::Geometry::LogicalGeometry.

◆ registerChildObjects()

virtual void AMP::Geometry::Geometry::registerChildObjects ( AMP::IO::RestartManager manager) const
virtualinherited

Register child objects.

This function register child objects if necessary

Parameters
managerRestart manager

Reimplemented in AMP::Geometry::MultiGeometry.

◆ surface()

int AMP::Geometry::SquareFrustum::surface ( const Point x) const
finaloverridevirtual

Get the surface id.

This function will return the surface id closest to the point

Parameters
[in]xCurrent position
Returns
Returns the surface id (0:NSurface-1)

Implements AMP::Geometry::Geometry.

◆ surfaceNorm()

Point AMP::Geometry::SquareFrustum::surfaceNorm ( const Point x) const
finaloverridevirtual

Return the outward normal to a surface.

This function will return the surface id and outward normal to the surface at the given point

Parameters
[in]xCurrent position
Returns
Returns the surface normal

Implements AMP::Geometry::Geometry.

◆ volume()

double AMP::Geometry::SquareFrustum::volume ( ) const
finaloverridevirtual

Return the volume.

This function will return the interior volume of the object

Returns
Returns the volume

Implements AMP::Geometry::Geometry.

◆ writeRestart()

void AMP::Geometry::SquareFrustum::writeRestart ( int64_t  fid) const
overridevirtual

Write restart data to file.

This function will write the mesh to an HDF5 file

Parameters
fidFile identifier to write

Reimplemented from AMP::Geometry::LogicalGeometry.

Member Data Documentation

◆ d_centroid

Point AMP::Geometry::SquareFrustum::d_centroid
protected

Definition at line 67 of file SquareFrustum.h.

◆ d_dir

uint8_t AMP::Geometry::SquareFrustum::d_dir
protected

Definition at line 62 of file SquareFrustum.h.

◆ d_face

FacePoints AMP::Geometry::SquareFrustum::d_face
protected

Definition at line 68 of file SquareFrustum.h.

◆ d_ids

const std::array<int, 6> AMP::Geometry::LogicalGeometry::d_ids
protectedinherited

◆ d_logicalDim

const uint8_t AMP::Geometry::LogicalGeometry::d_logicalDim
protectedinherited

◆ d_normal

FaceNormal AMP::Geometry::SquareFrustum::d_normal
protected

Definition at line 69 of file SquareFrustum.h.

◆ d_physicalDim

const uint8_t AMP::Geometry::Geometry::d_physicalDim
protectedinherited

Definition at line 200 of file Geometry.h.

Referenced by AMP::Geometry::Geometry::getDim().

◆ d_pyramid_size

std::array<double, 3> AMP::Geometry::SquareFrustum::d_pyramid_size
protected

Definition at line 64 of file SquareFrustum.h.

◆ d_range

std::array<double, 6> AMP::Geometry::SquareFrustum::d_range
protected

Definition at line 63 of file SquareFrustum.h.

◆ d_scale_height

double AMP::Geometry::SquareFrustum::d_scale_height
protected

Definition at line 65 of file SquareFrustum.h.

◆ d_volume

double AMP::Geometry::SquareFrustum::d_volume
protected

Definition at line 66 of file SquareFrustum.h.


The documentation for this class was generated from the following file:



Advanced Multi-Physics (AMP)
Oak Ridge National Laboratory
Idaho National Laboratory
Los Alamos National Laboratory
This page automatically produced from the
source code by doxygen
Last updated: Tue Mar 10 2026 13:06:42.
Comments on this page