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

Common code for specific implementations of MeshDomain on TSTT interfaces. More...

Inheritance diagram for GeomTSTTCommon:

Public Member Functions

 GeomTSTTCommon (TSTTG::Geometry &geom) throw (TSTTB::Error )
 
virtual ~GeomTSTTCommon ()
 
void move_to (void *geom_handle, Vector3D &coord) const throw ( TSTTB::Error )
 Evaluate the closest point to the input position on the specified geometric entity and return the result in the passed position argument (move the passed position onto the geometry.) More...
 
void normal (void *geom_handle, Vector3D &coord) const throw ( TSTTB::Error )
 Given a geometric entity and a position, evaluate the normal on the geometric entity at the closest point on that entity to the input position, and pass back the result in the input coord vector. More...
 
void normal (void *geom_handle, Vector3D coords[], unsigned count) const throw ( TSTTB::Error )
 Given a geometric entity and a position, evaluate the normal on the geometric entity at the closest point on that entity to the input position, and pass back the result in the input coord vector. More...
 
void closest_and_normal (void *geom_handle, const Vector3D &position, Vector3D &closest, Vector3D &normal) const throw (TSTTB::Error)
 Given a geometric entity and a position, get point on the geometric entity closest to the input position, and the surface normal at that position. More...
 

Public Attributes

TSTTG::Shape geomIface
 TSTT geometry interface implementation to query. More...
 
sidl::array< void * > geomHandles
 Temporary storage for geometry entity handles. More...
 
sidl::array< double > positionsIn
 Temporary storate for input and output vectors. More...
 
sidl::array< double > positionsOut
 
sidl::array< double > normalsOut
 

Detailed Description

Common code for specific implementations of MeshDomain on TSTT interfaces.

This class contains the common functionality used by concrete implementations of MeshDomain on the TSTT geometry interface.

Definition at line 55 of file GeomTSTT.cpp.

Constructor & Destructor Documentation

GeomTSTTCommon ( TSTTG::Geometry &  geom)
throw (TSTTB::Error
)
Parameters
geomThe TSTT geometry interface implementation to query

Definition at line 407 of file GeomTSTT.cpp.

408  : geomIface( geom ),
409  geomHandles( alloc_sidl_vector<void*>(1) ),
410  positionsIn( alloc_sidl_vector<double>(3) )
411 {
412 }
sidl::array< void * > geomHandles
Temporary storage for geometry entity handles.
Definition: GeomTSTT.cpp:99
TSTTG::Shape geomIface
TSTT geometry interface implementation to query.
Definition: GeomTSTT.cpp:96
sidl::array< double > positionsIn
Temporary storate for input and output vectors.
Definition: GeomTSTT.cpp:101
~GeomTSTTCommon ( )
virtual

Definition at line 414 of file GeomTSTT.cpp.

414 {}

Member Function Documentation

void closest_and_normal ( void *  geom_handle,
const Vector3D position,
Vector3D closest,
Vector3D normal 
) const
throw (TSTTB::Error
)

Given a geometric entity and a position, get point on the geometric entity closest to the input position, and the surface normal at that position.

Definition at line 479 of file GeomTSTT.cpp.

References Mesquite::convert_from_sidl_vector(), and Mesquite::convert_to_sidl_vector().

Referenced by DomainTSTT::closest_point(), and GeomEntTSTT::closest_point().

484 {
485  // going to assume this in the following reinterpret_cast, so
486  // check to make sure it is true
487  assert( sizeof(Vector3D) == 3*sizeof(double) );
488 
489  memcpy( convert_from_sidl_vector(positionsIn), &position, 3*sizeof(double) );
490  positionsOut = convert_to_sidl_vector( reinterpret_cast<double*>(&closest), 3 );
491  normalsOut = convert_to_sidl_vector( reinterpret_cast<double*>(&normal), 3 );
493 
494  int junk1, junk2;
495  geomIface.gentityClosestPointAndNormal( geomHandles, 1,
496  positionsIn, 3,
497  positionsOut, junk1,
498  normalsOut, junk2 );
499 }
sidl::array< double > normalsOut
Definition: GeomTSTT.cpp:101
sidl::array< void * > geomHandles
Temporary storage for geometry entity handles.
Definition: GeomTSTT.cpp:99
void normal(void *geom_handle, Vector3D &coord) const
Given a geometric entity and a position, evaluate the normal on the geometric entity at the closest p...
Definition: GeomTSTT.cpp:437
sidl::array< double > positionsOut
Definition: GeomTSTT.cpp:101
TSTTG::Shape geomIface
TSTT geometry interface implementation to query.
Definition: GeomTSTT.cpp:96
static T * convert_from_sidl_vector(sidl::array< T > &array)
static sidl::array< T > convert_to_sidl_vector(T *array, size_t size)
NVec< 3, double > Vector3D
sidl::array< double > positionsIn
Temporary storate for input and output vectors.
Definition: GeomTSTT.cpp:101

Here is the call graph for this function:

Here is the caller graph for this function:

void move_to ( void *  geom_handle,
Vector3D coord 
) const
throw (TSTTB::Error
)

Evaluate the closest point to the input position on the specified geometric entity and return the result in the passed position argument (move the passed position onto the geometry.)

Definition at line 418 of file GeomTSTT.cpp.

References Mesquite::convert_from_sidl_vector(), Mesquite::convert_to_sidl_vector(), and coord.

Referenced by DomainTSTT::snap_to(), and GeomEntTSTT::snap_to().

420 {
421  // going to assume this in the following reinterpret_cast, so
422  // check to make sure it is true
423  assert( sizeof(Vector3D) == 3*sizeof(double) );
424 
425  memcpy( convert_from_sidl_vector(positionsIn), &coord, 3*sizeof(double) );
426  positionsOut = convert_to_sidl_vector( reinterpret_cast<double*>(&coord), 3 );
428 
429  int junk = 3;
430  geomIface.gentityClosestPoint( geomHandles, 1,
431  positionsIn, 3,
432  positionsOut, junk );
433 }
sidl::array< void * > geomHandles
Temporary storage for geometry entity handles.
Definition: GeomTSTT.cpp:99
int coord[NPANE][NROW *NCOL][3]
Definition: blastest.C:86
sidl::array< double > positionsOut
Definition: GeomTSTT.cpp:101
TSTTG::Shape geomIface
TSTT geometry interface implementation to query.
Definition: GeomTSTT.cpp:96
static T * convert_from_sidl_vector(sidl::array< T > &array)
static sidl::array< T > convert_to_sidl_vector(T *array, size_t size)
NVec< 3, double > Vector3D
sidl::array< double > positionsIn
Temporary storate for input and output vectors.
Definition: GeomTSTT.cpp:101

Here is the call graph for this function:

Here is the caller graph for this function:

void normal ( void *  geom_handle,
Vector3D coord 
) const
throw (TSTTB::Error
)

Given a geometric entity and a position, evaluate the normal on the geometric entity at the closest point on that entity to the input position, and pass back the result in the input coord vector.

Definition at line 437 of file GeomTSTT.cpp.

References Mesquite::convert_from_sidl_vector(), Mesquite::convert_to_sidl_vector(), and coord.

Referenced by DomainTSTT::normal_at(), and GeomEntTSTT::normal_at().

439 {
440  // going to assume this in the following reinterpret_cast, so
441  // check to make sure it is true
442  assert( sizeof(Vector3D) == 3*sizeof(double) );
443 
444  memcpy( convert_from_sidl_vector(positionsIn), &coord, 3*sizeof(double) );
445  normalsOut = convert_to_sidl_vector( reinterpret_cast<double*>(&coord), 3 );
447 
448  int junk;
449  geomIface.gentityNormal( geomHandles, 1,
450  positionsIn, 3,
451  normalsOut, junk );
452 }
sidl::array< double > normalsOut
Definition: GeomTSTT.cpp:101
sidl::array< void * > geomHandles
Temporary storage for geometry entity handles.
Definition: GeomTSTT.cpp:99
int coord[NPANE][NROW *NCOL][3]
Definition: blastest.C:86
TSTTG::Shape geomIface
TSTT geometry interface implementation to query.
Definition: GeomTSTT.cpp:96
static T * convert_from_sidl_vector(sidl::array< T > &array)
static sidl::array< T > convert_to_sidl_vector(T *array, size_t size)
NVec< 3, double > Vector3D
sidl::array< double > positionsIn
Temporary storate for input and output vectors.
Definition: GeomTSTT.cpp:101

Here is the call graph for this function:

Here is the caller graph for this function:

void normal ( void *  geom_handle,
Vector3D  coords[],
unsigned  count 
) const
throw (TSTTB::Error
)

Given a geometric entity and a position, evaluate the normal on the geometric entity at the closest point on that entity to the input position, and pass back the result in the input coord vector.

Definition at line 454 of file GeomTSTT.cpp.

References Mesquite::convert_from_sidl_vector(), and Mesquite::convert_to_sidl_vector().

456 {
457  // going to assume this in the following reinterpret_cast, so
458  // check to make sure it is true
459  assert( sizeof(Vector3D) == 3*sizeof(double) );
460 
461  if (positionsIn.upper(0)+1 < 3*(int)count)
462  positionsIn = positionsIn.create1d( 3*count );
463  memcpy( convert_from_sidl_vector(positionsIn), coords, 3*count*sizeof(double) );
464 
465  normalsOut = convert_to_sidl_vector( reinterpret_cast<double*>(coords), 3*count );
466 
467  if (geomHandles.upper(0)+1 < (int)count)
468  geomHandles = geomHandles.create1d( count );
469  void** ptr = convert_from_sidl_vector( geomHandles );
470  for (void** end = ptr + count; ptr != end; ++ptr)
471  *ptr = geom;
472 
473  int junk;
474  geomIface.gentityNormal( geomHandles, count,
475  positionsIn, 3*count,
476  normalsOut, junk );
477 }
sidl::array< double > normalsOut
Definition: GeomTSTT.cpp:101
sidl::array< void * > geomHandles
Temporary storage for geometry entity handles.
Definition: GeomTSTT.cpp:99
TSTTG::Shape geomIface
TSTT geometry interface implementation to query.
Definition: GeomTSTT.cpp:96
static T * convert_from_sidl_vector(sidl::array< T > &array)
static sidl::array< T > convert_to_sidl_vector(T *array, size_t size)
NVec< 3, double > Vector3D
sidl::array< double > positionsIn
Temporary storate for input and output vectors.
Definition: GeomTSTT.cpp:101

Here is the call graph for this function:

Member Data Documentation

sidl::array<void*> geomHandles
mutable

Temporary storage for geometry entity handles.

Definition at line 99 of file GeomTSTT.cpp.

TSTTG::Shape geomIface
mutable

TSTT geometry interface implementation to query.

Definition at line 96 of file GeomTSTT.cpp.

sidl::array<double> normalsOut
mutable

Definition at line 101 of file GeomTSTT.cpp.

sidl::array<double> positionsIn
mutable

Temporary storate for input and output vectors.

Definition at line 101 of file GeomTSTT.cpp.

sidl::array<double> positionsOut
mutable

Definition at line 101 of file GeomTSTT.cpp.


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