ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
eb_cut_cell_::path_data Struct Reference

Intersection metadata for one ordered edge path in the cut-cell box. More...

#include <ERF_EBCutCell.H>

Collaboration diagram for eb_cut_cell_::path_data:

Public Member Functions

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE path_data ()=default
 Construct empty path data. More...
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void set (const amrex::RealVect &eb_point, const amrex::RealVect &eb_normal, const amrex::RealVect &v_start, const amrex::RealVect &v_end)
 Compute and store the intersection data for one edge. More...
 

Public Attributes

bool intersected {}
 Whether the edge intersects the EB plane. More...
 
bool intersected_start {}
 Whether the intersection lies on the start vertex. More...
 
bool intersected_end {}
 Whether the intersection lies on the end vertex. More...
 
amrex::RealVect vIP {}
 Coordinates of the intersection point. More...
 
amrex::Real distIP {}
 Distance from the start vertex to the intersection point. More...
 
amrex::Real edge_length {}
 Physical length of the edge. More...
 

Detailed Description

Intersection metadata for one ordered edge path in the cut-cell box.

Constructor & Destructor Documentation

◆ path_data()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE eb_cut_cell_::path_data::path_data ( )
default

Construct empty path data.

Member Function Documentation

◆ set()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void eb_cut_cell_::path_data::set ( const amrex::RealVect &  eb_point,
const amrex::RealVect &  eb_normal,
const amrex::RealVect &  v_start,
const amrex::RealVect &  v_end 
)
inline

Compute and store the intersection data for one edge.

Parameters
eb_pointPoint on the EB plane.
eb_normalUnit normal for the EB plane.
v_startFirst endpoint of the edge.
v_endSecond endpoint of the edge.
469  {
470  constexpr amrex::Real tol = amrex::Real(1.e-15);
471  amrex::RealVect v_intersect{v_start};
472  amrex::Real dist_intersect = std::numeric_limits<amrex::Real>::quiet_NaN();
474  eb_point, eb_normal, v_start, v_end, v_intersect, dist_intersect
475  );
476  vIP = v_intersect;
477  distIP = dist_intersect;
478  edge_length = (v_start - v_end).vectorLength();
479  if (intersected) {
480  // check if intersection is at vertices
481  intersected_start = (amrex::Math::abs(dist_intersect) < tol);
482  intersected_end = (amrex::Math::abs(edge_length - dist_intersect) < tol);
483  } else {
484  intersected_start = false;
485  intersected_end = false;
486  distIP = amrex::Real(-1.0);
487  }
488  }
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int intersect_plane_edge(amrex::RealVect const &a_plane_point, amrex::RealVect const &a_plane_normal, amrex::RealVect const &a_edge_point0, amrex::RealVect const &a_edge_point1, amrex::RealVect &a_intersection_point, amrex::Real &a_intersection_dist)
Intersect a plane with a line segment.
Definition: ERF_EBCutCell.H:30
amrex::Real Real
Definition: ERF_ShocInterface.H:19
amrex::RealVect vIP
Coordinates of the intersection point.
Definition: ERF_EBCutCell.H:450
amrex::Real distIP
Distance from the start vertex to the intersection point.
Definition: ERF_EBCutCell.H:452
amrex::Real edge_length
Physical length of the edge.
Definition: ERF_EBCutCell.H:454
bool intersected_end
Whether the intersection lies on the end vertex.
Definition: ERF_EBCutCell.H:448
bool intersected
Whether the edge intersects the EB plane.
Definition: ERF_EBCutCell.H:444
bool intersected_start
Whether the intersection lies on the start vertex.
Definition: ERF_EBCutCell.H:446

Referenced by eb_cut_cell_::calc_edge_intersections().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ distIP

amrex::Real eb_cut_cell_::path_data::distIP {}

Distance from the start vertex to the intersection point.

Referenced by set().

◆ edge_length

amrex::Real eb_cut_cell_::path_data::edge_length {}

Physical length of the edge.

Referenced by set().

◆ intersected

bool eb_cut_cell_::path_data::intersected {}

Whether the edge intersects the EB plane.

Referenced by eb_cut_cell_::calc_edge_intersections(), and set().

◆ intersected_end

bool eb_cut_cell_::path_data::intersected_end {}

Whether the intersection lies on the end vertex.

Referenced by eb_cut_cell_::calc_edge_intersections(), and set().

◆ intersected_start

bool eb_cut_cell_::path_data::intersected_start {}

Whether the intersection lies on the start vertex.

Referenced by eb_cut_cell_::calc_edge_intersections(), and set().

◆ vIP

amrex::RealVect eb_cut_cell_::path_data::vIP {}

Coordinates of the intersection point.

Referenced by eb_cut_cell_::calc_edge_intersections(), and set().


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