41 const std::string& colour)
const
46 outfile <<
"ZONE I=2, J=2, K=2 C=" << colour << std::endl;
128 using namespace OcTreeNames;
159 for (
unsigned i = 0;
i < 3;
i++)
204 for (
int i = 0;
i < 3;
i++)
240 using namespace OcTreeNames;
243 unsigned nvalue = ncont_interpolated_values();
258 for (
int i = 0;
i < 3;
i++)
277 for (
unsigned i = 0;
i < 3;
i++)
289 for (
unsigned k = 0;
k < nvalue;
k++)
298 for (
unsigned i = 0;
i < 3;
i++)
315 for (
unsigned k = 0;
k < nvalue;
k++)
322 throw OomphLibError(
"Make sure you are not giving OMEGA as bound",
340 using namespace OcTreeNames;
401 unsigned maxnvalue = ncont_interpolated_values();
425 std::set<unsigned>& boundary)
const
427 using namespace OcTreeNames;
448 for (
int i = 0;
i < 3;
i++)
531 throw OomphLibError(
"Make sure you are not giving OMEGA as boundary",
544 for (
unsigned i = 0;
i < 4;
i++)
553 for (
unsigned i = 0;
i < 2;
i++)
560 std::set_intersection(
574 inserter(boundary, boundary.begin()));
583 const unsigned& boundary,
588 using namespace OcTreeNames;
621 <<
" is not on Left face\n";
640 <<
" is not on Right face\n";
660 <<
" is not on Bottom face\n";
678 <<
" is not on Upper face\n";
697 <<
" is not on Back face\n";
715 <<
" is not on Front face\n";
730 if ((
s[0] != -1.0) || (
s[2] != 1.0))
734 <<
" is not on Front-Left edge\n";
747 if ((
s[0] != -1.0) || (
s[1] != -1.0))
751 <<
" is not on Bottom-Left edge\n";
763 if ((
s[0] != -1.0) || (
s[1] != 1.0))
767 <<
" is not on Upper-Left edge\n";
780 if ((
s[0] != -1.0) || (
s[2] != -1.0))
784 <<
" is not on Back-Left edge\n";
796 if ((
s[0] != 1.0) || (
s[2] != 1.0))
800 <<
" is not on Front-Right edge\n";
813 if ((
s[0] != 1.0) || (
s[1] != -1.0))
817 <<
" is not on Bottom-Right edge\n";
830 if ((
s[0] != 1.0) || (
s[1] != 1.0))
834 <<
" is not on Upper-Right edge\n";
847 if ((
s[0] != 1.0) || (
s[2] != -1.0))
851 <<
" is not on Back-Right edge\n";
864 if ((
s[1] != -1.0) || (
s[2] != -1.0))
868 <<
" is not on Back-Bottom edge\n";
879 if ((
s[1] != -1.0) || (
s[2] != 1.0))
883 <<
" is not on Front-Bottom edge\n";
895 if ((
s[1] != 1.0) || (
s[2] != -1.0))
899 <<
" is not on Back-Upper edge\n";
911 if ((
s[1] != 1.0) || (
s[2] != 1.0))
915 <<
" is not on Upper-Front edge\n";
929 <<
" passed" << std::endl;
934 error_stream <<
"corresponding to : x= [" << x[0] <<
" " << x[1] <<
" "
945 unsigned node = start;
995 using namespace OcTreeNames;
1006 edges.push_back(LD);
1010 edges.push_back(LB);
1014 edges.push_back(LU);
1018 edges.push_back(LF);
1027 edges.push_back(RD);
1031 edges.push_back(RB);
1035 edges.push_back(RU);
1039 edges.push_back(RF);
1048 edges.push_back(DB);
1052 edges.push_back(DF);
1061 edges.push_back(UB);
1065 edges.push_back(UF);
1114 if (
neigh_pt->object_pt()->nodes_built())
1124 for (
unsigned i = 0;
i < 3;
i++)
1143 octree_pt()->root_pt()->is_neighbour_periodic(
faces[
j]);
1194 if (
neigh_pt->object_pt()->nodes_built())
1204 for (
unsigned i = 0;
i < 3;
i++)
1229 is_periodic = octree_pt()->root_pt()->is_neighbour_periodic(
1298 using namespace OcTreeNames;
1307 if (Father_bound[
n_p].nrow() == 0)
1309 setup_father_bounds();
1313 OcTree* father_pt =
dynamic_cast<OcTree*
>(octree_pt()->father_pt());
1316 int son_type = octree_pt()->
son_type();
1324 std::string error_message =
1325 "Something fishy here: I have no father and yet \n";
1326 error_message +=
"I have no nodes. Who has created me then?!\n";
1353 throw OomphLibError(
"Can't handle generalised nodal positions (yet).",
1366 s_lo = octree_pt()->Direction_to_vector[son_type];
1370 for (
unsigned i = 0;
i <
n_dim;
i++)
1376 for (
unsigned i = 0;
i <
n_dim;
i++)
1386 for (
unsigned i = 0;
i <
n_dim;
i++)
1390 0.5 * (
s_lo[
i] + 1.0) *
1394 0.5 * (
s_hi[
i] + 1.0) *
1404 "Trouble: father_el_pt->node_pt(0)==0\n Can't build son element!\n",
1466 for (
unsigned t = 0;
t < ntstorage;
t++)
1482 for (
unsigned k = 0;
k <
n_var;
k++)
1535 "boundaries.size()>2 seems a bit strange..\n",
1557 for (
unsigned t = 0;
t < ntstorage;
t++)
1567 for (
unsigned i = 0;
i <
n_dim;
i++)
1575 for (std::set<unsigned>::iterator
it =
boundaries.begin();
1651 "boundaries.size()>2 seems a bit strange..\n",
1662 <<
"Periodic node is not on a boundary...\n"
1682 for (
unsigned t = 0;
t < ntstorage;
t++)
1692 for (
unsigned i = 0;
i <
n_dim;
i++)
1700 for (std::set<unsigned>::iterator
it =
boundaries.begin();
1774 "boundaries.size()>2 seems a bit strange..\n",
1801 unsigned n_cont = ncont_interpolated_values();
1829 std::string error_message =
"We have a SolidNode outside "
1830 "a refineable SolidElement\n";
1832 "during mesh refinement -- this doesn't make sense";
1843 for (
unsigned k = 0;
k <
n_dim;
k++)
1855 for (std::set<unsigned>::iterator
it =
boundaries.begin();
1906 for (
unsigned t = 0;
t < ntstorage;
t++)
1917 for (
unsigned i = 0;
i <
n_dim;
i++)
1925 for (
unsigned t = 0;
t < ntstorage;
t++)
2003 std::string error_message =
2004 "Failed to cast to MacroElementNodeUpdateElementBase*\n";
2006 "Strange -- if the father is a MacroElementNodeUpdateElement\n";
2007 error_message +=
"the son should be too....\n";
2021 m_el_pt->set_node_update_info(geom_object_pt);
2026 if (tree_pt()->father_pt()->object_pt()->
is_halo())
2047 std::string error_message =
2048 "Failed to cast to ElementWithMovingNodes*\n";
2050 "Strange -- if the son is a ElementWithMovingNodes\n";
2051 error_message +=
"the father should be too....\n";
2061 ->are_dresidual_dnodal_coordinates_always_evaluated_by_fd())
2064 ->enable_always_evaluate_dresidual_dnodal_coordinates_by_fd();
2074 ->is_fill_in_jacobian_from_geometric_data_bypassed())
2076 aux_el_pt->enable_bypass_fill_in_jacobian_from_geometric_data();
2109 using namespace OcTreeNames;
2126 using namespace OcTreeNames;
2146 using namespace OcTreeNames;
2227 for (
unsigned i = 0;
i <
n_dim;
i++)
2235 for (
unsigned i = 0;
i <
n_dim;
i++)
2247 for (
unsigned i = 0;
i <
n_dim;
i++)
2251 for (
unsigned i = 0;
i <
n_dim;
i++)
2275 local_one_d_fraction_of_interpolating_node(
i0, 0,
value_id);
2278 local_one_d_fraction_of_interpolating_node(
i1, 2,
value_id);
2285 local_one_d_fraction_of_interpolating_node(
i0, 0,
value_id);
2288 local_one_d_fraction_of_interpolating_node(
i1, 2,
value_id);
2296 local_one_d_fraction_of_interpolating_node(
i0, 1,
value_id);
2298 local_one_d_fraction_of_interpolating_node(
i1, 2,
value_id);
2306 local_one_d_fraction_of_interpolating_node(
i0, 1,
value_id);
2308 local_one_d_fraction_of_interpolating_node(
i1, 2,
value_id);
2315 local_one_d_fraction_of_interpolating_node(
i0, 0,
value_id);
2317 local_one_d_fraction_of_interpolating_node(
i1, 1,
value_id);
2324 local_one_d_fraction_of_interpolating_node(
i0, 0,
value_id);
2326 local_one_d_fraction_of_interpolating_node(
i1, 1,
value_id);
2340 for (
unsigned i = 0;
i <
n_dim;
i++)
2349 neigh_pt->object_pt()->get_interpolating_node_at_local_coordinate(
2459 std::ofstream
reportage(
"dodgy.dat", std::ios_base::app);
2466 <<
"SANITY CHECK in oc_hang_helper \n"
2470 <<
" is not hanging and has " << std::endl
2475 <<
"even though the two should be "
2476 <<
"identical" << std::endl;
2511 using namespace OcTreeNames;
2636 for (
unsigned i = 0;
i < 3;
i++)
2657 for (
unsigned i = 0;
i < 3;
i++)
2671 <<
" " << std::endl;
2687 neigh_pt->object_pt()->get_interpolated_values(
2692 get_interpolated_values(
t,
s, values);
2697 neigh_pt->object_pt()->ncont_interpolated_values();
2708 <<
"erru (S)" <<
err <<
" " <<
ival <<
" " <<
n
2709 <<
" " << values[
ival] <<
" "
2734 if (max_error > 1
e-9)
2736 oomph_info <<
"\n#------------------------------------ \n#Max error ";
2739 oomph_info <<
"#------------------------------------ \n " << std::endl;
2767 using namespace OcTreeNames;
2785 for (
int i = 0;
i < 3;
i++)
2804 for (
unsigned i = 0;
i < 3;
i++)
2816 for (
unsigned k = 0;
k <
n_dim;
k++)
2825 for (
unsigned i = 0;
i < 3;
i++)
2842 for (
unsigned k = 0;
k <
n_dim;
k++)
2850 throw OomphLibError(
"Make sure you are not giving OMEGA as bound",
2869 using namespace OcTreeNames;
2939 "Corner node 1 cannot be cast to SolidNode --> something is wrong",
2947 "Corner node 2 cannot be cast to SolidNode --> something is wrong",
2955 "Corner node 3 cannot be cast to SolidNode --> something is wrong",
2963 "Corner node 4 cannot be cast to SolidNode --> something is wrong",
2976 for (
unsigned k = 0;
k <
n_dim;
k++)
Base class for algebraic elements.
TimeStepper *& time_stepper_pt()
Return the pointer to the timestepper.
bool is_pinned(const unsigned &i) const
Test whether the i-th variable is pinned (1: true; 0: false).
A policy class that serves to establish the common interfaces for elements that contain moving nodes....
virtual void set_macro_elem_pt(MacroElement *macro_elem_pt)
Set pointer to macro element – can be overloaded in derived elements to perform additional tasks.
virtual Node * get_node_at_local_coordinate(const Vector< double > &s) const
If there is a node at this local coordinate, return the pointer to the node.
virtual double s_min() const
Min value of local coordinate.
double size() const
Calculate the size of the element (length, area, volume,...) in Eulerian computational coordinates....
virtual Node * construct_node(const unsigned &n)
Construct the local node n and return a pointer to the newly created node object.
virtual void shape(const Vector< double > &s, Shape &psi) const =0
Calculate the geometric shape functions at local coordinate s. This function must be overloaded for e...
virtual double interpolated_x(const Vector< double > &s, const unsigned &i) const
Return FE interpolated coordinate x[i] at local coordinate s.
unsigned nnode() const
Return the number of nodes.
virtual double s_max() const
Max. value of local coordinate.
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...
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.
virtual unsigned nnode_1d() const
Return the number of nodes along one edge of the element Default is to return zero — must be overload...
unsigned nodal_dimension() const
Return the required Eulerian dimension of the nodes in this element.
virtual double local_one_d_fraction_of_node(const unsigned &n1d, const unsigned &i)
Get the local fraction of any node in the n-th position in a one dimensional expansion along the i-th...
bool is_halo() const
Is this element a halo?
int non_halo_proc_ID()
ID of processor ID that holds non-halo counterpart of halo element; negative if not a halo.
int Non_halo_proc_ID
Non-halo processor ID for Data; -1 if it's not 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.
Class that contains data for hanging nodes.
Base class for elements that allow MacroElement-based node update.
void add_boundary_node(const unsigned &b, Node *const &node_pt)
Add a (pointer to) a node to the b-th boundary.
void add_node_pt(Node *const &node_pt)
Add a (pointer to a) node to the mesh.
bool boundary_coordinate_exists(const unsigned &i) const
Indicate whether the i-th boundary has an intrinsic coordinate.
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
virtual void get_boundaries_pt(std::set< unsigned > *&boundaries_pt)
Return a pointer to set of mesh boundaries that this node occupies; this will be overloaded by Bounda...
double & x(const unsigned &i)
Return the i-th nodal coordinate.
virtual void get_coordinates_on_boundary(const unsigned &b, const unsigned &k, Vector< double > &boundary_zeta)
Return the vector of the k-th generalised boundary coordinates on mesh boundary b....
unsigned nposition_type() const
Number of coordinate types needed in the mapping between local and global coordinates.
OcTree class: Recursively defined, generalised octree.
static Vector< int > faces_of_common_edge(const int &edge)
Function that, given an edge, returns the two faces on which it.
static Vector< std::string > Direct_string
Translate (enumerated) directions into strings.
static Vector< Vector< int > > Direction_to_vector
For each direction, i.e. a son_type (vertex), a face or an edge, this defines a vector that indicates...
static std::map< Vector< int >, int > Vector_to_direction
Each vector representing a direction can be translated into a direction, either a son type (vertex),...
An OomphLibError object which should be thrown when an run-time error is encountered....
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 that is used to template the refineable Q elements by dimension. It's really nothing more tha...
A class that is used to template the solid refineable Q elements by dimension. It's really nothing mo...
A Class for shape functions. In simple cases, the shape functions have only one index that can be tho...
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...
TAdvectionDiffusionReactionElement()
Constructor: Call constructors for TElement and AdvectionDiffusionReaction equations.
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)
int son_type() const
Return son type.
RefineableElement * object_pt() const
Return the pointer to the object (RefineableElement) represented by the tree.
static const int OMEGA
Default value for an unassigned neighbour.
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...