30 #ifndef OOMPH_REFINEABLE_QUAD_SPECTRAL_ELEMENT_HEADER 31 #define OOMPH_REFINEABLE_QUAD_SPECTRAL_ELEMENT_HEADER 36 #include <oomph-lib-config.h> 60 LeakCheckNames::RefineableQSpectralElement<2>
_build+=1;
85 LeakCheckNames::RefineableQSpectralElement<2>
_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];
126 if(this->node_pt(jnod)==0)
129 bool is_periodic =
false;
130 Node* created_node_pt =
131 this->node_created_by_neighbour(s_fraction,is_periodic);
134 if(created_node_pt!=0)
140 "Cannot handle periodic nodes in refineable spectral elements yet",
141 OOMPH_CURRENT_FUNCTION,
142 OOMPH_EXCEPTION_LOCATION);
147 this->node_pt(jnod) = created_node_pt;
157 using namespace QuadTreeNames;
160 if(s_fraction[0] < 0.5)
163 if(s_fraction[1] < 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];
175 s_in_son[0] = -1.0 + 4.0*s_fraction[0];
176 s_in_son[1] = -1.0 + 4.0*(s_fraction[1]-0.5);
182 if(s_fraction[1] < 0.5)
186 s_in_son[0] = -1.0 + 4.0*(s_fraction[0]-0.5);
187 s_in_son[1] = -1.0 + 4.0*s_fraction[1];
194 s_in_son[0] = -1.0 + 4.0*(s_fraction[0]-0.5);
195 s_in_son[1] = -1.0 + 4.0*(s_fraction[1]-0.5);
203 this->tree_pt()->son_pt(son)->object_pt());
210 if(i0==0) {boundary =
W;}
212 else if(i0==n_p-1) {boundary =
E;}
251 std::set<unsigned> boundaries;
265 if(boundaries.size()>0)
268 this->node_pt(jnod) =
269 this->construct_boundary_node(jnod,time_stepper_pt);
272 Vector<int> bound_cons(ncont_interpolated_values());
273 son_el_pt->
get_bcs(boundary,bound_cons);
276 unsigned nval = this->node_pt(jnod)->nvalue();
277 for(
unsigned k=0;k<nval;k++)
279 if(bound_cons[k]) {this->node_pt(jnod)->pin(k);}
285 dynamic_cast<SolidNode*
>(this->node_pt(jnod));
286 if (solid_node_pt!=0)
289 unsigned n_dim = this->node_pt(jnod)->
ndim();
294 if (son_solid_el_pt==0)
297 "We have a SolidNode outside a refineable SolidElement\n";
299 "during mesh refinement -- this doesn't make sense\n";
303 OOMPH_CURRENT_FUNCTION,
304 OOMPH_EXCEPTION_LOCATION);
310 for(
unsigned k=0;k<n_dim;k++)
312 if (solid_bound_cons[k]) {solid_node_pt->
pin_position(k);}
318 for(std::set<unsigned>::iterator it = boundaries.begin();
319 it != boundaries.end(); ++it)
335 ->set_coordinates_on_boundary(*it,zeta);
344 this->node_pt(jnod) = this->construct_node(jnod,time_stepper_pt);
361 for(
unsigned t=0;
t<ntstorage;
t++)
363 using namespace QuadTreeNames;
368 son_el_pt->
get_x(
t,s_in_son,x_prev);
369 for(
unsigned i=0;
i<2;
i++)
371 this->node_pt(jnod)->x(
t,
i) = x_prev[
i];
377 for(
unsigned t=0;
t<ntstorage;
t++)
385 for(
unsigned k=0;k<this->node_pt(jnod)->nvalue();k++)
387 this->node_pt(jnod)->set_value(
t,k,prev_values[k]);
405 "Have not implemented rebuilding from sons for";
407 "Algebraic Spectral elements yet\n";
411 "RefineableQSpectralElement::rebuild_from_sons()",
412 OOMPH_EXCEPTION_LOCATION);
424 unsigned n_node = this->nnode();
425 for(
unsigned n=0;n<n_node;n++)
427 if(node_pt(n)==0) {
return false;}
void get_boundaries(const int &edge, std::set< unsigned > &boundaries) const
Determine set of (mesh) boundaries that the element edge/vertex lives on.
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...
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...
RefineableQSpectralElement()
Constructor.
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.
void pin_position(const unsigned &i)
Pin the nodal position.
void get_bcs(int bound, Vector< int > &bound_cons) const
Determine Vector of boundary conditions along edge (or on vertex) bound (S/W/N/E/SW/SE/NW/NE): For va...
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...
void rebuild_from_sons(Mesh *&mesh_pt)
The only thing to add is rebuild from sons.
unsigned ntstorage() const
Return the number of doubles required to represent history (one for steady)
virtual bool nodes_built()
Overload the nodes built function.
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.
Refineable version of Solid quad elements.
void interpolated_zeta_on_edge(const unsigned &boundary, const int &edge, const Vector< double > &s, Vector< double > &zeta)
Return the value of the intrinsic boundary coordinate interpolated along the edge (S/W/N/E) ...
long RefineableQElement< 2 > _build
RefineableQSpectralElement(const RefineableQSpectralElement< 2 > &dummy)
Broken copy constructor.
Base class for time-stepping schemes. Timestepper provides an approximation of the temporal derivativ...