|
ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
|
Buildings implicit function backed by STL triangle mesh. More...
#include <ERF_EBIFBuildings.H>

Public Member Functions | |
| BuildingsIF (std::string const &stl_file, amrex::Real scale, amrex::Array< amrex::Real, 3 > const ¢er, int reverse_normal, amrex::Geometry const &geom) | |
| Construct a buildings implicit function from an STL file. More... | |
| AMREX_GPU_HOST_DEVICE amrex::Real | operator() (AMREX_D_DECL(amrex::Real x, amrex::Real y, amrex::Real z)) const noexcept |
| Evaluate signed distance at a point. More... | |
| AMREX_GPU_HOST_DEVICE amrex::Real | operator() (const amrex::RealArray &p) const noexcept |
| Evaluate signed distance at a point array. More... | |
Protected Attributes | |
| amrex::Geometry | m_geom |
| Domain geometry (for coordinate transformations) More... | |
| amrex::STLtools | m_stl_tools |
| STL tools object (for loading and processing STL files) More... | |
| std::shared_ptr< amrex::MultiFab > | m_levelset_mf |
| Pre-sampled signed distance field (distributed MultiFab for parallel computation) More... | |
| amrex::Box | m_data_box |
| Bounding box of sampled data. More... | |
| amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > | m_problo |
| Cached geometry data for GPU-compatible access. More... | |
| amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > | m_dx |
| amrex::Array4< const amrex::Real > | m_local_array |
| Local array view for GPU-compatible operator() access. More... | |
Buildings implicit function backed by STL triangle mesh.
This class provides an implicit function interface for building geometry loaded from STL files. It uses AMReX's STL infrastructure with BVH (Bounding Volume Hierarchy) acceleration for efficient signed distance queries.
The operator evaluates signed distance at any 3D point, following the AMReX EB convention: positive = inside solid (building), zero = boundary, negative = fluid.
Note: This class pre-samples the STL geometry onto a reference grid and interpolates at query points. For very large or complex geometries, consider using AMReX's IndexSpaceSTL directly instead.
|
inline |
Construct a buildings implicit function from an STL file.
| stl_file | Path to the STL mesh file (binary or ASCII format). |
| scale | Uniform scaling factor applied to STL coordinates (typically 1.0). |
| center | Translation vector to recenter the mesh [m]. |
| reverse_normal | Non-zero to flip triangle normals if needed. |
| geom | Domain geometry for grid setup and BVH optimization. |
The constructor:
|
inlinenoexcept |
Evaluate signed distance at a point.
| x | Physical x-coordinate [m] |
| y | Physical y-coordinate [m] |
| z | Physical z-coordinate [m] |
This operator performs trilinear interpolation of the pre-sampled signed distance field. For points outside the sampled domain, it returns a negative value (fluid region).
Note: The signed distance field is computed in parallel across ranks during construction, then replicated for fast operator() access.
Referenced by operator()().

|
inlinenoexcept |
Evaluate signed distance at a point array.
| p | Physical coordinate array [x, y, z] in meters. |

|
protected |
Bounding box of sampled data.
Referenced by BuildingsIF(), and operator()().
|
protected |
Referenced by BuildingsIF(), and operator()().
|
protected |
Domain geometry (for coordinate transformations)
|
protected |
Pre-sampled signed distance field (distributed MultiFab for parallel computation)
Referenced by BuildingsIF().
|
mutableprotected |
Local array view for GPU-compatible operator() access.
Referenced by BuildingsIF(), and operator()().
|
protected |
Cached geometry data for GPU-compatible access.
Referenced by BuildingsIF(), and operator()().
|
protected |
STL tools object (for loading and processing STL files)
Referenced by BuildingsIF().