|
IBAMR
IBAMR version 0.19.
|
Provides an analytic description of a convex polygon. It inherets from the EmbeddedBoundaryShape base class and provides a concrete implementation of the "isInside()" method, which specifies whether a cell is INSIDE the convex poly. More...
#include <EmbeddedBoundaryShapePolygon.h>

Public Member Functions | |
| EmbeddedBoundaryShapePolygon (const std::string &object_name, tbox::Pointer< tbox::Database > input_db) | |
| ~EmbeddedBoundaryShapePolygon () | |
| bool | isInside (const double *xyz) const |
| void | isInside (const int *nx, const double *dx, const double *origin, int *inout) const |
| virtual void | printClassData (std::ostream &os) const |
Private Member Functions | |
| void | getFromInput (tbox::Pointer< tbox::Database > db) |
| bool | sameSide (double p1[3], double p2[3], double a[3], double b[3]) const |
| bool | pointInPolygon (tbox::Array< double > v_x, tbox::Array< double > v_y, double p_x, double p_y) const |
| void | crossProduct (double a[3], const double b[3], const double c[3]) const |
| double | dotProduct (const double a[3], const double b[3]) const |
Private Attributes | |
| std::string | d_object_name |
| double | d_height |
| double | d_eps |
| tbox::Array< double > | d_vx |
| tbox::Array< double > | d_vy |
| int | d_num_vertices |
The user must specify at least three coordinates that define the vertices the poly. If the problem is 3D, a height must also be specified. An example input entry would look like:
* Polygon1{
* type = "POLYGON"
* coords_1 = 1.0 , 1.0
* coords_2 = 2.0 , 1.0
* coords_3 = 2.0 , 2.0
* coords_4 = 1.0 , 2.0
* height = 8.0
* }
* | SAMRAI::appu::EmbeddedBoundaryShapePolygon< DIM >::EmbeddedBoundaryShapePolygon | ( | const std::string & | object_name, |
| tbox::Pointer< tbox::Database > | input_db | ||
| ) |
| object_name | name of object of this class |
| input_db | the input database which contains radius and center specification. |
| SAMRAI::appu::EmbeddedBoundaryShapePolygon< DIM >::~EmbeddedBoundaryShapePolygon | ( | ) |
The destructor does nothing.
|
virtual |
Concrete implementation of the isInside() method defined by the EmbeddedBoundaryShapeX base class. This method indicates whether the supplied xyz coordinates are inside or outside of the polygon.
| xyz | double array[DIM] specifying coordinates. |
Reimplemented from SAMRAI::appu::EmbeddedBoundaryShape< DIM >.
|
virtual |
Concrete implementation of the isInside() method defined by the EmbeddedBoundaryShapeX base class. This method indicates whether the array of xyz coordinates are inside or outside of the polygon.
| nx | integer array [DIM] specifying number of points in each dir |
| dx | double array [DIM] specifying spacing of points in each dir |
| origin | double array [DIM] specifying origin of lower corner |
| inout | int array dimensioned the total number of points (i.e. nx[0]*nx[1]*nx[2]). This is an OUTPUT quantity. |
Reimplemented from SAMRAI::appu::EmbeddedBoundaryShape< DIM >.
|
virtual |
Dump data to supplied stream.
Implements SAMRAI::appu::EmbeddedBoundaryShape< DIM >.
|
private |
Read name, and vertex information from input. The name is optional but at least three vertices must be specified by the input file.
|
private |
Returns TRUE if points p1 and p2 are on the same side of line segment ab; FALSE otherwise.
|
private |
Returns TRUE if a point p is within a convex polygon defined by vertices (v_x[i], * v_y[i]), i = 0..d_num_vertices-1; FALSE otherwise.
|
private |
This method computes the cross prodcut, A = B cross C.
|
private |
This method computes the dot product of A and B.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
1.8.17