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

#include <Rocprop.h>

Inheritance diagram for Rocprop:
Collaboration diagram for Rocprop:

Public Types

enum  { PROP_FO, PROP_MP }
 

Public Member Functions

 Rocprop ()
 Defautl constructor. More...
 
virtual ~Rocprop ()
 
void initialize (const COM::Attribute *pmesh, SURF::Rocsurf *rsurf=NULL)
 Initialize Rocprop with given mesh. More...
 
void perturb_mesh (COM::Attribute *pmesh, const double &alpha)
 Perturb the given mesh by alpha times shortest edge length. More...
 
void set_constraints (const COM::Attribute *cnstr_types)
 Set the types and directions of constraints Propagation_3::set_constraints. More...
 
void set_bounds (const COM::Attribute *bnd)
 Set the bounds Propagation_3::set_bounds. More...
 
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. More...
 
void set_remesher (void *rem, int *owner=0)
 Register remesher. Rocprop does not own the remesher. More...
 
void remesh_serial (COM::Attribute *mesh_out, double *lave=NULL, double *fangle=NULL)
 Invoke serial remeshing. More...
 
void set_option (const char *opt, const char *val)
 Set options for propagation. More...
 
virtual Manifoldmanifold ()
 
int validate_object () const
 

Static Public Member Functions

static void load (const std::string &mname)
 
static void unload (const std::string &mname)
 

Protected Types

enum  { PROP_COOKIE =7627873 }
 

Protected Attributes

SURF::Rocsurf * _parent
 
Propagation_3_prop
 
COM::Window * _win
 
COM::Window * _buf
 
Remesher_base_rem
 
int _rem_owner
 
int _prop_method
 
char _wf_expn
 
char _wght_scheme
 
char _nrm_dfsn
 
char _feature_layer
 
double _eig_thres
 
double _courant
 
double _fangle_strong
 
double _fangle_weak
 
double _fangle_turn
 
int _verb
 
const COM::Attribute * _cnstr_types
 
const COM::Attribute * _cnstr_bound
 
double _time_lb
 
int _smoother
 
int _rediter
 
int _conserv
 
int _rank
 
int _cookie
 

Detailed Description

Definition at line 44 of file Rocprop.h.

Member Enumeration Documentation

anonymous enum
Enumerator
PROP_FO 
PROP_MP 

Definition at line 46 of file Rocprop.h.

anonymous enum
protected
Enumerator
PROP_COOKIE 

Definition at line 129 of file Rocprop.h.

129 { PROP_COOKIE=7627873};

Constructor & Destructor Documentation

Rocprop ( )
inline

Defautl constructor.

Definition at line 49 of file Rocprop.h.

49  : _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),
char _nrm_dfsn
Definition: Rocprop.h:143
double _courant
Definition: Rocprop.h:146
const COM::Attribute * _cnstr_bound
Definition: Rocprop.h:153
int _conserv
Definition: Rocprop.h:158
int _cookie
Definition: Rocprop.h:161
int _verb
Definition: Rocprop.h:151
double _fangle_strong
Definition: Rocprop.h:147
char _wf_expn
Definition: Rocprop.h:141
char _feature_layer
Definition: Rocprop.h:144
int _prop_method
Definition: Rocprop.h:139
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 _rediter
Definition: Rocprop.h:157
char _wght_scheme
Definition: Rocprop.h:142
COM::Window * _win
Definition: Rocprop.h:133
double _eig_thres
Definition: Rocprop.h:145
COM::Window * _buf
Definition: Rocprop.h:134
SURF::Rocsurf * _parent
Definition: Rocprop.h:131
double _fangle_weak
Definition: Rocprop.h:148
~Rocprop ( )
virtual

Definition at line 35 of file Rocprop.C.

35  {
36  // Delete Window_manifold_2, Window, and Propagation_3 objects.
37  if ( _wm) { delete _wm; _wm = NULL; }
38  if ( _buf){ delete _buf; _buf = NULL; }
39 
40  if ( _prop) { delete _prop; _prop = NULL; }
41  if ( _rem && _rem_owner) { delete _rem; _rem = NULL; }
42 }
Propagation_3 * _prop
Definition: Rocprop.h:132
Remesher_base * _rem
Definition: Rocprop.h:136
int _rem_owner
Definition: Rocprop.h:138
COM::Window * _buf
Definition: Rocprop.h:134

Member Function Documentation

void initialize ( const COM::Attribute *  pmesh,
SURF::Rocsurf *  rsurf = NULL 
)

Initialize Rocprop with given mesh.

Definition at line 44 of file Rocprop.C.

References COM_assertion_msg, COM_CONN, COM_NC, COM_PCONN, COMMPI_Comm_rank(), COMMPI_Initialized(), and Rocsurf::initialize().

Referenced by load().

45 {
46  COM_assertion_msg( validate_object()==0, "Invalid object");
47  COM_assertion_msg( pmesh, "Mesh must be present");
48 
49  _win = const_cast<COM::Window*>(pmesh->window());
50  _parent = rsurf;
51 
52  MPI_Comm comm = _win->get_communicator();
54  else _rank = 0;
55 
56  if ( _parent==NULL) {
57  // Initialize the superclass
58  Rocsurf::initialize( pmesh);
59  }
60  else {
61  // If has a parent, then use the Window_manifold_2 of parent
62  // and clear up this object's Window_manifold_2 if created.
63  if ( _wm) { delete _wm; _wm = NULL; }
64  COM_assertion_msg(rsurf->manifold(), "Manifold of parent must exist");
65  }
66 
67  // Delete propagation object
68  if ( _prop) { delete _prop; _prop = NULL; }
69 
70  // Create a buffer window to clone the coordinates but use nc and pconn.
71  if ( _buf) delete _buf;
72  _buf = new COM::Window( _win->name()+"-propbuffer", comm);
73  _buf->inherit( _win->attribute( COM::COM_CONN), "",
74  COM::Pane::INHERIT_USE, true, NULL, 0);
75  _buf->inherit( _win->attribute( COM::COM_NC), "",
76  COM::Pane::INHERIT_USE, true, NULL, 0);
77  _buf->inherit( _win->attribute( COM::COM_NC), "oldnc",
78  COM::Pane::INHERIT_CLONE, true, NULL, 0);
79  _buf->inherit( _win->attribute( COM::COM_PCONN), "",
80  COM::Pane::INHERIT_USE, true, NULL, 0);
81 
82  _buf->init_done();
83 }
int COMMPI_Comm_rank(MPI_Comm c)
Definition: commpi.h:162
#define COM_assertion_msg(EX, msg)
int _rank
Definition: Rocprop.h:159
void initialize(const COM::Attribute *pmesh)
Constructs the communication patterns of a distributed mesh.
Definition: Rocsurf.C:35
Propagation_3 * _prop
Definition: Rocprop.h:132
COM::Window * _win
Definition: Rocprop.h:133
int COMMPI_Initialized()
Definition: commpi.h:168
int validate_object() const
Definition: Rocprop.h:123
COM::Window * _buf
Definition: Rocprop.h:134
SURF::Rocsurf * _parent
Definition: Rocprop.h:131

Here is the call graph for this function:

Here is the caller graph for this function:

void load ( const std::string &  mname)
static

Definition at line 322 of file Rocprop.C.

References COM_DOUBLE, COM_INT, COM_METADATA, COM_new_attribute(), COM_new_window(), COM_RAWDATA, COM_set_member_function(), COM_set_object(), COM_STRING, COM_VOID, COM_window_init_done(), Rocsurf::compute_edge_lengths(), initialize(), perturb_mesh(), propagate(), remesh_serial(), set_bounds(), set_constraints(), set_option(), and set_remesher().

Referenced by Rocprop_load_module(), rocprop_load_module(), ROCPROP_LOAD_MODULE(), rocprop_load_module_(), and ROCPROP_LOAD_MODULE_().

322  {
323  Rocprop *rp = new Rocprop();
324 
325  COM_new_window( mname.c_str());
326 
327  std::string glb=mname+".global";
328 
329  COM_new_attribute( glb.c_str(), 'w', COM_VOID, 1, "");
330  COM_set_object( glb.c_str(), 0, rp);
331 
332  COM_Type types[7];
333  types[0] = types[2] = COM_RAWDATA; types[1] = COM_METADATA;
334  COM_set_member_function( (mname+".initialize").c_str(),
335  (Member_func_ptr)(&Rocprop::initialize),
336  glb.c_str(), "biB", types);
337 
338  COM_set_member_function( (mname+".set_constraints").c_str(),
339  (Member_func_ptr)(&Rocprop::set_constraints),
340  glb.c_str(), "bi", types);
341 
342  COM_set_member_function( (mname+".set_bounds").c_str(),
343  (Member_func_ptr)(&Rocprop::set_bounds),
344  glb.c_str(), "bi", types);
345 
346  types[2] = COM_DOUBLE;
347  COM_set_member_function( (mname+".perturb_mesh").c_str(),
348  (Member_func_ptr)(&Rocprop::perturb_mesh),
349  glb.c_str(), "bbi", types);
350 
351  types[2] = types[4] = COM_METADATA; types[3] = types[5] = COM_DOUBLE;
352  types[6]=COM_INT;
353  COM_set_member_function( (mname+".propagate").c_str(),
354  (Member_func_ptr)(&Rocprop::propagate),
355  glb.c_str(), "bibioOO", types);
356 
357  types[1] = types[2] = COM_STRING;
358  COM_set_member_function( (mname+".set_option").c_str(),
359  (Member_func_ptr)(&Rocprop::set_option),
360  glb.c_str(), "bii", types);
361 
362  types[1] = COM_METADATA; types[2] = types[3] = COM_DOUBLE;
363  COM_set_member_function( (mname+".remesh_serial").c_str(),
364  (Member_func_ptr)(&Rocprop::remesh_serial),
365  glb.c_str(), "boII", types);
366 
367  types[1] = COM_VOID; types[2] = COM_INT;
368  COM_set_member_function( (mname+".set_remesher").c_str(),
369  (Member_func_ptr)(&Rocprop::set_remesher),
370  glb.c_str(), "biI", types);
371 
372  // Register inherited member functions from Rocsurf.
373  std::string glb_surf=mname+".global_surf";
374  Rocsurf *surf = rp;
375  COM_new_attribute( glb_surf.c_str(), 'w', COM_VOID, 1, "");
376  COM_set_object( glb_surf.c_str(), 0, surf);
377 
378  types[1] = types[2] = types[3] = COM_DOUBLE;
379  COM_set_member_function( (mname+".compute_edge_lengths").c_str(),
380  (Member_func_ptr)(&Rocsurf::compute_edge_lengths),
381  glb_surf.c_str(), "boOO", types);
382 
383  COM_window_init_done( mname.c_str());
384 }
void set_bounds(const COM::Attribute *bnd)
Set the bounds Propagation_3::set_bounds.
Definition: Rocprop.C:101
int COM_Type
Indices for derived data types.
Definition: roccom_basic.h:122
void perturb_mesh(COM::Attribute *pmesh, const double &alpha)
Perturb the given mesh by alpha times shortest edge length.
Definition: Rocprop.C:85
void set_constraints(const COM::Attribute *cnstr_types)
Set the types and directions of constraints Propagation_3::set_constraints.
Definition: Rocprop.C:96
void COM_set_object(const char *wa_str, int pane_id, Type *addr)
Definition: roccom_c++.h:144
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
void COM_window_init_done(const char *w_str, int pane_changed=true)
Definition: roccom_c++.h:102
void COM_new_window(const char *wname, MPI_Comm c=MPI_COMM_NULL)
Definition: roccom_c++.h:86
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
Rocprop()
Defautl constructor.
Definition: Rocprop.h:49
void compute_edge_lengths(double *lave, double *lmin, double *lmax)
Computes edge lengths of a given window.
Definition: Rocsurf.C:87
void COM_new_attribute(const char *wa_str, const char loc, const int type, int ncomp, const char *unit)
Registering an attribute type.
Definition: roccom_c++.h:118
void COM_set_member_function(const char *wf_str, Member_func_ptr func, const char *wa_str, const char *intents, const COM_Type *types)
Definition: roccom_c++.h:330
void set_remesher(void *rem, int *owner=0)
Register remesher. Rocprop does not own the remesher.
Definition: Rocprop.h:89
void initialize(const COM::Attribute *pmesh, SURF::Rocsurf *rsurf=NULL)
Initialize Rocprop with given mesh.
Definition: Rocprop.C:44

Here is the call graph for this function:

Here is the caller graph for this function:

virtual Manifold* manifold ( )
inlinevirtual

Definition at line 120 of file Rocprop.h.

References _parent.

121  { return _wm?_wm:(_parent?_parent->manifold():NULL); }
SURF::Rocsurf * _parent
Definition: Rocprop.h:131
void perturb_mesh ( COM::Attribute *  pmesh,
const double &  alpha 
)

Perturb the given mesh by alpha times shortest edge length.

Definition at line 85 of file Rocprop.C.

References COM_assertion_msg.

Referenced by load().

85  {
86  COM_assertion_msg( validate_object()==0, "Invalid object");
87 
88  // If Rocprop is not yet initialized, call the initialization routine.
89  SURF::Window_manifold_2 *wm = manifold();
90  if ( wm == NULL)
91  { initialize( pmesh, _parent); wm = manifold(); }
92 
93  wm->perturb_mesh( alpha);
94 }
virtual Manifold * manifold()
Definition: Rocprop.h:120
#define COM_assertion_msg(EX, msg)
int validate_object() const
Definition: Rocprop.h:123
SURF::Rocsurf * _parent
Definition: Rocprop.h:131
void initialize(const COM::Attribute *pmesh, SURF::Rocsurf *rsurf=NULL)
Initialize Rocprop with given mesh.
Definition: Rocprop.C:44

Here is the caller graph for this function:

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.

This function subcycles until it reachs given time step or sub-time-step becomes too small. If the time step became too small, then abort if code is NULL, or return -1 if code is not NULL.

Definition at line 106 of file Rocprop.C.

References Rocblas::add(), COM_assertion, COM_assertion_msg, COM_NC, Rocblas::copy(), i, and Rocblas::sub().

Referenced by load().

112 {
113  COM_assertion_msg( validate_object()==0, "Invalid object");
114 
115  // If Rocprop is not yet initialized, call the initialization routine.
116  SURF::Window_manifold_2 *wm = manifold();
117  if ( wm == NULL)
118  { initialize( pmesh, _parent); wm = manifold(); }
119 
120  COM_assertion_msg( pmesh->window() == _win,
121  "Rocprop was initialized for a different window");
122 
123  // If the propagation object is not yet created, create a default one.
124  if ( _prop == NULL) {
125  if ( _prop_method == PROP_FO)
126  _prop = new FaceOffset_3( wm, _buf);
127  else
128  _prop = new MarkerParticles_3( wm, _buf);
129  }
130 
131  // Save the coordinates into buffers
132  COM::Attribute *nc = _buf->attribute( COM::COM_NC);
133  COM::Attribute *oldnc = _buf->attribute( "oldnc");
134  Rocblas::copy( nc, oldnc);
135 
136  // Initialize constraints
140 
141  // Set tolerance for eigenvalues.
142  if ( _prop_method == PROP_FO) {
143  if ( _eig_thres>=0)
144  ((FaceOffset_3*)_prop)->set_eigen_threshold( _eig_thres);
145  if ( _courant>=0)
146  ((FaceOffset_3*)_prop)->set_courant_constant( _courant);
147  if ( _fangle_strong>=0)
148  ((FaceOffset_3*)_prop)->set_fangle_strong( _fangle_strong);
149  if ( _fangle_weak>=0)
150  ((FaceOffset_3*)_prop)->set_fangle_weak( _fangle_weak);
151  if ( _fangle_turn>=0)
152  ((FaceOffset_3*)_prop)->set_fangle_turn( _fangle_turn);
153  if ( _wf_expn>=0)
154  ((FaceOffset_3*)_prop)->set_wavefrontal_expansion( _wf_expn);
155  if ( _nrm_dfsn>=0)
156  ((FaceOffset_3*)_prop)->set_normal_diffusion( _nrm_dfsn);
157  if ( _feature_layer>=0)
158  ((FaceOffset_3*)_prop)->set_feature_layer( _feature_layer);
159  if ( _wght_scheme>=0)
160  ((FaceOffset_3*)_prop)->set_weighting_scheme( _wght_scheme);
161  if ( _smoother>=0)
162  ((FaceOffset_3*)_prop)->set_smoother( _smoother);
163  if ( _conserv>=0)
164  ((FaceOffset_3*)_prop)->set_conserve( _conserv);
165  }
166 
167  COM::Attribute *spd = spds_io ?
168  _buf->inherit( spds_io, "rpr_spd_buf",
169  COM::Pane::INHERIT_USE, true, NULL, 0) : NULL;
170  _buf->init_done( false);
171 
172  // Subcycle to take small time steps
173  double t = 0, t_rem = *dt;
174  while ( t_rem > 0 || *dt==0) {
175  // Time stepping
176  int smoothed=(_rediter>0);
177  double max_dt = _prop->time_stepping( spd, t_rem, du, &smoothed);
178 
179  if ( _verb && _rank==0)
180  std::cout << "Rocprop: Subcycling with time step " << max_dt << std::endl;
181 
182  t = *dt - (t_rem-max_dt);
183  t_rem = *dt - t;
184 
185  if ( t_rem > 0 && max_dt < *dt * _time_lb) {
186  // If code is present, then set it to nonzero value
187  // if time step is large.
188  if ( code) {
189  *code = -1;
190  std::cerr << "Rocprop: Given time step could not be reached" << std::endl;
191  break;
192  }
193  else if ( dt_elapsed==NULL) {
194  std::cerr << "Rocprop: Time step is smaller than the lower bound "
195  << *dt*_time_lb << '=' << *dt << '*' << _time_lb
196  << "\nMesh is too distorted. Stopping..." << std::endl;
197  COM_assertion( max_dt >= *dt * _time_lb); abort();
198  }
199  }
200  if ( code) *code = 0;
201 
202  // Add the dispments to the current coordinates
203  Rocblas::add( nc, du, nc);
204 
205  // Reset the speed function
206  if ( _cnstr_bound && spd && spd->is_elemental())
207  _prop->bound_facial_speed( spd);
208 
209  // If propagation method is face offsetting, then perform mesh smoothing
210  // by face offsetting with time step equal to 0.
211  if ( _prop_method == PROP_FO) {
212  for ( int i=smoothed; i<_rediter; ++i) {
213  if ( _verb && _rank==0)
214  std::cout << "Rocprop: Perform additional mesh smoothing" << std::endl;
215  _prop->time_stepping( NULL, 0, du, NULL);
216  Rocblas::add( nc, du, nc);
217  }
218  }
219 
220  // If user request for elapsed time, then do not subcycle.
221  if ( dt_elapsed) { *dt_elapsed = t; break; }
222  else if ( *dt==0) break;
223  }
224 
225  // Compute displacements and recover the original coordinates
226  Rocblas::sub( nc, oldnc, du);
227  Rocblas::copy( oldnc, nc);
228 
229  // Deallocate spds_buf
230  if ( spd) _buf->delete_attribute( spd->name());
231  _buf->init_done( false);
232 }
char _nrm_dfsn
Definition: Rocprop.h:143
static void sub(const Attribute *x, const Attribute *y, Attribute *z)
Operation wrapper for subtraction.
Definition: op3args.C:237
#define COM_assertion(EX)
Error checking utility similar to the assert macro of the C language.
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
int _verb
Definition: Rocprop.h:151
void set_verbose(bool b)
Set the verbose level.
#define COM_assertion_msg(EX, msg)
double _fangle_strong
Definition: Rocprop.h:147
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.
char _wf_expn
Definition: Rocprop.h:141
void bound_facial_speed(COM::Attribute *fa)
char _feature_layer
Definition: Rocprop.h:144
void set_bounds(const COM::Attribute *bnd)
Set the bounds.
Definition: Propagation_3.C:58
int _rank
Definition: Rocprop.h:159
int _prop_method
Definition: Rocprop.h:139
static void add(const Attribute *x, const Attribute *y, Attribute *z)
Operation wrapper for addition.
Definition: op3args.C:221
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
blockLoc i
Definition: read.cpp:79
virtual void set_constraints(const COM::Attribute *cnstr_types)
Set the types and directions of nodal constraints.
Definition: Propagation_3.C:81
int _smoother
Definition: Rocprop.h:156
int _rediter
Definition: Rocprop.h:157
char _wght_scheme
Definition: Rocprop.h:142
static void copy(const Attribute *x, Attribute *y)
Wrapper for copy.
Definition: op2args.C:333
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
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

Here is the call graph for this function:

Here is the caller graph for this function:

void remesh_serial ( COM::Attribute *  mesh_out,
double *  lave = NULL,
double *  fangle = NULL 
)

Invoke serial remeshing.

Definition at line 307 of file Rocprop.C.

References COM_assertion, COMMPI_Comm_rank(), COMMPI_Initialized(), and MPI_COMM_WORLD.

Referenced by load().

307  {
309 
310  if ( _rem) {
311  double l = lave?*lave:0.;
312  if ( l==0) compute_edge_lengths( &l, NULL, NULL);
313 
314  _rem->remesh_serial( _wm, mesh_out, l, fangle?*fangle:0.);
315  }
316  else {
318  std::cerr << "No remesher was registered" << std::endl;
319  }
320 }
int COMMPI_Comm_rank(MPI_Comm c)
Definition: commpi.h:162
#define COM_assertion(EX)
Error checking utility similar to the assert macro of the C language.
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 MPI_IO INTEGER MPI_BOTTOM INTEGER MPI_DOUBLE_PRECISION INTEGER MPI_LOGICAL INTEGER MPI_2REAL INTEGER MPI_2DOUBLE_COMPLEX INTEGER MPI_LB INTEGER MPI_WTIME_IS_GLOBAL INTEGER MPI_COMM_WORLD
virtual void remesh_serial(Manifold *wm, COM::Attribute *mesh_out, double lave, double fangle)=0
Remesher_base * _rem
Definition: Rocprop.h:136
int COMMPI_Initialized()
Definition: commpi.h:168

Here is the call graph for this function:

Here is the caller graph for this function:

void set_bounds ( const COM::Attribute *  bnd)

Set the bounds Propagation_3::set_bounds.

Definition at line 101 of file Rocprop.C.

References COM_assertion_msg.

Referenced by load().

101  {
102  COM_assertion_msg( validate_object()==0, "Invalid object");
103  _cnstr_bound = bnd;
104 }
const COM::Attribute * _cnstr_bound
Definition: Rocprop.h:153
#define COM_assertion_msg(EX, msg)
int validate_object() const
Definition: Rocprop.h:123

Here is the caller graph for this function:

void set_constraints ( const COM::Attribute *  cnstr_types)

Set the types and directions of constraints Propagation_3::set_constraints.

Definition at line 96 of file Rocprop.C.

References COM_assertion_msg.

Referenced by load().

96  {
97  COM_assertion_msg( validate_object()==0, "Invalid object");
98  _cnstr_types = cnstr_types;
99 }
#define COM_assertion_msg(EX, msg)
const COM::Attribute * _cnstr_types
Definition: Rocprop.h:152
int validate_object() const
Definition: Rocprop.h:123

Here is the caller graph for this function:

void set_option ( const char *  opt,
const char *  val 
)

Set options for propagation.

The options supported are: "method": "mp" (marker particles, default), "fo" (face offsetting) "wavefrontal": 0 or 1 (for true or false) "weight": weighting scheme "eigthres": encoding relative threshold for null space. "dirthres": encoding relative threshold for tangent space. "courant": encoding courant constant (between 0 and 1) "fangle": feature face angle, between 0 and 180. "fmode": "auto" (propagate calls f-d automatically), and "manual" "smoother": mesh smoother. "rediter": redistribution iterations. "verbose": verbose level.

Definition at line 234 of file Rocprop.C.

References cimg_library::cimg::atof(), COM_assertion, COM_assertion_msg, cimg_library::cimg::option(), SMOOTHER_ANGLE_WEIGHTED_CENTROID, SMOOTHER_ANISOTROPIC, SMOOTHER_LAPLACIAN, and SMOOTHER_NONE.

Referenced by load().

235 {
236  COM_assertion_msg( validate_object()==0, "Invalid object");
237 
238  std::string option;
239  if ( opt) option = opt;
240 
241  if ( option == "method") {
242  std::string value(val);
243  int old_method = _prop_method;
244 
245  if ( value == "fo") // Face offsetting
247  else
248  _prop_method = PROP_MP; // Marker particle
249 
250  // Remove old object if method is changed.
251  if ( _prop_method != old_method && _prop)
252  { delete _prop; _prop=NULL; }
253  }
254  else if ( option == "eigthres") {
255  _eig_thres = std::atof( val);
256  }
257  else if ( option == "smoother") {
258  std::string value(val);
259  if ( value == "none")
261  else if ( value == "centroid")
263  else if ( value == "anisotropic")
265  else {
266  COM_assertion( value == "Laplacian" || value == "laplacian");
268  }
269  }
270  else if ( option == "rediter") {
271  _rediter = std::atoi( val);
272  }
273  else if ( option == "conserv") {
274  _conserv = std::atoi( val);
275  }
276  else if ( option == "courant") {
277  _courant = std::atof( val);
278  }
279  else if ( option == "wavefrontal") {
280  _wf_expn = std::atoi( val);
281  }
282  else if ( option == "weight") {
283  _wght_scheme = std::atoi( val);
284  }
285  else if ( option == "normaldif") {
286  _nrm_dfsn = std::atoi( val);
287  }
288  else if ( option == "feature_layer") {
289  _feature_layer = std::atoi( val);
290  }
291  else if ( option == "sangle" || option == "fangle_strong") {
292  _fangle_strong = std::atof( val);
293  }
294  else if ( option == "fangle" || option=="fangle_weak") {
295  _fangle_weak = std::atof( val);
296  }
297  else if ( option == "tangle" || option == "fangle_tun") {
298  _fangle_turn = std::atof( val);
299  }
300  else if ( option == "verbose")
301  _verb = atoi( val);
302  else
303  COM_assertion_msg( false, (std::string("Unknown option ")+option).c_str());
304 }
char _nrm_dfsn
Definition: Rocprop.h:143
#define COM_assertion(EX)
Error checking utility similar to the assert macro of the C language.
double _courant
Definition: Rocprop.h:146
int _conserv
Definition: Rocprop.h:158
int _verb
Definition: Rocprop.h:151
const char * option(const char *const name, const int argc, const char *const *const argv, const char *defaut, const char *const usage=0)
Definition: CImg.h:5604
#define COM_assertion_msg(EX, msg)
double _fangle_strong
Definition: Rocprop.h:147
char _wf_expn
Definition: Rocprop.h:141
char _feature_layer
Definition: Rocprop.h:144
float atof(const char *const str)
Read a float number from a C-string.
Definition: CImg.h:4905
int _prop_method
Definition: Rocprop.h:139
double _fangle_turn
Definition: Rocprop.h:149
Propagation_3 * _prop
Definition: Rocprop.h:132
int _smoother
Definition: Rocprop.h:156
int _rediter
Definition: Rocprop.h:157
char _wght_scheme
Definition: Rocprop.h:142
double _eig_thres
Definition: Rocprop.h:145
int validate_object() const
Definition: Rocprop.h:123
double _fangle_weak
Definition: Rocprop.h:148

Here is the call graph for this function:

Here is the caller graph for this function:

void set_remesher ( void *  rem,
int *  owner = 0 
)
inline

Register remesher. Rocprop does not own the remesher.

Definition at line 89 of file Rocprop.h.

References _rem, and _rem_owner.

Referenced by load().

89  {
90  if ( _rem && _rem_owner) delete _rem;
91  _rem = (Remesher_base*)rem;
92  _rem_owner = owner && *owner;
93  }
Remesher_base * _rem
Definition: Rocprop.h:136
int _rem_owner
Definition: Rocprop.h:138

Here is the caller graph for this function:

void unload ( const std::string &  mname)
static

Definition at line 386 of file Rocprop.C.

References COM_assertion_msg, COM_delete_window(), COM_get_object(), and validate_object().

Referenced by Rocprop_unload_module(), rocprop_unload_module(), ROCPROP_UNLOAD_MODULE(), rocprop_unload_module_(), and ROCPROP_UNLOAD_MODULE_().

386  {
387  Rocprop *rp;
388  std::string glb=mname+".global";
389 
390  COM_get_object( glb.c_str(), 0, &rp);
391 
392  COM_assertion_msg( rp->validate_object()==0, "Invalid object");
393 
394  delete rp;
395  COM_delete_window( mname.c_str());
396 }
void COM_delete_window(const char *wname)
Definition: roccom_c++.h:94
#define COM_assertion_msg(EX, msg)
void COM_get_object(const char *wa_str, int pane_id, Type **addr)
Definition: roccom_c++.h:152
int validate_object() const
Definition: Rocprop.h:123

Here is the call graph for this function:

Here is the caller graph for this function:

int validate_object ( ) const
inline

Definition at line 123 of file Rocprop.h.

References _cookie, PROP_COOKIE, and Rocsurf::validate_object().

Referenced by unload().

123  {
124  if ( _cookie != PROP_COOKIE) return -1;
125  else return Rocsurf::validate_object();
126  }
int _cookie
Definition: Rocprop.h:161
int validate_object() const
Definition: Rocsurf.h:156

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

COM::Window* _buf
protected

Definition at line 134 of file Rocprop.h.

const COM::Attribute* _cnstr_bound
protected

Definition at line 153 of file Rocprop.h.

const COM::Attribute* _cnstr_types
protected

Definition at line 152 of file Rocprop.h.

int _conserv
protected

Definition at line 158 of file Rocprop.h.

int _cookie
protected

Definition at line 161 of file Rocprop.h.

Referenced by validate_object().

double _courant
protected

Definition at line 146 of file Rocprop.h.

double _eig_thres
protected

Definition at line 145 of file Rocprop.h.

double _fangle_strong
protected

Definition at line 147 of file Rocprop.h.

double _fangle_turn
protected

Definition at line 149 of file Rocprop.h.

double _fangle_weak
protected

Definition at line 148 of file Rocprop.h.

char _feature_layer
protected

Definition at line 144 of file Rocprop.h.

char _nrm_dfsn
protected

Definition at line 143 of file Rocprop.h.

SURF::Rocsurf* _parent
protected

Definition at line 131 of file Rocprop.h.

Referenced by manifold().

Propagation_3* _prop
protected

Definition at line 132 of file Rocprop.h.

int _prop_method
protected

Definition at line 139 of file Rocprop.h.

int _rank
protected

Definition at line 159 of file Rocprop.h.

int _rediter
protected

Definition at line 157 of file Rocprop.h.

Remesher_base* _rem
protected

Definition at line 136 of file Rocprop.h.

Referenced by set_remesher().

int _rem_owner
protected

Definition at line 138 of file Rocprop.h.

Referenced by set_remesher().

int _smoother
protected

Definition at line 156 of file Rocprop.h.

double _time_lb
protected

Definition at line 155 of file Rocprop.h.

int _verb
protected

Definition at line 151 of file Rocprop.h.

char _wf_expn
protected

Definition at line 141 of file Rocprop.h.

char _wght_scheme
protected

Definition at line 142 of file Rocprop.h.

COM::Window* _win
protected

Definition at line 133 of file Rocprop.h.


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