Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Rocprop.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: Rocprop.h,v 1.21 2008/12/06 08:45:27 mtcampbe Exp $
24 
25 #ifndef _ROCPROP_H_
26 #define _ROCPROP_H_
27 
28 #include "propbasic.h"
29 #include "roccom.h"
30 #include "roccom_devel.h"
31 #include "Propagation_3.h"
32 #include "../Rocsurf/include/Rocsurf.h"
33 
35 
37 public:
38  virtual void remesh_serial( Manifold *wm, COM::Attribute *mesh_out,
39  double lave, double fangle)=0;
40 
41  virtual ~Remesher_base() {}
42 };
43 
44 class Rocprop : public SURF::Rocsurf {
45 public:
46  enum { PROP_FO, PROP_MP};
47 
49  Rocprop() : _parent(NULL), _prop(NULL), _win(NULL), _buf(NULL), _rem(NULL),
51  _nrm_dfsn(-1), _feature_layer(-1), _eig_thres(-1),
52  _courant( -1), _fangle_strong(-1),
53  _fangle_weak(-1), _fangle_turn(-1), _verb(0), _cnstr_types(NULL),
54  _cnstr_bound(NULL), _time_lb(1./128), _smoother( -1), _rediter(4),
56 
57  virtual ~Rocprop();
58 
60  void initialize( const COM::Attribute *pmesh,
61  SURF::Rocsurf *rsurf=NULL);
62 
64  void perturb_mesh( COM::Attribute *pmesh, const double &alpha);
65 
69  void set_constraints( const COM::Attribute *cnstr_types);
70 
74  void set_bounds( const COM::Attribute *bnd);
75 
81  void propagate( const COM::Attribute *pmesh,
82  COM::Attribute *vel,
83  const double *dt,
84  COM::Attribute *du,
85  double *dt_elapsed=NULL,
86  int *code=NULL);
87 
89  void set_remesher( void *rem, int *owner=0) {
90  if ( _rem && _rem_owner) delete _rem;
91  _rem = (Remesher_base*)rem;
92  _rem_owner = owner && *owner;
93  }
94 
96  void remesh_serial( COM::Attribute *mesh_out,
97  double *lave=NULL, double *fangle=NULL);
98 
113  void set_option( const char *opt, const char *val);
114 
115  static void load( const std::string &mname);
116 
117  static void unload( const std::string &mname);
118 
119  // Obtain a reference to the manifold.
120  virtual Manifold *manifold()
121  { return _wm?_wm:(_parent?_parent->manifold():NULL); }
122 
123  int validate_object() const {
124  if ( _cookie != PROP_COOKIE) return -1;
125  else return Rocsurf::validate_object();
126  }
127 
128 protected:
129  enum { PROP_COOKIE=7627873};
130 
131  SURF::Rocsurf *_parent; // Parent Rocsurf object
132  Propagation_3 *_prop; // Propagation object
133  COM::Window *_win; // User window.
134  COM::Window *_buf; // A buffer window that clones the
135  // coordinates but use nc and pconn.
136  Remesher_base *_rem; // Base for remeshing
137 
138  int _rem_owner;// Whether Rocprop owns the remesher
140 
141  char _wf_expn; //< Whether expansion is wavefrontal
142  char _wght_scheme; //< Weighting scheme
143  char _nrm_dfsn; //< Whether diffuse normals
144  char _feature_layer; //< Whether to generate feature layer
145  double _eig_thres; //< Threshold for primary-null psace
146  double _courant; //< Constant in front of CFL condition (0<c<1)
147  double _fangle_strong; //< Feature face angle.
148  double _fangle_weak; //< Feature face angle.
149  double _fangle_turn; //< Feature turning angle.
150 
151  int _verb; // Verbose level
152  const COM::Attribute *_cnstr_types;// Types of nodal constraints
153  const COM::Attribute *_cnstr_bound;// cylindrical bound
154 
155  double _time_lb; // Lowerbound of relative time step
156  int _smoother; // Choice of smoother
157  int _rediter; // Redistribution iterations
158  int _conserv; // Whether or not to conserve mass
159  int _rank; // process rank.
160 
161  int _cookie;
162 };
163 
165 
166 #endif // _ROCPROP_H_
167 
168 
169 
170 
171 
172 
char _nrm_dfsn
Definition: Rocprop.h:143
void set_bounds(const COM::Attribute *bnd)
Set the bounds Propagation_3::set_bounds.
Definition: Rocprop.C:101
double _courant
Definition: Rocprop.h:146
here we put it at the!beginning of the common block The point to point and collective!routines know about but MPI_TYPE_STRUCT as yet does not!MPI_STATUS_IGNORE and MPI_STATUSES_IGNORE are similar objects!Until the underlying MPI library implements the C version of these are declared as arrays of MPI_STATUS_SIZE!The types and are OPTIONAL!Their values are zero if they are not available Note that!using these reduces the portability of code(though may enhance!portability between Crays and other systems)!INTEGER MPI_TAG_UB
virtual Manifold * manifold()
Definition: Rocprop.h:120
const COM::Attribute * _cnstr_bound
Definition: Rocprop.h:153
int _conserv
Definition: Rocprop.h:158
#define PROP_END_NAMESPACE
Definition: propbasic.h:29
int _cookie
Definition: Rocprop.h:161
int _verb
Definition: Rocprop.h:151
void perturb_mesh(COM::Attribute *pmesh, const double &alpha)
Perturb the given mesh by alpha times shortest edge length.
Definition: Rocprop.C:85
#define PROP_BEGIN_NAMESPACE
Definition: propbasic.h:28
double _fangle_strong
Definition: Rocprop.h:147
This file contains the prototypes for Roccom API.
void set_constraints(const COM::Attribute *cnstr_types)
Set the types and directions of constraints Propagation_3::set_constraints.
Definition: Rocprop.C:96
char _wf_expn
Definition: Rocprop.h:141
virtual void remesh_serial(Manifold *wm, COM::Attribute *mesh_out, double lave, double fangle)=0
virtual ~Rocprop()
Definition: Rocprop.C:35
void propagate(const COM::Attribute *pmesh, COM::Attribute *vel, const double *dt, COM::Attribute *du, double *dt_elapsed=NULL, int *code=NULL)
Propagates the interface.
Definition: Rocprop.C:106
char _feature_layer
Definition: Rocprop.h:144
int _rank
Definition: Rocprop.h:159
int _prop_method
Definition: Rocprop.h:139
SURF::Window_manifold_2 Manifold
Definition: propbasic.h:46
static void unload(const std::string &mname)
Definition: Rocprop.C:386
double _fangle_turn
Definition: Rocprop.h:149
const COM::Attribute * _cnstr_types
Definition: Rocprop.h:152
Propagation_3 * _prop
Definition: Rocprop.h:132
double _time_lb
Definition: Rocprop.h:155
int _smoother
Definition: Rocprop.h:156
Remesher_base * _rem
Definition: Rocprop.h:136
int _rem_owner
Definition: Rocprop.h:138
virtual ~Remesher_base()
Definition: Rocprop.h:41
void remesh_serial(COM::Attribute *mesh_out, double *lave=NULL, double *fangle=NULL)
Invoke serial remeshing.
Definition: Rocprop.C:307
void set_option(const char *opt, const char *val)
Set options for propagation.
Definition: Rocprop.C:234
int _rediter
Definition: Rocprop.h:157
char _wght_scheme
Definition: Rocprop.h:142
Rocprop()
Defautl constructor.
Definition: Rocprop.h:49
int validate_object() const
Definition: Rocsurf.h:156
COM::Window * _win
Definition: Rocprop.h:133
double _eig_thres
Definition: Rocprop.h:145
int validate_object() const
Definition: Rocprop.h:123
COM::Window * _buf
Definition: Rocprop.h:134
void set_remesher(void *rem, int *owner=0)
Register remesher. Rocprop does not own the remesher.
Definition: Rocprop.h:89
This class provides some common primitives used by various propagation algorithms.
Definition: Propagation_3.h:40
static void load(const std::string &mname)
Definition: Rocprop.C:322
SURF::Rocsurf * _parent
Definition: Rocprop.h:131
double _fangle_weak
Definition: Rocprop.h:148
void initialize(const COM::Attribute *pmesh, SURF::Rocsurf *rsurf=NULL)
Initialize Rocprop with given mesh.
Definition: Rocprop.C:44