30 #ifndef OOMPH_REFINEABLE_BRICK_SPECTRAL_ELEMENT_HEADER 31 #define OOMPH_REFINEABLE_BRICK_SPECTRAL_ELEMENT_HEADER 36 #include <oomph-lib-config.h> 60 LeakCheckNames::RefineableQSpectralElement<3>
_build+=1;
85 LeakCheckNames::RefineableQSpectralElement<3>
_build-=1;
94 if(this->node_pt(0)==0)
97 OOMPH_CURRENT_FUNCTION,
98 OOMPH_EXCEPTION_LOCATION);
101 TimeStepper* time_stepper_pt = this->node_pt(0)->time_stepper_pt();
102 unsigned ntstorage = time_stepper_pt->
ntstorage();
107 unsigned n_p = this->nnode_1d();
108 for(
unsigned i0=0;i0<n_p;i0++)
111 s_fraction[0] = this->local_one_d_fraction_of_node(i0,0);
113 s[0] = -1.0 + 2.0*s_fraction[0];
115 for(
unsigned i1=0;i1<n_p;i1++)
118 s_fraction[1] = this->local_one_d_fraction_of_node(i1,1);
120 s[1] = -1.0 + 2.0*s_fraction[1];
122 for(
unsigned i2=0;i2<n_p;i2++)
125 s_fraction[2] = this->local_one_d_fraction_of_node(i2,2);
127 s[2] = -1.0 + 2.0*s_fraction[2];
130 jnod = i0 + n_p*i1 + n_p*n_p*i2;
133 if(this->node_pt(jnod)==0)
136 Node* created_node_pt = this->node_created_by_neighbour(s_fraction);
139 if(created_node_pt!=0)
141 this->node_pt(jnod) = created_node_pt;
151 using namespace OcTreeNames;
154 if(s_fraction[0] < 0.5)
157 if(s_fraction[1] < 0.5)
160 if(s_fraction[2] < 0.5)
164 s_in_son[0] = -1.0 + 4.0*s_fraction[0];
165 s_in_son[1] = -1.0 + 4.0*s_fraction[1];
166 s_in_son[2] = -1.0 + 4.0*s_fraction[2];
173 s_in_son[0] = -1.0 + 4.0*s_fraction[0];
174 s_in_son[1] = -1.0 + 4.0*s_fraction[1];
175 s_in_son[2] = -1.0 + 4.0*(s_fraction[2]-0.5);
182 if(s_fraction[2] < 0.5)
186 s_in_son[0] = -1.0 + 4.0*s_fraction[0];
187 s_in_son[1] = -1.0 + 4.0*(s_fraction[1]-0.5);
188 s_in_son[2] = -1.0 + 4.0*s_fraction[2];
195 s_in_son[0] = -1.0 + 4.0*s_fraction[0];
196 s_in_son[1] = -1.0 + 4.0*(s_fraction[1]-0.5);
197 s_in_son[2] = -1.0 + 4.0*(s_fraction[2]-0.5);
205 if(s_fraction[1] < 0.5)
208 if(s_fraction[2] < 0.5)
212 s_in_son[0] = -1.0 + 4.0*(s_fraction[0]-0.5);
213 s_in_son[1] = -1.0 + 4.0*s_fraction[1];
214 s_in_son[2] = -1.0 + 4.0*s_fraction[2];
221 s_in_son[0] = -1.0 + 4.0*(s_fraction[0]-0.5);
222 s_in_son[1] = -1.0 + 4.0*s_fraction[1];
223 s_in_son[2] = -1.0 + 4.0*(s_fraction[2]-0.5);
230 if(s_fraction[2] < 0.5)
234 s_in_son[0] = -1.0 + 4.0*(s_fraction[0]-0.5);
235 s_in_son[1] = -1.0 + 4.0*(s_fraction[1]-0.5);
236 s_in_son[2] = -1.0 + 4.0*s_fraction[2];
243 s_in_son[0] = -1.0 + 4.0*(s_fraction[0]-0.5);
244 s_in_son[1] = -1.0 + 4.0*(s_fraction[1]-0.5);
245 s_in_son[2] = -1.0 + 4.0*(s_fraction[2]-0.5);
253 this->tree_pt()->son_pt(son)->object_pt());
260 if(i0==0) {boundary =
L;}
262 else if(i0==n_p-1) {boundary =
R;}
371 std::set<unsigned> boundaries;
385 if (boundaries.size()>0)
388 this->node_pt(jnod) =
389 this->construct_boundary_node(jnod,time_stepper_pt);
392 Vector<int> bound_cons(ncont_interpolated_values());
393 son_el_pt->
get_bcs(boundary,bound_cons);
396 unsigned nval = this->node_pt(jnod)->nvalue();
397 for(
unsigned k=0;k<nval;k++)
399 if(bound_cons[k]) {this->node_pt(jnod)->pin(k);}
405 dynamic_cast<SolidNode*
>(this->node_pt(jnod));
406 if (solid_node_pt!=0)
409 unsigned n_dim = this->node_pt(jnod)->
ndim();
414 if (son_solid_el_pt==0)
417 "We have a SolidNode outside a refineable SolidElement\n";
419 "during mesh refinement -- this doesn't make sense\n";
423 OOMPH_CURRENT_FUNCTION,
424 OOMPH_EXCEPTION_LOCATION);
430 for(
unsigned k=0;k<n_dim;k++)
432 if (solid_bound_cons[k]) {solid_node_pt->
pin_position(k);}
438 for(std::set<unsigned>::iterator it = boundaries.begin();
439 it != boundaries.end(); ++it)
454 this->node_pt(jnod)->set_coordinates_on_boundary(*it,zeta);
462 this->node_pt(jnod) =
463 this->construct_node(jnod,time_stepper_pt);
479 for(
unsigned t=0;
t<ntstorage;
t++)
485 son_el_pt->
get_x(
t,s_in_son,x_prev);
486 for(
unsigned i=0;
i<3;
i++)
488 this->node_pt(jnod)->x(
t,
i) = x_prev[
i];
494 for(
unsigned t=0;
t<ntstorage;
t++)
502 for(
unsigned k=0;k<this->node_pt(jnod)->nvalue();k++)
504 this->node_pt(jnod)->set_value(
t,k,prev_values[k]);
522 "Have not implemented rebuilding from sons for";
524 "Algebraic Spectral elements yet\n";
528 "RefineableQSpectralElement::rebuild_from_sons()",
529 OOMPH_EXCEPTION_LOCATION);
541 unsigned n_node = this->nnode();
542 for(
unsigned n=0;n<n_node;n++)
544 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...
void broken_copy(const std::string &class_name)
Issue error message and terminate execution.
virtual ~RefineableQSpectralElement()
Broken assignment operator.
void add_boundary_node(const unsigned &b, Node *const &node_pt)
Add a (pointer to) a node to the b-th boundary.
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...
virtual bool nodes_built()
Overload the nodes built function.
bool boundary_coordinate_exists(const unsigned &i) const
Indicate whether the i-th boundary has an intrinsic coordinate.
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
void rebuild_from_sons(Mesh *&mesh_pt)
The only thing to add is rebuild from sons.
void interpolated_zeta_on_face(const unsigned &boundary, const int &face, const Vector< double > &s, Vector< double > &zeta)
Return the value of the intrinsic boundary coordinate interpolated along the face.
void add_node_pt(Node *const &node_pt)
Add a (pointer to a) node to the mesh.
unsigned ndim() const
Return (Eulerian) spatial dimension of the node.
RefineableQSpectralElement(const RefineableQSpectralElement< 3 > &dummy)
Broken copy constructor.
void get_bcs(int bound, Vector< int > &bound_cons) const
Determine Vector of boundary conditions along the element's boundary (or vertex) bound (S/W/N/E/SW/SE...
void pin_position(const unsigned &i)
Pin the nodal position.
Refineable version of Solid brick elements.
void get_solid_bcs(int bound, Vector< int > &solid_bound_cons) const
Determine vector of solid (positional) boundary conditions along edge (or on vertex) bound (S/W/N/E/S...
unsigned ntstorage() const
Return the number of doubles required to represent history (one for steady)
static const int OMEGA
Default value for an unassigned neighbour.
A Class for nodes that deform elastically (i.e. position is an unknown in the problem). The idea is that the Eulerian positions are stored in a Data object and the Lagrangian coordinates are stored in addition. The pointer that addresses the Eulerian positions is set to the pointer to Value in the Data object. Hence, SolidNode uses knowledge of the internal structure of Data and must be a friend of the Data class. In order to allow a mesh to deform via an elastic-style equation in deforming-domain problems, the positions are stored separately from the values, so that elastic problems may be combined with any other type of problem.
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
void get_boundaries(const int &edge, std::set< unsigned > &boundaries) const
Base class for time-stepping schemes. Timestepper provides an approximation of the temporal derivativ...