26 #ifndef OOMPH_REFINEABLE_BRICK_SPECTRAL_ELEMENT_HEADER 
   27 #define OOMPH_REFINEABLE_BRICK_SPECTRAL_ELEMENT_HEADER 
   32 #include <oomph-lib-config.h> 
   53       LeakCheckNames::RefineableQSpectralElement<3> 
_build += 1;
 
   74       LeakCheckNames::RefineableQSpectralElement<3> 
_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];
 
  111           for (
unsigned i2 = 0; i2 < n_p; i2++)
 
  114             s_fraction[2] = this->local_one_d_fraction_of_node(i2, 2);
 
  116             s[2] = -1.0 + 2.0 * s_fraction[2];
 
  119             jnod = i0 + n_p * i1 + n_p * n_p * i2;
 
  122             if (this->node_pt(jnod) == 0)
 
  125               bool is_periodic = 
false;
 
  126               Node* created_node_pt =
 
  127                 this->node_created_by_neighbour(s_fraction, is_periodic);
 
  130               if (created_node_pt != 0)
 
  136                                       "refineable spectral elements yet",
 
  137                                       OOMPH_CURRENT_FUNCTION,
 
  138                                       OOMPH_EXCEPTION_LOCATION);
 
  143                   this->node_pt(jnod) = created_node_pt;
 
  154                 using namespace OcTreeNames;
 
  157                 if (s_fraction[0] < 0.5)
 
  160                   if (s_fraction[1] < 0.5)
 
  163                     if (s_fraction[2] < 0.5)
 
  167                       s_in_son[0] = -1.0 + 4.0 * s_fraction[0];
 
  168                       s_in_son[1] = -1.0 + 4.0 * s_fraction[1];
 
  169                       s_in_son[2] = -1.0 + 4.0 * s_fraction[2];
 
  176                       s_in_son[0] = -1.0 + 4.0 * s_fraction[0];
 
  177                       s_in_son[1] = -1.0 + 4.0 * s_fraction[1];
 
  178                       s_in_son[2] = -1.0 + 4.0 * (s_fraction[2] - 0.5);
 
  185                     if (s_fraction[2] < 0.5)
 
  189                       s_in_son[0] = -1.0 + 4.0 * s_fraction[0];
 
  190                       s_in_son[1] = -1.0 + 4.0 * (s_fraction[1] - 0.5);
 
  191                       s_in_son[2] = -1.0 + 4.0 * s_fraction[2];
 
  198                       s_in_son[0] = -1.0 + 4.0 * s_fraction[0];
 
  199                       s_in_son[1] = -1.0 + 4.0 * (s_fraction[1] - 0.5);
 
  200                       s_in_son[2] = -1.0 + 4.0 * (s_fraction[2] - 0.5);
 
  208                   if (s_fraction[1] < 0.5)
 
  211                     if (s_fraction[2] < 0.5)
 
  215                       s_in_son[0] = -1.0 + 4.0 * (s_fraction[0] - 0.5);
 
  216                       s_in_son[1] = -1.0 + 4.0 * s_fraction[1];
 
  217                       s_in_son[2] = -1.0 + 4.0 * s_fraction[2];
 
  224                       s_in_son[0] = -1.0 + 4.0 * (s_fraction[0] - 0.5);
 
  225                       s_in_son[1] = -1.0 + 4.0 * s_fraction[1];
 
  226                       s_in_son[2] = -1.0 + 4.0 * (s_fraction[2] - 0.5);
 
  233                     if (s_fraction[2] < 0.5)
 
  237                       s_in_son[0] = -1.0 + 4.0 * (s_fraction[0] - 0.5);
 
  238                       s_in_son[1] = -1.0 + 4.0 * (s_fraction[1] - 0.5);
 
  239                       s_in_son[2] = -1.0 + 4.0 * s_fraction[2];
 
  246                       s_in_son[0] = -1.0 + 4.0 * (s_fraction[0] - 0.5);
 
  247                       s_in_son[1] = -1.0 + 4.0 * (s_fraction[1] - 0.5);
 
  248                       s_in_son[2] = -1.0 + 4.0 * (s_fraction[2] - 0.5);
 
  256                     this->tree_pt()->son_pt(son)->object_pt());
 
  267                 else if (i0 == n_p - 1)
 
  292                 else if (i1 == n_p - 1)
 
  344                 else if (i2 == n_p - 1)
 
  380                 std::set<unsigned> boundaries;
 
  394                 if (boundaries.size() > 0)
 
  397                   this->node_pt(jnod) =
 
  398                     this->construct_boundary_node(jnod, time_stepper_pt);
 
  401                   Vector<int> bound_cons(ncont_interpolated_values());
 
  402                   son_el_pt->
get_bcs(boundary, bound_cons);
 
  405                   unsigned nval = this->node_pt(jnod)->nvalue();
 
  406                   for (
unsigned k = 0; k < nval; k++)
 
  410                       this->node_pt(jnod)->pin(k);
 
  417                     dynamic_cast<SolidNode*
>(this->node_pt(jnod));
 
  418                   if (solid_node_pt != 0)
 
  421                     unsigned n_dim = this->node_pt(jnod)->
ndim();
 
  426                     if (son_solid_el_pt == 0)
 
  428                       std::string error_message = 
"We have a SolidNode outside " 
  429                                                   "a refineable SolidElement\n";
 
  431                         "during mesh refinement -- this doesn't make sense\n";
 
  434                                           OOMPH_CURRENT_FUNCTION,
 
  435                                           OOMPH_EXCEPTION_LOCATION);
 
  441                     for (
unsigned k = 0; k < n_dim; k++)
 
  443                       if (solid_bound_cons[k])
 
  452                   for (std::set<unsigned>::iterator it = boundaries.begin();
 
  453                        it != boundaries.end();
 
  467                         *it, boundary, s_in_son, zeta);
 
  469                       this->node_pt(jnod)->set_coordinates_on_boundary(*it,
 
  478                   this->node_pt(jnod) =
 
  479                     this->construct_node(jnod, time_stepper_pt);
 
  495                 for (
unsigned t = 0; 
t < ntstorage; 
t++)
 
  501                   son_el_pt->
get_x(
t, s_in_son, x_prev);
 
  502                   for (
unsigned i = 0; 
i < 3; 
i++)
 
  504                     this->node_pt(jnod)->x(
t, 
i) = x_prev[
i];
 
  510                 for (
unsigned t = 0; 
t < ntstorage; 
t++)
 
  518                   for (
unsigned k = 0; k < this->node_pt(jnod)->nvalue(); k++)
 
  520                     this->node_pt(jnod)->set_value(
t, k, prev_values[k]);
 
  538                   "Have not implemented rebuilding from sons for";
 
  539                 error_message += 
"Algebraic Spectral elements yet\n";
 
  543                   "RefineableQSpectralElement::rebuild_from_sons()",
 
  544                   OOMPH_EXCEPTION_LOCATION);
 
  556       unsigned n_node = this->nnode();
 
  557       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 interpolated_zeta_on_face(const unsigned &boundary, const int &face, const Vector< double > &s, Vector< double > &zeta)
Return the value of the intrinsic boundary coordinate interpolated along the face.
void get_bcs(int bound, Vector< int > &bound_cons) const
Determine Vector of boundary conditions along the element's boundary (or vertex) bound (S/W/N/E/SW/SE...
void get_boundaries(const int &edge, std::set< unsigned > &boundaries) const
Given an element edge/vertex, return a Vector which contains all the (mesh-)boundary numbers that thi...
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.
void rebuild_from_sons(Mesh *&mesh_pt)
The only thing to add is rebuild from sons.
RefineableQSpectralElement(const RefineableQSpectralElement< 3 > &dummy)=delete
Broken copy constructor.
virtual bool nodes_built()
Overload the nodes built function.
RefineableQSpectralElement()
Constructor.
A class that is used to template the refineable Q spectral elements by dimension. It's really nothing...
Refineable version of Solid brick 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
//////////////////////////////////////////////////////////////////// ////////////////////////////////...