Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GeoPrim Namespace Reference

Classes

class  CPoint
 
class  CVector
 
class  C3Vector
 /brief Cartesian 3 Vector More...
 
class  CLine
 
class  CLineSegment
 
class  CBox
 
class  CPlane
 
class  C3Plane
 
class  CFacet
 
class  C3Facet
 

Typedefs

typedef C3Vector C3Point
 

Functions

template<typename PointContainer >
C3Point C3Centroid (const PointContainer &pc)
 
template<typename PointContainer >
CPoint Centroid (const PointContainer &pc)
 
void Transpose (CVector matrix[])
 
void Transpose_2x3 (CVector matrix[], double tpose[][2])
 
double Distance (const CPoint &p, const CLine &l)
 
double Distance (const C3Point &p, const CLine &l)
 
std::ostream & operator<< (std::ostream &oS, const GeoPrim::CBox &b)
 
std::ostream & operator<< (std::ostream &oS, const GeoPrim::CPoint &p)
 
std::istream & operator>> (std::istream &iS, GeoPrim::CPoint &p)
 
std::ostream & operator<< (std::ostream &oS, const GeoPrim::CVector &v)
 
std::istream & operator>> (std::istream &iS, GeoPrim::CVector &v)
 
std::ostream & operator<< (std::ostream &oS, const GeoPrim::C3Vector &v)
 
std::istream & operator>> (std::istream &iS, GeoPrim::C3Vector &v)
 
GeoPrim::CPoint operator* (double scalar, const GeoPrim::CPoint &p)
 
GeoPrim::C3Vector operator* (double scalar, const GeoPrim::C3Vector &v)
 
GeoPrim::CVector operator* (double scalar, const GeoPrim::CVector &v)
 

Variables

const double TOL = 1e-16
 
const double PI = 4.0*atan(1.0)
 

Typedef Documentation

typedef C3Vector C3Point

Definition at line 763 of file GeoPrimitives.H.

Function Documentation

C3Point GeoPrim::C3Centroid ( const PointContainer &  pc)

Definition at line 1481 of file GeoPrimitives.H.

References pi, x, y, and z.

Referenced by C3Facet::Centroid().

1482  {
1483  double x = 0.0;
1484  double y = 0.0;
1485  double z = 0.0;
1486  double np = 1.0/static_cast<double>(pc.size());
1487  typename PointContainer::const_iterator pi = pc.begin();
1488  while(pi != pc.end()){
1489  x += (*pi)->x();
1490  y += (*pi)->y();
1491  z += (*pi)->z();
1492  pi++;
1493  }
1494  x *= np;
1495  y *= np;
1496  z *= np;
1497  return(C3Point(x,y,z));
1498  };
void int int REAL REAL * y
Definition: read.cpp:74
void int int int REAL REAL REAL * z
Definition: write.cpp:76
void int int REAL * x
Definition: read.cpp:74
const double pi
C3Vector C3Point

Here is the caller graph for this function:

CPoint GeoPrim::Centroid ( const PointContainer &  pc)

Definition at line 1501 of file GeoPrimitives.H.

References pi, x, y, and z.

Referenced by CFacet::centroid().

1502  {
1503  double x = 0.0;
1504  double y = 0.0;
1505  double z = 0.0;
1506  double np = 1.0/static_cast<double>(pc.size());
1507  typename PointContainer::const_iterator pi = pc.begin();
1508  while(pi != pc.end()){
1509  x += pi->x();
1510  y += pi->y();
1511  z += pi->z();
1512  pi++;
1513  }
1514  x *= np;
1515  y *= np;
1516  z *= np;
1517  return(CPoint(x,y,z));
1518  };
void int int REAL REAL * y
Definition: read.cpp:74
void int int int REAL REAL REAL * z
Definition: write.cpp:76
void int int REAL * x
Definition: read.cpp:74
const double pi

Here is the caller graph for this function:

double GeoPrim::Distance ( const C3Point &  p,
const CLine &  l 
)

Definition at line 45 of file GeoPrimitives.C.

References C3Vector::Mag(), CVector::mag2(), CLine::p, v, CLine::v, CPoint::x(), CVector::x(), C3Vector::x(), CPoint::y(), CVector::y(), C3Vector::y(), CPoint::z(), CVector::z(), and C3Vector::z().

46  {
47  double u = (((p.x() - l.p.x())*l.v.x() + (p.y() - l.p.y())*l.v.y() +
48  (p.z() - l.p.z())*l.v.z())/l.v.mag2());
49  C3Point p2(l.p.x()+(u*l.v.x()),l.p.y()+(u*l.v.y()),l.p.z()+(u*l.v.z()));
50  C3Vector v(p,p2);
51  return(v.Mag());
52  }
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
C3Vector C3Point

Here is the call graph for this function:

double Distance ( const CPoint &  p,
const CLine &  l 
)

Definition at line 35 of file GeoPrimitives.C.

References CVector::mag(), CVector::mag2(), CLine::p, v, CLine::v, CPoint::x(), CVector::x(), CPoint::y(), CVector::y(), CPoint::z(), and CVector::z().

36  {
37  double u = (((p.x() - l.p.x())*l.v.x() + (p.y() - l.p.y())*l.v.y() +
38  (p.z() - l.p.z())*l.v.z())/l.v.mag2());
39  CPoint p2(l.p.x()+(u*l.v.x()),l.p.y()+(u*l.v.y()),l.p.z()+(u*l.v.z()));
40  CVector v(p,p2);
41  return(v.mag());
42  }
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20

Here is the call graph for this function:

GeoPrim::CPoint GeoPrim::operator* ( double  scalar,
const GeoPrim::CPoint p 
)

Definition at line 117 of file GeoPrimitives.C.

References CPoint::x(), CPoint::y(), and CPoint::z().

118  {
119  GeoPrim::CPoint rv(p);
120  rv.x() *= scalar;
121  rv.y() *= scalar;
122  rv.z() *= scalar;
123  return(rv);
124  }

Here is the call graph for this function:

GeoPrim::C3Vector GeoPrim::operator* ( double  scalar,
const GeoPrim::C3Vector v 
)

Definition at line 126 of file GeoPrimitives.C.

127  {
128  GeoPrim::C3Vector rv(v);
129  return(rv *= scalar);
130  }
/brief Cartesian 3 Vector
GeoPrim::CVector GeoPrim::operator* ( double  scalar,
const GeoPrim::CVector v 
)

Definition at line 132 of file GeoPrimitives.C.

133  {
134  GeoPrim::CVector rv(v);
135  return(rv *= scalar);
136  }
std::ostream& GeoPrim::operator<< ( std::ostream &  oS,
const GeoPrim::CBox b 
)

Definition at line 55 of file GeoPrimitives.C.

References CBox::P1(), and CBox::P2().

56  {
57  oS << b.P1() << " " << b.P2();
58  return(oS);
59  }
const CPoint & P2() const
const CPoint & P1() const

Here is the call graph for this function:

std::ostream& GeoPrim::operator<< ( std::ostream &  oS,
const GeoPrim::CPoint p 
)

Definition at line 62 of file GeoPrimitives.C.

References CPoint::x(), CPoint::y(), and CPoint::z().

63  {
64  oS << p.x() << " " << p.y() << " " << p.z();
65  return(oS);
66  }

Here is the call graph for this function:

std::ostream& GeoPrim::operator<< ( std::ostream &  oS,
const GeoPrim::CVector v 
)

Definition at line 90 of file GeoPrimitives.C.

References CVector::x(), CVector::y(), and CVector::z().

91  {
92  oS << v.x() << " " << v.y() << " " << v.z();
93  return(oS);
94  }

Here is the call graph for this function:

std::ostream& GeoPrim::operator<< ( std::ostream &  oS,
const GeoPrim::C3Vector v 
)

Definition at line 104 of file GeoPrimitives.C.

References C3Vector::x(), C3Vector::y(), and C3Vector::z().

105  {
106  oS << v.x() << " " << v.y() << " " << v.z();
107  return(oS);
108  }

Here is the call graph for this function:

std::istream& GeoPrim::operator>> ( std::istream &  iS,
GeoPrim::CPoint p 
)

Definition at line 69 of file GeoPrimitives.C.

70  {
71  iS >> p[0] >> p[1] >> p[2];
72  return(iS);
73  }
std::istream& GeoPrim::operator>> ( std::istream &  iS,
GeoPrim::CVector v 
)

Definition at line 97 of file GeoPrimitives.C.

98  {
99  iS >> v[0] >> v[1] >> v[2];
100  return(iS);
101  }
std::istream& GeoPrim::operator>> ( std::istream &  iS,
GeoPrim::C3Vector v 
)

Definition at line 111 of file GeoPrimitives.C.

112  {
113  iS >> v[0] >> v[1] >> v[2];
114  return(iS);
115  }
void Transpose ( CVector  matrix[])

Definition at line 11 of file GeoPrimitives.C.

References CVector::init(), x, y, and z.

Referenced by Mesh::GenericCell_2::shapef_jacobian_at(), and Mesh::GenericElement::shapef_jacobian_at().

12  {
13  CVector tpose[3];
14 
15  tpose[0].init(matrix[0].x(),matrix[1].x(),matrix[2].x());
16  tpose[1].init(matrix[0].y(),matrix[1].y(),matrix[2].y());
17  tpose[2].init(matrix[0].z(),matrix[1].z(),matrix[2].z());
18  matrix[0].init(tpose[0]);
19  matrix[1].init(tpose[1]);
20  matrix[2].init(tpose[2]);
21  }
void int int REAL REAL * y
Definition: read.cpp:74
void int int int REAL REAL REAL * z
Definition: write.cpp:76
void int int REAL * x
Definition: read.cpp:74

Here is the call graph for this function:

Here is the caller graph for this function:

void Transpose_2x3 ( CVector  matrix[],
double  tpose[][2] 
)

Definition at line 24 of file GeoPrimitives.C.

References CVector::x(), CVector::y(), and CVector::z().

25  {
26  tpose[0][0] = matrix[0].x();
27  tpose[1][0] = matrix[0].y();
28  tpose[2][0] = matrix[0].z();
29  tpose[0][1] = matrix[1].x();
30  tpose[1][1] = matrix[1].y();
31  tpose[2][1] = matrix[1].z();
32  }

Here is the call graph for this function:

Variable Documentation

const double PI = 4.0*atan(1.0)

Definition at line 18 of file GeoPrimitives.H.

Referenced by CFacet::contains_point().