26 #ifndef OOMPH_REFINEABLE_LINE_SPECTRAL_ELEMENT_HEADER
27 #define OOMPH_REFINEABLE_LINE_SPECTRAL_ELEMENT_HEADER
32 #include <oomph-lib-config.h>
57 LeakCheckNames::RefineableQSpectralElement<1>
_build += 1;
77 LeakCheckNames::RefineableQSpectralElement<1>
_build -= 1;
86 if (this->node_pt(0) == 0)
89 OOMPH_CURRENT_FUNCTION,
90 OOMPH_EXCEPTION_LOCATION);
93 TimeStepper* time_stepper_pt = this->node_pt(0)->time_stepper_pt();
96 const unsigned ntstorage = time_stepper_pt->
ntstorage();
102 const unsigned n_node = this->nnode_1d();
105 for (
unsigned n = 0; n < n_node; n++)
108 s_fraction[0] = this->local_one_d_fraction_of_node(n, 0);
111 s[0] = -1.0 + 2.0 * s_fraction[0];
114 if (this->node_pt(n) == 0)
117 bool is_periodic =
false;
118 Node* created_node_pt =
119 this->node_created_by_neighbour(s_fraction, is_periodic);
122 if (created_node_pt != 0)
128 "Cannot handle periodic nodes in refineable spectral elements",
129 OOMPH_CURRENT_FUNCTION,
130 OOMPH_EXCEPTION_LOCATION);
135 this->node_pt(n) = created_node_pt;
145 using namespace BinaryTreeNames;
148 if (s_fraction[0] < 0.5)
151 s_in_son[0] = -1.0 + 4.0 * s_fraction[0];
157 s_in_son[0] = -1.0 + 4.0 * (s_fraction[0] - 0.5);
164 this->tree_pt()->son_pt(son)->object_pt());
170 if (n == 0 || n == n_node - 1)
173 "I am trying to rebuild one of the (two) vertex nodes in\n";
175 "this 1D element. It should not have been possible to delete\n";
176 error_message +=
"either of these!\n";
179 OOMPH_CURRENT_FUNCTION,
180 OOMPH_EXCEPTION_LOCATION);
185 this->node_pt(n) = this->construct_node(n, time_stepper_pt);
199 for (
unsigned t = 0;
t < ntstorage;
t++)
206 son_el_pt->
get_x(
t, s_in_son, x_prev);
209 this->node_pt(n)->x(
t, 0) = x_prev[0];
223 const unsigned n_value = this->node_pt(n)->nvalue();
226 for (
unsigned v = 0; v < n_value; v++)
228 this->node_pt(n)->set_value(
t, v, prev_values[v]);
245 "Have not implemented rebuilding from sons for";
246 error_message +=
"Algebraic Spectral elements yet\n";
250 "RefineableQSpectralElement<1>::rebuild_from_sons()",
251 OOMPH_EXCEPTION_LOCATION);
262 const unsigned n_node = this->nnode();
263 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_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...
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...
A class that is used to template the refineable Q elements by dimension. It's really nothing more tha...
Refineable version of LineElements that add functionality for spectral Elements.
virtual ~RefineableQSpectralElement()
Broken assignment operator.
RefineableQSpectralElement()
Constructor.
void rebuild_from_sons(Mesh *&mesh_pt)
The only thing to add is rebuild from sons.
RefineableQSpectralElement(const RefineableQSpectralElement< 1 > &dummy)=delete
Broken copy constructor.
virtual bool nodes_built()
Overload the nodes built function.
A class that is used to template the refineable Q spectral elements by dimension. It's really nothing...
////////////////////////////////////////////////////////////////////// //////////////////////////////...
unsigned ntstorage() const
Return the number of doubles required to represent history (one for steady)
std::string string(const unsigned &i)
Return the i-th string or "" if the relevant string hasn't been defined.
long RefineableQElement< 2 > _build
//////////////////////////////////////////////////////////////////// ////////////////////////////////...