50 using namespace BinaryTreeNames;
72 Father_bound[
n_node](0, L) = L;
94 using namespace BinaryTreeNames;
144 if (neighbour_pt != 0)
159 std::string error_message =
160 "Problem: an element claims to have had its nodes built, yet\n";
161 error_message +=
"it is missing (a least) a node at its edge.\n";
173 is_periodic = binary_tree_pt()->root_pt()->is_neighbour_periodic(
217 using namespace BinaryTreeNames;
224 if (Father_bound[
n_node].nrow() == 0)
226 setup_father_bounds();
231 dynamic_cast<BinaryTree*
>(binary_tree_pt()->father_pt());
235 const int son_type = Tree_pt->
son_type();
246 std::string error_message =
247 "Something fishy here: I have no father and yet \n";
248 error_message +=
"I have no nodes. Who has created me then?!\n";
275 throw OomphLibError(
"Can't handle generalised nodal positions (yet).",
328 "Trouble: father_el_pt->node_pt(0)==0\n Can't build son element!\n",
376 for (
unsigned t = 0;
t < ntstorage;
t++)
395 for (
unsigned k = 0;
k <
n_var;
k++)
435 std::string error_message =
436 "node_created_by_neighbour returns a node which claims\n";
437 error_message +=
"to be periodic. In a 1D mesh any periodic "
438 "nodes must exist\n";
439 error_message +=
"in the initial (coarse) mesh.";
476 for (
unsigned t = 0;
t < ntstorage;
t++)
565 std::string error_message =
566 "Failed to cast to MacroElementNodeUpdateElementBase*\n";
568 "Strange -- if the father is a MacroElementNodeUpdateElement\n";
569 error_message +=
"the son should be too....\n";
582 m_el_pt->set_node_update_info(geom_object_pt);
605 std::string error_message =
606 "Failed to cast to ElementWithMovingNodes*\n";
608 "Strange -- if the son is a ElementWithMovingNodes\n";
609 error_message +=
"the father should be too....\n";
619 ->are_dresidual_dnodal_coordinates_always_evaluated_by_fd())
622 ->enable_always_evaluate_dresidual_dnodal_coordinates_by_fd();
631 ->is_fill_in_jacobian_from_geometric_data_bypassed())
633 aux_el_pt->enable_bypass_fill_in_jacobian_from_geometric_data();
656 const std::string& colour)
const
664 outfile <<
"ZONE I=2,J=2, C=" << colour << std::endl;
677 <<
", HU = GRID, H = 0.01, AN = MIDCENTER, T =\"" <<
Number <<
"\""
688 using namespace BinaryTreeNames;
695 const unsigned n_time = 1;
759 is_periodic = tree_pt()->root_pt()->is_neighbour_periodic(
852 <<
"erru " <<
err <<
" " <<
ival <<
" "
877 if (max_error > 1
e-9)
879 oomph_info <<
"\n#------------------------------------ \n#Max error ";
881 oomph_info <<
"#------------------------------------ \n " << std::endl;
Base class for algebraic elements.
BinaryTree class: Recursively defined, generalised binary tree.
BinaryTree * gteq_edge_neighbour(const int &direction, Vector< double > &s_in_neighbour, int &edge, int &diff_level, bool &in_neighbouring_tree) const
Return pointer to greater or equal-sized edge neighbour in specified direction; also provide info reg...
TimeStepper *& time_stepper_pt()
Return the pointer to the timestepper.
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.
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 double interpolated_x(const Vector< double > &s, const unsigned &i) const
Return FE interpolated coordinate x[i] at local coordinate s.
MacroElement * Macro_elem_pt
Pointer to the element's macro element (NULL by default)
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...
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...
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...
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;.
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.
TimeStepper *& time_stepper_pt()
Access function for pointer to time stepper: Null if object is not time-dependent.
Base class for elements that allow MacroElement-based node update.
void add_node_pt(Node *const &node_pt)
Add a (pointer to a) node to the mesh.
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
double & x(const unsigned &i)
Return the i-th nodal coordinate.
unsigned nposition_type() const
Number of coordinate types needed in the mapping between local and global coordinates.
An OomphLibError object which should be thrown when an run-time error is encountered....
virtual bool nodes_built()
Return true if all the nodes have been built, false if not.
virtual unsigned ncont_interpolated_values() const =0
Number of continuously interpolated values. Note: We assume that they are located at the beginning of...
virtual void get_interpolated_values(const Vector< double > &s, Vector< double > &values)
Get all continously interpolated function values in this element as a Vector. Note: Vector sets is ow...
A class that is used to template the refineable Q elements by dimension. It's really nothing more tha...
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...