Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
compute_bounded_volumes.C File Reference

This file contains implementation for computing the volume bounded between two different locations of each face of the surface mesh of a given window. More...

#include "Rocsurf.h"
#include "roccom_devel.h"
#include "Element_accessors.h"
#include "Generic_element_2.h"
#include <math.h>
#include <vector>
Include dependency graph for compute_bounded_volumes.C:

Go to the source code of this file.

Functions

SURF_BEGIN_NAMESPACE void arrange (Point_3< Real > ps_face[4], Point_3< Real > ps[8], int ind1, int ind2, int ind3, int ind4)
 
void arrange (Point_3< Real > ps_face[3], Point_3< Real > ps[8], int ind1, int ind2, int ind3)
 
Real get_face_volume (Point_3< Real > ps_face[], int ne)
 
void normalize_coor (Point_3< Real > ps_face[], int n, int k)
 

Detailed Description

This file contains implementation for computing the volume bounded between two different locations of each face of the surface mesh of a given window.

Typically, the two locations of the surface correspond to the surface at two different snapshots of a simulation.

Definition in file compute_bounded_volumes.C.

Function Documentation

SURF_BEGIN_NAMESPACE void arrange ( Point_3< Real ps_face[4],
Point_3< Real ps[8],
int  ind1,
int  ind2,
int  ind3,
int  ind4 
)

Definition at line 44 of file compute_bounded_volumes.C.

Referenced by Rocsurf::compute_bounded_volumes(), and Rocsurf::compute_swept_volumes().

49  {
50  ps_face[0] = ps[ind1];
51  ps_face[1] = ps[ind2];
52  ps_face[2] = ps[ind3];
53  ps_face[3] = ps[ind4];
54 }

Here is the caller graph for this function:

void arrange ( Point_3< Real ps_face[3],
Point_3< Real ps[8],
int  ind1,
int  ind2,
int  ind3 
)

Definition at line 56 of file compute_bounded_volumes.C.

60  {
61  ps_face[0] = ps[ind1];
62  ps_face[1] = ps[ind2];
63  ps_face[2] = ps[ind3];
64 }
Real get_face_volume ( Point_3< Real ps_face[],
int  ne 
)

Definition at line 67 of file compute_bounded_volumes.C.

References Vector_3< Type >::cross_product(), Generic_element_2::get_gp_nat_coor(), Generic_element_2::get_gp_weight(), Generic_element_2::get_num_gp(), Generic_element_2::interpolate(), Generic_element_2::Jacobian(), k, n, volume(), and x.

Referenced by Rocsurf::compute_bounded_volumes(), Rocsurf::compute_signed_volumes(), and Rocsurf::compute_swept_volumes().

67  {
68 
69  Generic_element_2 e(ne);
70  Vector_2<Real> nc(0,0);
71  Vector_3<Real> J[2];
72  int order = 1;
73 
74  int size = e.get_num_gp(order);
75  Real volume = 0;
76  for (int k = 0; k<size; k++){
77  Real weight = e.get_gp_weight( k, order);
78  e.get_gp_nat_coor(k, nc, order);
79 
81  e.interpolate(ps_face,nc,&x);
82 
83  e.Jacobian( ps_face,nc,J);
84  // Get the normal to the face
86 
87  Real t = weight * (n*(Vector_3<Real>&)x);
88 
89  // compute the volume, and add to running total
90  volume += t;
91  }
92  return volume;
93 }
j indices k indices k
Definition: Indexing.h:6
Encapsulation of the element-wise computations for two-dimensional elements.
double Real
Definition: mapbasic.h:322
int volume(const block *b)
Definition: split.cpp:181
void int int REAL * x
Definition: read.cpp:74
const NT & n
static Vector_3 cross_product(const Vector_3 &v, const Vector_3 &w)
Definition: mapbasic.h:104

Here is the call graph for this function:

Here is the caller graph for this function:

void normalize_coor ( Point_3< Real ps_face[],
int  n,
int  k 
)

Definition at line 95 of file compute_bounded_volumes.C.

References i, k, and n.

Referenced by Rocsurf::compute_bounded_volumes(), and Rocsurf::compute_swept_volumes().

95  {
96  Vector_3<Real> c(0,0,0);
97 
98  for ( int i=0; i<n; ++i) {
99  c += (Vector_3<Real>&)ps_face[i];
100  }
101  c /= k;
102 
103  for ( int i=0; i<n; ++i) {
104  ps_face[i] -= c;
105  }
106 }
j indices k indices k
Definition: Indexing.h:6
blockLoc i
Definition: read.cpp:79
const NT & n

Here is the caller graph for this function: