41 namespace Multi_domain_functions
119#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
273 int n_proc = comm_pt->nproc();
274 int my_rank = comm_pt->my_rank();
372#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
591#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
602#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
632#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
659#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
660 std::stringstream
junk;
661 junk <<
"Node needs to be constructed [size="
676#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
677 std::stringstream
junk;
688#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
717#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
719 "Node needs to be constructed[2]");
734#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
741#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
764#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
789#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
793#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
800#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
807 if (time_stepper_pt != 0)
814 if (
nod_pt->is_on_boundary())
817#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
834#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
835 std::stringstream
junk;
836 junk <<
"Node is on " <<
nb <<
" boundaries";
839 for (
unsigned i = 0;
i <
nb;
i++)
842#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
843 std::stringstream
junk;
855 throw OomphLibError(
"Failed to cast new node to boundary node\n",
860 std::map<unsigned, unsigned>*
map_pt =
861 bnod_pt->index_of_first_value_assigned_by_face_element_pt();
867#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
868 std::stringstream
junk;
870 "No additional values were created by face element");
878#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
879 std::stringstream
junk;
884 for (std::map<unsigned, unsigned>::iterator
p =
map_pt->begin();
889#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
890 std::stringstream
junk;
894#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
904#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
922#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
929#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
940#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
960#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1018#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1022#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1026#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1035#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1039#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1066#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1070#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1077#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1079 "Master node Not found timestepper");
1085 if (time_stepper_pt != 0)
1095#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1111#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1112 std::stringstream
junk;
1113 junk <<
"Master node is on " <<
nb <<
" boundaries";
1116 for (
unsigned i = 0;
i <
nb;
i++)
1119#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1120 std::stringstream
junk;
1134 throw OomphLibError(
"Failed to cast new node to boundary node\n",
1139 std::map<unsigned, unsigned>*
map_pt =
1140 bnod_pt->index_of_first_value_assigned_by_face_element_pt();
1146#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1147 std::stringstream
junk;
1149 "No additional values were created by face element for this master "
1158#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1159 std::stringstream
junk;
1164 for (std::map<unsigned, unsigned>::iterator
p =
map_pt->begin();
1169#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1170 std::stringstream
junk;
1172 "Key of map entry for master node");
1175#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1177 "Value of map entry for master node");
1186#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1188 "Master node is not on any boundary");
1205#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1212#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1223#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1225 "Master Alg Node n geom objects");
1242#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1244 "Master node Found geom object");
1270#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1272 "Master Node needs to be constructed");
1284#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1286 "Mesh is macro element mesh");
1293#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1315 error_stream <<
"You are using a MacroElement node update\n"
1316 <<
"in a case with non-QElements. This has not\n"
1317 <<
"yet been implemented.\n";
1328#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1330 "Mesh is not a macro element mesh");
1350#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1352 "External haloed element already exists");
1355#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1357 "Index of existing external haloed element");
1413#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1415 <<
" Bool: New node needs to be constructed "
1431#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1433 <<
" Index of existing external halo node "
1462#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1464 <<
" Number of values of external halo node "
1478#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1480 <<
" Timestepper req'd for node "
1486#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1488 <<
" Index of timestepper "
1502#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1504 <<
" Is node on boundary? "
1511 if (time_stepper_pt != 0)
1522#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1524 <<
" Number of boundaries the node is on: "
1530 for (
unsigned i = 0;
i <
nb;
i++)
1533#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1535 <<
" Node is on boundary "
1545#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1547 <<
" Number of additional values created by face element "
1563 throw OomphLibError(
"Failed to cast new node to boundary node\n",
1568 if (
bnew_nod_pt->index_of_first_value_assigned_by_face_element_pt() ==
1571 bnew_nod_pt->index_of_first_value_assigned_by_face_element_pt() =
1572 new std::map<unsigned, unsigned>;
1577 std::map<unsigned, unsigned>*
map_pt =
1578 bnew_nod_pt->index_of_first_value_assigned_by_face_element_pt();
1585#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1588 <<
" Key of map entry"
1595#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1598 <<
" Value of map entry"
1613 if (time_stepper_pt != 0)
1641#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1643 <<
" Alg node update id "
1655#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1657 <<
" Alg node # of ref values "
1680#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1682 <<
" Alg node # of geom objects "
1694#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1696 <<
" Alg node: geom object index "
1734 geom_object_vector_pt =
macro_mesh_pt->geom_object_vector_pt();
1807 int n_proc = comm_pt->nproc();
1808 int my_rank = comm_pt->my_rank();
1812#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1880 <<
" zeta coordinates have been set to DBX_MAX\n";
1970 ->ncont_interpolated_values();
1984#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
1986 "Mesh is macro element mesh[2]");
1998#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
2000 "Number of macro element[2]");
2023 <<
"You are using a MacroElement node update\n"
2024 <<
"in a case with non-QElements. This has not\n"
2025 <<
"yet been implemented.\n";
2034#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
2036 "Mesh is not a macro element mesh [2]");
2049 "Unable to cast source function to finite element\n",
2050 "Multi_domain_functions::locate_zeta_for_missing_"
2079#ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
2081 "Index of existing external haloed element[2]");
2170 <<
"mesh_pt [ " <<
n_mesh <<
" ] don't match.\n";
2190 mesh_pt[
i_mesh]->element_pt(
e));
2207 <<
" is not consitent with dimension assumed \n"
2208 <<
" in multidomain namespace, " <<
Dim << std::endl;
2328 for (
unsigned i = 0;
i <
Dim;
i++)
2343 Mesh*
const& mesh_pt,
2366 int n_proc = comm_pt->nproc();
2375 comm_pt->mpi_comm());
2384 comm_pt->mpi_comm());
2393 error_stream <<
"The elements within the two meshes do not\n"
2394 <<
"have the same dimension, so the multi-domain\n"
2395 <<
"method will not work.\n"
2396 <<
"For the mesh, dim=" <<
mesh_dim
2442 for (
unsigned i = 0;
i <
Dim;
i++)
2454 for (
unsigned i = 0;
i <
Dim;
i++)
Algebraic meshes contain AlgebraicElements and AlgebraicNodes. They implement the node update functio...
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....
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?
A geometric object is an object that provides a parametrised description of its shape via the functio...
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...
MacroElementNodeUpdate nodes are nodes with a positional update function, based on their element's Ma...
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.
Base class for Qelements.
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)....
TAdvectionDiffusionReactionElement<NREAGENT,DIM,NNODE_1D> elements are isoparametric triangular DIM-d...
Base class for time-stepping schemes. Timestepper provides an approximation of the temporal derivativ...
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....
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...