42 namespace Multi_domain_functions
120#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
274 int n_proc = comm_pt->nproc();
275 int my_rank = comm_pt->my_rank();
373#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
592#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
603#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
633#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
660#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
661 std::stringstream
junk;
662 junk <<
"Node needs to be constructed [size="
677#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
678 std::stringstream
junk;
689#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
718#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
720 "Node needs to be constructed[2]");
735#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
742#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
765#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
790#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
794#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
801#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
808 if (time_stepper_pt != 0)
815 if (
nod_pt->is_on_boundary())
818#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
835#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
836 std::stringstream
junk;
837 junk <<
"Node is on " <<
nb <<
" boundaries";
840 for (
unsigned i = 0;
i <
nb;
i++)
843#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
844 std::stringstream
junk;
856 throw OomphLibError(
"Failed to cast new node to boundary node\n",
861 std::map<unsigned, unsigned>*
map_pt =
862 bnod_pt->index_of_first_value_assigned_by_face_element_pt();
868#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
869 std::stringstream
junk;
871 "No additional values were created by face element");
879#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
880 std::stringstream
junk;
885 for (std::map<unsigned, unsigned>::iterator
p =
map_pt->begin();
890#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
891 std::stringstream
junk;
895#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
905#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
923#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
930#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
941#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
961#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1019#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1023#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1027#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1036#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1040#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1067#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1071#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1078#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1080 "Master node Not found timestepper");
1086 if (time_stepper_pt != 0)
1096#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1112#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1113 std::stringstream
junk;
1114 junk <<
"Master node is on " <<
nb <<
" boundaries";
1117 for (
unsigned i = 0;
i <
nb;
i++)
1120#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1121 std::stringstream
junk;
1135 throw OomphLibError(
"Failed to cast new node to boundary node\n",
1140 std::map<unsigned, unsigned>*
map_pt =
1141 bnod_pt->index_of_first_value_assigned_by_face_element_pt();
1147#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1148 std::stringstream
junk;
1150 "No additional values were created by face element for this master "
1159#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1160 std::stringstream
junk;
1165 for (std::map<unsigned, unsigned>::iterator
p =
map_pt->begin();
1170#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1171 std::stringstream
junk;
1173 "Key of map entry for master node");
1176#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1178 "Value of map entry for master node");
1187#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1189 "Master node is not on any boundary");
1206#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1213#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1224#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1226 "Master Alg Node n geom objects");
1243#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1245 "Master node Found geom object");
1271#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1273 "Master Node needs to be constructed");
1285#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1287 "Mesh is macro element mesh");
1294#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1316 error_stream <<
"You are using a MacroElement node update\n"
1317 <<
"in a case with non-QElements. This has not\n"
1318 <<
"yet been implemented.\n";
1329#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1331 "Mesh is not a macro element mesh");
1351#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1353 "External haloed element already exists");
1356#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1358 "Index of existing external haloed element");
1414#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1416 <<
" Bool: New node needs to be constructed "
1432#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1434 <<
" Index of existing external halo node "
1463#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1465 <<
" Number of values of external halo node "
1479#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1481 <<
" Timestepper req'd for node "
1487#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1489 <<
" Index of timestepper "
1503#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1505 <<
" Is node on boundary? "
1512 if (time_stepper_pt != 0)
1523#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1525 <<
" Number of boundaries the node is on: "
1531 for (
unsigned i = 0;
i <
nb;
i++)
1534#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1536 <<
" Node is on boundary "
1546#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1548 <<
" Number of additional values created by face element "
1564 throw OomphLibError(
"Failed to cast new node to boundary node\n",
1569 if (
bnew_nod_pt->index_of_first_value_assigned_by_face_element_pt() ==
1572 bnew_nod_pt->index_of_first_value_assigned_by_face_element_pt() =
1573 new std::map<unsigned, unsigned>;
1578 std::map<unsigned, unsigned>*
map_pt =
1579 bnew_nod_pt->index_of_first_value_assigned_by_face_element_pt();
1586#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1589 <<
" Key of map entry"
1596#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1599 <<
" Value of map entry"
1614 if (time_stepper_pt != 0)
1642#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1644 <<
" Alg node update id "
1656#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1658 <<
" Alg node # of ref values "
1681#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1683 <<
" Alg node # of geom objects "
1695#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1697 <<
" Alg node: geom object index "
1735 geom_object_vector_pt =
macro_mesh_pt->geom_object_vector_pt();
1808 int n_proc = comm_pt->nproc();
1809 int my_rank = comm_pt->my_rank();
1813#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1881 <<
" zeta coordinates have been set to DBX_MAX\n";
1971 ->ncont_interpolated_values();
1985#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1987 "Mesh is macro element mesh[2]");
1999#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
2001 "Number of macro element[2]");
2024 <<
"You are using a MacroElement node update\n"
2025 <<
"in a case with non-QElements. This has not\n"
2026 <<
"yet been implemented.\n";
2035#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
2037 "Mesh is not a macro element mesh [2]");
2050 "Unable to cast source function to finite element\n",
2051 "Multi_domain_functions::locate_zeta_for_missing_"
2080#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
2082 "Index of existing external haloed element[2]");
2171 <<
"mesh_pt [ " <<
n_mesh <<
" ] don't match.\n";
2191 mesh_pt[
i_mesh]->element_pt(
e));
2208 <<
" is not consitent with dimension assumed \n"
2209 <<
" in multidomain namespace, " <<
Dim << std::endl;
2329 for (
unsigned i = 0;
i <
Dim;
i++)
2344 Mesh*
const& mesh_pt,
2367 int n_proc = comm_pt->nproc();
2376 comm_pt->mpi_comm());
2385 comm_pt->mpi_comm());
2394 error_stream <<
"The elements within the two meshes do not\n"
2395 <<
"have the same dimension, so the multi-domain\n"
2396 <<
"method will not work.\n"
2397 <<
"For the mesh, dim=" <<
mesh_dim
2443 for (
unsigned i = 0;
i <
Dim;
i++)
2455 for (
unsigned i = 0;
i <
Dim;
i++)
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
A class that contains the information required by Nodes that are located on Mesh boundaries....
This is a base class for all elements that require external sources (e.g. FSI, multi-domain problems ...
FaceElements are elements that coincide with the faces of higher-dimensional "bulk" elements....
A general Finite Element class.
Integral *const & integral_pt() const
Return the pointer to the integration scheme (const version)
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)
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...
double size() const
Calculate the size of the element (length, area, volume,...) in Eulerian computational coordinates....
void locate_zeta(const Vector< double > &zeta, GeomObject *&geom_object_pt, Vector< double > &s, const bool &use_coordinate_as_initial_guess=false)
For a given value of zeta, the "global" intrinsic coordinate of a mesh of FiniteElements represented ...
virtual Node * construct_node(const unsigned &n)
Construct the local node n and return a pointer to the newly created node object.
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.
MacroElement * macro_elem_pt()
Access function to pointer to macro element.
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...
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
A Generalised Element class.
bool is_halo() const
Is this element a halo?
/////////////////////////////////////////////////////////////////////
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.
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.
MacroElementNodeUpdateMeshes contain MacroElementNodeUpdateNodes which have their own node update fun...
////////////////////////////////////////////////////////////////////
Base class for MacroElement s that are used during mesh refinement in domains with curvlinear and/or ...
GeneralisedElement *& element_pt(const unsigned long &e)
Return pointer to element e.
unsigned long nelement() const
Return number of elements in the mesh.
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
An oomph-lib wrapper to the MPI_Comm communicator object. Just contains an MPI_Comm object (which is ...
An OomphLibError object which should be thrown when an run-time error is encountered....
////////////////////////////////////////////////////////////////// //////////////////////////////////...
OomphCommunicator * communicator_pt()
access function to the oomph-lib communicator
TimeStepper *& time_stepper_pt()
Access function for the pointer to the first (presumably only) timestepper.
unsigned ntime_stepper() const
Return the number of time steppers.
/////////////////////////////////////////////////////////////////// /////////////////////////////////...
RefineableElements are FiniteElements that may be subdivided into children to provide a better local ...
A Class for nodes that deform elastically (i.e. position is an unknown in the problem)....
//////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////// //////////////////////////////...
unsigned ntstorage() const
Return the number of doubles required to represent history (one for steady)
Vector< int > Proc_id_plus_one_of_external_element
Proc_id_plus_one_of_external_element[i] contains the processor id (plus one) of the processor on whic...
Vector< double > Flat_packed_located_coordinates
Vector of flat-packed local coordinates for zeta tuples that have been located.
void send_and_receive_located_info(int &iproc, Mesh *const &external_mesh_pt, Problem *problem_pt)
Send location information from current process; Received location information from (current process +...
unsigned Counter_for_flat_packed_unsigneds
Counter used when processing vector of flat-packed unsigneds – this is really "private" data,...
Vector< Vector< unsigned > > External_element_located
Lookup scheme for whether a local element's integration point has had an external element assigned to...
unsigned Dim
Dimension of zeta tuples (set by get_dim_helper) – needed because we store the scalar coordinates in ...
Vector< double > Flat_packed_doubles
Vector of flat-packed doubles to be communicated with other processors.
void send_and_receive_missing_zetas(Problem *problem_pt)
Send the zeta coordinates from the current process to the next process; receive from the previous pro...
void get_required_master_nodal_information_helper(int &iproc, Node *master_nod_pt, Problem *problem_pt, Mesh *const &external_mesh_pt, int &n_cont_inter_values)
Helper function to get the required master nodal information from an external haloed master node so t...
void clean_up()
Helper function that clears all the information used during the external storage creation.
Vector< unsigned > Flat_packed_unsigneds
Vector of flat-packed unsigneds to be communicated with other processors – this is really "private" d...
Vector< double > Zeta_coords_for_further_away_comparison
Vector of zeta coordinates that we're currently trying to locate; used in sorting of bin entries in f...
bool Doc_timings
Boolean to indicate whether to doc timings or not.
void add_external_haloed_master_node_helper(int &iproc, Node *master_nod_pt, Problem *problem_pt, Mesh *const &external_mesh_pt, int &n_cont_inter_values)
Helper function to add external haloed node that is a master.
void get_dim_helper(Problem *problem_pt, Mesh *const &mesh_pt, Mesh *const &external_mesh_pt)
Helper function that computes the dimension of the elements within each of the specified meshes (and ...
std::ofstream Doc_boundary_coordinate_file
Output file to document the boundary coordinate along the mesh boundary of the bulk mesh during call ...
Vector< double > Flat_packed_zetas_not_found_locally
Vector of flat-packed zeta coordinates for which the external element could not be found during curre...
Vector< std::string > Flat_packed_unsigneds_string
void locate_zeta_for_local_coordinates(const Vector< Mesh * > &mesh_pt, Mesh *const &external_mesh_pt, Vector< MeshAsGeomObject * > &mesh_geom_obj_pt, const unsigned &interaction_index)
locate zeta for current set of "local" coordinates vector-based version
void construct_new_external_halo_node_helper(Node *&new_nod_pt, unsigned &loc_p, unsigned &node_index, FiniteElement *const &new_el_pt, Mesh *const &external_mesh_pt, Problem *problem_pt)
Helper function which constructs a new external halo node (on new element) with the required informat...
bool Allow_use_of_halo_elements_as_external_elements
Boolean to indicate if we're allowed to use halo elements as external elements. Can drastically reduc...
bool Allow_use_of_halo_elements_as_external_elements_for_projection
Indicate whether we are allowed to use halo elements as external elements for projection,...
bool Doc_stats
Boolean to indicate whether to output basic info during setup_multi_domain_interaction() routines.
bool Doc_full_stats
Boolean to indicate whether to output further info during setup_multi_domain_interaction() routines.
Vector< double > Received_flat_packed_zetas_to_be_found
Vector of flat-packed zeta coordinates for which the external element could not be found on another p...
void add_external_haloed_node_helper(int &iproc, Node *nod_pt, Problem *problem_pt, Mesh *const &external_mesh_pt, int &n_cont_inter_values)
Helper to add external haloed node that is not a master.
void get_required_nodal_information_helper(int &iproc, Node *nod_pt, Problem *problem_pt, Mesh *const &external_mesh_pt, int &n_cont_inter_values)
Helper function to get the required nodal information from an external haloed node so that a fully-fu...
void recursively_add_masters_of_external_haloed_node(int &iproc, Node *nod_pt, Problem *problem_pt, Mesh *const &external_mesh_pt, int &n_cont_inter_values)
Recursively add any master nodes (and their master nodes etc) of external nodes.
void add_external_halo_node_helper(Node *&new_nod_pt, Mesh *const &external_mesh_pt, unsigned &loc_p, unsigned &node_index, FiniteElement *const &new_el_pt, int &n_cont_inter_values, Problem *problem_pt)
Helper functiono to add external halo node that is not a master.
bool Use_bulk_element_as_external
Boolean to indicate when to use the bulk element as the external element. Defaults to false,...
Vector< unsigned > Located_element_status
Vector to indicate (to another processor) whether a located element (that will have to represented as...
void add_external_haloed_node_to_storage(int &iproc, Node *nod_pt, Problem *problem_pt, Mesh *const &external_mesh_pt, int &n_cont_inter_values)
Helper function to add external haloed nodes, including any masters.
unsigned Counter_for_flat_packed_doubles
Counter used when processing vector of flat-packed doubles – this is really "private" data,...
bool first_closer_than_second(const std::pair< FiniteElement *, Vector< double > > &p1, const std::pair< FiniteElement *, Vector< double > > &p2)
Comparison function for sorting entries in bin: Returns true if point identified by p1 (comprising po...
void locate_zeta_for_missing_coordinates(int &iproc, Mesh *const &external_mesh_pt, Problem *problem_pt, Vector< MeshAsGeomObject * > &mesh_geom_obj_pt)
Locate zeta for current set of missing coordinates; vector-based version.
bool Accept_failed_locate_zeta_in_setup_multi_domain_interaction
Boolean to indicate that failure in setup multi domain functions is acceptable; defaults to false....
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
OomphInfo oomph_info
Single (global) instantiation of the OomphInfo object – this is used throughout the library as a "rep...