26 #ifndef OOMPH_REFINEABLE_QUAD_SPECTRAL_ELEMENT_HEADER 
   27 #define OOMPH_REFINEABLE_QUAD_SPECTRAL_ELEMENT_HEADER 
   32 #include <oomph-lib-config.h> 
   53       LeakCheckNames::RefineableQSpectralElement<2> 
_build += 1;
 
   74       LeakCheckNames::RefineableQSpectralElement<2> 
_build -= 1;
 
   83       if (this->node_pt(0) == 0)
 
   86                             OOMPH_CURRENT_FUNCTION,
 
   87                             OOMPH_EXCEPTION_LOCATION);
 
   90       TimeStepper* time_stepper_pt = this->node_pt(0)->time_stepper_pt();
 
   91       unsigned ntstorage = time_stepper_pt->
ntstorage();
 
   96       unsigned n_p = this->nnode_1d();
 
   97       for (
unsigned i0 = 0; i0 < n_p; i0++)
 
  100         s_fraction[0] = this->local_one_d_fraction_of_node(i0, 0);
 
  102         s[0] = -1.0 + 2.0 * s_fraction[0];
 
  104         for (
unsigned i1 = 0; i1 < n_p; i1++)
 
  107           s_fraction[1] = this->local_one_d_fraction_of_node(i1, 1);
 
  109           s[1] = -1.0 + 2.0 * s_fraction[1];
 
  112           jnod = i0 + n_p * i1;
 
  115           if (this->node_pt(jnod) == 0)
 
  118             bool is_periodic = 
false;
 
  119             Node* created_node_pt =
 
  120               this->node_created_by_neighbour(s_fraction, is_periodic);
 
  123             if (created_node_pt != 0)
 
  129                                     "refineable spectral elements yet",
 
  130                                     OOMPH_CURRENT_FUNCTION,
 
  131                                     OOMPH_EXCEPTION_LOCATION);
 
  136                 this->node_pt(jnod) = created_node_pt;
 
  146               using namespace QuadTreeNames;
 
  149               if (s_fraction[0] < 0.5)
 
  152                 if (s_fraction[1] < 0.5)
 
  156                   s_in_son[0] = -1.0 + 4.0 * s_fraction[0];
 
  157                   s_in_son[1] = -1.0 + 4.0 * s_fraction[1];
 
  164                   s_in_son[0] = -1.0 + 4.0 * s_fraction[0];
 
  165                   s_in_son[1] = -1.0 + 4.0 * (s_fraction[1] - 0.5);
 
  171                 if (s_fraction[1] < 0.5)
 
  175                   s_in_son[0] = -1.0 + 4.0 * (s_fraction[0] - 0.5);
 
  176                   s_in_son[1] = -1.0 + 4.0 * s_fraction[1];
 
  183                   s_in_son[0] = -1.0 + 4.0 * (s_fraction[0] - 0.5);
 
  184                   s_in_son[1] = -1.0 + 4.0 * (s_fraction[1] - 0.5);
 
  192                   this->tree_pt()->son_pt(son)->object_pt());
 
  204               else if (i0 == n_p - 1)
 
  229               else if (i1 == n_p - 1)
 
  247               std::set<unsigned> boundaries;
 
  261               if (boundaries.size() > 0)
 
  264                 this->node_pt(jnod) =
 
  265                   this->construct_boundary_node(jnod, time_stepper_pt);
 
  268                 Vector<int> bound_cons(ncont_interpolated_values());
 
  269                 son_el_pt->
get_bcs(boundary, bound_cons);
 
  272                 unsigned nval = this->node_pt(jnod)->nvalue();
 
  273                 for (
unsigned k = 0; k < nval; k++)
 
  277                     this->node_pt(jnod)->pin(k);
 
  284                   dynamic_cast<SolidNode*
>(this->node_pt(jnod));
 
  285                 if (solid_node_pt != 0)
 
  288                   unsigned n_dim = this->node_pt(jnod)->
ndim();
 
  293                   if (son_solid_el_pt == 0)
 
  296                       "We have a SolidNode outside a refineable SolidElement\n";
 
  298                       "during mesh refinement -- this doesn't make sense\n";
 
  301                                         OOMPH_CURRENT_FUNCTION,
 
  302                                         OOMPH_EXCEPTION_LOCATION);
 
  308                   for (
unsigned k = 0; k < n_dim; k++)
 
  310                     if (solid_bound_cons[k])
 
  319                 for (std::set<unsigned>::iterator it = boundaries.begin();
 
  320                      it != boundaries.end();
 
  334                       *it, boundary, s_in_son, zeta);
 
  336                     this->node_pt(jnod)->set_coordinates_on_boundary(*it, zeta);
 
  345                 this->node_pt(jnod) =
 
  346                   this->construct_node(jnod, time_stepper_pt);
 
  363               for (
unsigned t = 0; 
t < ntstorage; 
t++)
 
  365                 using namespace QuadTreeNames;
 
  370                 son_el_pt->
get_x(
t, s_in_son, x_prev);
 
  371                 for (
unsigned i = 0; 
i < 2; 
i++)
 
  373                   this->node_pt(jnod)->x(
t, 
i) = x_prev[
i];
 
  379               for (
unsigned t = 0; 
t < ntstorage; 
t++)
 
  387                 for (
unsigned k = 0; k < this->node_pt(jnod)->nvalue(); k++)
 
  389                   this->node_pt(jnod)->set_value(
t, k, prev_values[k]);
 
  407                 "Have not implemented rebuilding from sons for";
 
  408               error_message += 
"Algebraic Spectral elements yet\n";
 
  412                 "RefineableQSpectralElement::rebuild_from_sons()",
 
  413                 OOMPH_EXCEPTION_LOCATION);
 
  424       unsigned n_node = this->nnode();
 
  425       for (
unsigned n = 0; n < n_node; n++)
 
////////////////////////////////////////////////////////////////////
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...
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...
unsigned ndim() const
Return (Eulerian) spatial dimension of the node.
An OomphLibError object which should be thrown when an run-time error is encountered....
RefineableElements are FiniteElements that may be subdivided into children to provide a better local ...
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...
void get_boundaries(const int &edge, std::set< unsigned > &boundaries) const
Determine set of (mesh) boundaries that the element edge/vertex lives on.
void get_bcs(int bound, Vector< int > &bound_cons) const
Determine Vector of boundary conditions along edge (or on vertex) bound (S/W/N/E/SW/SE/NW/NE): For va...
void interpolated_zeta_on_edge(const unsigned &boundary, const int &edge, const Vector< double > &s, Vector< double > &zeta)
Return the value of the intrinsic boundary coordinate interpolated along the edge (S/W/N/E)
A class that is used to template the refineable Q elements by dimension. It's really nothing more tha...
Refineable version of QuadElements that add functionality for spectral Elements.
virtual ~RefineableQSpectralElement()
Broken assignment operator.
virtual bool nodes_built()
Overload the nodes built function.
void rebuild_from_sons(Mesh *&mesh_pt)
The only thing to add is rebuild from sons.
RefineableQSpectralElement(const RefineableQSpectralElement< 2 > &dummy)=delete
Broken copy constructor.
RefineableQSpectralElement()
Constructor.
A class that is used to template the refineable Q spectral elements by dimension. It's really nothing...
Refineable version of Solid quad elements.
void get_solid_bcs(int bound, Vector< int > &solid_bound_cons) const
Determine vector of solid (positional) boundary conditions along edge (or on vertex) bound (S/W/N/E/S...
A Class for nodes that deform elastically (i.e. position is an unknown in the problem)....
void pin_position(const unsigned &i)
Pin the nodal position.
////////////////////////////////////////////////////////////////////// //////////////////////////////...
unsigned ntstorage() const
Return the number of doubles required to represent history (one for steady)
static const int OMEGA
Default value for an unassigned neighbour.
std::string string(const unsigned &i)
Return the i-th string or "" if the relevant string hasn't been defined.
long RefineableQElement< 2 > _build
//////////////////////////////////////////////////////////////////// ////////////////////////////////...