Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Propagation_3.h
Go to the documentation of this file.
1 /* *******************************************************************
2  * Rocstar Simulation Suite *
3  * Copyright@2015, Illinois Rocstar LLC. All rights reserved. *
4  * *
5  * Illinois Rocstar LLC *
6  * Champaign, IL *
7  * www.illinoisrocstar.com *
8  * sales@illinoisrocstar.com *
9  * *
10  * License: See LICENSE file in top level of distribution package or *
11  * http://opensource.org/licenses/NCSA *
12  *********************************************************************/
13 /* *******************************************************************
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, *
15  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES *
16  * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND *
17  * NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR *
18  * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
19  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, *
20  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE *
21  * USE OR OTHER DEALINGS WITH THE SOFTWARE. *
22  *********************************************************************/
23 // $Id: Propagation_3.h,v 1.17 2008/12/06 08:45:27 mtcampbe Exp $
24 
25 #ifndef _PROPAGATION_3_H_
26 #define _PROPAGATION_3_H_
27 
28 #include <iostream>
29 #include <vector>
30 #include <map>
31 #include "propbasic.h"
32 
34 
35 const int MAX_LINES = 6;
36 const int BOUND_LEN = 15;
37 
41 public:
43  : _surf(NULL), _mode( SURF::ACROSS_PANE), _buf(NULL), _rank(0),
44  _verb(0), _cnstr_set(0), _cnstr_nodes(0), _cnstr_faces(0),
46 
47  virtual ~Propagation_3() {}
48 
50  Propagation_3( Manifold *wm, COM::Window *buf);
51 
63  virtual double time_stepping( const COM::Attribute *spd, double dt,
64  COM::Attribute *disps, int *smoothed=NULL)=0;
65 
87  virtual void set_constraints( const COM::Attribute *cnstr_types);
88 
90  void set_bounds( const COM::Attribute *bnd);
91 
92  // Bound a face based on nodal constraints. If all the nodes are beyond
93  // the bounded, then set the value to zero.
94  void bound_facial_speed( COM::Attribute *fa);
95 
97  virtual void enforce_nodal_constraints( COM::Attribute *du);
98 
99  virtual void bound_nodal_motion( COM::Attribute *disps);
100 
102  void set_verbose( bool b) { _verb = b; }
103 
104 protected:
106  void convert_constraints( const COM::Attribute *ctypes_faces,
107  COM::Attribute *ctypes_nodes);
109  void determine_constraint_boundary( const COM::Attribute *ctypes_faces,
110  COM::Attribute *ctypes_bndry_edges,
111  COM::Attribute *ctypes_bndry_nodes);
112 
116  static void get_constraint_directions( int type, int &ndirs,
117  Vector_3 dirs[2]);
118 
120  static void enforce_nodal_constraint( int type, Vector_3 &du);
121 
122  static void bound_nodal_motion( const Point_3 &pnt, const double *bnd,
123  Vector_3 &du, double eps=0);
124 
125  static bool check_spherical_bound( const Point_3 &pnt, const Point_3 &org,
126  const double rad_min, const double rad_max,
127  double eps=0);
128  static void bound_spherical_disp( const Point_3 &pnt, const Point_3 &org,
129  const double rad_min, const double rad_max,
130  Vector_3 &disp, double eps=0);
131 
132  static bool check_radial_bound( const double x, const double y,
133  const double bnd_min, const double bnd_max,
134  double eps=0);
135  static void bound_radial_disp( const double x, const double y,
136  const double bnd_min, const double bnd_max,
137  double &dx, double &dy, double eps=0);
138 
139  static bool check_axial_bound( const double x, const double bnd_min,
140  const double bnd_max, double eps=0);
141  static void bound_axial_disp( const double x, const double bnd_min,
142  const double bnd_max, double &dx, double eps=0);
143 
144  static bool reached_nodal_bound( const Point_3 &pnt, const double *bnd,
145  double eps=0);
146 
147  static bool in_bounding_box( const Point_3 &pnt,
148  const Point_3 &lb, const Point_3 &ub) {
149  return pnt[0] >= lb[0] && pnt[0] <= ub[0] &&
150  pnt[1] >= lb[1] && pnt[1] <= ub[1] &&
151  pnt[2] >= lb[2] && pnt[2] <= ub[2];
152  }
153 
154 protected:
155  static double square(double x) { return x*x; }
157  SURF::Access_Mode _mode; // Mode for accessing manifold
158 
159  COM::Window *_buf; // The buffer window created by Rocprop.
160 
161  int _rank; // Process rank.
162  bool _verb; // Whether to constraints were set
163  bool _cnstr_set; // Whether to constraints were set
164  bool _bnd_set; // Whether to bound was set
165  COM::Attribute *_cnstr_nodes; // Stores types of nodal constaints.
166  COM::Attribute *_cnstr_faces; // Stores facial constaints
167  COM::Attribute *_cnstr_bndry_edges; // Stores edges along constraint boundaries
168  COM::Attribute *_cnstr_bndry_nodes; // Stores nodes along constraint boundaries
169  COM::Attribute *_cnstr_bound; // Stores cylindrical constraint
170 
171  std::vector< COM::Pane*> _panes; // panes of buffer window
172 };
173 
175 
176 #endif
177 
178 
179 
180 
181 
182 
COM::Window * _buf
PROP_BEGIN_NAMESPACE const int MAX_LINES
Definition: Propagation_3.h:35
#define PROP_END_NAMESPACE
Definition: propbasic.h:29
void set_verbose(bool b)
Set the verbose level.
static void bound_spherical_disp(const Point_3 &pnt, const Point_3 &org, const double rad_min, const double rad_max, Vector_3 &disp, double eps=0)
COM::Attribute * _cnstr_nodes
void int int REAL REAL * y
Definition: read.cpp:74
static bool check_spherical_bound(const Point_3 &pnt, const Point_3 &org, const double rad_min, const double rad_max, double eps=0)
static bool reached_nodal_bound(const Point_3 &pnt, const double *bnd, double eps=0)
NT dx
#define PROP_BEGIN_NAMESPACE
Definition: propbasic.h:28
COM::Attribute * _cnstr_faces
void determine_constraint_boundary(const COM::Attribute *ctypes_faces, COM::Attribute *ctypes_bndry_edges, COM::Attribute *ctypes_bndry_nodes)
Convert facial or panel constraints to nodal constraints.
static void enforce_nodal_constraint(int type, Vector_3 &du)
Enforce constraint for a specific vector.
virtual double time_stepping(const COM::Attribute *spd, double dt, COM::Attribute *disps, int *smoothed=NULL)=0
Main entry for invoking a surface propagation algorithm.
static void bound_axial_disp(const double x, const double bnd_min, const double bnd_max, double &dx, double eps=0)
Access_Mode
Definition: Manifold_2.h:52
virtual ~Propagation_3()
Definition: Propagation_3.h:47
void convert_constraints(const COM::Attribute *ctypes_faces, COM::Attribute *ctypes_nodes)
Convert facial constraints to nodal constraints.
void bound_facial_speed(COM::Attribute *fa)
COM::Attribute * _cnstr_bound
void set_bounds(const COM::Attribute *bnd)
Set the bounds.
Definition: Propagation_3.C:58
std::vector< COM::Pane * > _panes
Point object that represents a single point.
Definition: datatypedef.h:68
static double square(double x)
virtual void bound_nodal_motion(COM::Attribute *disps)
static bool check_axial_bound(const double x, const double bnd_min, const double bnd_max, double eps=0)
static void bound_radial_disp(const double x, const double y, const double bnd_min, const double bnd_max, double &dx, double &dy, double eps=0)
SURF::Window_manifold_2 Manifold
Definition: propbasic.h:46
virtual void set_constraints(const COM::Attribute *cnstr_types)
Set the types and directions of nodal constraints.
Definition: Propagation_3.C:81
void int int REAL * x
Definition: read.cpp:74
Manifold * _surf
static bool check_radial_bound(const double x, const double y, const double bnd_min, const double bnd_max, double eps=0)
SURF::Access_Mode _mode
COM::Attribute * _cnstr_bndry_edges
NT dy
COM::Attribute * _cnstr_bndry_nodes
static void get_constraint_directions(int type, int &ndirs, Vector_3 dirs[2])
Get orthonormals of the constraints.
virtual void enforce_nodal_constraints(COM::Attribute *du)
Enforces the nodal constraints by projecting motion onto given direction.
Some basic geometric data types.
Definition: mapbasic.h:54
const int BOUND_LEN
Definition: Propagation_3.h:36
This class provides some common primitives used by various propagation algorithms.
Definition: Propagation_3.h:40
static bool in_bounding_box(const Point_3 &pnt, const Point_3 &lb, const Point_3 &ub)