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)
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",
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";
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()",
556 unsigned n_node = this->nnode();
557 for (
unsigned n = 0;
n < n_node;
n++)
int i
Definition: BiCGSTAB_step_by_step.cpp:9
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
dominoes D
Definition: Domino.cpp:55
MatrixXd L
Definition: LLT_example.cpp:6
@ R
Definition: StatisticsVector.h:21
Matrix< SCALARB, Dynamic, Dynamic, opt_B > B
Definition: bench_gemm.cpp:48
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 interpolated_zeta_on_face(const unsigned &boundary, const int &face, const Vector< double > &s, Vector< double > &zeta)
Definition: refineable_brick_element.cc:582
void get_bcs(int bound, Vector< int > &bound_cons) const
Definition: refineable_brick_element.cc:238
void get_boundaries(const int &edge, std::set< unsigned > &boundaries) const
Definition: refineable_brick_element.cc:424
Definition: Qelements.h:2259
Definition: refineable_brick_spectral_element.h:47
virtual ~RefineableQSpectralElement()
Broken assignment operator.
Definition: refineable_brick_spectral_element.h:71
void rebuild_from_sons(Mesh *&mesh_pt)
The only thing to add is rebuild from sons.
Definition: refineable_brick_spectral_element.h:79
RefineableQSpectralElement(const RefineableQSpectralElement< 3 > &dummy)=delete
Broken copy constructor.
virtual bool nodes_built()
Overload the nodes built function.
Definition: refineable_brick_spectral_element.h:554
RefineableQSpectralElement()
Constructor.
Definition: refineable_brick_spectral_element.h:50
Definition: Qspectral_elements.h:1323
Refineable version of Solid brick elements.
Definition: refineable_brick_element.h:239
void get_solid_bcs(int bound, Vector< int > &solid_bound_cons) const
Definition: refineable_brick_element.cc:2764
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
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 U
Swimming speed.
Definition: two_d_variable_diff_adapt.cc:53
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286
@ RDF
Definition: octree.h:54
@ DF
Definition: octree.h:67
@ RD
Definition: octree.h:62
@ RUB
Definition: octree.h:52
@ RB
Definition: octree.h:58
@ UF
Definition: octree.h:68
@ LUF
Definition: octree.h:55
@ RU
Definition: octree.h:64
@ F
Definition: octree.h:74
@ LDF
Definition: octree.h:53
@ LF
Definition: octree.h:65
@ RDB
Definition: octree.h:50
@ LD
Definition: octree.h:61
@ LUB
Definition: octree.h:51
@ RUF
Definition: octree.h:56
@ RF
Definition: octree.h:66
@ LDB
Definition: octree.h:49
@ LU
Definition: octree.h:63
@ DB
Definition: octree.h:59
@ UB
Definition: octree.h:60
@ LB
Definition: octree.h:57
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