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)
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",
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";
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()",
262 const unsigned n_node = this->nnode();
263 for (
unsigned n = 0;
n < n_node;
n++)
Array< int, Dynamic, 1 > v
Definition: Array_initializer_list_vector_cxx11.cpp:1
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
MatrixXd L
Definition: LLT_example.cpp:6
@ R
Definition: StatisticsVector.h:21
Definition: algebraic_elements.h:506
void get_x(const Vector< double > &s, Vector< double > &x) const
Definition: elements.h:1885
void add_node_pt(Node *const &node_pt)
Add a (pointer to a) node to the mesh.
Definition: mesh.h:611
Definition: oomph_definitions.h:222
Definition: refineable_elements.h:97
virtual void get_interpolated_values(const Vector< double > &s, Vector< double > &values)
Definition: refineable_elements.h:417
Definition: Qelements.h:2259
Definition: refineable_line_spectral_element.h:51
virtual ~RefineableQSpectralElement()
Broken assignment operator.
Definition: refineable_line_spectral_element.h:74
RefineableQSpectralElement()
Constructor.
Definition: refineable_line_spectral_element.h:54
void rebuild_from_sons(Mesh *&mesh_pt)
The only thing to add is rebuild from sons.
Definition: refineable_line_spectral_element.h:82
RefineableQSpectralElement(const RefineableQSpectralElement< 1 > &dummy)=delete
Broken copy constructor.
virtual bool nodes_built()
Overload the nodes built function.
Definition: refineable_line_spectral_element.h:260
Definition: Qspectral_elements.h:1323
Definition: timesteppers.h:231
unsigned ntstorage() const
Definition: timesteppers.h:601
RealScalar s
Definition: level1_cplx_impl.h:130
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).
Definition: AnisotropicHookean.h:10
t
Definition: plotPSD.py:36
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86