#include <ERF_EBPolygon.H>
|
| AMREX_GPU_HOST_DEVICE | polygon_ (amrex::RealVect a_point, amrex::RealVect a_normal) |
| |
| AMREX_GPU_HOST_DEVICE | polygon_ () |
| |
| AMREX_GPU_HOST_DEVICE void | add_vertex (amrex::RealVect const &a_v) |
| |
| AMREX_GPU_HOST_DEVICE int | get_num_vertices () |
| |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void | set_area (amrex::Real const &a_area) |
| |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void | define () |
| |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int | ok () const noexcept |
| |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real | area () const noexcept |
| |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real | distance (amrex::RealVect const &a_point) const noexcept |
| |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::RealVect | get_centroid () const noexcept |
| |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::RealVect | normal () const noexcept |
| |
| void | report (int const a_id, amrex::RealVect a_v0) |
| |
| void | debug (int const a_id) |
| |
| void | debug () |
| |
◆ polygon_() [1/2]
| AMREX_GPU_HOST_DEVICE polygon_::polygon_ |
( |
amrex::RealVect |
a_point, |
|
|
amrex::RealVect |
a_normal |
|
) |
| |
|
inline |
23 ,
m_vertices({amrex::RealVect(0.), amrex::RealVect(0.), amrex::RealVect(0.),
24 amrex::RealVect(0.), amrex::RealVect(0.), amrex::RealVect(0.)})
int m_defined
Definition: ERF_EBPolygon.H:242
amrex::Real m_area
Definition: ERF_EBPolygon.H:246
amrex::Array< amrex::RealVect, m_max_vertices > m_vertices
Definition: ERF_EBPolygon.H:250
int const m_cell_face
Definition: ERF_EBPolygon.H:237
int m_sorted
Definition: ERF_EBPolygon.H:248
amrex::RealVect const m_eb_normal
Definition: ERF_EBPolygon.H:240
int m_num_vertices
Definition: ERF_EBPolygon.H:244
amrex::RealVect const m_eb_point
Definition: ERF_EBPolygon.H:239
amrex::RealVect m_zdir
Definition: ERF_EBPolygon.H:254
◆ polygon_() [2/2]
| AMREX_GPU_HOST_DEVICE polygon_::polygon_ |
( |
| ) |
|
|
inline |
37 ,
m_vertices({amrex::RealVect(0.), amrex::RealVect(0.), amrex::RealVect(0.),
38 amrex::RealVect(0.), amrex::RealVect(0.), amrex::RealVect(0.)})
◆ add_vertex()
| AMREX_GPU_HOST_DEVICE void polygon_::add_vertex |
( |
amrex::RealVect const & |
a_v | ) |
|
|
inline |
◆ area()
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real polygon_::area |
( |
| ) |
const |
|
inlinenoexcept |
◆ debug() [1/2]
void debug()
Definition: ERF_EBPolygon.H:229
◆ debug() [2/2]
| void polygon_::debug |
( |
int const |
a_id | ) |
|
|
inline |
224 amrex::Print() <<
"EBPolygon: id = " << a_id <<
", m_num_vertices = " <<
m_num_vertices <<
'\n';
226 amrex::Print() <<
"EBPolygon: v" << i <<
": " <<
m_vertices[i] <<
'\n';
◆ define()
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void polygon_::define |
( |
| ) |
|
|
inline |
88 amrex::Array<amrex::RealVect,m_max_vertices> vertex_cent;
95 amrex::RealVect v_normal;
97 const amrex::RealVect& vertex_cent_0 = vertex_cent[0];
101 amrex::RealVect
vi = vertex_cent[i];
102 amrex::RealVect v_cross = vertex_cent_0.crossProduct(
vi);
110 if (!amrex::almostEqual(max_norm2, 0.0))
112 v_normal /= std::sqrt(max_norm2);
121 m_theta[i] = std::atan2(
m_zdir.dotProduct( vertex_cent[0].crossProduct(vertex_cent[i]) ),
122 vertex_cent[0].dotProduct(vertex_cent[i]));
133 amrex::Swap(vertex_cent[j], vertex_cent[j+1]);
143 amrex::RealVect vi_cross_vj = vertex_cent[i].crossProduct(vertex_cent[j]);
144 m_area += 0.5*vi_cross_vj.vectorLength();
constexpr amrex::Real PI
Definition: ERF_Constants.H:6
amrex::Real Real
Definition: ERF_ShocInterface.H:19
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::RealVect get_centroid() const noexcept
Definition: ERF_EBPolygon.H:169
amrex::GpuArray< amrex::Real, m_max_vertices > m_theta
Definition: ERF_EBPolygon.H:252
real(c_double), private vi
Definition: ERF_module_mp_morr_two_moment.F90:219
◆ distance()
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real polygon_::distance |
( |
amrex::RealVect const & |
a_point | ) |
const |
|
inlinenoexcept |
◆ get_centroid()
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::RealVect polygon_::get_centroid |
( |
| ) |
const |
|
inlinenoexcept |
170 amrex::RealVect cent(0.);
179 amrex::RealVect v0_cross_v1 = v0.crossProduct(v1);
180 amrex::Real area_tri = 0.5 * v0_cross_v1.vectorLength();
183 cent += area_tri * cent_tri;
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real area() const noexcept
Definition: ERF_EBPolygon.H:154
Referenced by eb_cut_cell_::centBoun(), eb_cut_cell_::centVol(), define(), and report().
◆ get_num_vertices()
| AMREX_GPU_HOST_DEVICE int polygon_::get_num_vertices |
( |
| ) |
|
|
inline |
◆ normal()
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::RealVect polygon_::normal |
( |
| ) |
const |
|
inlinenoexcept |
◆ ok()
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int polygon_::ok |
( |
| ) |
const |
|
inlinenoexcept |
◆ report()
| void polygon_::report |
( |
int const |
a_id, |
|
|
amrex::RealVect |
a_v0 |
|
) |
| |
|
inline |
203 #ifndef AMREX_USE_GPU
205 amrex::Print() <<
"Face " << a_id
206 <<
" -------------------------------------------\n"
207 <<
"\nok? " << (
ok() ?
"yes" :
"no") <<
"\n\n";
209 amrex::Print() <<
"v" << i <<
": " <<
m_vertices[i] <<
'\n';
211 amrex::Print() <<
"\nvc: " <<
" " << centroid <<
"\n";
216 amrex::Print() <<
"\narea: " <<
m_area
217 <<
"\ndistance: " << dist
218 <<
"\nvolume: " << dist*
m_area
219 <<
"\n==================================================\n\n";
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real distance(amrex::RealVect const &a_point) const noexcept
Definition: ERF_EBPolygon.H:161
◆ set_area()
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void polygon_::set_area |
( |
amrex::Real const & |
a_area | ) |
|
|
inline |
◆ m_area
◆ m_cell_face
| int const polygon_::m_cell_face |
|
private |
◆ m_defined
◆ m_eb_normal
| amrex::RealVect const polygon_::m_eb_normal |
|
private |
◆ m_eb_point
| amrex::RealVect const polygon_::m_eb_point |
|
private |
◆ m_max_vertices
| constexpr int polygon_::m_max_vertices = 6 |
|
staticconstexprprivate |
◆ m_num_vertices
| int polygon_::m_num_vertices |
|
private |
◆ m_sorted
◆ m_theta
◆ m_vertices
◆ m_zdir
| amrex::RealVect polygon_::m_zdir |
|
private |
The documentation for this class was generated from the following file: