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)
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",
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";
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()",
424 unsigned n_node = this->nnode();
425 for (
unsigned n = 0;
n < n_node;
n++)
int i
Definition: BiCGSTAB_step_by_step.cpp:9
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
Definition: algebraic_elements.h:506
void get_x(const Vector< double > &s, Vector< double > &x) const
Definition: elements.h:1885
void add_boundary_node(const unsigned &b, Node *const &node_pt)
Add a (pointer to) a node to the b-th boundary.
Definition: mesh.cc:243
void add_node_pt(Node *const &node_pt)
Add a (pointer to a) node to the mesh.
Definition: mesh.h:611
bool boundary_coordinate_exists(const unsigned &i) const
Indicate whether the i-th boundary has an intrinsic coordinate.
Definition: mesh.h:565
unsigned ndim() const
Return (Eulerian) spatial dimension of the node.
Definition: nodes.h:1054
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
void get_boundaries(const int &edge, std::set< unsigned > &boundaries) const
Definition: refineable_quad_element.cc:288
void get_bcs(int bound, Vector< int > &bound_cons) const
Definition: refineable_quad_element.cc:145
void interpolated_zeta_on_edge(const unsigned &boundary, const int &edge, const Vector< double > &s, Vector< double > &zeta)
Definition: refineable_quad_element.cc:390
Definition: Qelements.h:2259
Definition: refineable_quad_spectral_element.h:47
virtual ~RefineableQSpectralElement()
Broken assignment operator.
Definition: refineable_quad_spectral_element.h:71
virtual bool nodes_built()
Overload the nodes built function.
Definition: refineable_quad_spectral_element.h:422
void rebuild_from_sons(Mesh *&mesh_pt)
The only thing to add is rebuild from sons.
Definition: refineable_quad_spectral_element.h:79
RefineableQSpectralElement(const RefineableQSpectralElement< 2 > &dummy)=delete
Broken copy constructor.
RefineableQSpectralElement()
Constructor.
Definition: refineable_quad_spectral_element.h:50
Definition: Qspectral_elements.h:1323
Refineable version of Solid quad elements.
Definition: refineable_quad_element.h:222
void get_solid_bcs(int bound, Vector< int > &solid_bound_cons) const
Definition: refineable_quad_element.cc:2064
void pin_position(const unsigned &i)
Pin the nodal position.
Definition: nodes.h:1816
Definition: timesteppers.h:231
unsigned ntstorage() const
Definition: timesteppers.h:601
static const int OMEGA
Default value for an unassigned neighbour.
Definition: tree.h:262
@ N
Definition: constructor.cpp:22
RealScalar s
Definition: level1_cplx_impl.h:130
char char char int int * k
Definition: level2_impl.h:374
EIGEN_STRONG_INLINE const Eigen::CwiseBinaryOp< Eigen::internal::scalar_zeta_op< typename DerivedX::Scalar >, const DerivedX, const DerivedQ > zeta(const Eigen::ArrayBase< DerivedX > &x, const Eigen::ArrayBase< DerivedQ > &q)
Definition: SpecialFunctionsArrayAPI.h:152
double E
Elastic modulus.
Definition: TwenteMeshGluing.cpp:68
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286
@ SE
Definition: quadtree.h:57
@ S
Definition: quadtree.h:62
@ NW
Definition: quadtree.h:58
@ NE
Definition: quadtree.h:59
@ W
Definition: quadtree.h:63
@ SW
Definition: quadtree.h:56
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