43#include "triangle_mesh.h"
122 <<
"Element " <<
e <<
" in submesh " <<
imesh
123 <<
" is a duplicate \n and was ignored when assembling"
124 <<
" combined mesh." << std::endl;
126 "Mesh::Mesh(const Vector<Mesh*>&)",
140 for (
unsigned long n = 0;
n <
n_node;
n++)
150 <<
"WARNING: " << std::endl
151 <<
"Node " <<
n <<
" in submesh " <<
imesh
152 <<
" is a duplicate \n and was ignored when assembling "
153 <<
"combined mesh." << std::endl;
155 "Mesh::Mesh(const Vector<Mesh*>&)",
208 for (
unsigned b = 0; b <
n_bound; b++)
296 for (
unsigned long n = 0;
n <
nnode();
n++)
302 unsigned nmaster =
nod_pt->hanging_pt()->nmaster();
327 err_stream <<
"Calling node_update() for a mesh which contains"
329 <<
"master nodes which live in the external storage."
331 <<
"These nodes do not belong to elements on this"
333 <<
"processor and therefore cannot be updated locally."
373 for (
unsigned e = 0;
e <
nel;
e++)
398 if (!(
nod_pt->is_hanging()))
453 for (
unsigned j = 0;
j <
nnod;
j++)
462 for (
unsigned long n = 0;
n <
n_node;
n++)
477 unsigned nmaster =
nod_pt->hanging_pt()->nmaster();
493 for (
unsigned long n = 0;
n <
n_node;
n++)
495 Node_pt[
n]->perform_auxiliary_node_update_fct();
499 oomph_info <<
"Time taken to update nodal positions [sec]: "
539 std::map<Node*, bool>
done;
558 for (
unsigned j = 0;
j <
nnod;
j++)
565 unsigned long count = 0;
571 for (
unsigned e = 0;
e <
nel;
e++)
582 for (
unsigned j = 0;
j <
nnod;
j++)
614 std::string error_message =
"Trouble: Number of nodes hasn't stayed ";
617 error_message +=
"constant during reordering!\n";
685 for (
unsigned long i = 0;
i <
nnod;
i++)
692 for (
unsigned long i = 0;
i <
nel;
i++)
716 for (
unsigned long i = 0;
i <
nnod;
i++)
726 for (
unsigned long i = 0;
i <
nel;
i++)
751 for (
unsigned long i = 0;
i <
nel;
i++)
808 oomph_info <<
"\n ERROR: Failed Element::self_test() for element i="
819 <<
" duplicate elements were encountered in mesh!"
833 oomph_info <<
"\n ERROR: Failed Node::self_test() for node i=" <<
i
844 <<
" duplicate nodes were encountered in mesh!" << std::endl;
883 for (
unsigned e = 0;
e <
nelem;
e++)
911 for (
unsigned i = 0;
i <
n_dim;
i++)
977 for (
unsigned long n = 0;
n <
n_node;
n++)
990 if (!(
Node_pt[
n]->is_on_boundary()))
1099 dump_file <<
Node_pt_range <<
" # number of nodes " << std::endl;
1109 for (
unsigned e = 0;
e < n_element;
e++)
1116 <<
" # number of internal Data items in element " <<
e
1156 <<
" is not the same as specified in the restart file "
1164 for (
unsigned long n = 0;
n <
n_node;
n++)
1182 for (
unsigned e = 0;
e < n_element;
e++)
1200 <<
" is not the same as specified in the restart file "
1226 const unsigned&
nplot)
const
1229 file_out.setf(std::ios_base::uppercase);
1240 throw OomphLibError(
"Recast for FiniteElement failed for element 0!\n",
1259 <<
"Element " <<
i <<
" has different number of degrees of freedom\n"
1260 <<
"than from previous elements, Paraview cannot handle this.\n"
1261 <<
"We suggest that the problem is broken up into submeshes instead."
1284 error_stream <<
"Recast for element " <<
i <<
" failed" << std::endl;
1300 file_out <<
"<?xml version=\"1.0\"?>\n"
1301 <<
"<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" "
1302 <<
"byte_order=\"LittleEndian\">\n"
1303 <<
"<UnstructuredGrid>\n"
1323 for (
unsigned i = 0;
i < ndof;
i++)
1325 file_out <<
"<DataArray type=\"Float32\" "
1327 <<
"format=\"ascii\""
1340 error_stream <<
"Recast for element " <<
j <<
" failed" << std::endl;
1362 <<
"<DataArray type=\"Float32\""
1363 <<
" NumberOfComponents=\""
1366 <<
"format=\"ascii\">\n";
1379 error_stream <<
"Recast for element " <<
i <<
" faild" << std::endl;
1397 <<
"<DataArray type=\"Int32\" Name=\"connectivity\" format=\"ascii\">\n";
1414 error_stream <<
"Recast for element " <<
i <<
" faild" << std::endl;
1423 <<
"<DataArray type=\"Int32\" "
1424 <<
"Name=\"offsets\" format=\"ascii\">\n";
1440 error_stream <<
"Recast for element " <<
i <<
" failed" << std::endl;
1449 <<
"<DataArray type=\"UInt8\" Name=\"types\">\n";
1462 error_stream <<
"Recast for element " <<
i <<
" failed" << std::endl;
1478 <<
"</UnstructuredGrid>\n"
1493 const unsigned&
nplot,
1497 file_out.setf(std::ios_base::uppercase);
1508 throw OomphLibError(
"Recast for FiniteElement failed for element 0!\n",
1527 <<
"Element " <<
i <<
" has different number of degrees of freedom\n"
1528 <<
"than from previous elements, Paraview cannot handle this.\n"
1529 <<
"We suggest that the problem is broken up into submeshes instead."
1552 error_stream <<
"Recast for element " <<
i <<
" failed" << std::endl;
1568 file_out <<
"<?xml version=\"1.0\"?>\n"
1569 <<
"<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" "
1570 <<
"byte_order=\"LittleEndian\">\n"
1571 <<
"<UnstructuredGrid>\n"
1591 for (
unsigned i = 0;
i < ndof;
i++)
1593 file_out <<
"<DataArray type=\"Float32\" "
1595 <<
"format=\"ascii\""
1608 error_stream <<
"Recast for element " <<
j <<
" failed" << std::endl;
1630 <<
"<DataArray type=\"Float32\""
1631 <<
" NumberOfComponents=\""
1634 <<
"format=\"ascii\">\n";
1647 error_stream <<
"Recast for element " <<
i <<
" faild" << std::endl;
1665 <<
"<DataArray type=\"Int32\" Name=\"connectivity\" format=\"ascii\">\n";
1682 error_stream <<
"Recast for element " <<
i <<
" faild" << std::endl;
1691 <<
"<DataArray type=\"Int32\" "
1692 <<
"Name=\"offsets\" format=\"ascii\">\n";
1708 error_stream <<
"Recast for element " <<
i <<
" failed" << std::endl;
1717 <<
"<DataArray type=\"UInt8\" Name=\"types\">\n";
1730 error_stream <<
"Recast for element " <<
i <<
" failed" << std::endl;
1746 <<
"</UnstructuredGrid>\n"
1761 const unsigned&
nplot,
1766 file_out.setf(std::ios_base::uppercase);
1777 throw OomphLibError(
"Recast for FiniteElement failed for element 0!\n",
1796 <<
"Element " <<
i <<
" has different number of degrees of freedom\n"
1797 <<
"than from previous elements, Paraview cannot handle this.\n"
1798 <<
"We suggest that the problem is broken up into submeshes instead."
1821 error_stream <<
"Recast for element " <<
i <<
" failed" << std::endl;
1837 file_out <<
"<?xml version=\"1.0\"?>\n"
1838 <<
"<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" "
1839 <<
"byte_order=\"LittleEndian\">\n"
1840 <<
"<UnstructuredGrid>\n"
1860 for (
unsigned i = 0;
i < ndof;
i++)
1862 file_out <<
"<DataArray type=\"Float32\" "
1864 <<
"format=\"ascii\""
1877 error_stream <<
"Recast for element " <<
j <<
" failed" << std::endl;
1900 <<
"<DataArray type=\"Float32\""
1901 <<
" NumberOfComponents=\""
1904 <<
"format=\"ascii\">\n";
1917 error_stream <<
"Recast for element " <<
i <<
" faild" << std::endl;
1935 <<
"<DataArray type=\"Int32\" Name=\"connectivity\" format=\"ascii\">\n";
1952 error_stream <<
"Recast for element " <<
i <<
" faild" << std::endl;
1961 <<
"<DataArray type=\"Int32\" "
1962 <<
"Name=\"offsets\" format=\"ascii\">\n";
1978 error_stream <<
"Recast for element " <<
i <<
" failed" << std::endl;
1987 <<
"<DataArray type=\"UInt8\" Name=\"types\">\n";
2000 error_stream <<
"Recast for element " <<
i <<
" failed" << std::endl;
2016 <<
"</UnstructuredGrid>\n"
2038 oomph_info <<
"Can't execute output(...) for non FiniteElements"
2081 oomph_info <<
"Can't execute output(...) for non FiniteElements"
2124 oomph_info <<
"Can't execute output(...) for non FiniteElements"
2167 oomph_info <<
"Can't execute output(...) for non FiniteElements"
2212 oomph_info <<
"Can't execute output_fct(...) for non FiniteElements"
2257 oomph_info <<
"Can't execute output_fct(...) for non FiniteElements"
2291 unsigned long Nelement =
nelement();
2292 for (
unsigned long e = 0;
e < Nelement;
e++)
2309 for (
unsigned long n = 0;
n <
n_node;
n++)
2316 ->position_time_stepper_pt()
2317 ->assign_initial_positions_impulsive(
Node_pt[
n]);
2330 const unsigned long Nelement =
nelement();
2331 for (
unsigned long e = 0;
e < Nelement;
e++)
2348 for (
unsigned long n = 0;
n <
n_node;
n++)
2370 const unsigned long Nelement =
nelement();
2371 for (
unsigned long e = 0;
e < Nelement;
e++)
2388 for (
unsigned long n = 0;
n <
n_node;
n++)
2393 Node_pt[
n]->position_time_stepper_pt()->calculate_predicted_positions(
2410 <<
"Empty set_mesh_level_time_stepper() has been called.\n"
2411 <<
"This function needs to be overloaded to reset any (pointers to) \n"
2412 <<
"timesteppers for meshes that store timesteppers in locations "
2414 <<
"than the Nodes or Elements;\n"
2415 <<
"e.g. SpineMeshes have SpineData with timesteppers,\n"
2416 <<
"Triangle and TetMeshes store the timestepper for use in "
2417 "adaptivity.\n\n\n";
2419 <<
"If you are solving a continuation or bifurcation detecion\n"
2420 <<
"problem and strange things are happening, then check that\n"
2421 <<
"you don't need to overload this function for your mesh."
2422 <<
"\n This warning can be suppressed by setting:\n"
2423 <<
"Mesh::Suppress_warning_about_empty_mesh_level_time_stepper_"
2441 for (
unsigned long n = 0;
n <
n_node;
n++)
2450 for (
unsigned long e = 0;
e < n_element;
e++)
2475 for (
unsigned long n = 0;
n <
n_node;
n++)
2479 (this->
Node_pt[
n]->does_pointer_correspond_to_position_data(
2488 for (
unsigned long e = 0;
e < n_element;
e++)
2521 for (
unsigned long n = 0;
n <
n_node;
n++)
2524 this->
Node_pt[
n]->set_time_stepper(time_stepper_pt,
2526 this->
Node_pt[
n]->set_position_time_stepper(time_stepper_pt,
2540 for (
unsigned long e = 0;
e < n_element;
e++)
2605 std::list<std::pair<unsigned long, int>>
2610 for (
unsigned long e = 0;
e < n_element;
e++)
2637 <<
" is not contained in any elements in the Mesh."
2639 <<
"How was it created then?" << std::endl;
2653 std::list<std::pair<unsigned long, int>>::iterator
list_it =
2734 for (
int d = 0; d <
n_proc; d++)
2757 for (
unsigned j = 0;
j <
nnod;
j++)
2786 for (
unsigned j = 0;
j <
nnod;
j++)
2820 for (
unsigned j = 0;
j <
nnod;
j++)
2847 for (
unsigned j = 0;
j <
nnod;
j++)
2871 oomph_info <<
"Time for identification of shared nodes: "
2916 "Processor has shared nodes with itself! Something's gone wrong!",
2932 for (
int d = 0; d <
n_proc; d++)
2956 oomph_info <<
"Time for initial classification in "
2957 "Mesh::synchronise_shared_nodes(): "
3073 oomph_info <<
"Time for alltoall in Mesh::synchronise_shared_nodes(): "
3081 oomph_info <<
"Starting vector to set conversion in "
3082 <<
"Mesh::synchronise_shared_nodes() for a total of "
3091 for (
int d = 0; d <
n_proc; d++)
3105 <<
"Time for vector to set in Mesh::synchronise_shared_nodes(): "
3129 std::map<unsigned, std::pair<Node*, std::set<unsigned>>>
domains_map;
3166 for (std::map<
unsigned, std::pair<
Node*, std::set<unsigned>>>::iterator
3177 error_stream <<
"Map did not store entries in order of key\n "
3178 <<
"Current key: " << (*it).first
3180 <<
"Need to rewrite this...\n";
3192 std::set<unsigned>
domain_set((*it).second.second);
3206 std::set<Node*>::iterator
ittt =
3234 "Processor has shared nodes with itself! Something's gone wrong!",
3245 <<
"Time for final processing in Mesh::synchronise_shared_nodes(): "
3253 oomph_info <<
"Total time for Mesh::synchronise_shared_nodes(): "
3289 oomph_info <<
"Time for Mesh::setup_shared_node_scheme() "
3290 <<
" Mesh::classify_halo_and_haloed_nodes(): "
3320 for (
unsigned e = 0;
e <
nelem;
e++)
3329 for (
unsigned j = 0;
j <
nnod;
j++)
3340 ->variable_position_pt()]
3352 for (
unsigned e = 0;
e < nelem;
e++)
3362 for (
unsigned j = 0;
j <
nnod;
j++)
3374 ->variable_position_pt()]
3386 <<
"Time for setup loops in Mesh::classify_halo_and_haloed_nodes: "
3403 for (
int d = 0; d <
n_proc; d++)
3443 for (std::set<unsigned>::iterator
it =
procs_set.begin();
3550 <<
"Time for pt2pt send/recv in Mesh::classify_halo_and_haloed_nodes: "
3562 for (
unsigned j = 0;
j <
nnod;
j++)
3580 for (std::set<unsigned>::iterator
it =
procs_set.begin();
3612 std::map<Node*, bool>
done;
3623 for (
unsigned e = 0;
e <
nelem;
e++)
3634 for (
unsigned j = 0;
j <
nnod;
j++)
3702 for (
unsigned e = 0;
e <
nelem;
e++)
3713 for (
unsigned j = 0;
j <
nnod;
j++)
3742 <<
"Time for first classific in Mesh::classify_halo_and_haloed_nodes: "
3800 for (
unsigned j = 0;
j <
nnod;
j++)
3855 oomph_info <<
"Global max number of overlooked haloes: "
3861 oomph_info <<
"Time for setup 1st alltoalls in "
3862 "Mesh::classify_halo_and_haloed_nodes: "
3885 <<
"Time for 1st alltoall in Mesh::classify_halo_and_haloed_nodes: "
3936 <<
"Time for 2nd alltoall in Mesh::classify_halo_and_haloed_nodes: "
4012 <<
"Failed to find node that is shared node " <<
j
4014 <<
") \n in shared node lookup scheme with processor "
4029 oomph_info <<
"Time for 1st setup 3rd alltoall in "
4030 "Mesh::classify_halo_and_haloed_nodes: "
4058 for (
unsigned j = 0;
j <
n;
j++)
4076 oomph_info <<
"Time for 2nd setup 3rd alltoall in "
4077 "Mesh::classify_halo_and_haloed_nodes: "
4102 <<
"Time for 3rd alltoall in Mesh::classify_halo_and_haloed_nodes: "
4153 <<
"Time for 4th alltoall in Mesh::classify_halo_and_haloed_nodes: "
4209 oomph_info <<
"Time for postproc 4th alltoall in "
4210 "Mesh::classify_halo_and_haloed_nodes: "
4220 for (
int d = 0; d <
n_proc; d++)
4228 for (
unsigned j = 0;
j <
nnod;
j++)
4233 for (
unsigned j = 0;
j <
nnod;
j++)
4241 for (
unsigned j = 0;
j <
nnod;
j++)
4246 for (
unsigned j = 0;
j <
nnod;
j++)
4259 <<
" holds " << this->
nnode() <<
" nodes of which "
4260 << this->
nhalo_node() <<
" are halo nodes \n while "
4262 << this->
nshared_node() <<
" are shared nodes." << std::endl;
4331 "Processor has haloed nodes with itself! Something's gone wrong!",
4339 "Processor has halo nodes with itself! Something's gone wrong!",
4346 throw OomphLibError(
"Processor has root haloed elements with itself! "
4347 "Something's gone wrong!",
4355 "Processor has root halo elements with itself! Something's gone wrong!",
4369 <<
" are shared nodes." << std::endl;
4406 oomph_info <<
"Total time for Mesh::classify_halo_and_halo_nodes(): "
4444 for (
int d = 0; d <
n_proc; d++)
4474 std::ostringstream error_message;
4475 error_message <<
"Clash in numbers of halo and haloed nodes "
4477 error_message <<
" between procs " <<
dd <<
" and " << d
4489 std::ostringstream error_message;
4491 <<
"Clash in numbers of external halo and haloed nodes "
4493 error_message <<
" between procs " <<
dd <<
" and " << d
4561 "Failed to cast node to boundary node even though "
4562 "we've received data for boundary node",
4572 ->index_of_first_value_assigned_by_face_element_pt() ==
4576 ->index_of_first_value_assigned_by_face_element_pt() =
4577 new std::map<unsigned, unsigned>;
4583 std::map<unsigned, unsigned>*
map_pt =
4585 ->index_of_first_value_assigned_by_face_element_pt();
4600 std::ostringstream error_message;
4601 error_message <<
"Existing map entry for map entry "
4602 <<
i <<
" for node located at ";
4604 for (
unsigned ii = 0;
ii <
n;
ii++)
4688 std::map<unsigned, unsigned>*
map_pt =
4689 bnod_pt->index_of_first_value_assigned_by_face_element_pt();
4704 for (std::map<unsigned, unsigned>::iterator
p =
4739 oomph_info <<
"Total time for Mesh::resize_halo_nodes(): "
4757 unsigned n_node = (
it->second).size();
4792 for (
unsigned l = 0;
l <
nleaf;
l++)
4812 unsigned n_node = (
it->second).size();
4875 int min = 1000000000;
4934 int min = 1000000000;
4970 int n_proc = comm_pt->nproc();
4971 int my_rank = comm_pt->my_rank();
4987 for (
int d = 0; d <
n_proc; d++)
4994 << doc_info.
number() <<
".dat";
4999 for (
unsigned e = 0;
e <
nelem;
e++)
5011 for (
int d = 0; d <
n_proc; d++)
5032 for (
unsigned j = 0;
j <
nnod;
j++)
5039 for (
unsigned e = 0;
e <
nelem;
e++)
5050 for (
unsigned j = 0;
j <
nnod;
j++)
5072 for (
int d = 0; d <
n_proc; d++)
5079 << doc_info.
number() <<
".dat";
5084 for (
unsigned j = 0;
j <
nnod;
j++)
5088 for (
unsigned i = 0;
i <
n_dim;
i++)
5094 for (
int d = 0; d <
n_proc; d++)
5106 for (
unsigned j = 0;
j <
nnod;
j++)
5117 for (
unsigned e = 0;
e <
nelem;
e++)
5174 for (
unsigned e = 0;
e <
nelem;
e++)
5211 for (
unsigned e = 0;
e <
nelem;
e++)
5259 for (std::set<unsigned>::iterator
it =
5332 for (
unsigned e = 0;
e <
nelem;
e++)
5376 std::map<unsigned, bool>
done;
5378 for (
int d = 0; d <
n_proc; d++)
5381 for (
unsigned e = 0;
e <
nelem;
e++)
5389 std::ostringstream error_message;
5390 error_message <<
"Have already added element " << number
5391 <<
" as root halo element\n"
5397 done[number] =
true;
5479 comm_pt->mpi_comm());
5488 for (
int d = 0; d <
n_proc; d++)
5491 std::map<unsigned, bool>
done;
5496 for (
unsigned e = 0;
e <
n;
e++)
5514 std::ostringstream error_message;
5515 error_message <<
"Have already added element " << number
5516 <<
" as root haloed element\n"
5522 done[number] =
true;
5538 <<
" are root halo elements \n while "
5549 for (
unsigned e = 0;
e < nelem;
e++)
5559 for (
unsigned j = 0;
j <
nnod;
j++)
5562 nod_pt->set_non_obsolete();
5572#ifdef OOMPH_HAS_TRIANGLE_LIB
5573 if (is_a_triangle_mesh_base_mesh)
5587#ifdef OOMPH_HAS_TRIANGLE_LIB
5647 <<
"\n----------------------------------------------------\n";
5649 << this->
nelement() <<
" elements of which "
5651 <<
" are root halo elements \n while "
5653 <<
" are root haloed elements" << std::endl;
5660 <<
" are shared nodes." << std::endl;
5668 <<
" halo nodes, and " << std::endl
5674 <<
"----------------------------------------------------\n\n";
5688 for (
unsigned j = 0;
j <
nnod;
j++)
5698 for (
unsigned e = 0;
e <
nelem;
e++)
5771 <<
"Time for establishing refinement levels in "
5772 <<
" Mesh::prune_halo_elements_and_nodes() [includes comms]: "
5813 for (
unsigned j = 0;
j <
nnod;
j++)
5828 ref_mesh_pt->uniform_refinement_level_when_pruned();
5839 <<
"Time for synchronising refinement levels in "
5840 <<
" Mesh::prune_halo_elements_and_nodes() [includes comms]: "
5862 std::map<unsigned, std::map<FiniteElement*, bool>>
5875 for (
unsigned e = 0;
e <
nelem;
e++)
5904 for (
unsigned j = 0;
j <
nnod;
j++)
5908 if (!
nod_pt->is_obsolete())
5928 oomph_info <<
"Time for setup of retention pattern in "
5929 <<
" Mesh::prune_halo_elements_and_nodes(): "
5947 for (
int d = 0; d <
n_proc; d++)
5980 for (
unsigned e = 0;
e <
nelem;
e++)
6043 for (
unsigned e = 0;
e <
nelem;
e++)
6091 oomph_info <<
"Time for pt2pt comms of retention pattern in "
6092 <<
" Mesh::prune_halo_elements_and_nodes(): "
6104 for (
unsigned j = 0;
j <
nnod;
j++)
6117 for (
unsigned e = 0;
e <
nelem;
e++)
6123 unsigned level =
ref_el_pt->refinement_level();
6154 my_el_pt->tree_pt()->flush_object();
6197 Tree* tree_pt = (*it);
6215 for (
unsigned e = 0;
e <
nelem;
e++)
6222 for (
unsigned e = 0;
e <
nelem;
e++)
6237 for (
unsigned e = 0;
e < nelem;
e++)
6243 for (
unsigned j = 0;
j <
nnod;
j++)
6246 nod_pt->set_non_obsolete();
6256 for (
unsigned j = 0;
j <
nnod;
j++)
6259 if (!
nod_pt->is_obsolete())
6297 <<
"Time for local rebuild of mesh from retained elements in "
6298 <<
" Mesh::prune_halo_elements_and_nodes(): " <<
t_end -
t_start
6309 oomph_info <<
"Time for Mesh::classify_halo_and_haloed_nodes() "
6310 <<
" Mesh::prune_halo_elements_and_nodes(): "
6323 <<
" " << doc_info.
number() << std::endl;
6337 oomph_info <<
"Time for Mesh::reorder_nodes() "
6338 <<
" Mesh::prune_halo_elements_and_nodes(): "
6349 <<
"\n----------------------------------------------------\n";
6351 << this->
nelement() <<
" elements of which "
6353 <<
" are root halo elements \n while "
6355 <<
" are root haloed elements" << std::endl;
6362 <<
" are shared nodes." << std::endl;
6370 <<
" halo nodes, and " << std::endl
6376 <<
"----------------------------------------------------\n\n";
6404 for (
int d = 0; d <
n_proc; d++)
6438 double min = 1000000000.0;
6451 if (
eff > max) max =
eff;
6483 <<
"elements_on_proc" <<
my_rank <<
"_" << doc_info.
number()
6486 this->
output(some_file, 5);
6492 <<
"non_halo_elements_on_proc" <<
my_rank <<
"_"
6493 << doc_info.
number() <<
".dat";
6498 for (
unsigned e = 0;
e < nelem;
e++)
6509 some_file <<
"Generalised Element " <<
e <<
"\n";
6525 <<
"halo_elements_on_proc" <<
my_rank <<
"_" << doc_info.
number()
6532 <<
"halo_elements_with_proc" <<
domain <<
"_on_proc" <<
my_rank
6533 <<
"_" << doc_info.
number() <<
".dat";
6539 for (
unsigned e = 0;
e <
nelem;
e++)
6553 std::ostringstream error_message;
6555 <<
"Haloed element is not a leaf element. This shouldn't happen"
6557 error_message <<
"Here are the nodal positions: " << std::endl;
6559 for (
unsigned j = 0;
j <
nnod;
j++)
6563 for (
unsigned i = 0;
i <
n_dim;
i++)
6565 error_message <<
nod_pt->x(
i) <<
" ";
6567 error_message <<
"\n";
6582 some_file <<
"Generalised Element " <<
e <<
"\n";
6583 some_file2 <<
"Generalised Element " <<
e <<
"\n";
6593 <<
"haloed_elements_on_proc" <<
my_rank <<
"_" << doc_info.
number()
6600 <<
"haloed_elements_with_proc" <<
domain <<
"_on_proc"
6608 for (
unsigned e = 0;
e <
nelem;
e++)
6624 std::ostringstream error_message;
6626 <<
"Haloed element is not a leaf element. This shouldn't happen"
6628 error_message <<
"Here are the nodal positions: " << std::endl;
6630 for (
unsigned j = 0;
j <
nnod;
j++)
6634 for (
unsigned i = 0;
i <
n_dim;
i++)
6636 error_message <<
nod_pt->x(
i) <<
" ";
6638 error_message <<
"\n";
6653 some_file <<
"Generalised Element " <<
e <<
"\n";
6654 some_file2 <<
"Generalised Element " <<
e <<
"\n";
6665 <<
"non_halo_nodes_on_proc" <<
my_rank <<
"_" << doc_info.
number()
6669 for (
unsigned j = 0;
j <
nnod;
j++)
6675 for (
unsigned i = 0;
i < ndim;
i++)
6693 for (
unsigned j = 0;
j <
nnod;
j++)
6697 for (
unsigned i = 0;
i < ndim;
i++)
6709 <<
"solid_nodes_on_proc" <<
my_rank <<
"_" << doc_info.
number()
6713 for (
unsigned j = 0;
j <
nsnod;
j++)
6720 for (
unsigned i = 0;
i < ndim;
i++)
6735 <<
"halo_nodes_on_proc" <<
my_rank <<
"_" << doc_info.
number()
6742 <<
"halo_nodes_with_proc" <<
domain <<
"_on_proc" <<
my_rank
6743 <<
"_" << doc_info.
number() <<
".dat";
6746 for (
unsigned j = 0;
j <
nnod;
j++)
6750 for (
unsigned i = 0;
i < ndim;
i++)
6770 <<
"haloed_nodes_on_proc" <<
my_rank <<
"_" << doc_info.
number()
6777 <<
"haloed_nodes_with_proc" <<
domain <<
"_on_proc" <<
my_rank
6778 <<
"_" << doc_info.
number() <<
".dat";
6781 for (
unsigned j = 0;
j <
nnod;
j++)
6785 for (
unsigned i = 0;
i < ndim;
i++)
6805 <<
"shared_nodes_on_proc" <<
my_rank <<
"_" << doc_info.
number()
6812 <<
"shared_nodes_with_proc" <<
domain <<
"_on_proc" <<
my_rank
6813 <<
"_" << doc_info.
number() <<
".dat";
6816 for (
unsigned j = 0;
j <
nnod;
j++)
6820 for (
unsigned i = 0;
i < ndim;
i++)
6841 this->
output(some_file, 5);
6860 for (
unsigned b = 0; b <
nbound; b++)
6864 <<
"boundary_elements" <<
my_rank <<
"_" << b <<
"_"
6865 << doc_info.
number() <<
".dat";
6868 for (
unsigned e = 0;
e <
nelem;
e++)
6884 oomph_info <<
"Doing check_halo_schemes for mesh: " <<
typeid(*this).name()
6916 << doc_info.
label() <<
"_on_proc" <<
my_rank <<
"_with_proc"
6917 <<
dd <<
"_" << doc_info.
number() <<
".dat";
6922 for (
unsigned j = 0;
j <
nnod;
j++)
6926 for (
unsigned i = 0;
i < ndim;
i++)
6961 for (
int d = 0; d <
n_proc; d++)
6973 oomph_info <<
"Repeated node in shared node lookup scheme: " <<
i
6974 <<
"-th node with proc " << d <<
" : " <<
nod_pt
6977 for (
unsigned ii = 0;
ii <
n;
ii++)
6989 <<
"WARNING: " << std::endl
6990 <<
"There seem to be repeated entries in shared node scheme "
6991 <<
"with proc " << d <<
".\n"
6992 <<
"n_vector=" <<
n_vector <<
"; n_set=" <<
n_set << std::endl;
6995 warning_stream <<
"Shared node scheme has been output in files like\n"
7000 warning_stream <<
"Re-run with doc_info enabled to see where the "
7001 "shared nodes are.\n";
7004 "Mesh::check_halo_schemes",
7012 double max_error = 0.0;
7015 for (
int d = 0; d <
n_proc; d++)
7039 std::ostringstream error_message;
7041 error_message <<
"Clash in numbers of shared nodes! "
7043 error_message <<
"# of shared nodes on proc " <<
dd <<
": "
7045 error_message <<
"# of shared nodes on proc " << d <<
": "
7047 error_message <<
"(Re-)run Problem::check_halo_schemes() with "
7050 error_message <<
"to identify the problem" << std::endl;
7110 <<
" is hanging with masters" << std::endl;
7111 for (
unsigned m = 0;
7125 if (
error > max_error)
7171 oomph_info <<
"Max. error for shared nodes " << max_error << std::endl;
7174 std::ostringstream error_message;
7175 error_message <<
"This is bigger than the permitted threshold "
7178 <<
"If you believe this to be acceptable for your problem\n"
7179 <<
"increase Problem::Max_permitted_error_for_halo_check and re-run \n";
7195 << doc_info.
label() <<
"_on_proc" <<
my_rank <<
"_with_proc"
7196 <<
dd <<
"_" << doc_info.
number() <<
".dat";
7204 for (
unsigned e = 0;
e <
nelem;
e++)
7213 for (
unsigned j = 0;
j <
nnod;
j++)
7217 for (
unsigned i = 0;
i < ndim;
i++)
7229 for (
int d = 0; d <
n_proc; d++)
7233 << doc_info.
label() <<
"_on_proc" <<
my_rank <<
"_with_proc"
7234 << d <<
"_" << doc_info.
number() <<
".dat";
7257 std::ostringstream error_message;
7258 error_message <<
"Haloed element is not a leaf element. This "
7261 error_message <<
"Here are the nodal positions: " << std::endl;
7263 for (
unsigned j = 0;
j <
nnod;
j++)
7267 for (
unsigned i = 0;
i <
n_dim;
i++)
7269 error_message <<
nod_pt->x(
i) <<
" ";
7271 error_message <<
"\n";
7279 for (
unsigned j = 0;
j <
nnod2;
j++)
7283 for (
unsigned i = 0;
i < ndim;
i++)
7302 for (
int d = 0; d <
n_proc; d++)
7329 std::ostringstream error_message;
7331 <<
"Clash in numbers of halo and haloed elements! "
7333 error_message <<
"# of haloed elements whose halo counterpart "
7336 error_message <<
"# of halo elements whose non-halo "
7337 "counterpart lives on proc "
7339 error_message <<
"(Re-)run Problem::check_halo_schemes() with "
7342 error_message <<
"to identify the problem" << std::endl;
7409 <<
"_with_proc" <<
dd <<
"_" << doc_info.
number()
7415 <<
"_with_proc" <<
dd <<
"_" << doc_info.
number()
7459 if (
error > max_error)
7463 double tol = 1.0e-12;
7467 <<
"Discrepancy between nodal coordinates of halo(ed)"
7468 <<
"element larger than tolerance (" <<
tol
7469 <<
")\n Error: " <<
error <<
"\n";
7479 <<
"Number of values of node, " <<
nval
7480 <<
", does not match number of values on other proc, "
7502 unsigned nmaster =
nod_pt->hanging_pt(
i)->nmaster();
7506 <<
"Number of master nodes for hanging value "
7507 <<
i <<
" of node, " << nmaster
7508 <<
", does not match number of master "
7524 <<
" of node is not hanging whereas "
7526 <<
" masters and therefore is hanging. \n";
7539 <<
"Error(s) displayed above are for "
7540 <<
"domain with non-halo (i.e. haloed) elem: " <<
dd
7543 <<
"Domain with halo elem: " << d
7549 <<
"Current processor is " <<
my_rank <<
"\n"
7550 <<
"Nodal positions: " <<
x_halo[0] <<
"\n"
7558 <<
"Current processor is " <<
my_rank <<
"\n"
7559 <<
"Nodal positions: " <<
x_halo[0] <<
" "
7561 <<
"and haloed: " <<
x_haloed[0] <<
" "
7569 <<
"Current processor is " <<
my_rank <<
"\n"
7570 <<
"Nodal positions: " <<
x_halo[0] <<
" "
7572 <<
"and haloed: " <<
x_haloed[0] <<
" "
7580 "Nodal dimension not equal to 1, 2 or 3\n",
7694 unsigned nmaster =
nod_pt->hanging_pt(
i)->nmaster();
7743 oomph_info <<
"Max. error for halo/haloed elements " << max_error
7748 oomph_info <<
"This is bigger than the permitted threshold "
7751 <<
"If you believe this to be acceptable for your problem\n"
7752 <<
"increase Problem::Max_permitted_error_for_halo_check and re-run \n";
7773 << doc_info.
label() <<
"_on_proc" <<
my_rank <<
"_with_proc"
7774 <<
dd <<
"_" << doc_info.
number() <<
".dat";
7779 for (
unsigned j = 0;
j <
nnod;
j++)
7783 for (
unsigned i = 0;
i < ndim;
i++)
7809 halo_file <<
" 1.0 1.1 1.1" << std::endl;
7818 for (
int d = 0; d <
n_proc; d++)
7822 << doc_info.
label() <<
"_on_proc" <<
my_rank <<
"_with_proc"
7823 << d <<
"_" << doc_info.
number() <<
".dat";
7828 for (
unsigned j = 0;
j <
nnod;
j++)
7832 for (
unsigned i = 0;
i < ndim;
i++)
7870 for (
int d = 0; d <
n_proc; d++)
7895 std::ostringstream error_message;
7897 error_message <<
"Clash in numbers of halo and haloed nodes! "
7900 <<
"# of haloed nodes whose halo counterpart lives on proc "
7903 <<
"# of halo nodes whose non-halo counterpart lives on proc "
7906 <<
"(Re-)run Mesh::check_halo_schemes() with DocInfo object"
7908 error_message <<
"to identify the problem" << std::endl;
7949 if (
error > max_error)
7995 oomph_info <<
"Max. error for halo/haloed nodes " << max_error << std::endl;
7999 std::ostringstream error_message;
8000 error_message <<
"This is bigger than the permitted threshold "
8003 <<
"If you believe this to be acceptable for your problem\n"
8004 <<
"increase Problem::Max_permitted_error_for_halo_check and re-run \n";
8021 << doc_info.
label() <<
"_on_proc" <<
my_rank <<
"_with_proc"
8022 <<
dd <<
"_" << doc_info.
number() <<
".dat";
8030 << doc_info.
label() <<
"_on_proc" <<
my_rank <<
"_with_proc"
8031 <<
dd <<
"_" << doc_info.
number() <<
".dat";
8040 for (
unsigned e = 0;
e <
nelem;
e++)
8049 for (
unsigned j = 0;
j <
nnod;
j++)
8053 for (
unsigned i = 0;
i < ndim;
i++)
8065 for (
int d = 0; d <
n_proc; d++)
8069 << doc_info.
label() <<
"_on_proc" <<
my_rank <<
"_with_proc"
8070 << d <<
"_" << doc_info.
number() <<
".dat";
8078 << doc_info.
label() <<
"_on_proc" <<
my_rank <<
"_with_proc"
8079 << d <<
"_" << doc_info.
number() <<
".dat";
8096 for (
unsigned j = 0;
j <
nnod2;
j++)
8100 for (
unsigned i = 0;
i < ndim;
i++)
8119 for (
int d = 0; d <
n_proc; d++)
8147 std::ostringstream error_message;
8149 <<
"Clash in numbers of external halo and haloed elements! "
8151 error_message <<
"# of external haloed elements whose halo "
8152 "counterpart lives on proc "
8154 error_message <<
"# of external halo elements whose non-halo "
8155 "counterpart lives on proc "
8157 error_message <<
"(Re-)run Problem::check_halo_schemes() with "
8160 error_message <<
"to identify the problem" << std::endl;
8229 <<
"_with_proc" <<
dd <<
"_" << doc_info.
number()
8235 <<
"_with_proc" <<
dd <<
"_" << doc_info.
number()
8279 if (
error > max_error)
8283 double tol = 1.0e-12;
8286 oomph_info <<
"Discrepancy between nodal coordinates "
8287 "of external halo(ed)"
8288 <<
"element larger than tolerance (" <<
tol
8289 <<
")\n Error: " <<
error <<
"\n";
8299 <<
"Number of values of node, " <<
nval
8300 <<
", does not match number of values on other proc, "
8322 unsigned nmaster =
nod_pt->hanging_pt(
i)->nmaster();
8326 <<
"Number of master nodes for hanging value "
8327 <<
i <<
" of node, " << nmaster
8328 <<
", does not match number of master "
8344 <<
" of node is not hanging whereas "
8346 <<
" masters and therefore is hanging. \n";
8358 oomph_info <<
"Error(s) displayed above are for "
8359 <<
"domain with external non-halo (i.e. "
8363 <<
"Domain with halo elem: " << d
8369 <<
"Current processor is " <<
my_rank <<
"\n"
8370 <<
"Nodal positions: " <<
x_halo[0] <<
"\n"
8378 <<
"Current processor is " <<
my_rank <<
"\n"
8379 <<
"Nodal positions: " <<
x_halo[0] <<
" "
8381 <<
"and haloed: " <<
x_haloed[0] <<
" "
8389 <<
"Current processor is " <<
my_rank <<
"\n"
8390 <<
"Nodal positions: " <<
x_halo[0] <<
" "
8392 <<
"and haloed: " <<
x_haloed[0] <<
" "
8400 "Nodal dimension not equal to 1, 2 or 3\n",
8496 unsigned nmaster =
nod_pt->hanging_pt(
i)->nmaster();
8545 oomph_info <<
"Max. error for external halo/haloed elements " << max_error
8550 oomph_info <<
"This is bigger than the permitted threshold "
8553 <<
"If you believe this to be acceptable for your problem\n"
8554 <<
"increase Problem::Max_permitted_error_for_halo_check and re-run \n";
8574 for (
unsigned j = 0;
j <
n;
j++)
8628 for (
unsigned j = 0;
j <
nnod;
j++)
8738 for (
unsigned j = 0;
j <
nnod;
j++)
8775 for (
unsigned i = 1;
i <
nel;
i++)
8779 std::ostringstream error_message;
8781 <<
"Every element in the mesh must have the same number of "
8782 <<
"types of DOF for ndof_types() to work\n"
8784 <<
"Element " <<
i <<
" [out of a total of " <<
nel <<
" ] has "
8786 <<
"Element types are: Element 0:" <<
typeid(*
element_pt(0)).
name()
8837 for (
unsigned p = 1;
p <
nproc;
p++)
8852 std::ostringstream error_message;
8854 <<
"The elements in this mesh must have the same number "
8855 <<
"of types of DOF on each processor";
8856 for (
unsigned p = 0;
p <
nproc;
p++)
8860 error_message <<
"Processor " <<
p <<
" : "
8865 error_message <<
"Processor " <<
p <<
" : (no elements)\n";
8877 for (
unsigned p = 1;
p <
nproc;
p++)
8931 std::ostringstream error_message;
8933 <<
"Every element in the mesh must have the same number of "
8934 <<
"elemental dimension for elemental_dimension() to work.\n"
8935 <<
"Element 0 has elemental dimension " <<
int_dim <<
"\n"
8936 <<
"Element " <<
i <<
" has elemental dimension "
8979 for (
unsigned p = 1;
p <
nproc;
p++)
8994 std::ostringstream error_message;
8996 <<
"The elements in this mesh must have the same elemental "
8997 <<
"dimension number on each processor";
8998 for (
unsigned p = 0;
p <
nproc;
p++)
9002 error_message <<
"Processor " <<
p <<
" : " <<
dim_recv[
p]
9007 error_message <<
"Processor " <<
p <<
" : (no elements)\n";
9020 for (
unsigned p = 1;
p <
nproc;
p++)
9069 std::ostringstream error_message;
9071 <<
"Every element in the mesh must have the same number of "
9072 <<
"nodal dimension for nodal_dimension() to work.\n"
9073 <<
"Element 0 has nodal dimension " <<
int_dim <<
"\n"
9074 <<
"Element " <<
i <<
" has nodal dimension "
9117 for (
unsigned p = 1;
p <
nproc;
p++)
9132 std::ostringstream error_message;
9134 <<
"The elements in this mesh must have the same nodal "
9135 <<
"dimension number on each processor";
9136 for (
unsigned p = 0;
p <
nproc;
p++)
9140 error_message <<
"Processor " <<
p <<
" : " <<
dim_recv[
p]
9145 error_message <<
"Processor " <<
p <<
" : (no elements)\n";
9158 for (
unsigned p = 1;
p <
nproc;
p++)
9202 for (
unsigned i = 0;
i <
nnode();
i++)
9211 if (
nod_pt->is_hanging())
9220 for (
unsigned m = 0;
m <
hang_pt->nmaster();
m++)
9227 for (
int d = 0; d <
Comm_pt->nproc(); d++)
9270 for (
unsigned t = 0;
t <
nt;
t++)
9278 for (
unsigned i = 0;
i <
n_dim;
i++)
9335 nod_pt->set_nonhanging();
9354 int d = (*it).first;
9378 int d = (*it).first;
9407 int dd = (*itt).first;
9439 int d = (*it).first;
9612 namespace ParaviewHelper
9617 pvd_file <<
"<?xml version=\"1.0\"?>" << std::endl
9618 <<
"<VTKFile type=\"Collection\" version=\"0.1\">" << std::endl
9619 <<
"<Collection>" << std::endl;
9629 pvd_file <<
"<DataSet timestep=\"" << time <<
"\" ";
9641 pvd_file <<
"</Collection>" << std::endl <<
"</VTKFile>";
Algebraic nodes are nodes with an algebraic positional update function.
A class that contains the information required by Nodes that are located on Mesh boundaries....
GeneralisedTimestepper used to store the arclength derivatives and pervious solutions required in con...
A Class for the derivatives of shape functions The class design is essentially the same as Shape,...
TimeStepper *& time_stepper_pt()
Return the pointer to the timestepper.
bool does_pointer_correspond_to_value(double *const ¶meter_pt)
Check whether the pointer parameter_pt addresses internal data values.
void dump(std::ostream &dump_file) const
Dump the data object to a file.
void set_halo(const unsigned &non_halo_proc_ID)
Label the node as halo and specify processor that holds non-halo counterpart.
void set_time_stepper(TimeStepper *const &time_stepper_pt, const bool &preserve_existing_data)
Set a new timestepper by resizing the appropriate storage. If already assigned the equation numbering...
void read(std::ifstream &restart_file)
Read data object from a file.
Information for documentation of results: Directory and file number to enable output in the form RESL...
std::string & label()
String used (e.g.) for labeling output files.
bool is_doc_enabled() const
Are we documenting?
std::string directory() const
Output directory.
unsigned & number()
Number used (e.g.) for labeling output files.
A general Finite Element class.
virtual void scalar_value_paraview(std::ofstream &file_out, const unsigned &i, const unsigned &nplot) const
Write values of the i-th scalar field at the plot points. Broken virtual. Needs to be implemented for...
virtual unsigned nplot_points_paraview(const unsigned &nplot) const
Return the number of actual plot points for paraview plot with parameter nplot. Broken virtual; can b...
Integral *const & integral_pt() const
Return the pointer to the integration scheme (const version)
void position(const Vector< double > &zeta, Vector< double > &r) const
Return the parametrised position of the FiniteElement in its incarnation as a GeomObject,...
virtual void local_coordinate_of_node(const unsigned &j, Vector< double > &s) const
Get local coordinates of node j in the element; vector sets its own size (broken virtual)
virtual void output(std::ostream &outfile)
Output the element data — typically the values at the nodes in a format suitable for post-processing.
double size() const
Calculate the size of the element (length, area, volume,...) in Eulerian computational coordinates....
virtual std::string scalar_name_paraview(const unsigned &i) const
Name of the i-th scalar field. Default implementation returns V1 for the first one,...
void check_jacobian(const double &jacobian) const
Helper function used to check for singular or negative Jacobians in the transform from local to globa...
unsigned dim() const
Return the spatial dimension of the element, i.e. the number of local coordinates required to paramet...
unsigned nnode() const
Return the number of nodes.
virtual void write_paraview_type(std::ofstream &file_out, const unsigned &nplot) const
Return the paraview element type. Broken virtual. Needs to be implemented for each new geometric elem...
void(* SteadyExactSolutionFctPt)(const Vector< double > &, Vector< double > &)
Function pointer for function that computes vector-valued steady "exact solution" as .
void get_x(const Vector< double > &s, Vector< double > &x) const
Global coordinates as function of local coordinates. Either via FE representation or via macro-elemen...
virtual unsigned nscalar_paraview() const
Number of scalars/fields output by this element. Broken virtual. Needs to be implemented for each new...
virtual Node * construct_boundary_node(const unsigned &n)
Construct the local node n as a boundary node; that is a node that MAY be placed on a mesh boundary a...
double dshape_eulerian(const Vector< double > &s, Shape &psi, DShape &dpsidx) const
Compute the geometric shape functions and also first derivatives w.r.t. global coordinates at local c...
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
virtual unsigned nsub_elements_paraview(const unsigned &nplot) const
Return the number of local sub-elements for paraview plot with parameter nplot. Broken virtual; can b...
virtual void describe_local_dofs(std::ostream &out, const std::string ¤t_string) const
Function to describe the local dofs of the element[s]. The ostream specifies the output stream to whi...
unsigned nodal_dimension() const
Return the required Eulerian dimension of the nodes in this element.
virtual void node_update()
Update the positions of all nodes in the element using each node update function. The default impleme...
virtual void scalar_value_fct_paraview(std::ofstream &file_out, const unsigned &i, const unsigned &nplot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt) const
Write values of the i-th scalar field at the plot points. Broken virtual. Needs to be implemented for...
void output_paraview(std::ofstream &file_out, const unsigned &nplot) const
Paraview output – this outputs the coordinates at the plot points (for parameter nplot) to specified ...
void(* UnsteadyExactSolutionFctPt)(const double &, const Vector< double > &, Vector< double > &)
Function pointer for function that computes Vector-valued time-dependent function as .
static bool Suppress_output_while_checking_for_inverted_elements
Static boolean to suppress output while checking for inverted elements.
int get_node_number(Node *const &node_pt) const
Return the number of the node *node_pt if this node is in the element, else return -1;.
virtual void write_paraview_offsets(std::ofstream &file_out, const unsigned &nplot, unsigned &offset_sum) const
Return the offsets for the paraview sub-elements. Broken virtual. Needs to be implemented for each ne...
virtual void write_paraview_output_offset_information(std::ofstream &file_out, const unsigned &nplot, unsigned &counter) const
Fill in the offset information for paraview plot. Broken virtual. Needs to be implemented for each ne...
A Generalised Element class.
void set_nonhalo()
Label the element as not being a halo.
virtual unsigned ndof_types() const
The number of types of degrees of freedom in this element are sub-divided into.
bool is_halo() const
Is this element a halo?
void assign_internal_eqn_numbers(unsigned long &global_number, Vector< double * > &Dof_pt)
Assign the global equation numbers to the internal Data. The arguments are the current highest global...
Data *& internal_data_pt(const unsigned &i)
Return a pointer to i-th internal data object.
int non_halo_proc_ID()
ID of processor ID that holds non-halo counterpart of halo element; negative if not a halo.
unsigned ninternal_data() const
Return the number of internal data objects.
bool must_be_kept_as_halo() const
Test whether the element must be kept as a halo element.
void add_internal_value_pt_to_map(std::map< unsigned, double * > &map_of_value_pt)
Add pointers to the internal data values to map indexed by the global equation number.
void set_halo(const unsigned &non_halo_proc_ID)
Label the element as halo and specify processor that holds non-halo counterpart.
virtual void assign_local_eqn_numbers(const bool &store_local_dof_pt)
Setup the arrays of local equation numbers for the element. If the optional boolean argument is true,...
void describe_dofs(std::ostream &out, const std::string ¤t_string) const
Function to describe the dofs of the element. The ostream specifies the output stream to which the de...
unsigned ndim() const
Access function to # of Eulerian coordinates.
TimeStepper *& time_stepper_pt()
Access function for pointer to time stepper: Null if object is not time-dependent.
unsigned nlagrangian() const
Access function to # of Lagrangian coordinates.
Class that contains data for hanging nodes.
Node *const & master_node_pt(const unsigned &i) const
Return a pointer to the i-th master node.
unsigned nmaster() const
Return the number of master nodes.
virtual double knot(const unsigned &i, const unsigned &j) const =0
Return local coordinate s[j] of i-th integration point.
virtual unsigned nweight() const =0
Return the number of integration points of the scheme.
void add_boundary_node(const unsigned &b, Node *const &node_pt)
Add a (pointer to) a node to the b-th boundary.
Vector< Node * > Node_pt
Vector of pointers to nodes.
std::map< unsigned, Vector< Node * > > Shared_node_pt
Map of vectors holding the pointers to the shared nodes. These are all the nodes that are on two "nei...
static Steady< 0 > Default_TimeStepper
Default Steady Timestepper, to be used in default arguments to Mesh constructors.
bool does_pointer_correspond_to_mesh_data(double *const ¶meter_pt)
Does the double pointer correspond to any mesh data.
unsigned ndof_types() const
Return number of dof types in mesh.
void remove_boundary_node(const unsigned &b, Node *const &node_pt)
Remove a node from the boundary b.
bool is_mesh_distributed() const
Boolean to indicate if Mesh has been distributed.
void output_external_halo_elements(std::ostream &outfile, const unsigned &n_plot=5)
Output all external halo elements.
void setup_shared_node_scheme()
Setup shared node scheme.
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...
std::map< unsigned, Vector< GeneralisedElement * > > Root_haloed_element_pt
Map of vectors holding the pointers to the root haloed elements.
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.
unsigned nexternal_haloed_element()
Total number of external haloed elements in this Mesh.
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...
unsigned nexternal_halo_node()
Total number of external halo nodes in this Mesh.
unsigned nodal_dimension() const
Return number of nodal dimension in mesh.
bool Lookup_for_elements_next_boundary_is_setup
Flag to indicate that the lookup schemes for elements that are adjacent to the boundaries has been se...
void flush_element_and_node_storage()
Flush storage for elements and nodes by emptying the vectors that store the pointers to them....
std::map< unsigned, Vector< GeneralisedElement * > > External_haloed_element_pt
Map of vectors holding the pointers to the external haloed elements.
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....
void flush_element_storage()
Flush storage for elements (only) by emptying the vectors that store the pointers to them....
FiniteElement * finite_element_pt(const unsigned &e) const
Upcast (downcast?) to FiniteElement (needed to access FiniteElement member functions).
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 check_halo_schemes(DocInfo &doc_info, double &max_permitted_error_for_halo_check)
Check halo and shared schemes on the mesh.
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 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...
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...
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 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_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.
unsigned nboundary_element(const unsigned &b) const
Return number of finite elements that are adjacent to boundary b.
bool Keep_all_elements_as_halos
bool to indicate whether to keep all elements in a mesh as halos or not
Node *& node_pt(const unsigned long &n)
Return pointer to global node n.
std::map< unsigned, Vector< Node * > > External_haloed_node_pt
Map of vectors holding the pointers to the external haloed nodes.
virtual void setup_boundary_element_info()
Interface for function that is used to setup the boundary information (Empty virtual function – imple...
FiniteElement * boundary_element_pt(const unsigned &b, const unsigned &e) const
Return pointer to e-th finite element on boundary b.
std::map< unsigned, Vector< GeneralisedElement * > > Root_halo_element_pt
Map of vectors holding the pointers to the root halo elements.
unsigned elemental_dimension() const
Return number of elemental dimension in mesh.
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...
OomphCommunicator * Comm_pt
Pointer to communicator – set to NULL if mesh is not distributed.
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 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.
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.
void shift_time_values()
Shift time-dependent data along for next timestep: Deal with nodal Data/positions and the element's i...
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 r...
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,...
void calculate_predictions()
Calculate predictions for all Data and positions associated with the mesh, usually used in adaptive t...
unsigned nboundary() const
Return number of boundaries.
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...
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...
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.
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 ...
void remove_boundary_nodes()
Clear all pointers to boundary nodes.
bool Output_halo_elements
Bool for output of halo elements.
unsigned long nnode() const
Return number of nodes in the mesh.
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(....
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,...
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.
void delete_all_external_storage()
Wipe the storage for all externally-based elements.
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...
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...
unsigned nhalo_node()
Total number of halo nodes in this Mesh.
std::map< unsigned, Vector< Node * > > Halo_node_pt
Map of vectors holding the pointers to the halo nodes.
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).
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,...
const Vector< GeneralisedElement * > & element_pt() const
Return reference to the Vector of elements.
void output(std::ostream &outfile)
Output for all elements.
void add_element_pt(GeneralisedElement *const &element_pt)
Add a (pointer to) an element to the mesh.
std::map< unsigned, Vector< Node * > > Haloed_node_pt
Map of vectors holding the pointers to the haloed nodes.
void assign_initial_values_impulsive()
Assign initial values for an impulsive start.
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.
bool Resize_halo_nodes_not_required
Set this to true to suppress resizing of halo nodes (at your own risk!)
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...
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...
virtual ~Mesh()
Virtual Destructor to clean up all memory.
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 get_external_halo_node_pt(Vector< Node * > &external_halo_node_pt)
Get vector of pointers to all external halo nodes.
void add_node_pt(Node *const &node_pt)
Add a (pointer to a) node to the mesh.
virtual void read(std::ifstream &restart_file)
Read solution from restart file.
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.
void doc_mesh_distribution(DocInfo &doc_info)
Doc the mesh distribution, to be processed with tecplot macros.
unsigned self_test()
Self-test: Check elements and nodes. Return 0 for OK.
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 set_consistent_pinned_values_for_continuation(ContinuationStorageScheme *const &continuation_stepper_pt)
Set consistent values for pinned data in continuation.
Vector< Node * > prune_dead_nodes()
Prune nodes. Nodes that have been marked as obsolete are removed from the mesh (and its boundary-node...
Vector< GeneralisedElement * > Element_pt
Vector of pointers to generalised elements.
void resize_halo_nodes()
Helper function that resizes halo nodes to the same size as their non-halo counterparts if required....
std::map< unsigned, Vector< Node * > > External_halo_node_pt
Map of vectors holding the pointers to the external halo nodes.
unsigned nhaloed_node()
Total number of haloed nodes in this Mesh.
unsigned nexternal_haloed_node()
Total number of external haloed nodes in this Mesh.
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.
static bool Suppress_warning_about_empty_mesh_level_time_stepper_function
Boolean used to control warning about empty mesh level timestepper function.
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 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...
Vector< GeneralisedElement * > haloed_element_pt(const unsigned &p)
Return vector of haloed elements in this Mesh whose haloing counterpart is held on processor p.
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.
void null_external_halo_node(const unsigned &p, Node *nod_pt)
Null out specified external halo node (used when deleting duplicates)
unsigned nshared_node()
Total number of shared nodes in this Mesh.
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...
unsigned long nelement() const
Return number of elements in the mesh.
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 m...
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 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 output_boundaries(std::ostream &outfile)
Output the nodes on the boundaries (into separate tecplot zones)
unsigned nexternal_halo_element()
Total number of external halo elements in this Mesh.
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.
std::map< unsigned, Vector< GeneralisedElement * > > External_halo_element_pt
External halo(ed) elements are created as and when they are needed to act as source elements for the ...
Node *& boundary_node_pt(const unsigned &b, const unsigned &n)
Return pointer to node n on boundary b.
unsigned nroot_halo_element()
Total number of root halo elements in this Mesh.
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
void set_obsolete()
Mark node as obsolete.
void read(std::ifstream &restart_file)
Read nodal position and associated data from file for restart.
void position(Vector< double > &pos) const
Compute Vector of nodal positions either directly or via hanging node representation.
virtual void remove_from_boundary(const unsigned &b)
Broken interface for removing the node from the mesh boundary b Here to provide error reporting.
void set_non_obsolete()
Mark node as non-obsolete.
unsigned ndim() const
Return (Eulerian) spatial dimension of the node.
virtual void add_to_boundary(const unsigned &b)
Broken interface for adding the node to the mesh boundary b Essentially here for error reporting.
bool is_hanging() const
Test whether the node is geometrically hanging.
double & x_gen(const unsigned &k, const unsigned &i)
Reference to the generalised position x(k,i). ‘Type’: k; Coordinate direction: i.
HangInfo *const & hanging_pt() const
Return pointer to hanging node data (this refers to the geometric hanging node status) (const version...
An oomph-lib wrapper to the MPI_Comm communicator object. Just contains an MPI_Comm object (which is ...
std::ostream *& stream_pt()
Access function for the stream pointer.
An OomphLibError object which should be thrown when an run-time error is encountered....
===================================================================== A class for handling oomph-lib ...
An OomphLibWarning object which should be created as a temporary object to issue a warning....
RefineableElements are FiniteElements that may be subdivided into children to provide a better local ...
A Class for shape functions. In simple cases, the shape functions have only one index that can be tho...
IC problem for an elastic body discretised on a given (sub)-mesh. We switch the elements' residuals a...
SolidNode * node_pt(const unsigned long &n)
Return a pointer to the n-th global SolidNode.
void set_lagrangian_nodal_coordinates()
Make the current configuration the undeformed one by setting the nodal Lagrangian coordinates to thei...
static SolidICProblem Solid_IC_problem
Static problem that can be used to assign initial conditions on a given solid mesh (need to define th...
A Class for nodes that deform elastically (i.e. position is an unknown in the problem)....
unsigned nlagrangian_type() const
Number of types of Lagrangian coordinates used to interpolate the Lagrangian coordinates within the e...
double & xi_gen(const unsigned &k, const unsigned &i)
Reference to the generalised Lagrangian position. ‘Type’: k; 'Coordinate direction: i.
unsigned nlagrangian() const
Return number of lagrangian coordinates.
TAdvectionDiffusionReactionElement<NREAGENT,DIM,NNODE_1D> elements are isoparametric triangular DIM-d...
void output(std::ostream &outfile)
Output function: x,y,u or x,y,z,u.
void output_fct(std::ostream &outfile, const unsigned &n_plot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt)
Output function for an exact solution: x,y,u_exact.
Base class for time-stepping schemes. Timestepper provides an approximation of the temporal derivativ...
virtual void shift_time_values(Data *const &data_pt)=0
This function advances the Data's time history so that we can move on to the next timestep.
virtual void calculate_predicted_values(Data *const &data_pt)
Do the predictor step for data stored in a Data object (currently empty – overwrite for specific sche...
virtual void assign_initial_values_impulsive(Data *const &data_pt)=0
Initialise the time-history for the Data values corresponding to an impulsive start.
Base class for tree-based refineable meshes.
A generalised tree base class that abstracts the common functionality between the quad- and octrees u...
RefineableElement * object_pt() const
Return the pointer to the object (RefineableElement) represented by the tree.
void flush_object()
Flush the object represented by the tree.
Base class for triangle meshes (meshes made of 2D triangle elements). Note: we choose to template Tri...
A slight extension to the standard template vector class so that we can include "graceful" array rang...
bool Doc_comprehensive_timings
Global boolean to switch on comprehensive timing – can probably be declared const false when developm...
bool node_global_position_comparison(Node *nd1_pt, Node *nd2_pt)
Function for ordering nodes. Return true if first node's position is "before" second nodes....
void write_pvd_footer(std::ofstream &pvd_file)
Write the pvd file footer.
void write_pvd_header(std::ofstream &pvd_file)
Write the pvd file header.
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.
double timer()
returns the time in seconds after some point in past
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).
OomphInfo oomph_info
Single (global) instantiation of the OomphInfo object – this is used throughout the library as a "rep...