33 #ifndef OOMPH_GENERIC_MESH_HEADER 34 #define OOMPH_GENERIC_MESH_HEADER 38 #include <oomph-lib-config.h> 252 Lookup_for_elements_next_boundary_is_setup=
false;
259 Keep_all_elements_as_halos=
false;
263 Resize_halo_nodes_not_required=
false;
302 std::ostringstream error_stream;
303 error_stream <<
"Empty default reset boundary element info function" 305 error_stream <<
"This should be overloaded in a specific " 306 <<
"TriangleMeshBase\n";
308 "Mesh::reset_boundary_element_info()",
309 OOMPH_EXCEPTION_LOCATION);
315 template<
class BULK_ELEMENT>
319 if (!Boundary_coordinate_exists[b])
321 oomph_info <<
"No boundary coordinates were set up for boundary " 333 for(
unsigned e=0;
e<nel;
e++)
358 for (
unsigned iplot=0;iplot<num_plot_points;iplot++)
364 for (
unsigned i=0;
i<dim;
i++)
366 the_file << x[
i] <<
" ";
368 for (
unsigned i=0;
i<(dim-1);
i++)
370 the_file << zeta[
i] <<
" ";
373 the_file << std::endl;
388 unsigned nnod=this->
nnode();
390 for (
unsigned j=0;j<nnod;j++)
393 for (
unsigned i=0;
i<dim;
i++)
395 nod_pt->
x(
i)*=factor;
463 {
return Element_pt[
e];}
467 {
return Element_pt[
e];}
485 OOMPH_CURRENT_FUNCTION,
486 OOMPH_EXCEPTION_LOCATION);
498 {
return Boundary_node_pt[b][n];}
502 {
return Boundary_node_pt[b][n];}
507 Boundary_node_pt.resize(nbound);
508 Boundary_coordinate_exists.resize(nbound,
false);
529 Boundary_node_pt.clear();
533 const unsigned n_node =
nnode();
534 for(
unsigned nd=0; nd<n_node; nd++)
541 std::set<unsigned>* boundaries_pt;
545 unsigned max_boundary_n = 1 +
546 *std::max_element(boundaries_pt->begin(), boundaries_pt->end());
553 std::set<unsigned>::const_iterator it;
554 for(it=boundaries_pt->begin(); it!=boundaries_pt->end(); it++)
556 Boundary_node_pt[*it].push_back(nd_pt);
567 if(Boundary_coordinate_exists.empty()) {
return false;}
571 #ifdef RANGE_CHECKING 572 if (i>=Boundary_coordinate_exists.size())
574 std::ostringstream error_message;
575 error_message <<
"Range Error: " << i <<
" is not in the range (0," 576 << Boundary_coordinate_exists.size()-1 << std::endl;
579 OOMPH_CURRENT_FUNCTION,
580 OOMPH_EXCEPTION_LOCATION);
583 return Boundary_coordinate_exists[
i];
587 unsigned long nelement()
const {
return Element_pt.size();}
590 unsigned long nnode()
const {
return Node_pt.size();}
606 {Element_pt.push_back(element_pt);}
624 virtual void node_update(
const bool& update_all_solid_nodes=
false);
628 virtual void reorder_nodes(
const bool& use_old_ordering=
true);
634 const bool& use_old_ordering=
true)
const;
638 template<
class BULK_ELEMENT,
template<
class>
class FACE_ELEMENT>
644 for(
unsigned n=0;n<nbound_node;n++)
650 for(
unsigned e=0;
e<nbound_element;
e++)
653 FACE_ELEMENT<BULK_ELEMENT>* face_element_pt =
681 for (
unsigned e=0;
e<nel;
e++)
683 max_size=std::max(max_size,
685 min_size=std::min(min_size,
697 for (
unsigned e=0;
e<nel;
e++)
718 std::ofstream& inverted_element_file);
729 std::ofstream inverted_element_file;
731 inverted_element_file);
739 oomph_info <<
"\n\nStarting check for repeated nodes...";
741 unsigned nnod=
nnode();
742 for (
unsigned j=0;j<nnod;j++)
745 unsigned dim=nod1_pt->
ndim();
746 for (
unsigned k=j+1;k<nnod;k++)
750 for (
unsigned i=0;
i<dim;
i++)
752 dist+=pow((nod1_pt->
x(
i)-nod2_pt->
x(
i)),2);
757 oomph_info <<
"\n\nRepeated node!" << std::endl;
758 oomph_info <<
"Distance between nodes " << j <<
" and " << k
760 oomph_info <<
"is " << dist <<
" which is less than the" 762 oomph_info <<
"permitted distance of " << epsilon
763 << std::endl << std::endl;
764 oomph_info <<
"The offending nodes are located at: " << std::endl;
765 for (
unsigned i=0;
i<dim;
i++)
773 <<
"\n\n[NOTE: message issued as diagonistic rather than an error\n" 774 <<
" because at least one of the nodes is a copy; you may still\n" 775 <<
" want to check this out. BACKGROUND: Copied nodes share the same Data but\n" 776 <<
" will, in general, have different spatial positions (e.g. when used\n" 777 <<
" as periodic nodes); however there are cases when they are located\n" 778 <<
" at the same spatial position (e.g. in oomph-lib's annular mesh which\n" 779 <<
" is a rolled-around version of the rectangular quadmesh). In such cases,\n" 780 <<
" the nodes could have been deleted and completely replaced by \n" 781 <<
" pointers to existing nodes, but may have been left there for convenience\n" 782 <<
" or out of laziness...]\n";
793 if (failed)
return 1;
796 oomph_info <<
"...done: Test passed!" << std::endl << std::endl;
806 unsigned nboundary()
const {
return Boundary_node_pt.size();}
810 {
return Boundary_node_pt[ibound].size();}
817 if (!Lookup_for_elements_next_boundary_is_setup)
820 "Lookup scheme for elements next to boundary hasn't been set up yet!\n",
821 OOMPH_CURRENT_FUNCTION,
822 OOMPH_EXCEPTION_LOCATION);
825 return Boundary_element_pt[b][
e];
834 for(
unsigned nd=0, nnd=
nnode(); nd<nnd; nd++)
836 if( !(
node_pt(nd)->is_on_boundary()))
842 std::ostringstream error_msg;
843 error_msg <<
"No non-boundary nodes in the mesh.";
845 OOMPH_CURRENT_FUNCTION,
846 OOMPH_EXCEPTION_LOCATION);
855 if (!Lookup_for_elements_next_boundary_is_setup)
858 "Lookup scheme for elements next to boundary hasn't been set up yet!\n",
859 OOMPH_CURRENT_FUNCTION,
860 OOMPH_EXCEPTION_LOCATION);
863 return Boundary_element_pt[b].size();
873 if (!Lookup_for_elements_next_boundary_is_setup)
876 "Lookup scheme for elements next to boundary hasn't been set up yet!\n",
877 OOMPH_CURRENT_FUNCTION,
878 OOMPH_EXCEPTION_LOCATION);
881 return Face_index_at_boundary[b][
e];
885 virtual void dump(std::ofstream &dump_file,
886 const bool& use_old_ordering=
true)
const;
890 const bool& use_old_ordering=
true)
const 892 std::ofstream dump_stream(dump_file_name.c_str());
894 if(!dump_stream.is_open())
896 std::string err =
"Couldn't open file "+dump_file_name;
898 OOMPH_CURRENT_FUNCTION);
901 dump(dump_stream, use_old_ordering);
905 virtual void read(std::ifstream &restart_file);
914 const unsigned &nplot)
const;
922 const unsigned &nplot,
926 void output(std::ostream &outfile);
929 void output(std::ostream &outfile,
const unsigned &n_plot);
932 void output(FILE* file_pt);
935 void output(FILE* file_pt,
const unsigned &nplot);
940 std::ofstream outfile;
941 outfile.open(output_filename.c_str());
949 std::ofstream outfile;
950 outfile.open(output_filename.c_str());
956 void output_fct(std::ostream &outfile,
const unsigned &n_plot,
961 void output_fct(std::ostream &outfile,
const unsigned &n_plot,
972 std::ofstream outfile;
973 outfile.open(output_filename.c_str());
994 const bool &preserve_existing_data)
998 preserve_existing_data);
1006 const bool &preserve_existing_data);
1017 const bool &preserve_existing_data);
1022 const bool &preserve_existing_data);
1038 unsigned long n_element = Element_pt.size();
1039 for(
unsigned long e=0;
e<n_element;
e++)
1043 #ifdef OOMPH_HAS_MPI 1060 double& error,
double& norm)
1063 norm=0.0; error=0.0;
1065 double el_error,el_norm;
1068 unsigned long Element_pt_range = Element_pt.size();
1069 for(
unsigned long e=0;
e<Element_pt_range;
e++)
1076 "Can't execute compute_error(...) for non FiniteElements",
1077 OOMPH_CURRENT_FUNCTION,
1078 OOMPH_EXCEPTION_LOCATION);
1084 #ifdef OOMPH_HAS_MPI 1089 el_pt->
compute_error(outfile,exact_soln_pt,time,el_error,el_norm);
1092 norm+=el_norm; error+=el_error;
1101 double& error,
double& norm)
1104 norm=0.0; error=0.0;
1106 double el_error,el_norm;
1109 unsigned long Element_pt_range = Element_pt.size();
1110 for(
unsigned long e=0;
e<Element_pt_range;
e++)
1117 "Can't execute compute_error(...) for non FiniteElements",
1118 OOMPH_CURRENT_FUNCTION,
1119 OOMPH_EXCEPTION_LOCATION);
1125 #ifdef OOMPH_HAS_MPI 1129 el_pt->
compute_error(outfile,exact_soln_pt,el_error,el_norm);
1132 norm+=el_norm; error+=el_error;
1141 std::ostream &outfile,
1147 unsigned n_error=error.size();
1148 unsigned n_norm=norm.size();
1149 for(
unsigned i=0;
i<n_error;
i++)
1153 for(
unsigned i=0;
i<n_norm;
i++)
1161 unsigned long Element_pt_range = Element_pt.size();
1162 for(
unsigned long e=0;
e<Element_pt_range;
e++)
1169 "Can't execute compute_error(...) for non FiniteElements",
1170 OOMPH_CURRENT_FUNCTION,
1171 OOMPH_EXCEPTION_LOCATION);
1174 for(
unsigned i=0;
i<n_error;
i++)
1178 for(
unsigned i=0;
i<n_norm;
i++)
1183 #ifdef OOMPH_HAS_MPI 1187 el_pt->
compute_error(outfile,exact_soln_pt,time,el_error,el_norm);
1190 for(
unsigned i=0;
i<n_error;
i++)
1192 error[
i]+=el_error[
i];
1194 for(
unsigned i=0;
i<n_norm;
i++)
1196 norm[
i]+=el_norm[
i];
1210 unsigned n_error=error.size();
1211 unsigned n_norm=norm.size();
1212 for(
unsigned i=0;
i<n_error;
i++)
1216 for(
unsigned i=0;
i<n_norm;
i++)
1224 unsigned long Element_pt_range = Element_pt.size();
1225 for(
unsigned long e=0;
e<Element_pt_range;
e++)
1232 "Can't execute compute_error(...) for non FiniteElements",
1233 OOMPH_CURRENT_FUNCTION,
1234 OOMPH_EXCEPTION_LOCATION);
1237 for(
unsigned i=0;
i<n_error;
i++)
1241 for(
unsigned i=0;
i<n_norm;
i++)
1246 #ifdef OOMPH_HAS_MPI 1250 el_pt->
compute_error(outfile,exact_soln_pt,el_error,el_norm);
1253 for(
unsigned i=0;
i<n_error;
i++)
1255 error[
i]+=el_error[
i];
1257 for(
unsigned i=0;
i<n_norm;
i++)
1259 norm[
i]+=el_norm[
i];
1268 #ifdef OOMPH_HAS_MPI 1280 #ifdef OOMPH_HAS_MPI 1288 #ifdef OOMPH_HAS_MPI 1309 const bool& report_stats,
1310 const bool& overrule_keep_as_halo_element_status);
1317 const bool& report_stats=
false)
1321 bool overrule_keep_as_halo_element_status=
false;
1322 return distribute(comm_pt,element_domain,deleted_element_pt,
1323 doc_info,report_stats,
1324 overrule_keep_as_halo_element_status);
1335 const bool& report_stats=
false)
1340 doc_info,report_stats);
1353 const bool& report_stats);
1360 double& max_efficiency,
1361 double& min_efficiency);
1368 double& max_permitted_error_for_halo_check);
1374 const bool& report_stats);
1413 for (
unsigned e=0;
e<nelem;
e++)
1428 unsigned nleaf=leaf_pt.size();
1429 for (
unsigned l=0;l<nleaf;l++)
1431 vec_el_pt.push_back(leaf_pt[l]->object_pt());
1436 vec_el_pt.push_back(el_pt);
1452 for (
unsigned e=0;
e<nelem;
e++)
1467 unsigned nleaf=leaf_pt.size();
1468 for (
unsigned l=0;l<nleaf;l++)
1470 vec_el_pt.push_back(leaf_pt[l]->object_pt());
1475 vec_el_pt.push_back(el_pt);
1487 for (
unsigned e=0;
e<n;
e++)
1500 Root_halo_element_pt.begin();it!=Root_halo_element_pt.end();it++)
1502 n+=it->second.size();
1512 return Root_halo_element_pt[p].size();
1520 return Root_halo_element_pt[p];
1529 return Root_halo_element_pt[p][
e];
1537 Root_halo_element_pt[p].push_back(el_pt);
1546 Halo_node_pt.begin();it!=Halo_node_pt.end();it++)
1548 n+=it->second.size();
1558 std::map<unsigned, Vector<Node*> >::iterator it=
1559 Halo_node_pt.find(p);
1560 if (it==Halo_node_pt.end())
1564 return (*it).second.size();
1571 Halo_node_pt[p].push_back(nod_pt);
1579 return Halo_node_pt[p][j];
1588 Root_haloed_element_pt.begin();it!=Root_haloed_element_pt.end();it++)
1590 n+=it->second.size();
1600 std::map<unsigned, Vector<GeneralisedElement*> >::iterator it=
1601 Root_haloed_element_pt.find(p);
1602 if (it==Root_haloed_element_pt.end())
1606 return (*it).second.size();
1615 std::map<unsigned, Vector<GeneralisedElement*> >::iterator it=
1616 Root_haloed_element_pt.find(p);
1617 if (it==Root_haloed_element_pt.end())
1622 return (*it).second;
1630 return Root_haloed_element_pt[p][
e];
1640 Root_haloed_element_pt[p].push_back(el_pt);
1649 Haloed_node_pt.begin();it!=Haloed_node_pt.end();it++)
1651 n+=it->second.size();
1662 std::map<unsigned, Vector<Node*> >::iterator it=
1663 Haloed_node_pt.find(p);
1664 if (it==Haloed_node_pt.end())
1668 return (*it).second.size();
1675 return Haloed_node_pt[p][j];
1682 Haloed_node_pt[p].push_back(nod_pt);
1693 Resize_halo_nodes_not_required=
true;
1701 Resize_halo_nodes_not_required=
false;
1707 Output_halo_elements=
false;
1713 Output_halo_elements=
true;
1721 Shared_node_pt.begin();it!=Shared_node_pt.end();it++)
1723 n+=it->second.size();
1732 Shared_node_pt.begin();it!=Shared_node_pt.end();it++)
1734 unsigned n=it->second.size();
1735 for (
unsigned j=0;j<n;j++)
1737 oomph_info <<
"Shared node with proc " << it->first <<
" ";
1738 Node* nod_pt=it->second[j];
1739 unsigned ndim=nod_pt->
ndim();
1740 for (
unsigned i=0;
i<ndim;
i++)
1745 oomph_info << j <<
" " << nod_pt << std::endl;
1755 std::map<unsigned, Vector<Node*> >::iterator it=
1756 Shared_node_pt.find(p);
1757 if (it==Shared_node_pt.end())
1761 return (*it).second.size();
1768 return Shared_node_pt[p][j];
1778 shared_node_pt.resize(np);
1779 for (
unsigned j=0;j<np;j++)
1781 shared_node_pt[j] = Shared_node_pt[p][j];
1791 Shared_node_pt[p].push_back(nod_pt);
1799 unsigned& max_number,
1800 unsigned& min_number);
1807 unsigned& max_number,
1808 unsigned& min_number);
1815 const unsigned &n_plot=5)
1818 External_halo_element_pt.begin();
1819 it!=External_halo_element_pt.end();it++)
1821 unsigned p=(*it).first;
1828 const unsigned &n_plot=5)
1830 unsigned nel=External_halo_element_pt[p].size();
1831 for (
unsigned e=0;
e<nel;
e++)
1834 External_halo_element_pt[p][
e]);
1837 fe_pt->
output(outfile,n_plot);
1845 const unsigned &n_plot=5)
1848 External_haloed_element_pt.begin();
1849 it!=External_haloed_element_pt.end();it++)
1851 unsigned p=(*it).first;
1858 const unsigned &n_plot=5)
1860 unsigned nel=External_haloed_element_pt[p].size();
1861 for (
unsigned e=0;
e<nel;
e++)
1864 External_haloed_element_pt[p][
e]);
1867 fe_pt->
output(outfile,n_plot);
1878 External_halo_element_pt.begin();
1879 it!=External_halo_element_pt.end();it++)
1881 n+=it->second.size();
1891 std::map<unsigned, Vector<GeneralisedElement*> >::iterator it=
1892 External_halo_element_pt.find(p);
1893 if (it==External_halo_element_pt.end())
1897 return (*it).second.size();
1905 return External_halo_element_pt[p][
e];
1913 External_halo_element_pt[p].push_back(el_pt);
1922 External_haloed_element_pt.begin();
1923 it!=External_haloed_element_pt.end();it++)
1925 n+=it->second.size();
1935 std::map<unsigned, Vector<GeneralisedElement*> >::iterator it=
1936 External_haloed_element_pt.find(p);
1937 if (it==External_haloed_element_pt.end())
1941 return (*it).second.size();
1949 return External_haloed_element_pt[p][
e];
1962 External_halo_node_pt.begin();it!=External_halo_node_pt.end();it++)
1964 n+=it->second.size();
1974 external_halo_node_pt.reserve(n_total);
1976 External_halo_node_pt.begin();it!=External_halo_node_pt.end();it++)
1978 unsigned np=(it->second).size();
1979 for (
unsigned j=0;j<np;j++)
1981 external_halo_node_pt.push_back((it->second)[j]);
1985 if (external_halo_node_pt.size()!=n_total)
1987 std::ostringstream error_stream;
1989 <<
"Total number of external halo nodes, " 1990 << n_total <<
" doesn't match number of entries \n in vector, " 1991 << external_halo_node_pt.size() << std::endl;
1993 OOMPH_CURRENT_FUNCTION,
1994 OOMPH_EXCEPTION_LOCATION);
2005 std::map<unsigned, Vector<Node*> >::iterator it=
2006 External_halo_node_pt.find(p);
2007 if (it==External_halo_node_pt.end())
2011 return (*it).second.size();
2018 External_halo_node_pt[p].push_back(nod_pt);
2027 return External_halo_node_pt[p][j];
2034 std::map<unsigned, Vector<Node*> >::iterator it=
2035 External_halo_node_pt.find(p);
2036 if (it==External_halo_node_pt.end())
2041 return (*it).second;
2064 External_haloed_node_pt.begin();it!=External_haloed_node_pt.end();it++)
2066 n+=it->second.size();
2076 std::map<unsigned, Vector<Node*> >::iterator it=
2077 External_haloed_node_pt.find(p);
2078 if (it==External_haloed_node_pt.end())
2082 return (*it).second.size();
2089 return External_haloed_node_pt[p][j];
2100 std::map<unsigned, Vector<Node*> >::iterator it=
2101 External_haloed_node_pt.find(p);
2102 if (it==External_haloed_node_pt.end())
2107 return (*it).second;
2123 std::set<int> procs;
2125 External_halo_node_pt.begin();it!=External_halo_node_pt.end();it++)
2127 procs.insert((*it).first);
2140 std::map<
Data*,std::set<unsigned> >
2141 &processors_associated_with_data,
2143 overrule_keep_as_halo_element_status)
2145 std::ostringstream error_stream;
2146 error_stream <<
"Empty default create_shared_boundaries() method" 2148 error_stream <<
"This should be overloaded in a specific " 2149 <<
"TriangleMeshBase\n";
2151 "Mesh::create_shared_boundaries()",
2152 OOMPH_EXCEPTION_LOCATION);
2160 std::ostringstream error_stream;
2161 error_stream <<
"Empty default try_to_add_root_haloed_element_pt() method" 2163 error_stream <<
"This should be overloaded in a specific " 2164 <<
"TriangleMeshBase\n";
2166 "Mesh::try_to_add_root_haloed_element_pt()",
2167 OOMPH_EXCEPTION_LOCATION);
2174 std::ostringstream error_stream;
2175 error_stream <<
"Empty default try_to_add_haloed_node_pt() method" 2177 error_stream <<
"This should be overloaded in a specific " 2178 <<
"TriangleMeshBase\n";
2180 "Mesh::try_to_add_haloed_node_pt()",
2181 OOMPH_EXCEPTION_LOCATION);
2239 #ifdef OOMPH_HAS_MPI 2244 unsigned n=sub_mesh_pt.size();
2246 for (
unsigned i=0;
i<n;
i++)
2248 sub_mesh_mesh_pt[
i]=
static_cast<Mesh*
>(sub_mesh_pt[
i]);
2258 if(!dynamic_cast<SolidNode*>(
Node_pt[n]))
2260 std::ostringstream error_stream;
2261 error_stream <<
"Error: Node " << n <<
"is a " 2263 <<
", not an SolidNode" << std::endl;
2265 OOMPH_CURRENT_FUNCTION,
2266 OOMPH_EXCEPTION_LOCATION);
2270 return (static_cast<SolidNode*>(
Node_pt[n]));
2280 std::ostringstream error_stream;
2282 <<
"Error: Node " << n <<
"is a " 2284 <<
", not an SolidNode" << std::endl;
2286 OOMPH_CURRENT_FUNCTION,
2287 OOMPH_EXCEPTION_LOCATION);
2306 OOMPH_CURRENT_FUNCTION,
2307 OOMPH_EXCEPTION_LOCATION);
2309 if(!dynamic_cast<SolidNode*>(el_pt->
node_pt(n)))
2311 std::ostringstream error_message;
2313 error_message <<
"Error: Node " << n <<
" of element " << e
2314 <<
"is a " <<
typeid(*np).name()
2315 <<
", not an SolidNode" << std::endl;
2318 OOMPH_CURRENT_FUNCTION,
2319 OOMPH_EXCEPTION_LOCATION);
2323 return(static_cast<SolidNode*>(
2330 void set_lagrangian_nodal_coordinates();
2340 set_lagrangian_nodal_coordinates();
2370 if (node1_pt==node2_pt)
2373 std::ostringstream error_stream;
2374 error_stream <<
"Edge cannot have two identical vertex nodes\n";
2377 OOMPH_CURRENT_FUNCTION,
2378 OOMPH_EXCEPTION_LOCATION);
2384 if (node1_pt>node2_pt)
2427 else if (Node1_pt==other.
node1_pt())
2448 return (Node1_pt->is_on_boundary() && Node2_pt->is_on_boundary() );
2456 return ((dynamic_cast<BoundaryNodeBase*>(Node1_pt)!=0)&&
2457 (dynamic_cast<BoundaryNodeBase*>(Node2_pt)!=0));
2481 namespace MeshChecker
2496 template<
class GEOM_ELEMENT_BASE,
class ELEMENT>
2498 const unsigned& nnode_1d=0)
2506 ELEMENT* el_pt=
new ELEMENT;
2509 if (dynamic_cast<GEOM_ELEMENT_BASE*>(el_pt)==0)
2511 std::stringstream error_message;
2513 <<
"You have specified an illegal element type! Element is of type \n\n" 2514 <<
typeid(el_pt).name()
2515 <<
"\n\nand cannot be cast to type \n\n " 2516 <<
typeid(GEOM_ELEMENT_BASE).name()
2519 OOMPH_CURRENT_FUNCTION,
2520 OOMPH_EXCEPTION_LOCATION);
2524 if (dim!=el_pt->dim())
2526 std::stringstream error_message;
2528 <<
"You have specified an illegal element type! Element is of type \n\n" 2529 <<
typeid(el_pt).name()
2530 <<
"\n\nand has dimension = " << el_pt->dim()
2531 <<
" but we need dim = " << dim << std::endl;
2533 OOMPH_CURRENT_FUNCTION,
2534 OOMPH_EXCEPTION_LOCATION);
2541 if (nnode_1d!=el_pt->nnode_1d())
2543 std::stringstream error_message;
2545 <<
"You have specified an illegal element type! Element is of type \n\n" 2546 <<
typeid(el_pt).name()
2547 <<
"\n\nand has nnode_1d = " << el_pt->nnode_1d()
2548 <<
" but we need nnode_1d = " << nnode_1d << std::endl;
2550 OOMPH_CURRENT_FUNCTION,
2551 OOMPH_EXCEPTION_LOCATION);
2572 namespace ParaviewHelper
2582 const double& time);
2593 namespace NodeOrdering
2601 unsigned ndim = nd1_pt->
ndim();
2604 for(j=0; j<ndim; j++)
2606 if(std::abs(nd1_pt->
x(j) - nd2_pt->
x(j)) > 1
e-10)
2608 if(nd1_pt->
x(j) < nd2_pt->
x(j))
2620 std::string err =
"Nodes are at the same point to ~ 1e-10!";
2621 err +=
" difference is " +
2624 OOMPH_CURRENT_FUNCTION);
unsigned nshared_node()
Total number of shared nodes in this Mesh.
virtual std::string tecplot_zone_string(const unsigned &nplot) const
Return string for tecplot zone header (when plotting nplot points in each "coordinate direction") ...
static bool Suppress_warning_about_empty_mesh_level_time_stepper_function
Boolean used to control warning about empty mesh level timestepper function.
void output_boundaries(const std::string &output_filename)
void assign_local_eqn_numbers(const bool &store_local_dof_pt)
Assign the local equation numbers in all elements If the boolean argument is true then also store poi...
unsigned nboundary_element(const unsigned &b) const
Return number of finite elements that are adjacent to boundary b.
A Generalised Element class.
virtual void distribute(OomphCommunicator *comm_pt, const Vector< unsigned > &element_domain, Vector< GeneralisedElement *> &deleted_element_pt, DocInfo &doc_info, const bool &report_stats, const bool &overrule_keep_as_halo_element_status)
Distribute the problem and doc; make this virtual to allow overloading for particular meshes where fu...
void set_communicator_pt(OomphCommunicator *comm_pt)
Node * haloed_node_pt(const unsigned &p, const unsigned &j)
Access fct to the j-th haloed node in this Mesh whose halo counterpart is held on processor p...
void doc_boundary_coordinates(const unsigned &b, std::ofstream &the_file)
Output boundary coordinates on boundary b – template argument specifies the bulk element type (neede...
void add_shared_node_pt(const unsigned &p, Node *&nod_pt)
Add shared node whose counterpart is held on processor p to the storage scheme for shared nodes...
virtual void reset_boundary_element_info(Vector< unsigned > &ntmp_boundary_elements, Vector< Vector< unsigned > > &ntmp_boundary_elements_in_region, Vector< FiniteElement *> &deleted_elements)
Virtual function to perform the reset boundary elements info rutines.
GeneralisedElement *& root_haloed_element_pt(const unsigned &p, const unsigned &e)
Access fct to the e-th root haloed element in this Mesh whose non-halo counterpart is held on process...
unsigned nexternal_halo_node(const unsigned &p)
Number of external halo nodes in this Mesh whose non-halo (external) counterpart is held on processor...
void broken_copy(const std::string &class_name)
Issue error message and terminate execution.
unsigned ndof_types() const
Return number of dof types in mesh.
unsigned nexternal_haloed_node(const unsigned &p)
Number of external haloed nodes in this Mesh whose halo (external) counterpart is held on processor p...
void disable_resizing_of_halo_nodes()
Function to suppress resizing of halo nodes – optmisation but call it at your own risk! ...
std::map< unsigned, Vector< Node * > > Shared_node_pt
void write_pvd_footer(std::ofstream &pvd_file)
Write the pvd file footer.
Vector< GeneralisedElement * > halo_element_pt(const unsigned &p)
Return vector of halo elements in this Mesh whose non-halo counterpart is held on processor p...
Vector< Node * > Node_pt
Vector of pointers to nodes.
std::map< unsigned, Vector< GeneralisedElement * > > Root_halo_element_pt
Map of vectors holding the pointers to the root halo elements.
Node *& boundary_node_pt(const unsigned &b, const unsigned &n)
Return pointer to node n on boundary b.
unsigned nexternal_halo_element()
Total number of external halo elements in this Mesh.
std::map< unsigned, Vector< Node * > > Haloed_node_pt
Map of vectors holding the pointers to the haloed nodes.
SolidMesh(const Vector< SolidMesh *> &sub_mesh_pt)
Constructor builds combined mesh from the meshes specified. Note: This simply merges the meshes' elem...
void convert_to_boundary_node(Node *&node_pt, const Vector< FiniteElement *> &finite_element_pt)
A function that upgrades an ordinary node to a boundary node We shouldn't ever really use this...
SolidMesh(const SolidMesh &dummy)
Broken copy constructor.
SolidNode * element_node_pt(const unsigned long &e, const unsigned &n)
Return the n-th local SolidNode in elemnet e. This is required to cast the nodes in a solid mesh to b...
void get_shared_node_pt(const unsigned &p, Vector< Node *> &shared_node_pt)
Get vector of pointers to shared nodes with processor p. Required for faster search in Missing_master...
void doc_shared_nodes()
Doc shared nodes.
std::map< unsigned, Vector< GeneralisedElement * > > External_halo_element_pt
Map of vectors holding the pointers to the external halo elements.
void add_boundary_node(const unsigned &b, Node *const &node_pt)
Add a (pointer to) a node to the b-th boundary.
void add_external_halo_node_pt(const unsigned &p, Node *&nod_pt)
Add external halo node whose non-halo (external) counterpart is held on processor p to the storage sc...
void resize_halo_nodes()
Helper function that resizes halo nodes to the same size as their non-halo counterparts if required...
virtual void get_s_plot(const unsigned &i, const unsigned &nplot, Vector< double > &s, const bool &shifted_to_interior=false) const
Get cector of local coordinates of plot point i (when plotting nplot points in each "coordinate direc...
static Steady< 0 > Default_TimeStepper
Default Steady Timestepper, to be used in default arguments to Mesh constructors. ...
SolidMesh()
Default constructor.
virtual void output(std::ostream &outfile)
Output the element data — typically the values at the nodes in a format suitable for post-processing...
void output_fct(std::ostream &outfile, const unsigned &n_plot, FiniteElement::SteadyExactSolutionFctPt)
Output a given Vector function at f(n_plot) points in each element.
Node * node_pt(const unsigned long &n) const
Return pointer to global node n (const version)
std::vector< bool > Boundary_coordinate_exists
Vector of boolean data that indicates whether the boundary coordinates have been set for the boundary...
unsigned add_external_haloed_element_pt(const unsigned &p, GeneralisedElement *&el_pt)
Add external haloed element whose non-halo counterpart is held on processor p to the storage scheme f...
Vector< GeneralisedElement * > & element_pt()
Return reference to the Vector of elements.
virtual ~Mesh()
Virtual Destructor to clean up all memory.
Information for documentation of results: Directory and file number to enable output in the form RESL...
Vector< Node * > external_halo_node_pt(const unsigned &p)
Access fct to vector of external halo node in this Mesh whose non-halo external counterpart is held o...
void get_external_halo_node_pt(Vector< Node *> &external_halo_node_pt)
Get vector of pointers to all external halo nodes.
Mesh()
Default constructor.
void add_root_haloed_element_pt(const unsigned &p, GeneralisedElement *&el_pt)
Add root haloed element whose non-halo counterpart is held on processor p to the storage scheme for h...
void add_halo_node_pt(const unsigned &p, Node *&nod_pt)
Add halo node whose non-halo counterpart is held on processor p to the storage scheme for halo nodes...
void shift_time_values()
Shift time-dependent data along for next timestep: Deal with nodal Data/positions and the element's i...
void describe_local_dofs(std::ostream &out, const std::string ¤t_string) const
Function to describe the local dofs of the elements. The ostream specifies the output stream to which...
std::map< unsigned, Vector< Node * > > External_haloed_node_pt
Map of vectors holding the pointers to the external haloed nodes.
GeneralisedElement *& external_halo_element_pt(const unsigned &p, const unsigned &e)
Access fct to the e-th external halo element in this Mesh whose non-halo counterpart is held on proce...
void add_root_halo_element_pt(const unsigned &p, GeneralisedElement *&el_pt)
Add root halo element whose non-halo counterpart is held on processor p to this Mesh.
Node * get_some_non_boundary_node() const
Find a node not on any boundary in mesh_pt (useful for pinning a single node in a purely Neumann prob...
unsigned nexternal_halo_node()
Total number of external halo nodes in this Mesh.
bool Output_halo_elements
Bool for output of halo elements.
A general Finite Element class.
void enable_output_of_halo_elements()
Function to enable halo element output.
void(* UnsteadyExactSolutionFctPt)(const double &, const Vector< double > &, Vector< double > &)
Function pointer for function that computes Vector-valued time-dependent function as ...
Node * boundary_node_pt(const unsigned &b, const unsigned &n) const
Return pointer to node n on boundary b.
void get_halo_node_stats(double &av_number, unsigned &max_number, unsigned &min_number)
Get halo node stats for this distributed mesh: Average/max/min number of halo nodes over all processo...
void operator=(const Mesh &)
Broken assignment operator.
virtual void set_mesh_level_time_stepper(TimeStepper *const &time_stepper_pt, const bool &preserve_existing_data)
Function that can be used to set any additional timestepper data stored at the Mesh (as opposed to no...
void unset_keep_all_elements_as_halos()
Calll this function to unset the flag that keeps all elements in the mesh as halo elements...
double interpolated_x(const Vector< double > &s, const unsigned &i) const
Return FE interpolated coordinate x[i] at local coordinate s. Overloaded to get information from bulk...
FiniteElement * boundary_element_pt(const unsigned &b, const unsigned &e) const
Return pointer to e-th finite element on boundary b.
virtual void scale_mesh(const double &factor)
Scale all nodal coordinates by given factor. Virtual so it can be overloaded in SolidMesh class where...
bool boundary_coordinate_exists(const unsigned &i) const
Indicate whether the i-th boundary has an intrinsic coordinate.
bool is_halo() const
Is this element a halo?
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
unsigned long nboundary_node(const unsigned &ibound) const
Return number of nodes on a particular boundary.
unsigned self_test()
Self-test: Check elements and nodes. Return 0 for OK.
unsigned nodal_dimension() const
Return number of nodal dimension in mesh.
Vector< GeneralisedElement * > haloed_element_pt(const unsigned &p)
Return vector of haloed elements in this Mesh whose haloing counterpart is held on processor p...
void operator=(const SolidMesh &)
Broken assignment operator.
GeneralisedElement *& root_halo_element_pt(const unsigned &p, const unsigned &e)
Access fct to the e-th root halo element in this Mesh whose non-halo counterpart is held on processor...
virtual void dump(std::ofstream &dump_file, const bool &use_old_ordering=true) const
Dump the data in the mesh into a file for restart.
void set_elemental_internal_time_stepper(TimeStepper *const &time_stepper_pt, const bool &preserve_existing_data)
Set the timestepper associated with the internal data stored within elements in the meah...
bool is_hanging() const
Test whether the node is geometrically hanging.
int face_index_at_boundary(const unsigned &b, const unsigned &e) const
For the e-th finite element on boundary b, return int to indicate the face_index of the face adjacent...
unsigned nroot_haloed_element()
Total number of root haloed elements in this Mesh.
void output_external_haloed_elements(std::ostream &outfile, const unsigned &n_plot=5)
Output all external haloed elements.
unsigned nhalo_node(const unsigned &p)
Number of halo nodes in this Mesh whose non-halo counterpart is held on processor p...
void build_face_mesh(const unsigned &b, Mesh *const &face_mesh_pt)
Constuct a Mesh of FACE_ELEMENTs along the b-th boundary of the mesh (which contains elements of type...
virtual void compute_error(std::ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, Vector< double > &error, Vector< double > &norm)
Plot error when compared against a given time-depdendent exact solution. Also returns the norm of the...
void set_boundary_number_in_bulk_mesh(const unsigned &b)
Set function for the boundary number in bulk mesh.
unsigned nnon_halo_element()
Total number of non-halo elements in this mesh (Costly call computes result on the fly) ...
bool Lookup_for_elements_next_boundary_is_setup
void get_efficiency_of_mesh_distribution(double &av_efficiency, double &max_efficiency, double &min_efficiency)
Get efficiency of mesh distribution: In an ideal distribution without halo overhead, each processor would only hold its own elements. Efficieny per processor = (number of non-halo elements)/ (total number of elements).
void check_inverted_elements(bool &mesh_has_inverted_elements)
Check for inverted elements and report outcome.
unsigned nexternal_haloed_element(const unsigned &p)
Number of external haloed elements in this Mesh whose non-halo counterpart is held on processor p...
void(FiniteElement::* UnsteadyExactSolutionFctPt)(const double &time, const Vector< double > &x, Vector< double > &soln)
Typedef for function pointer to function that computes unsteady exact solution.
void copy_boundary_node_data_from_nodes()
virtual unsigned nplot_points(const unsigned &nplot) const
Return total number of plot points (when plotting nplot points in each "coordinate direction") ...
void get_haloed_node_stats(double &av_number, unsigned &max_number, unsigned &min_number)
Get haloed node stats for this distributed mesh: Average/max/min number of haloed nodes over all proc...
void write_pvd_information(std::ofstream &pvd_file, const std::string &output_filename, const double &time)
Add name of output file and associated continuous time to pvd file.
void remove_boundary_node(const unsigned &b, Node *const &node_pt)
virtual void compute_norm(double &norm)
Compute norm of solution – broken virtual can be overloaded by element writer to implement whatever ...
unsigned long nelement() const
Return number of elements in the mesh.
void output(const std::string &output_filename, const unsigned &n_plot)
Output at f(n_plot) points in each element.
GeneralisedElement * element_pt(const unsigned long &e) const
Return pointer to element e (const version)
virtual void classify_halo_and_haloed_nodes(const bool &report_stats=false)
void output(std::ostream &outfile)
Output for all elements.
void assign_initial_values_impulsive()
Assign initial values for an impulsive start.
Vector< Node * > external_haloed_node_pt(const unsigned &p)
Access fct to vector of external haloed node in this Mesh whose halo external counterpart is held on ...
void add_node_pt(Node *const &node_pt)
Add a (pointer to a) node to the mesh.
void output_fct_paraview(std::ofstream &file_out, const unsigned &nplot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt) const
Output in paraview format into specified file. Breaks up each element into sub-elements for plotting ...
unsigned ndim() const
Return (Eulerian) spatial dimension of the node.
void flush_element_storage()
Flush storage for elements (only) by emptying the vectors that store the pointers to them...
SolidNode * node_pt(const unsigned long &n)
Return a pointer to the n-th global SolidNode.
void scale_mesh(const double &factor)
Scale all nodal coordinates by given factor and re-assign the Lagrangian coordinates.
virtual void get_boundaries_pt(std::set< unsigned > *&boundaries_pt)
Return a pointer to set of mesh boundaries that this node occupies; this will be overloaded by Bounda...
unsigned nexternal_halo_element(const unsigned &p)
Number of external halo elements in this Mesh whose non-halo counterpart is held on processor p...
void calculate_predictions()
Calculate predictions for all Data and positions associated with the mesh, usually used in adaptive t...
double & x(const unsigned &i)
Return the i-th nodal coordinate.
unsigned add_external_haloed_node_pt(const unsigned &p, Node *&nod_pt)
Add external haloed node whose halo (external) counterpart is held on processor p to the storage sche...
bool Keep_all_elements_as_halos
bool to indicate whether to keep all elements in a mesh as halos or not
void(* SteadyExactSolutionFctPt)(const Vector< double > &, Vector< double > &)
Function pointer for function that computes vector-valued steady "exact solution" as ...
void check_inverted_elements(bool &mesh_has_inverted_elements, std::ofstream &inverted_element_file)
Check for inverted elements and report outcome in boolean variable. This visits all elements at their...
void null_external_halo_node(const unsigned &p, Node *nod_pt)
Null out specified external halo node (used when deleting duplicates)
void set_nodal_and_elemental_time_stepper(TimeStepper *const &time_stepper_pt, const bool &preserve_existing_data)
Set the timestepper associated with all nodal and elemental data stored in the mesh.
unsigned nhalo_node()
Total number of halo nodes in this Mesh.
void set_keep_all_elements_as_halos()
Call this function to keep all the elements as halo elements.
std::map< unsigned, Vector< GeneralisedElement * > > Root_haloed_element_pt
Map of vectors holding the pointers to the root haloed elements.
virtual unsigned try_to_add_root_haloed_element_pt(const unsigned &p, GeneralisedElement *&el_pt)
std::map< unsigned, Vector< GeneralisedElement * > > External_haloed_element_pt
Map of vectors holding the pointers to the external haloed elements.
void flush_node_storage()
Flush storage for nodes (only) by emptying the vectors that store the pointers to them...
Edge(Node *node1_pt, Node *node2_pt)
Constructor: Pass in the two vertex nodes.
Mesh(const Mesh &dummy)
Broken copy constructor.
Vector< Vector< int > > Face_index_at_boundary
For the e-th finite element on boundary b, this is the index of the face that lies along that boundar...
GeneralisedElement *& element_pt(const unsigned long &e)
Return pointer to element e.
Node * node2_pt() const
Access to the second vertex node.
bool operator==(const Edge &other) const
Comparison operator.
bool is_mesh_distributed() const
Boolean to indicate if Mesh has been distributed.
unsigned nhaloed_node(const unsigned &p)
Number of haloed nodes in this Mesh whose haloed counterpart is held on processor p...
Mesh(const Vector< Mesh *> &sub_mesh_pt)
Constructor builds combined mesh from the meshes specified. Note: This simply merges the meshes' elem...
void interpolated_zeta(const Vector< double > &s, Vector< double > &zeta) const
Calculate the interpolated value of zeta, the intrinsic coordinate of the element when viewed as a co...
Node *& external_halo_node_pt(const unsigned &p, const unsigned &j)
Access fct to the j-th external halo node in this Mesh whose non-halo external counterpart is held on...
unsigned nexternal_haloed_element()
Total number of external haloed elements in this Mesh.
void set_halo(const unsigned &non_halo_proc_ID)
Label the element as halo and specify processor that holds non-halo counterpart.
virtual void create_shared_boundaries(OomphCommunicator *comm_pt, const Vector< unsigned > &element_domain, const Vector< GeneralisedElement *> &backed_up_el_pt, const Vector< FiniteElement *> &backed_up_f_el_pt, std::map< Data *, std::set< unsigned > > &processors_associated_with_data, const bool &overrule_keep_as_halo_element_status)
Creates the shared boundaries, only used in unstructured meshes In this case with the "TriangleMesh" ...
void distribute(OomphCommunicator *comm_pt, const Vector< unsigned > &element_domain, Vector< GeneralisedElement *> &deleted_element_pt, const bool &report_stats=false)
Distribute the problem Add to vector of pointers to deleted elements.
unsigned nboundary() const
Return number of boundaries.
double total_size()
Determine the sum of all "sizes" of the FiniteElements in the mesh (non-FiniteElements are ignored)...
void set_nboundary(const unsigned &nbound)
Set the number of boundaries in the mesh.
virtual void classify_halo_and_haloed_nodes(DocInfo &doc_info, const bool &report_stats)
Classify the halo and haloed nodes in the mesh. Virtual so it can be overloaded to perform additional...
unsigned nexternal_haloed_node()
Total number of external haloed nodes in this Mesh.
Tree * tree_pt()
Access function: Pointer to quadtree representation of this element.
Vector< Node * > prune_dead_nodes()
Prune nodes. Nodes that have been marked as obsolete are removed from the mesh (and its boundary-node...
Node * Node1_pt
First vertex node.
Node * shared_node_pt(const unsigned &p, const unsigned &j)
Access fct to the j-th shared node in this Mesh who has a counterpart on processor p...
virtual void write_tecplot_zone_footer(std::ostream &outfile, const unsigned &nplot) const
Add tecplot zone "footer" to output stream (when plotting nplot points in each "coordinate direction"...
bool is_boundary_edge() const
Test whether the Edge is a boundary edge, i.e. does it connnect two boundary nodes?
void output_boundaries(std::ostream &outfile)
Output the nodes on the boundaries (into separate tecplot zones)
virtual void compute_norm(double &norm)
Compute norm of solution by summing contributions of compute_norm(...) for all constituent elements i...
void set_nodal_time_stepper(TimeStepper *const &time_stepper_pt, const bool &preserve_existing_data)
Set the timestepper associated with the nodal data in the mesh.
virtual void setup_boundary_element_info(std::ostream &outfile)
Setup lookup schemes which establish whic elements are located next to mesh's boundaries. Doc in outfile (if it's open). (Empty virtual function – implement this for specific Mesh classes)
Vector< GeneralisedElement * > root_halo_element_pt(const unsigned &p)
Vector of pointers to root halo elements in this Mesh whose non-halo counterpart is held on processor...
A class that represents a collection of data; each Data object may contain many different individual ...
void add_haloed_node_pt(const unsigned &p, Node *&nod_pt)
Add haloed node whose halo counterpart is held on processor p to the storage scheme for haloed nodes...
void remove_null_pointers_from_external_halo_node_storage()
Consolidate external halo node storage by removing nulled out pointes in external halo and haloed sch...
void prune_halo_elements_and_nodes(Vector< GeneralisedElement *> &deleted_element_pt, const bool &report_stats=false)
(Irreversibly) prune halo(ed) elements and nodes, usually after another round of refinement, to get rid of excessively wide halo layers. Note that the current mesh will be now regarded as the base mesh and no unrefinement relative to it will be possible once this function has been called.
virtual void get_node_reordering(Vector< Node *> &reordering, const bool &use_old_ordering=true) const
Get a reordering of the nodes in the order in which they appear in elements – can be overloaded for ...
Vector< GeneralisedElement * > Element_pt
Vector of pointers to generalised elements.
void set_external_haloed_node_pt(const unsigned &p, const Vector< Node *> &external_haloed_node_pt)
Set vector of external haloed node in this Mesh whose halo external counterpart is held on processor ...
Node *& external_haloed_node_pt(const unsigned &p, const unsigned &j)
Access fct to the j-th external haloed node in this Mesh whose halo external counterpart is held on p...
void check_halo_schemes(DocInfo &doc_info, double &max_permitted_error_for_halo_check)
Check halo and shared schemes on the mesh.
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
unsigned nhaloed_node()
Total number of haloed nodes in this Mesh.
std::map< unsigned, Vector< Node * > > Halo_node_pt
Map of vectors holding the pointers to the halo nodes.
Node *& node_pt(const unsigned long &n)
Return pointer to global node n.
GeneralisedTimestepper used to store the arclength derivatives and pervious solutions required in con...
Vector< Vector< FiniteElement * > > Boundary_element_pt
Vector of Vector of pointers to elements on the boundaries: Boundary_element_pt(b,e)
Vector< GeneralisedElement * > root_haloed_element_pt(const unsigned &p)
Vector of pointers to root haloed elements in this Mesh whose non-halo counterpart is held on process...
void doc_mesh_distribution(DocInfo &doc_info)
Doc the mesh distribution, to be processed with tecplot macros.
bool Resize_halo_nodes_not_required
Set this to true to suppress resizing of halo nodes (at your own risk!)
unsigned long nnode() const
Return number of nodes in the mesh.
unsigned nroot_haloed_element(const unsigned &p)
Number of root haloed elements in this Mesh whose non-halo counterpart is held on processor p...
void output_external_haloed_elements(const unsigned &p, std::ostream &outfile, const unsigned &n_plot=5)
Output all external haloed elements with processor p.
std::map< unsigned, Vector< Node * > > External_halo_node_pt
Map of vectors holding the pointers to the external halo nodes.
void output_external_halo_elements(const unsigned &p, std::ostream &outfile, const unsigned &n_plot=5)
Output all external halo elements with processor p.
FiniteElement * finite_element_pt(const unsigned &e) const
Upcast (downcast?) to FiniteElement (needed to access FiniteElement member functions).
void merge_meshes(const Vector< Mesh *> &sub_mesh_pt)
Merge meshes. Note: This simply merges the meshes' elements and nodes (ignoring duplicates; no bounda...
void set_halo(const unsigned &non_halo_proc_ID)
Label the node as halo and specify processor that holds non-halo counterpart.
void disable_doc()
Disable documentation.
void set_external_halo_node_pt(const unsigned &p, const Vector< Node *> &external_halo_node_pt)
Set vector of external halo node in this Mesh whose non-halo external counterpart is held on processo...
void output(const std::string &output_filename)
Output for all elements.
virtual void node_update(const bool &update_all_solid_nodes=false)
Update nodal positions in response to changes in the domain shape. Uses the FiniteElement::get_x(...) function for FiniteElements and doesn't do anything for other element types. If a MacroElement pointer has been set for a FiniteElement, the MacroElement representation is used to update the nodal positions; if not get_x(...) uses the FE interpolation and thus leaves the nodal positions unchanged. Virtual, so it can be overloaded by specific meshes, such as AlgebraicMeshes or SpineMeshes. Generally, this function updates the position of all nodes in response to changes in the boundary position. However, we ignore all SolidNodes since their position is computed as part of the solution – unless the bool flag is set to true. Such calls are typically made when the initial mesh is created and/or after a mesh has been refined repeatedly before the start of the computation.
A Class for nodes that deform elastically (i.e. position is an unknown in the problem). The idea is that the Eulerian positions are stored in a Data object and the Lagrangian coordinates are stored in addition. The pointer that addresses the Eulerian positions is set to the pointer to Value in the Data object. Hence, SolidNode uses knowledge of the internal structure of Data and must be a friend of the Data class. In order to allow a mesh to deform via an elastic-style equation in deforming-domain problems, the positions are stored separately from the values, so that elastic problems may be combined with any other type of problem.
unsigned nroot_halo_element()
Total number of root halo elements in this Mesh.
void broken_assign(const std::string &class_name)
Issue error message and terminate execution.
void dump(const std::string &dump_file_name, const bool &use_old_ordering=true) const
Dump the data in the mesh into a file for restart.
Vector< Vector< Node * > > Boundary_node_pt
Vector of Vector of pointers to nodes on the boundaries: Boundary_node_pt(b,n). Note that this is pri...
void synchronise_shared_nodes(const bool &report_stats)
Synchronise shared node lookup schemes to cater for the the case where: (1) a certain node on the cur...
void set_consistent_pinned_values_for_continuation(ContinuationStorageScheme *const &continuation_stepper_pt)
Set consistent values for pinned data in continuation.
void max_and_min_element_size(double &max_size, double &min_size)
Determine max and min area for all FiniteElements in the mesh (non-FiniteElements are ignored) ...
bool operator<(const Edge &other) const
Less-than operator.
void output_external_halo_elements(std::ostream &outfile, const unsigned &n_plot=5)
Output all external halo elements.
std::string string(const unsigned &i)
Return the i-th string or "" if the relevant string hasn't been defined.
unsigned check_for_repeated_nodes(const double &epsilon=1.0e-12)
Check for repeated nodes within a given spatial tolerance. Return (0/1) for (pass/fail).
bool does_pointer_correspond_to_mesh_data(double *const ¶meter_pt)
Does the double pointer correspond to any mesh data.
void get_all_halo_data(std::map< unsigned, double *> &map_of_halo_data)
Get all the halo data stored in the mesh and add pointers to the data to the map, indexed by global e...
virtual void setup_boundary_element_info()
Interface for function that is used to setup the boundary information (Empty virtual function – impl...
static SolidICProblem Solid_IC_problem
Static problem that can be used to assign initial conditions on a given solid mesh (need to define th...
Node * node1_pt() const
Access to the first vertex node.
void add_element_pt(GeneralisedElement *const &element_pt)
Add a (pointer to) an element to the mesh.
virtual void reorder_nodes(const bool &use_old_ordering=true)
Re-order nodes in the order in which they appear in elements – can be overloaded for more efficient ...
bool node_global_position_comparison(Node *nd1_pt, Node *nd2_pt)
unsigned nroot_halo_element(const unsigned &p)
Number of root halo elements in this Mesh whose non-halo counterpart is held on processor p...
virtual bool is_on_boundary() const
Test whether the Node lies on a boundary. The "bulk" Node cannot lie on a boundary, so return false. This will be overloaded by BoundaryNodes.
bool is_on_boundary() const
Test whether the Edge lies on a boundary. Relatively simple test, based on both vertices lying on (so...
unsigned elemental_dimension() const
Return number of elemental dimension in mesh.
const Vector< GeneralisedElement * > & element_pt() const
Return reference to the Vector of elements.
unsigned nshared_node(const unsigned &p)
Number of shared nodes in this Mesh who have a counterpart on processor p.
void describe_dofs(std::ostream &out, const std::string ¤t_string) const
Function to describe the dofs of the Mesh. The ostream specifies the output stream to which the descr...
virtual void compute_error(std::ostream &outfile, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt, const double &time, Vector< double > &error, Vector< double > &norm)
Plot error when compared against a given time-depdendent exact solution. Also returns the norm of the...
Node * Node2_pt
Second vertex node.
void disable_output_of_halo_elements()
Function to disable halo element output.
void assert_geometric_element(const unsigned &dim, const unsigned &nnode_1d=0)
Helper function to assert that finite element of type ELEMENT can be cast to base class of type GEOM_...
unsigned long assign_global_eqn_numbers(Vector< double *> &Dof_pt)
Assign the global equation numbers in the Data stored at the nodes and also internal element Data...
virtual void compute_error(std::ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error, double &norm)
Plot error when compared against a given time-depdendent exact solution. Also returns the norm of the...
void flush_element_and_node_storage()
Flush storage for elements and nodes by emptying the vectors that store the pointers to them...
void enable_resizing_of_halo_nodes()
Function to (re-)enable resizing of halo nodes – this returns things to the default behaviour...
virtual unsigned try_to_add_haloed_node_pt(const unsigned &p, Node *&nod_pt)
OomphCommunicator * communicator_pt() const
void stick_leaves_into_vector(Vector< Tree * > &)
Traverse tree and stick pointers to leaf "nodes" (only) into Vector.
virtual bool is_a_copy() const
Return a boolean to indicate whether the Data objact contains any copied values. A base Data object c...
void add_external_halo_element_pt(const unsigned &p, GeneralisedElement *&el_pt)
Add external halo element whose non-halo counterpart is held on processor p to this Mesh...
SolidNode * boundary_node_pt(const unsigned &b, const unsigned &n)
Return n-th SolidNodes on b-th boundary.
std::set< int > external_halo_proc()
Return the set of processors that hold external halo nodes. This is required to avoid having to pass ...
Base class for time-stepping schemes. Timestepper provides an approximation of the temporal derivativ...
virtual void compute_error(std::ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error, double &norm)
Plot the error when compared against a given exact solution . Also calculates the norm of the error a...
void delete_all_external_storage()
Wipe the storage for all externally-based elements.
OomphCommunicator * Comm_pt
Pointer to communicator – set to NULL if mesh is not distributed.
virtual void compute_error(std::ostream &outfile, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt, const double &time, double &error, double &norm)
Plot error when compared against a given exact solution. Also returns the norm of the error and that ...
GeneralisedElement *& external_haloed_element_pt(const unsigned &p, const unsigned &e)
Access fct to the e-th external haloed element in this Mesh whose non-halo counterpart is held on pro...
void(FiniteElement::* SteadyExactSolutionFctPt)(const Vector< double > &x, Vector< double > &soln)
Typedef for function pointer to function that computes steady exact solution.
IC problem for an elastic body discretised on a given (sub)-mesh. We switch the elements' residuals a...
void remove_boundary_nodes()
Clear all pointers to boundary nodes.
Node * halo_node_pt(const unsigned &p, const unsigned &j)
Access fct to the j-th halo node in this Mesh whose non-halo counterpart is held on processor p...
std::string to_string(T object, unsigned float_precision=8)
Conversion function that should work for anything with operator<< defined (at least all basic types)...
void output_paraview(std::ofstream &file_out, const unsigned &nplot) const
Output in paraview format into specified file. Breaks up each element into sub-elements for plotting ...
void setup_shared_node_scheme()
Setup shared node scheme.
virtual void read(std::ifstream &restart_file)
Read solution from restart file.
void write_pvd_header(std::ofstream &pvd_file)
Write the pvd file header.
An oomph-lib wrapper to the MPI_Comm communicator object. Just contains an MPI_Comm object (which is ...