26 #define USE_STD_INCLUDES 1
27 #define USE_C_PREFIX_INCLUDES 1
29 #include "MeshImpl.hpp"
30 #include "MsqError.hpp"
31 #include "InstructionQueue.hpp"
32 #include "MeshSet.hpp"
33 #include "TerminationCriterion.hpp"
34 #include "QualityAssessor.hpp"
35 #include "PlanarDomain.hpp"
36 #include "ShapeImprovementWrapper.hpp"
40 #include "MeanRatioFunctions.hpp"
41 #include "EdgeLengthQualityMetric.hpp"
42 #include "LPtoPTemplate.hpp"
43 #include "FeasibleNewton.hpp"
44 #include "ConjugateGradient.hpp"
48 using namespace Mesquite;
69 #define NO_STRINGSTREAM 1
78 using MAP::Pane_connectivity;
79 using MAP::Pane_communicator;
86 print_legible(0,
"Entering Rocmop::~Rocmop");
93 for(
int i =0,
ni=_dcs.size();
i<
ni; ++
i){
97 print_legible(1,
"Exiting Rocmop::~Rocmop");
112 std::getline(Inf,line);
113 while((line.empty() || line[0] ==
' ' || line[0] == noop) && Inf)
114 std::getline(Inf,line);
125 Inf.open(cfname.c_str());
138 std::cerr <<
"Rocmop: Warning: Could not open configfile, "
139 << cfname <<
"." << std::endl;
144 std::istringstream Istr;
160 if(verbosity < 0 || verbosity > 10){
161 std::cerr <<
"Rocmop: Warning: Invalid verbosity from configfile. "
162 <<
"Giving up on " << cfname <<
"." << std::endl;
168 if (rank==0 && _verb){
169 std::cout <<
"Rocmop: Found configfile, " << cfname <<
"." << std::endl
170 <<
"Rocmop: Setting verbosity to " << _verb <<
"." << std::endl;
178 if(_method < 0 || _method > SMOOTH_NONE){
179 std::cerr <<
"Rocmop: Warning: Invalid smoothing method from configfile. "
180 <<
"Giving up on " << cfname <<
"." << std::endl;
185 if (rank==0 && _verb){
186 std::cout <<
"Rocmop: Setting method to "
187 << (_method == SMOOTH_VOL_MESQ_WG ?
"SMOOTH_VOL_MESQ_WG" :
188 (_method == SMOOTH_VOL_MESQ_NG ?
"SMOOTH_VOL_MESQ_NG" :
189 (_method == SMOOTH_SURF_MEDIAL ?
"SMOOTH_SURF_MEDIAL" :
190 "SMOOTH_NONE"))) <<
"." << std::endl;
201 if (rank==0 && _verb){
202 std::cout <<
"Rocmop: Setting lazy to " << _lazy <<
"." << std::endl;
208 #if ! NO_STRINGSTREAM
213 sscanf(line.c_str(),
"%f", &tol);
215 if(tol < 0. || tol > 180.){
216 std::cerr <<
"Rocmop: Warning: Invalid dihedral angle tolerance"
217 <<
" from configfile. "
218 <<
"Giving up on " << cfname <<
"." << std::endl;
223 if (rank==0 && _verb){
224 std::cout <<
"Rocmop: Setting tolerance to " << _tol <<
"." << std::endl;
230 #if ! NO_STRINGSTREAM
235 sscanf(line.c_str(),
"%f", &max_disp);
237 if(max_disp < 0. || max_disp > 10.0){
238 std::cerr <<
"Rocmop: Warning: Invalid displacement constraint from configfile. "
239 <<
"Giving up on " << cfname <<
"." << std::endl;
244 if (rank==0 && _verb){
245 std::cout <<
"Rocmop: Setting displacement constraint to "
246 << _maxdisp <<
"." << std::endl;
254 if(_smoothfreq <= 0 || _method == SMOOTH_NONE)
256 if (rank==0 && _verb){
257 if(_method == SMOOTH_NONE){
258 std::cout <<
"Rocmop: No method selected, setting N to 0"
259 <<
", disabling smoothing." << std::endl;
262 std::cout <<
"Rocmop: Setting N to " << _smoothfreq
263 << (_smoothfreq==0 ?
", disabling smoothing." :
".")
271 #if ! NO_STRINGSTREAM
273 Istr >> _disp_thresh;
276 sscanf(line.c_str(),
"%f", &_disp_thresh);
278 if(_disp_thresh < 0.0)
280 else if ((_smoothfreq > 1) && (_disp_thresh > 0.0) ){
283 std::cout <<
"Rocmop: WARNING: N reset to 1 to enable displacement thresholding."
286 if (rank==0 && _verb){
287 std::cout <<
"Rocmop: Setting displacement threshold to "
288 << _disp_thresh <<
"." << std::endl;
308 std::string glb=mname+
".global";
320 glb.c_str(),
"biB", types);
324 glb.c_str(),
"bb", types);
330 glb.c_str(),
"bii", types);
337 glb.c_str(),
"bbB", types);
347 std::string glb=mname+
".global";
360 Profile_begin(
"Rocmop::check_disp");
363 int disp_id = w_disp->id();
364 double max_norm = 0.0;
370 std::vector<Pane*> allpanes;
371 const_cast<COM::Window*
>(_usr_window)->panes(allpanes);
374 for(
int i=0,
ni = allpanes.size();
i<
ni; ++
i){
377 COM::Attribute* ptr_att = allpanes[
i]->attribute(disp_id);
378 void* void_ptr = ptr_att->pointer();
381 for(
int j=0,
nj = allpanes[
i]->size_of_real_nodes();
j<
nj; ++
j){
396 agree_double(max_norm,
MPI_MAX);
399 disp_tally += max_norm;
402 std::ostringstream Ostr;
403 Ostr <<
"Mesh Displacement: " << disp_tally;
406 if(disp_tally > _disp_thresh){
410 print_legible(0,Ostr.str().c_str());
415 print_legible(1,Ostr.str().c_str());
418 Profile_end(
"Rocmop::check_disp");
429 Profile_begin(
"Rocmop::zero_disp");
432 int disp_id = w_disp->id();
433 std::vector<Pane*> allpanes;
434 const_cast<COM::Window*
>(_usr_window)->panes(allpanes);
436 for(
int i=0,
ni = allpanes.size();
i<
ni; ++
i){
438 COM::Attribute* ptr_att = allpanes[
i]->attribute(disp_id);
439 void* void_ptr = ptr_att->pointer();
441 for(
int j=0,
nj = allpanes[
i]->size_of_real_nodes();
j<
nj; ++
j){
449 Profile_end(
"Rocmop::zero_disp");
455 COM::Attribute *buf_att){
457 COM::Window* usr_window = usr_att->window();
458 COM::Window* buf_window = NULL;
460 bool del_buffer =
false;
465 std::string buf_name(usr_window->name()+
"-Rocmop_add_aspect");
466 buf_window =
new COM::Window(buf_name,
467 usr_window->get_communicator());
468 buf_window->inherit( usr_att,
"",
469 COM::Pane::INHERIT_CLONE,
true, NULL,0);
470 buf_window->init_done();
473 buf_window = _buf_window;
475 std::vector<Pane*> allpanes;
477 buf_window->panes(allpanes);
480 COM::Attribute * w_buff_R =
481 buf_window->new_attribute(
"Aspect Ratio: R (circumradius)",
'e',
COM_DOUBLE,1,
"");
482 COM::Attribute * w_buff_r =
483 buf_window->new_attribute(
"Aspect Ratio: r (inradius)",
'e',
COM_DOUBLE,1,
"");
484 COM::Attribute * w_buff_l =
485 buf_window->new_attribute(
"Aspect Ratio: l (shortest edge)",
'e',
COM_DOUBLE,1,
"");
486 COM::Attribute * w_buff_rR =
487 buf_window->new_attribute(
"Aspect Ratio: 3r/R",
'e',
COM_DOUBLE,1,
"");
488 COM::Attribute * w_buff_Rr =
489 buf_window->new_attribute(
"Aspect Ratio: R/r",
'e',
COM_DOUBLE,1,
"");
490 COM::Attribute * w_buff_Rl =
491 buf_window->new_attribute(
"Aspect Ratio: R/l",
'e',
COM_DOUBLE,1,
"");
492 COM::Attribute * w_buff_min =
493 buf_window->new_attribute(
"Aspect Ratio: min dih",
'e',
COM_DOUBLE,1,
"");
494 COM::Attribute * w_buff_max =
495 buf_window->new_attribute(
"Aspect Ratio: max dih",
'e',
COM_DOUBLE,1,
"");
497 buf_window->resize_array(w_buff_R,0);
498 buf_window->resize_array(w_buff_r,0);
499 buf_window->resize_array(w_buff_l,0);
500 buf_window->resize_array(w_buff_rR,0);
501 buf_window->resize_array(w_buff_Rr,0);
502 buf_window->resize_array(w_buff_Rl,0);
503 buf_window->resize_array(w_buff_min,0);
504 buf_window->resize_array(w_buff_max,0);
505 buf_window->init_done();
508 int R_id = w_buff_R->id();
509 int r_id = w_buff_r->id();
510 int l_id = w_buff_l->id();
511 int rR_id = w_buff_rR->id();
512 int Rr_id = w_buff_Rr->id();
513 int Rl_id = w_buff_Rl->id();
514 int min_id = w_buff_min->id();
515 int max_id = w_buff_max->id();
518 COM::Attribute * w_usr_R =
519 usr_window->new_attribute(
"Aspect Ratio: R",
'e',
COM_DOUBLE,1,
"");
520 COM::Attribute * w_usr_r =
521 usr_window->new_attribute(
"Aspect Ratio: r",
'e',
COM_DOUBLE,1,
"");
522 COM::Attribute * w_usr_l =
523 usr_window->new_attribute(
"Aspect Ratio: l",
'e',
COM_DOUBLE,1,
"");
524 COM::Attribute * w_usr_rR =
525 usr_window->new_attribute(
"Aspect Ratio: 3r/R",
'e',
COM_DOUBLE,1,
"");
526 COM::Attribute * w_usr_Rr =
527 usr_window->new_attribute(
"Aspect Ratio: R/r",
'e',
COM_DOUBLE,1,
"");
528 COM::Attribute * w_usr_Rl =
529 usr_window->new_attribute(
"Aspect Ratio: R/l",
'e',
COM_DOUBLE,1,
"");
530 COM::Attribute * w_usr_min =
531 usr_window->new_attribute(
"Aspect Ratio: min dih",
'e',
COM_DOUBLE,1,
"");
532 COM::Attribute * w_usr_max =
533 usr_window->new_attribute(
"Aspect Ratio: max dih",
'e',
COM_DOUBLE,1,
"");
535 usr_window->resize_array(w_usr_R,0);
536 usr_window->resize_array(w_usr_r,0);
537 usr_window->resize_array(w_usr_l,0);
538 usr_window->resize_array(w_usr_rR,0);
539 usr_window->resize_array(w_usr_Rr,0);
540 usr_window->resize_array(w_usr_Rl,0);
541 usr_window->resize_array(w_usr_min,0);
542 usr_window->resize_array(w_usr_max,0);
543 usr_window->init_done();
546 double angles[] = {0.0,0.0};
548 for(
int i=0,
ni=(
int)allpanes.size();
i<
ni;++
i){
551 double *R_ptr =
reinterpret_cast<double *
>
552 (allpanes[
i]->attribute(R_id)->pointer());
553 double *r_ptr =
reinterpret_cast<double *
>
554 (allpanes[
i]->attribute(r_id)->pointer());
555 double *l_ptr =
reinterpret_cast<double *
>
556 (allpanes[
i]->attribute(l_id)->pointer());
557 double *rR_ptr =
reinterpret_cast<double *
>
558 (allpanes[
i]->attribute(rR_id)->pointer());
559 double *Rr_ptr =
reinterpret_cast<double *
>
560 (allpanes[
i]->attribute(Rr_id)->pointer());
561 double *Rl_ptr =
reinterpret_cast<double *
>
562 (allpanes[
i]->attribute(Rl_id)->pointer());
563 double *min_ptr =
reinterpret_cast<double *
>
564 (allpanes[
i]->attribute(min_id)->pointer());
565 double *max_ptr =
reinterpret_cast<double *
>
566 (allpanes[
i]->attribute(max_id)->pointer());
568 for(
int j=0,
nj=allpanes[
i]->size_of_elements();
j<
nj;++
j){
570 Element_node_enumerator ene(allpanes[
i],
j+1);
584 "Cannot calculate aspect ratios with zero magnitude circumradius");
585 rR_ptr[
j] = (3.0*r)/R;
587 "Cannot calculate aspect ratios with zero magnitude circumradius");
590 "Cannot calculate aspect ratios with zero magnitude circumradius");
593 min_ptr[
j] = angles[0];
594 max_ptr[
j] = angles[1];
621 COM::Attribute *disp){
628 if (N==-9999) N = (_smoothfreq-1);
636 Profile_begin(
"Rocmop::smooth");
642 int pmesh_id = pmesh->id();
645 "Input to Rocmop::smooth must be a mesh or pmesh attribute.");
646 _is_pmesh = (pmesh_id ==
COM_PMESH) ?
true :
false;
651 if(_buf_window && (_usr_window == pmesh->window()))
664 _usr_window = pmesh->window();
667 std::string buf_name(_usr_window->name()+
"-Rocmopbuf");
668 _buf_window =
new COM::Window(buf_name,
669 _usr_window->get_communicator());
670 _buf_window->inherit( const_cast<COM::Attribute*>(pmesh),
"",
671 COM::Pane::INHERIT_CLONE,
true, NULL, 0);
672 _buf_window->init_done();
675 smoother_specific_init();
680 double mesh_qual = 190.0;
686 std::vector<const Pane*> allpanes;
687 _buf_window->panes(allpanes);
689 mesh_qual = check_all_elem_quality(allpanes);
693 bool exceeded =
true;
694 if(_disp_thresh > 0.0)
695 exceeded = check_displacements(disp);
697 if(exceeded || ((mesh_qual > _tol) && _lazy)){
698 print_legible(0,
"Smoothing...");
700 print_legible(0,
"Smoothing complete.");
702 const COM::Attribute *old_nc = pmesh->window()->attribute(
COM::COM_NC);
703 const COM::Attribute *new_nc =_buf_window->attribute(
COM::COM_NC);
705 constrain_displacements(disp);
708 _usr_window = pmesh->window();
709 zero_displacements(disp);
714 Profile_end(
"Rocmop::smooth");
720 _usr_window = pmesh->window();
721 zero_displacements(disp);
727 Profile_begin(
"Rocmop::smooth_in_place");
731 print_legible(0,
"Entering rocmop::smooth_in_place");
733 int pmesh_id = pmesh->id();
737 "Input to Rocmop::smooth_in_place must be a mesh or pmesh");
741 _usr_window = pmesh->window();
747 _buf_window =
new COM::Window(_usr_window->name()+
"-Rocmopbuf",
748 _usr_window->get_communicator());
749 _buf_window->inherit( const_cast<COM::Attribute*>(pmesh),
"",
750 false,
true, NULL, 0);
751 _buf_window->init_done();
753 std::vector<const Pane*> allpanes;
754 _buf_window->panes(allpanes);
756 double mesh_qual = 190.0;
760 mesh_qual = check_all_elem_quality(allpanes);
762 if (mesh_qual > _tol)
770 print_legible(1,
"Exiting rocmop::smooth_in_place");
772 Profile_end(
"Rocmop::smooth_in_place");
778 Profile_begin(
"Rocmop::perform_smoothing");
780 print_legible(1,
" Entering Rocmop::perform_smoothing");
786 perform_noniterative_smoothing();
787 else if( _method < SMOOTH_NONE)
788 perform_iterative_smoothing();
792 print_legible(1,
" Exiting Rocmop::perform_smoothing");
794 Profile_end(
"Rocmop::perform_smoothing");
801 Profile_begin(
"Rocmop::perform_itersmooth");
804 print_legible(1,
" Entering Rocmop::perform_iterative_smoothing");
808 std::vector<const Pane*> allpanes;
809 _buf_window->panes(allpanes);
813 if(_method==SMOOTH_VOL_MESQ_WG)
814 smooth_vol_mesq_wg();
816 else if(_method==SMOOTH_VOL_MESQ_NG)
817 smooth_vol_mesq_ng();
821 if((_method==SMOOTH_VOL_MESQ_WG) || (_method==SMOOTH_VOL_MESQ_NG))
826 else if(_method==SMOOTH_SURF_MEDIAL)
827 smooth_surf_medial();
831 print_legible(1,
" Exiting Rocmop::perform_iterative_smoothing");
833 Profile_end(
"Rocmop::perform_itersmooth");
839 Profile_begin(
"Rocmop::perform_nonitersmooth");
842 print_legible(1,
" Entering Rocmop::perform_noniterative_smoothing");
845 std::cerr <<
"Although the maximum number of iterations > 1 is selected,\n"
846 <<
"the smoothing method is noniterative, and will run once.\n";
853 print_legible(1,
" Exiting Rocmop::perform_noniterative_smoothing");
855 Profile_end(
"Rocmop::perform_nonitersmooth");
864 Profile_begin(
"Rocmop::perform_smooth_init");
867 print_legible(1,
" Entering Rocmop::smoother_specific_init");
870 if(_wm){
delete _wm; _wm = NULL; }
873 if(_method==SMOOTH_SURF_MEDIAL){
883 case SMOOTH_VOL_MESQ_WG: {
885 determine_shared_border();
890 case SMOOTH_VOL_MESQ_NG: {
893 const std::string surf_attr(
"is_surface");
894 const COM::Attribute *w_is_surface = _usr_window->attribute(surf_attr);
898 "Surface-list must have integer type");
900 "Surface-list must be nodal");
902 "Surface-list must have a single component");
904 "Surface-list must be initialized");
907 COM::Attribute * new_attr =
908 _buf_window->inherit( const_cast<COM::Attribute *>(w_is_surface),
909 surf_attr, COM::Pane::INHERIT_CLONE,
true, NULL, 0);
914 COM::Attribute* w_surf_attr =
915 _buf_window->new_attribute(
"is_surface",
'n',
COM_INT, 1,
"");
916 _buf_window->resize_array( w_surf_attr, 0);
918 determine_physical_border(w_surf_attr);
920 _buf_window->init_done();
927 case SMOOTH_VOL_MESQ_WG:
928 case SMOOTH_VOL_MESQ_NG:
933 case SMOOTH_SURF_MEDIAL: {
936 COM::Attribute* w_disps =
937 _buf_window->new_attribute(
"disps",
'n',
COM_DOUBLE, 3,
"");
938 _buf_window->resize_array( w_disps, 0);
940 COM::Attribute* w_facenormals =
941 _buf_window->new_attribute(
"facenormals",
'e',
COM_DOUBLE, 3,
"");
942 _buf_window->resize_array( w_facenormals, 0);
944 COM::Attribute* w_facecenters =
945 _buf_window->new_attribute(
"facecenters",
'e',
COM_DOUBLE, 3,
"");
946 _buf_window->resize_array( w_facecenters, 0);
948 COM::Attribute* w_eigvalues =
949 _buf_window->new_attribute(
"lambda",
'n',
COM_DOUBLE, 3,
"");
950 _buf_window->resize_array( w_eigvalues, 0);
952 COM::Attribute* w_vnormals =
953 _buf_window->new_attribute(
"vnormals",
'n',
COM_DOUBLE, 3,
"");
954 _buf_window->resize_array( w_vnormals, 0);
956 COM::Attribute* w_awnormals =
957 _buf_window->new_attribute(
"awnormals",
'n',
COM_DOUBLE, 3,
"");
958 _buf_window->resize_array( w_awnormals, 0);
960 COM::Attribute* w_uwnormals =
961 _buf_window->new_attribute(
"uwnormals",
'n',
COM_DOUBLE, 3,
"");
962 _buf_window->resize_array( w_uwnormals, 0);
964 COM::Attribute* w_eigvecs =
965 _buf_window->new_attribute(
"eigvecs",
'n',
COM_DOUBLE, 9,
"");
966 _buf_window->resize_array( w_eigvecs, 0);
968 COM::Attribute* w_tangranks =
969 _buf_window->new_attribute(
"tangranks",
'n',
COM_INT, 1,
"");
970 _buf_window->resize_array( w_tangranks, 0);
972 COM::Attribute* w_cntnranks =
973 _buf_window->new_attribute(
"cntnranks",
'n',
COM_INT, 1,
"");
974 _buf_window->resize_array( w_cntnranks, 0);
976 COM::Attribute* w_cntnvecs =
977 _buf_window->new_attribute(
"cntnvecs",
'n',
COM_DOUBLE, 6,
"");
978 _buf_window->resize_array( w_cntnvecs, 0);
980 COM::Attribute* w_scales =
981 _buf_window->new_attribute(
"scales",
'n',
COM_DOUBLE, 1,
"");
982 _buf_window->resize_array( w_scales, 0);
984 COM::Attribute* w_weights =
985 _buf_window->new_attribute(
"weights",
'n',
COM_DOUBLE, 1,
"");
986 _buf_window->resize_array( w_weights, 0);
988 COM::Attribute* w_weights2 =
989 _buf_window->new_attribute(
"weights2",
'n',
COM_DOUBLE, 1,
"");
990 _buf_window->resize_array( w_weights2, 0);
992 COM::Attribute* w_barycrds =
993 _buf_window->new_attribute(
"barycrds",
'n',
COM_DOUBLE, 2,
"");
994 _buf_window->resize_array( w_barycrds, 0);
996 COM::Attribute* w_PNelemids =
997 _buf_window->new_attribute(
"PNelemids",
'n',
COM_INT, 1,
"");
998 _buf_window->resize_array( w_PNelemids, 0);
1002 COM::Attribute * w_pnt_contrib =
1003 _buf_window->new_attribute(
"pnt_contrib",
'n',
COM_DOUBLE, 3,
"");
1004 _buf_window->resize_array(w_pnt_contrib, 0);
1006 COM::Attribute * w_disp_count =
1007 _buf_window->new_attribute(
"disp_count",
'n',
COM_DOUBLE, 1,
"");
1008 _buf_window->resize_array(w_disp_count, 0);
1010 _buf_window->init_done();
1024 print_legible(1,
" Exiting Rocmop::smoother_specific_init");
1026 Profile_end(
"Rocmop::perform_smooth_init");
1038 "Rocmop::set_value does not except NULL parameters");
1040 if(opt) option = opt;
1041 if ( option ==
"method") {
1043 ,
"Illegal value for 'method' option");
1044 _method = *((
int*)value);
1046 else if ( option ==
"verbose"){
1047 _verb = *((
int*)value); }
1048 else if ( option ==
"lazy"){
1049 _lazy = *((
int*)value); }
1050 else if ( option ==
"tol"){
1052 ,
"Illegal value for 'tol' option");
1053 _tol = *((
float*)value); }
1054 else if ( option ==
"maxdisp"){
1056 ,
"Illegal value for 'maxdisp' option");
1057 _maxdisp = *((
float*)value); }
1058 else if ( option ==
"niter"){
1059 _niter = *((
int*)value); }
1060 else if ( option ==
"ctol"){
1062 ,
"Illegal value for '_ctol' option");
1063 _ctol = *((
float*)value); }
1064 else if ( option ==
"ncycle"){
1065 _ncycle = *((
int*)value); }
1066 else if ( option ==
"inverted"){
1067 _invert = *((
int*)value);
1078 Profile_begin(
"Rocmop::smooth_mesquite");
1084 bool wg = (ghost_level == 0) ?
false :
true;
1089 mp.set_verb(_verb - 4);
1094 Profile_begin(
"Rocmop::Mesquite");
1096 mesh_quality_algorithm.run_instructions(mesh_set1, err);
1098 Profile_end(
"Rocmop::Mesquite");
1103 Profile_end(
"Rocmop::smooth_mesquite");
1108 Pane_communicator pc(att->window(), att->window()->get_communicator());
1110 pc.begin_update_shared_nodes();
1111 pc.reduce_on_shared_nodes(
MPI_SUM);
1112 pc.end_update_shared_nodes();
1117 Profile_begin(
"Rocmop::pane_border");
1120 print_legible(1,
"Entering Rocmop::determine_pane_border");
1122 std::vector<const COM::Pane*> allpanes;
1123 _buf_window->panes(allpanes);
1124 int local_npanes = (int)allpanes.size();
1126 _is_pane_bnd_node.resize(local_npanes);
1127 _is_pane_bnd_elem.resize(local_npanes);
1129 for(
int i=0;
i< local_npanes; ++
i){
1130 int size_of_real_nodes = allpanes[
i]->size_of_real_nodes();
1131 int size_of_real_elems = allpanes[
i]->size_of_real_elements();
1132 _is_pane_bnd_node[
i].resize(size_of_real_nodes,0);
1133 _is_pane_bnd_elem[
i].resize(size_of_real_elems,0);
1135 std::vector<bool> is_isolated;
1136 MAP::Pane_boundary pb (allpanes[
i]);
1137 pb.determine_border_nodes(_is_pane_bnd_node[
i], is_isolated);
1140 mark_elems_from_nodes(_is_pane_bnd_node,_is_pane_bnd_elem);
1142 print_legible(1,
"Exiting Rocmop::determine_pane_border");
1144 Profile_end(
"Rocmop::pane_border");
1151 Profile_begin(
"Rocmop::shared_border");
1154 print_legible(1,
"Entering Rocmop::determine_shared_nodes");
1156 std::vector<const COM::Pane*> allpanes;
1157 _buf_window->panes(allpanes);
1158 int local_npanes = (int)allpanes.size();
1160 _is_shared_node.resize(local_npanes);
1163 for(
int i=0;
i < (int)(local_npanes); ++
i){
1169 _is_shared_node[
i].resize(allpanes[
i]->size_of_real_nodes(),0);
1173 for (
int j=0,
nj=vs_size;
j<
nj;
j+=vs[
j+1]+2) {
1174 if (_buf_window->owner_rank( vs[
j]) >=0) ++count;
1179 for (
int j=0;
j<count; ++
j, index+=vs[index+1]+2) {
1181 while ( _buf_window->owner_rank(vs[index])<0) {
1182 index+=vs[index+1]+2;
1186 for(
int k=0;
k<vs[index+1]; ++
k){
1187 _is_shared_node[
i][vs[index+2+
k]-1] = 1;
1192 mark_elems_from_nodes(_is_shared_node,_is_shared_elem);
1194 print_legible(1,
"Exiting Rocmop::determine_shared_nodes");
1196 Profile_end(
"Rocmop::shared_border");
1202 Profile_begin(
"Rocmop::phys_border");
1204 print_legible(1,
"Entering Rocmop::determine_physical_border()");
1206 const std::string surf_attr(
"is_surface");
1207 COM::Attribute* w_is_surface = _buf_window->attribute(surf_attr);
1209 int is_surface_id = w_is_surface->id();
1211 std::vector<const COM::Pane*> allpanes;
1212 _buf_window->panes(allpanes);
1213 int local_npanes = (int)allpanes.size();
1215 _is_phys_bnd_node.resize(local_npanes);
1217 for(
int i=0;
i < local_npanes; ++
i){
1218 _is_phys_bnd_node[
i].resize(allpanes[
i]->size_of_real_nodes());
1221 const COM::Attribute *p_is_surface = allpanes[
i]->attribute(is_surface_id);
1222 int *is_surface_ptr = (
int*)p_is_surface->pointer();
1225 for(
int j=0, nj =(
int) allpanes[
i]->size_of_real_nodes();
j<
nj; ++
j){
1226 if (is_surface_ptr[
j])
1227 _is_phys_bnd_node[
i][
j] =
true;
1231 mark_elems_from_nodes(_is_phys_bnd_node,_is_phys_bnd_elem);
1234 print_legible(1,
"Exiting Rocmop::determine_physical_border()");
1236 Profile_end(
"Rocmop::phys_border");
1241 std::vector<std::vector<bool> > &marked_elems){
1243 Profile_begin(
"Rocmop::mark_elem_node");
1246 print_legible(1,
"Entering Rocmop::mark_elems_from_nodes");
1248 std::vector<const COM::Pane*> allpanes;
1249 _buf_window->panes(allpanes);
1250 int local_npanes = (int)allpanes.size();
1252 marked_elems.clear();
1253 marked_elems.resize(local_npanes);
1256 for(
int i=0;
i < (int)(local_npanes); ++
i){
1258 marked_elems[
i].clear();
1259 marked_elems[
i].resize(allpanes[
i]->size_of_real_elements(),
false);
1263 int s_real_elems = allpanes[
i]->size_of_real_elements();
1264 std::vector<int> nodes;
1265 for(
int j=1;
j<= s_real_elems; ++
j){
1266 Element_node_enumerator ene(allpanes[
i],
j);
1267 ene.get_nodes(nodes);
1268 for(
int k=0,
nk=nodes.size();
k<
nk; ++
k){
1269 if (marked_nodes[
i][nodes[
k]-1])
1270 marked_elems[
i][
j-1] =
true;
1275 print_legible(1,
"Exiting Rocmop::mark_elems_from_nodes");
1277 Profile_end(
"Rocmop::mark_elem_node");
1283 Profile_begin(
"Rocmop::invert_tets");
1285 print_legible(1,
"Entering Rocmop::invert_tets");
1286 std::vector<Pane*> allpanes;
1287 _buf_window->panes(allpanes);
1288 for(
int i=0,
ni = allpanes.size();
i<
ni; ++
i){
1296 print_legible(1,
"Exiting Rocmop::invert_tets");
1298 Profile_end(
"Rocmop::invert_tets");
1303 std::vector<COM::Pane*> &allpanes){
1305 Profile_begin(
"Rocmop::check_marked_quality");
1307 print_legible(1,
"Entering Rocmop::check_marked_elems");
1309 double worst_angle = 0.0;
1310 double angles[] = {0.0, 0.0};
1311 for(
int i=0,ni = allpanes.size();
i<
ni; ++
i){
1312 for(
int k =0,
nk=allpanes[
i]->size_of_real_elements();
k<
nk; ++
k){
1313 if(marked_elems[
i][
k]){
1314 Element_node_enumerator ene(allpanes[
i],k+1);
1318 if(angles[1]>worst_angle)
1319 worst_angle = angles[1];
1325 print_legible(1,
"Exiting Rocmop::check_marked_elems");
1327 Profile_end(
"Rocmop::check_marked_quality");
1335 Profile_begin(
"Rocmop::all_quality_const");
1337 print_legible(1,
"Entering Rocmop::check_all_elem_quality");
1340 int ierr = MPI_Comm_rank( _buf_window->get_communicator(),
1341 &
rank); assert( ierr == 0);
1342 double worst_angle = 0.0;
1343 double angles[] = {0.0, 0.0};
1344 for(
int i=0,ni = allpanes.size();
i<
ni; ++
i){
1345 int nk=allpanes[
i]->size_of_real_elements();
1347 nk = allpanes[
i]->size_of_elements();
1348 for(
int k =0; k<
nk; ++
k){
1349 Element_node_enumerator ene(allpanes[
i],k+1);
1353 if(angles[1]>worst_angle)
1354 worst_angle = angles[1];
1358 agree_double(worst_angle,
MPI_MAX);
1361 Profile_end(
"Rocmop::all_quality_const");
1365 print_legible(1,
"Exiting Rocmop::check_all_elem_quality");
1371 Profile_begin(
"Rocmop::all_quality");
1374 print_legible(1,
"Entering Rocmop::check_all_elem_quality");
1378 int ierr = MPI_Comm_rank( _buf_window->get_communicator(),
1379 &
rank); assert( ierr == 0);
1382 double worst_angle = 0.0;
1383 double angles[] = {0.0, 0.0};
1384 for(
int i=0,ni = allpanes.size();
i<
ni; ++
i){
1385 int nk=allpanes[
i]->size_of_real_elements();
1387 nk = allpanes[
i]->size_of_elements();
1389 for(
int k =0; k<
nk; ++
k){
1390 Element_node_enumerator ene(allpanes[
i],k+1);
1395 if(angles[1]>worst_angle)
1396 worst_angle = angles[1];
1400 Profile_end(
"Rocmop::all_quality");
1405 print_legible(1,
"Exiting Rocmop::check_all_elem_quality");
1414 int ierr = MPI_Comm_rank( _buf_window->get_communicator(),
1420 std::cout <<
"Rocmop: " << msg << std::endl;
1426 Profile_begin(
"Rocmop::const_disp");
1431 int disp_id = w_disp->id();
1432 double max_norm = 0.0;
1434 std::vector<Pane*> allpanes;
1435 const_cast<COM::Window*
>(_usr_window)->panes(allpanes);
1437 for(
int i=0,ni = allpanes.size();
i<
ni; ++
i){
1440 COM::Attribute* ptr_att = allpanes[
i]->attribute(disp_id);
1441 void* void_ptr = ptr_att->pointer();
1444 for(
int j=0,nj = allpanes[
i]->size_of_real_nodes();
j<
nj; ++
j){
1451 agree_double(max_norm,
MPI_MAX);
1453 if(max_norm > _maxdisp){
1454 double div = max_norm/_maxdisp;
1459 Profile_end(
"Rocmop::const_disp");
1465 Profile_begin(
"Rocmop::ext_dihedrals");
1472 int ierr = MPI_Comm_rank( window->get_communicator(),
1480 double max_angle = 0.0;
1481 double min_angle = 180.0;
1486 double angles[] = {0.0, 0.0};
1488 std::vector<Pane*> allpanes;
1489 window->panes(allpanes);
1491 for(
int i=0,ni = allpanes.size();
i<
ni; ++
i){
1492 for(
int k =0,nk=allpanes[
i]->size_of_real_elements(); k<
nk; ++
k){
1493 Element_node_enumerator ene(allpanes[
i],k+1);
1497 if(angles[1]>max_angle){
1498 max_angle = angles[1];
1499 max_pane = allpanes[
i]->id();
1502 if(angles[0]<min_angle){
1503 min_angle = angles[0];
1504 min_pane = allpanes[
i]->id();
1517 send.value = min_angle;
1521 MPI_Allreduce(&send,&recv,1,MPI_DOUBLE_INT,MPI_MINLOC,
1522 window->get_communicator());
1524 if(recv.rank == myrank && _verb > 1){
1525 std::cout <<
"Rocmop:" << std::endl <<
"Rocmop: "
1526 << std::setw(10) << min_angle <<
" on element "
1527 << min_elem <<
" of pane " << min_pane
1528 <<
"." << std::endl;
1533 MPI_Barrier(window->get_communicator());
1538 send.value = max_angle;
1541 MPI_Allreduce(&send,&recv,1,MPI_DOUBLE_INT,MPI_MAXLOC,
1542 window->get_communicator());
1544 if(recv.rank == myrank && _verb > 1){
1545 std::cout <<
"Rocmop:" << std::endl <<
"Rocmop: "
1546 << std::setw(10) << max_angle <<
" on element "
1547 << max_elem <<
" of pane " << max_pane << std::endl;
1551 MPI_Barrier(window->get_communicator());
1554 Profile_end(
"Rocmop::ext_dihedrals");
1561 string outstr(
"angles.txt");
1571 int ierr = MPI_Comm_rank( _buf_window->get_communicator(),
1572 &
rank); assert( ierr == 0);
1575 std::vector<Pane*> allpanes;
1576 _buf_window->panes(allpanes);
1578 double max_angle = 0.0;
1579 double min_angle = 180.0;
1580 double angles[] = {0.0, 0.0};
1582 file2.open(s2.c_str());
1583 for(
int i=0,ni = allpanes.size();
i<
ni; ++
i){
1584 for(
int k =0,nk=allpanes[
i]->size_of_real_elements(); k<
nk; ++
k){
1585 Element_node_enumerator ene(allpanes[
i],k+1);
1589 file2 << angles[0] <<
" " << angles[1] << std::endl;
1590 if(angles[1]>max_angle)
1591 max_angle = angles[1];
1592 if(angles[0]<min_angle)
1593 min_angle = angles[0];
1598 agree_double(max_angle,
MPI_MAX);
1599 agree_double(min_angle,
MPI_MIN);
1602 file.open(outstr.c_str(), std::ios::app);
1604 file << std::left << std::setw(30) << s << std::setw(0)
1605 <<
"(" << min_angle <<
" , " << max_angle <<
")\n";
1611 std::vector<std::vector<bool> > &to_check){
1613 int ierr = 0, rank =0;
1616 ierr = MPI_Comm_rank( _buf_window->get_communicator()
1622 std::vector<std::vector<bool> > elem_to_check;
1623 mark_elems_from_nodes(to_check, elem_to_check);
1625 std::vector<Pane*> allpanes;
1626 _buf_window->panes(allpanes);
1628 double max_angle = 0.0;
1629 double min_angle = 180.0;
1630 double angles[] = {0.0, 0.0};
1632 for(
int i=0,ni = allpanes.size();
i<
ni; ++
i){
1633 for(
int k =0,nk = elem_to_check[
i].size(); k<
nk; ++
k){
1634 if(elem_to_check[
i][k]){
1635 Element_node_enumerator ene(allpanes[
i],k+1);
1639 if(angles[1]>max_angle)
1640 max_angle = angles[1];
1641 if(angles[0]<min_angle){
1643 min_angle = angles[0];
1649 double temp = min_angle;
1651 agree_double(max_angle,
MPI_MAX);
1652 agree_double(min_angle,
MPI_MIN);
1655 string outstr(
"angles.txt");
1656 ofstream file (outstr.c_str(), std::ios::app);
1659 file << std::left << std::setw(30) << s << std::setw(0)
1660 <<
"(" << min_angle <<
" , " << max_angle <<
")";
1663 std::cout << std::left << std::setw(30) <<
"Rocmop: " << s
1664 << std::setw(0) <<
"(" << min_angle <<
" , "
1665 << max_angle <<
")" << std::endl;
1671 ierr = MPI_Barrier(_buf_window->get_communicator());
1674 if(min_angle == temp){
1676 string outstr(
"angles.txt");
1677 ofstream file (outstr.c_str(), std::ios::app);
1680 file <<
" worst = (" << rank <<
" , " <<
id <<
")\n";
1685 ierr = MPI_Barrier(_buf_window->get_communicator());
1691 Profile_begin(
"Rocmop::perturb_stat");
1694 std::vector<const Pane*> allpanes;
1695 std::vector<const Pane*> allpanes_usr;
1696 _buf_window->panes(allpanes);
1697 _usr_window->panes(allpanes_usr);
1699 COM::Attribute *w_fgpn_bnd =
1700 _buf_window->attribute(
"is_fgpn_bnd");
1701 COM::Attribute *w_qual_b_perturb =
1702 _buf_window->attribute(
"qual_b_perturb");
1703 COM::Attribute *w_qual_a_perturb =
1704 _buf_window->attribute(
"qual_a_perturb");
1706 double angles[] = {0.0, 0.0};
1709 for(
int i=0,ni=allpanes.size();
i<
ni; ++
i){
1711 COM::Attribute *p_fgpn_bnd =
1712 const_cast<COM::Attribute*
>(allpanes[
i]->attribute(w_fgpn_bnd->id()));
1713 COM::Attribute *p_qual_b_perturb =
1714 const_cast<COM::Attribute*
>(allpanes[
i]->attribute(w_qual_b_perturb->id()));
1716 int* fgpn_bnd_ptr =
reinterpret_cast<int*
>(p_fgpn_bnd->pointer());
1717 double* qual_b_perturb_ptr =
1718 reinterpret_cast<double*
>(p_qual_b_perturb->pointer());
1720 std::vector<int> elist;
1722 for(
int j=0, nj= allpanes[
i]->size_of_real_nodes();
j<
nj; ++
j){
1723 if(fgpn_bnd_ptr[
j]){
1724 _dcs[
i]->incident_elements(j+1,elist);
1725 qual_b_perturb_ptr[
j] = 0.0;
1726 for(uint k=0, nk=elist.size(); k<
nk; ++
k){
1727 Element_node_enumerator ene(allpanes[
i],k+1);
1731 if(angles[1]>qual_b_perturb_ptr[j])
1732 qual_b_perturb_ptr[
j] = angles[1];
1740 MAP::Pane_communicator pc(_buf_window, _buf_window->get_communicator());
1741 pc.init(w_qual_b_perturb);
1742 pc.begin_update_shared_nodes();
1743 pc.reduce_on_shared_nodes(
MPI_MAX);
1744 pc.end_update_shared_nodes();
1748 for(
int i=0,ni=allpanes.size();
i<
ni; ++
i){
1750 COM::Attribute *p_fgpn_bnd =
1751 const_cast<COM::Attribute*
>(allpanes[
i]->attribute(w_fgpn_bnd->id()));
1752 COM::Attribute *p_nc =
1753 const_cast<COM::Attribute*
>(allpanes[
i]->attribute(
COM::COM_NC));
1756 reinterpret_cast<int*
>(p_fgpn_bnd->pointer());
1760 std::vector<int> elist;
1762 for(
int j=0, nj= (
int)allpanes[
i]->size_of_real_nodes();
j<
nj; ++
j){
1764 if(fgpn_bnd_ptr[
j]){
1765 _dcs[
i]->incident_elements(j+1,elist);
1768 std::cout <<
"Rocmop: Perturbing node " << j+1 << std::endl;
1771 int rand_el = (
std::rand()%elist.size());
1772 Element_node_enumerator ene(allpanes[
i],elist[rand_el]);
1773 std::vector<int> enodes;
1774 ene.get_nodes(enodes);
1779 for(
int nk= (
int)enodes.size(); nindex<
nk; ++nindex){
1780 if(enodes[nindex]==j+1)
1785 "Node not found in supposedly adjacent element\n");
1786 double length = (nc_ptr[
j]-nc_ptr[enodes[(nindex+rand_ed)%4]-1]).norm();
1789 for(
int k=0; k<3; ++
k){
1792 -1.0*((double)((
std::rand()%1000)+1)/1000.0);
1794 nc_ptr[
j] += perturb;
1800 for(
int i=0,ni=(
int)allpanes.size();
i<
ni; ++
i){
1802 COM::Attribute *p_fgpn_bnd =
1803 const_cast<COM::Attribute*
>(allpanes[
i]->attribute(w_fgpn_bnd->id()));
1804 COM::Attribute *p_qual_a_perturb =
1805 const_cast<COM::Attribute*
>(allpanes[
i]->attribute(w_qual_a_perturb->id()));
1808 reinterpret_cast<int*
>(p_fgpn_bnd->pointer());
1809 double* qual_a_perturb_ptr =
1810 reinterpret_cast<double*
>(p_qual_a_perturb->pointer());
1812 std::vector<int> elist;
1814 for(
int j=0, nj= (
int)allpanes[
i]->size_of_real_nodes();
j<
nj; ++
j){
1815 if(fgpn_bnd_ptr[
j]){
1816 _dcs[
i]->incident_elements(j+1,elist);
1817 qual_a_perturb_ptr[
j] = 0.0;
1818 for(
int k=0, nk=(
int)elist.size(); k<
nk; ++
k){
1819 Element_node_enumerator ene(allpanes[
i],k+1);
1823 if(angles[1]>qual_a_perturb_ptr[j])
1824 qual_a_perturb_ptr[
j] = angles[1];
1832 MAP::Pane_communicator pc(_buf_window, _buf_window->get_communicator());
1833 pc.init(w_qual_a_perturb);
1834 pc.begin_update_shared_nodes();
1835 pc.reduce_on_shared_nodes(
MPI_MAX);
1836 pc.end_update_shared_nodes();
1841 for(
int i=0,ni=allpanes.size();
i<
ni; ++
i){
1843 COM::Attribute *p_fgpn_bnd =
1844 const_cast<COM::Attribute*
>(allpanes[
i]->attribute(w_fgpn_bnd->id()));
1845 COM::Attribute *p_nc =
1846 const_cast<COM::Attribute*
>(allpanes[
i]->attribute(
COM::COM_NC));
1847 COM::Attribute *p_nc_usr =
1848 const_cast<COM::Attribute*
>(allpanes_usr[
i]->attribute(
COM::COM_NC));
1850 COM::Attribute *p_qual_b_perturb =
1851 const_cast<COM::Attribute*
>(allpanes[
i]->attribute(w_qual_b_perturb->id()));
1852 COM::Attribute *p_qual_a_perturb =
1853 const_cast<COM::Attribute*
>(allpanes[
i]->attribute(w_qual_a_perturb->id()));
1856 reinterpret_cast<int*
>(p_fgpn_bnd->pointer());
1861 double* qual_b_perturb_ptr =
1862 reinterpret_cast<double*
>(p_qual_b_perturb->pointer());
1863 double* qual_a_perturb_ptr =
1864 reinterpret_cast<double*
>(p_qual_a_perturb->pointer());
1867 for(
int j=0, nj= (
int)allpanes[
i]->size_of_real_nodes();
j<
nj; ++
j){
1868 if(fgpn_bnd_ptr[
j] &&
1869 (qual_a_perturb_ptr[
j] > qual_b_perturb_ptr[
j]))
1870 nc_ptr[j] = nc_ptr_usr[j];
1874 Profile_end(
"Rocmop::perturb_stat");
1886 extern "C" void COM_F_FUNC2(rocmop_load_module, ROCMOP_LOAD_MODULE)(
const char *mname,
long int length)
1889 extern "C" void COM_F_FUNC2(rocmop_unload_module, ROCMOP_UNLOAD_MODULE)(
const char *mname,
long int length)
static void div_scalar(const Attribute *x, const void *y, Attribute *z, int swap=0)
Operation wrapper for division with y as a scalar pointer.
static void sub(const Attribute *x, const Attribute *y, Attribute *z)
Operation wrapper for subtraction.
int COM_Type
Indices for derived data types.
void determine_physical_border()
Determine which nodes and elements are on the physical border.
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
Utility for constructing pane connectivities in parallel.
3D Aspect Ratios Metric Class
void invert()
Invert Tetrahedrons.
void smooth_in_place(COM::Attribute *pmesh)
Smooth a mesh in place..
virtual void compute(double atts[]) const
Calculate the metric value on this element.
double check_all_elem_quality(std::vector< const COM::Pane * > &allpanes, bool with_ghost=false)
Get the largest dihedral angle of all real elements.
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_GROUP_EMPTY INTEGER MPI_MAX
const char * option(const char *const name, const int argc, const char *const *const argv, const char *defaut, const char *const usage=0)
void invert_tets()
Repair inverted tets.
void print_mquality(std::string &s, std::vector< std::vector< bool > > &to_check)
Print the quality range of marked elements, for debugging.
void COM_delete_window(const char *wname)
Used to hold the error state and return it to the application.
void perturb_stationary()
Randomly perturn stationary nodes on pane boundary, not on phys. surface.
void determine_pane_border()
Determine which nodes and elements are on pane borders.
#define COM_assertion_msg(EX, msg)
This file contains the prototypes for Roccom API.
3D geometric quality Metric declarations.
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_GROUP_EMPTY INTEGER MPI_MIN
A Roccom mesh optimization module.
std::ifstream & get_next_line(std::ifstream &Inf, std::string &line, const char noop)
void COM_set_object(const char *wa_str, int pane_id, Type *addr)
Handles communication of shared nodes, ghost nodes or ghost cells across panes.
#define COM_F_FUNC2(lowcase, uppercase)
static void reduce_sum_on_shared_nodes(COM::Attribute *att)
Perform a sum-reduction on the shared nodes for the given attribute.
void Rocmop_unload_module(const char *mname)
T norm(const NVec< DIM, T > &v)
void zero_displacements(COM::Attribute *disp)
double length(Vector3D *const v, int n)
void COM_get_object(const char *wa_str, int pane_id, Type **addr)
void read_config_file(const std::string &)
static int pconn_offset()
Retrieve an offset to avoid the number of communicating panes when reading a pconn attribute...
void perform_smoothing()
Perform smoothing on _buf_window.
void initialize(const COM::Attribute *pmesh)
Constructs the communication patterns of a distributed mesh.
void Rocmop_load_module(const char *mname)
virtual ~Rocmop()
Destructor.
A class enabling Mesquite calls on Rocmop panes.
void perform_noniterative_smoothing()
Perform noniterative smoothing.
int COM_compatible_types(COM_Type type1, COM_Type type2)
double check_marked_elem_quality(std::vector< std::vector< bool > > &marked_elems, std::vector< COM::Pane * > &allpanes)
Get the largest dihedral angle of marked real elements.
void constrain_displacements(COM::Attribute *w_disp)
Contrain displacements to _maxdisp.
Wrapper which performs a Feasible Newton solve using an objective function template with inverse mea...
static void unload(const std::string &mname)
Unloads Rocmop from Roccom.
void determine_shared_border()
Determine which nodes and elements are shared.
void COM_window_init_done(const char *w_str, int pane_changed=true)
void print_legible(int verb, const char *msg)
Single process print message if given verbosity level is exceeded.
#define MOP_END_NAMESPACE
void COM_new_window(const char *wname, MPI_Comm c=MPI_COMM_NULL)
virtual void initialize(Vector_3< double > n[], int type)
Initialize a 3D Geometric Metric by nodal coords and element type.
Definition for Rocblas API.
void print_quality(std::string &s)
Print the quality range of all elements, for debugging.
void smooth(const COM::Attribute *pmesh, COM::Attribute *disp)
Smooth the mesh in a Rocmop managed buffer.
static void update_ghosts(COM::Attribute *att, const COM::Attribute *pconn=NULL)
Update ghost nodal or elemental values for the given attribute.
void getAspects(double &R, double &r, double &l)
Get the geometric aspects.
void smoother_specific_init()
Perform smoother specific initialization.
static void load(const std::string &mname)
Loads Rocmop onto Roccom with a given module name.
#define MOP_BEGIN_NAMESPACE
3D Max and Min Angle Metric Class
void print_extremal_dihedrals(COM::Window *window)
Print the min and max dihedral angles along with their locations.
static void copy(const Attribute *x, Attribute *y)
Wrapper for copy.
double rand()
Return a random variable between [0,1] with respect to an uniform distribution.
void int int REAL REAL REAL *z blockDim dim * ni
void COM_new_attribute(const char *wa_str, const char loc, const int type, int ncomp, const char *unit)
Registering an attribute type.
void COM_set_member_function(const char *wf_str, Member_func_ptr func, const char *wa_str, const char *intents, const COM_Type *types)
Geometric helper function header file.
void set_value(const char *opt, const void *val)
Set a Rocomp option.
void mark_elems_from_nodes(std::vector< std::vector< bool > > &marked_nodes, std::vector< std::vector< bool > > &marked_elems)
Mark the nodes which contain marked elems.
void add_aspect_ratios(COM::Attribute *usr_att, COM::Attribute *buf_att=NULL)
#define MSQ_ERRRTN(err)
If passed error is true, return from a void function.
void smooth_mesquite(std::vector< COM::Pane * > &allpanes, int ghost_level=0)
Smooth the panes of the working window using MESQUITE.
void add_mesh(Mesquite::Mesh *mesh, MsqError &err)
adds a mesh to the MeshSet.
void perform_iterative_smoothing()
Perform iterative smoothing.
The MeshSet class stores one or more Mesquite::Mesh pointers and manages access to the mesh informati...
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_GROUP_EMPTY INTEGER MPI_SUM
bool check_displacements(COM::Attribute *disp)