30 #ifndef OOMPH_REFINEABLE_LINE_SPECTRAL_ELEMENT_HEADER 31 #define OOMPH_REFINEABLE_LINE_SPECTRAL_ELEMENT_HEADER 36 #include <oomph-lib-config.h> 64 LeakCheckNames::RefineableQSpectralElement<1>
_build+=1;
88 LeakCheckNames::RefineableQSpectralElement<1>
_build-=1;
97 if(this->node_pt(0)==0)
100 OOMPH_CURRENT_FUNCTION,
101 OOMPH_EXCEPTION_LOCATION);
104 TimeStepper* time_stepper_pt = this->node_pt(0)->time_stepper_pt();
107 const unsigned ntstorage = time_stepper_pt->
ntstorage();
113 const unsigned n_node = this->nnode_1d();
116 for(
unsigned n=0;n<n_node;n++)
119 s_fraction[0] = this->local_one_d_fraction_of_node(n,0);
122 s[0] = -1.0 + 2.0*s_fraction[0];
125 if(this->node_pt(n)==0)
128 bool is_periodic =
false;
129 Node* created_node_pt =
130 this->node_created_by_neighbour(s_fraction,is_periodic);
133 if(created_node_pt!=0)
139 "Cannot handle periodic nodes in refineable spectral elements",
140 OOMPH_CURRENT_FUNCTION,
141 OOMPH_EXCEPTION_LOCATION);
146 this->node_pt(n) = created_node_pt;
156 using namespace BinaryTreeNames;
159 if(s_fraction[0] < 0.5)
162 s_in_son[0] = -1.0 + 4.0*s_fraction[0];
168 s_in_son[0] = -1.0 + 4.0*(s_fraction[0]-0.5);
175 this->tree_pt()->son_pt(son)->object_pt());
181 if(n==0 || n==n_node-1)
184 "I am trying to rebuild one of the (two) vertex nodes in\n";
186 "this 1D element. It should not have been possible to delete\n";
188 "either of these!\n";
192 OOMPH_CURRENT_FUNCTION,
193 OOMPH_EXCEPTION_LOCATION);
198 this->node_pt(n) = this->construct_node(n,time_stepper_pt);
212 for(
unsigned t=0;
t<ntstorage;
t++)
219 son_el_pt->
get_x(
t,s_in_son,x_prev);
222 this->node_pt(n)->x(
t,0) = x_prev[0];
236 const unsigned n_value = this->node_pt(n)->nvalue();
239 for(
unsigned v=0;v<n_value;v++)
241 this->node_pt(n)->set_value(
t,v,prev_values[v]);
258 "Have not implemented rebuilding from sons for";
260 "Algebraic Spectral elements yet\n";
264 "RefineableQSpectralElement<1>::rebuild_from_sons()",
265 OOMPH_EXCEPTION_LOCATION);
276 const unsigned n_node = this->nnode();
277 for(
unsigned n=0;n<n_node;n++)
279 if(node_pt(n)==0) {
return false; }
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...
RefineableQSpectralElement(const RefineableQSpectralElement< 1 > &dummy)
Broken copy constructor.
void broken_copy(const std::string &class_name)
Issue error message and terminate execution.
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...
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
void add_node_pt(Node *const &node_pt)
Add a (pointer to a) node to the mesh.
virtual bool nodes_built()
Overload the nodes built function.
unsigned ntstorage() const
Return the number of doubles required to represent history (one for steady)
void rebuild_from_sons(Mesh *&mesh_pt)
The only thing to add is rebuild from sons.
std::string string(const unsigned &i)
Return the i-th string or "" if the relevant string hasn't been defined.
RefineableQSpectralElement()
Constructor.
long RefineableQElement< 2 > _build
Base class for time-stepping schemes. Timestepper provides an approximation of the temporal derivativ...
virtual ~RefineableQSpectralElement()
Broken assignment operator.