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

#include <PointPropagate.h>

Static Public Member Functions

static void propagate_faces (const std::string &wname, const Speed &s, double t, double dt, const std::string &vname)
 
static void propagate_nodes (const std::string &wname, const Speed &s, double t, double dt, const std::string &vname)
 

Static Protected Member Functions

static Vector_3 time_integrate (const Point_3 &p, const Speed &s, double t, double dt, int order)
 
static void propagate_gp_of_element (const Point_3 *pnts, COM::Element_node_enumerator &ene, const Speed &s, double t, double dt, Vector_3 *qp_vels)
 

Detailed Description

Definition at line 33 of file PointPropagate.h.

Member Function Documentation

void propagate_faces ( const std::string &  wname,
const Speed s,
double  t,
double  dt,
const std::string &  vname 
)
static

Definition at line 72 of file PointPropagate.C.

References COM_assertion_msg, COM_get_roccom(), i, j, nj, and propagate_gp_of_element().

Referenced by main().

73  {
74  COM::Window *win = COM_get_roccom()->get_window_object(wname);
75  COM::Attribute *velos = win->attribute( vname);
76 
77  COM_assertion_msg( velos->is_elemental() && velos->size_of_components()==9,
78  "Velos must be elemental data associated with quadrature points");
79 
80  // Loop through all the panes and then all the faces
81  std::vector<COM::Pane*> panes; win->panes( panes);
82 
83  // Loop through the panes and its real faces
84  std::vector< COM::Pane*>::iterator it = panes.begin();
85  for ( int i=0, local_npanes = panes.size(); i<local_npanes; ++i, ++it) {
86  COM::Pane *pane = *it;
87  const Point_3 *pnts = reinterpret_cast<Point_3*>(pane->coordinates());
88  Vector_3 *velos_ptr = reinterpret_cast<Vector_3*>
89  (pane->attribute( velos->id())->pointer());
90 
91  // Loop through real elements of the current pane
92  COM::Element_node_enumerator ene( pane, 1);
93  for ( int j=0, nj=pane->size_of_real_elements(); j<nj; ++j, ene.next()) {
94  // First compute the displacements at Gauss points using high-order
95  // time integration
96  propagate_gp_of_element( pnts, ene, s, t, dt, &velos_ptr[3*j]);
97 
98  // Convert displacements into velocities by dividing by time step.
99  velos_ptr[3*j] /= dt; velos_ptr[3*j+1] /= dt; velos_ptr[3*j+2] /= dt;
100  }
101  }
102 }
#define COM_assertion_msg(EX, msg)
static void propagate_gp_of_element(const Point_3 *pnts, COM::Element_node_enumerator &ene, const Speed &s, double t, double dt, Vector_3 *qp_vels)
blockLoc i
Definition: read.cpp:79
j indices j
Definition: Indexing.h:6
void int * nj
Definition: read.cpp:74
Some basic geometric data types.
Definition: mapbasic.h:54
COM_END_NAME_SPACE COM::Roccom_base * COM_get_roccom()
Definition: Roccom_base.h:537

Here is the call graph for this function:

Here is the caller graph for this function:

void propagate_gp_of_element ( const Point_3 pnts,
COM::Element_node_enumerator &  ene,
const Speed s,
double  t,
double  dt,
Vector_3 qp_vels 
)
staticprotected

Definition at line 49 of file PointPropagate.C.

References COM_assertion, i, and time_integrate().

Referenced by propagate_faces().

50  {
51 
52  // Only support triangular elements now
53  COM_assertion( ene.size_of_edges()==3);
54 
55  // Evaluate current face normal
56  COM::Element_node_vectors_k_const<Point_3> ps; ps.set( pnts, ene, 1);
57  SURF::Generic_element_2 e(ene.size_of_edges(), ene.size_of_nodes());
58 
59  // Look through the Gauss points and compute their displacements.
60  for ( int i=0; i<3; ++i) {
61  // Obtain the positions of the Gauss point
62  Vector_2 nc; e.get_gp_nat_coor( i, nc, 2);
63  Point_3 p; e.interpolate( ps, nc, &p);
64 
65  // Obtain the displacement at the Gauss point using 4th order RK
66  disps[ i] = time_integrate( p, s, t, dt, 4);
67  }
68 }
#define COM_assertion(EX)
Error checking utility similar to the assert macro of the C language.
blockLoc i
Definition: read.cpp:79
static Vector_3 time_integrate(const Point_3 &p, const Speed &s, double t, double dt, int order)

Here is the call graph for this function:

Here is the caller graph for this function:

void propagate_nodes ( const std::string &  wname,
const Speed s,
double  t,
double  dt,
const std::string &  vname 
)
static

Definition at line 106 of file PointPropagate.C.

References COM_assertion_msg, COM_get_roccom(), i, j, nj, and time_integrate().

Referenced by main().

107  {
108  COM::Window *win = COM_get_roccom()->get_window_object(wname);
109  COM::Attribute *velos = win->attribute( vname);
110 
111  COM_assertion_msg( velos->is_nodal() && velos->size_of_components()==3,
112  "Velos must be nodal data associated");
113 
114  double a = 1./dt;
115 
116  // Loop through all the panes and then all the vertices
117  std::vector<COM::Pane*> panes; win->panes( panes);
118 
119  std::vector< COM::Pane*>::iterator it = panes.begin();
120  for ( int i=0, local_npanes = panes.size(); i<local_npanes; ++i, ++it) {
121  COM::Pane *pane = *it;
122  const Point_3 *pnts = reinterpret_cast<Point_3*>(pane->coordinates());
123  Vector_3 *velos_ptr = reinterpret_cast<Vector_3*>
124  (pane->attribute( velos->id())->pointer());
125 
126  // Loop through real vertices of the current pane
127  for ( int j=0, nj=pane->size_of_real_nodes(); j<nj; ++j) {
128  velos_ptr[j] = a*time_integrate( pnts[j], s, t, dt, 4);
129  }
130  }
131 }
#define COM_assertion_msg(EX, msg)
blockLoc i
Definition: read.cpp:79
j indices j
Definition: Indexing.h:6
void int * nj
Definition: read.cpp:74
Some basic geometric data types.
Definition: mapbasic.h:54
COM_END_NAME_SPACE COM::Roccom_base * COM_get_roccom()
Definition: Roccom_base.h:537
static Vector_3 time_integrate(const Point_3 &p, const Speed &s, double t, double dt, int order)

Here is the call graph for this function:

Here is the caller graph for this function:

PROP_BEGIN_NAMESPACE Vector_3 time_integrate ( const Point_3 p,
const Speed s,
double  t,
double  dt,
int  order 
)
staticprotected

Definition at line 32 of file PointPropagate.C.

References Speed::get_velocity().

Referenced by propagate_gp_of_element(), and propagate_nodes().

33  {
34  Vector_3 disp1 = dt*s.get_velocity( p, t);
35 
36  // If first order, using Euler's method
37  if ( order <= 1) { return disp1; }
38 
39  // Otherwise, use fourth-order Runge-Kutta.
40  Vector_3 disp2 = dt*s.get_velocity( p+0.5*disp1, t+0.5*dt);
41  Vector_3 disp3 = dt*s.get_velocity( p+0.5*disp2, t+0.5*dt);
42  Vector_3 disp4 = dt*s.get_velocity( p+disp3, t+dt);
43 
44  return (disp1+disp4)/6+(disp2+disp3)/3;
45 }
virtual Vector_3 get_velocity(const Point_3 &p, double t) const
Definition: speeds.h:40
Some basic geometric data types.
Definition: mapbasic.h:54

Here is the call graph for this function:

Here is the caller graph for this function:


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