33 #ifndef OOMPH_HERMITE_ELEMENT_HEADER 34 #define OOMPH_HERMITE_ELEMENT_HEADER 38 #include <oomph-lib-config.h> 97 template<
unsigned DIM>
116 static_cast<unsigned>(pow(2.0,static_cast<int>(DIM)));
144 unsigned ncoord =
dim();
145 for(
unsigned i=0;
i<ncoord;
i++)
148 if((s[
i] -
s_max() > 0.0) ||
161 unsigned ncoord =
dim();
162 for(
unsigned i=0;
i<ncoord;
i++)
204 {
return invert_jacobian<DIM>(jacobian,inverse_jacobian);}
218 transform_second_derivatives_template<DIM>(jacobian,inverse_jacobian,
219 jacobian2,dbasis,d2basis);
236 const double S_min = this->
s_min();
237 const double S_range = this->
s_max() - S_min;
238 for(
unsigned i=0;
i<DIM;
i++)
240 j_sub[
i] = j_copy%NNODE_1D;
241 j_copy = (j_copy - j_sub[
i])/NNODE_1D;
242 s[
i]= S_min + double(j_sub[
i])/(double)(NNODE_1D-1)*S_range;
249 s_fraction.resize(DIM);
253 for(
unsigned i=0;
i<DIM;
i++)
255 j_sub[
i] = j_copy%NNODE_1D;
256 j_copy = (j_copy - j_sub[
i])/NNODE_1D;
257 s_fraction[
i]= j_sub[
i];
275 void output(std::ostream &outfile);
278 void output(std::ostream &outfile,
const unsigned &n_plot);
281 void output(FILE* file_pt);
284 void output(FILE* file_pt,
const unsigned &n_plot);
288 void get_s_plot(
const unsigned&
i,
const unsigned& nplot,
290 const bool& use_equally_spaced_interior_sample_points=
false)
335 const unsigned& nplot,
337 const bool& use_equally_spaced_interior_sample_points)
const 341 s[0]=-1.0+2.0*double(i)/double(nplot-1);
342 if (use_equally_spaced_interior_sample_points)
345 double dx_new=range/double(nplot);
346 double range_new=double(nplot-1)*dx_new;
347 s[0]=-1.0+0.5*dx_new+range_new*(1.0+s[0])/range;
364 std::ostringstream header;
365 header <<
"ZONE I=" << nplot <<
"\n";
385 const unsigned& nplot,
387 const bool& use_equally_spaced_interior_sample_points)
const 392 unsigned i1=(i-i0)/nplot;
394 s[0]=-1.0+2.0*double(i0)/double(nplot-1);
395 s[1]=-1.0+2.0*double(i1)/double(nplot-1);
397 if (use_equally_spaced_interior_sample_points)
400 double dx_new=range/double(nplot);
401 double range_new=double(nplot-1)*dx_new;
402 s[0]=-1.0+0.5*dx_new+range_new*(1.0+s[0])/range;
403 s[1]=-1.0+0.5*dx_new+range_new*(1.0+s[1])/range;
421 const unsigned& nplot)
const 423 std::ostringstream header;
424 header <<
"ZONE I=" << nplot <<
", J=" << nplot <<
"\n";
434 {
return nplot*nplot;}
442 template<
unsigned DIM>
452 {
return FiniteElement::invert_jacobian<DIM>(jacobian,inverse_jacobian);}
467 &inverse_jacobian,
DShape &dbasis)
const 484 FiniteElement::transform_second_derivatives_diagonal<DIM>(
485 jacobian,inverse_jacobian,jacobian2,dbasis,d2basis);
519 template <
unsigned DIM>
529 unsigned n_node =
nnode();
531 this->set_lagrangian_dimension(DIM);
533 this->set_nnodal_lagrangian_type(n_node);
549 void output(std::ostream &outfile);
552 void output(std::ostream &outfile,
const unsigned &n_plot);
555 void output(FILE* file_pt);
558 void output(FILE* file_pt,
const unsigned &n_plot);
594 template <
unsigned DIM>
623 return this->local_to_lagrangian_mapping_diagonal(dpsids,jacobian,
double local_to_lagrangian_mapping(const DShape &dpsids, DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
Overload the local to lagrangian mapping so that it uses diagonal terms only.
virtual std::string tecplot_zone_string(const unsigned &nplot) const
Return string for tecplot zone header (when plotting nplot points in each "coordinate direction") ...
double local_one_d_fraction_of_node(const unsigned &n1d, const unsigned &i)
Get the local fraction of any node in the n-th position in a one dimensional expansion along the i-th...
void transform_second_derivatives(const DenseMatrix< double > &jacobian, const DenseMatrix< double > &inverse_jacobian, const DenseMatrix< double > &jacobian2, DShape &dbasis, DShape &d2basis) const
Overload the template-free interface for the calculation of transformation of second derivatives...
double invert_jacobian_mapping(const DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
Overload the template-free interface for the calculation of the inverse jacobian. Pass the dimension ...
unsigned nplot_points(const unsigned &nplot) const
void broken_copy(const std::string &class_name)
Issue error message and terminate execution.
double s_min() const
Min. value of local coordinate.
bool local_coord_is_valid(const Vector< double > &s)
Check whether the local coordinate are valid or not.
void transform_second_derivatives(const DenseMatrix< double > &jacobian, const DenseMatrix< double > &inverse_jacobian, const DenseMatrix< double > &jacobian2, DShape &dbasis, DShape &d2basis) const
Overload the template-free interface for the calculation of transformation of second derivatives...
virtual void d2shape_local(const Vector< double > &s, Shape &psi, DShape &dpsids, DShape &d2psids) const
Function to compute the geometric shape functions and also first and second derivatives w...
virtual void get_s_plot(const unsigned &i, const unsigned &nplot, Vector< double > &s, const bool &shifted_to_interior=false) const
Get cector of local coordinates of plot point i (when plotting nplot points in each "coordinate direc...
virtual void output(std::ostream &outfile)
Output the element data — typically the values at the nodes in a format suitable for post-processing...
void transform_derivatives(const DenseMatrix< double > &inverse_jacobian, DShape &dbasis) const
Overload the template-free interface for the transformation of derivatives, so that the diagonal vers...
void get_s_plot(const unsigned &i, const unsigned &nplot, Vector< double > &s, const bool &use_equally_spaced_interior_sample_points=false) const
Get cector of local coordinates of plot point i (when plotting nplot points in each "coordinate direc...
void operator=(const SolidQHermiteElement &)
Broken assignment operator.
virtual void set_integration_scheme(Integral *const &integral_pt)
Set the spatial integration scheme.
SolidQHermiteElement()
Constructor.
void operator=(const QHermiteElement &)
Broken assignment operator.
SolidDiagQHermiteElement()
Constructor.
QHermiteElement(const QHermiteElement &dummy)
Broken copy constructor.
QHermiteElementBase()
Empty default constructor.
virtual unsigned nplot_points(const unsigned &nplot) const
Return total number of plot points (when plotting nplot points in each "coordinate direction") ...
void set_n_node(const unsigned &n)
Set the number of nodes in the element to n, by resizing the storage for pointers to the Node objects...
void set_dimension(const unsigned &dim)
Set the dimension of the element and initially set the dimension of the nodes to be the same as the d...
virtual double s_min() const
Min value of local coordinate.
void local_fraction_of_node(const unsigned &j, Vector< double > &s_fraction)
Get local fraction of node j in the element; vector sets its own size.
QHermiteElement()
Constructor.
void local_coordinate_of_node(const unsigned &j, Vector< double > &s) const
Get local coordinates of node j in the element; vector sets its own size.
void operator=(const QHermiteElementBase &)
Broken assignment operator.
SolidDiagQHermiteElement(const SolidDiagQHermiteElement &dummy)
Broken copy constructor.
DiagQHermiteElement()
Constructor.
void move_local_coord_back_into_element(Vector< double > &s) const
Adjust local coordinates so that they're located inside the element.
SolidQHermiteElement(const SolidQHermiteElement &dummy)
Broken copy constructor.
std::string tecplot_zone_string(const unsigned &nplot) const
Return string for tecplot zone header (when plotting nplot points in each "coordinate direction) ...
double local_to_eulerian_mapping(const DShape &dpsids, DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
Overload the local to eulerian mapping so that it uses diagonal terms only.
void set_nnodal_position_type(const unsigned &nposition_type)
Set the number of types required to interpolate the coordinate.
virtual void dshape_local(const Vector< double > &s, Shape &psi, DShape &dpsids) const
Function to compute the geometric shape functions and derivatives w.r.t. local coordinates at local c...
DiagQHermiteElement(const DiagQHermiteElement &dummy)
Broken copy constructor.
virtual double s_max() const
Max. value of local coordinate.
double invert_jacobian_mapping(const DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
Overload the template-free interface for the calculation of the inverse jacobian. The element dimensi...
void operator=(const SolidDiagQHermiteElement &)
Broken assignment operator.
unsigned dim() const
Return the spatial dimension of the element, i.e. the number of local coordinates required to paramet...
unsigned nnode_1d() const
Return number of nodes along each element edge.
void operator=(const DiagQHermiteElement &)
Broken assignment operator.
void broken_assign(const std::string &class_name)
Issue error message and terminate execution.
static Gauss< DIM, 3 > Default_integration_scheme
Default integration rule: Gaussian integration of same 'order' as the element.
std::string string(const unsigned &i)
Return the i-th string or "" if the relevant string hasn't been defined.
void transform_derivatives_diagonal(const DenseMatrix< double > &inverse_jacobian, DShape &dbasis) const
Convert derivative w.r.t local coordinates to derivatives w.r.t the coordinates used to assemble the ...
virtual void build_face_element(const int &face_index, FaceElement *face_element_pt)
Function for building a lower dimensional FaceElement on the specified face of the FiniteElement...
unsigned nnode() const
Return the number of nodes.
SolidFiniteElement class.
virtual double local_to_eulerian_mapping_diagonal(const DShape &dpsids, DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
Calculate the mapping from local to Eulerian coordinates given the derivatives of the shape functions...
virtual void shape(const Vector< double > &s, Shape &psi) const =0
Calculate the geometric shape functions at local coordinate s. This function must be overloaded for e...
QHermiteElementBase(const QHermiteElementBase &)
Broken copy constructor.
double s_max() const
Max. value of local coordinate.