66 for (
unsigned ipt = n_intpt; ipt > 0; ipt--)
68 delete (*Shape_stored_pt)[ipt - 1];
69 (*Shape_stored_pt)[ipt - 1] = 0;
89 for (
unsigned ipt = n_intpt; ipt > 0; ipt--)
91 delete (*DShape_local_stored_pt)[ipt - 1];
92 (*DShape_local_stored_pt)[ipt - 1] = 0;
112 for (
unsigned ipt = n_intpt; ipt > 0; ipt--)
114 delete (*D2Shape_local_stored_pt)[ipt - 1];
115 (*D2Shape_local_stored_pt)[ipt - 1] = 0;
147 for (
unsigned ipt = n_intpt; ipt > 0; ipt--)
149 delete (*DShape_eulerian_stored_pt)[ipt - 1];
150 (*DShape_eulerian_stored_pt)[ipt - 1] = 0;
171 for (
unsigned ipt = n_intpt; ipt > 0; ipt--)
173 delete (*D2Shape_eulerian_stored_pt)[ipt - 1];
174 (*D2Shape_eulerian_stored_pt)[ipt - 1] = 0;
265 unsigned n_node =
nnode();
270 "FiniteElement::Node_pt must be resized to a value greater than\n";
271 error_message +=
"zero before calling pre_compute_shape_at_knots()";
274 error_message, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
289 Shape psi(n_node, n_position_type);
293 for (
unsigned ipt = 0; ipt < n_intpt; ipt++)
299 Shape* psi_pt =
new Shape(n_node, n_position_type);
303 for (
unsigned n = 0; n < n_node; n++)
305 for (
unsigned k = 0; k < n_position_type; k++)
307 (*psi_pt)(n, k) = psi(n, k);
324 unsigned n_node =
nnode();
329 "FiniteElement::Node_pt must be resized to a value greater than\n";
331 "zero before calling pre_compute_dshape_local_at_knots()";
334 error_message, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
353 Shape psi(n_node, n_position_type);
354 DShape dpsids(n_node, n_position_type,
Dim);
358 for (
unsigned ipt = 0; ipt < n_intpt; ipt++)
364 Shape* psi_pt =
new Shape(n_node, n_position_type);
369 for (
unsigned n = 0; n < n_node; n++)
371 for (
unsigned k = 0; k < n_position_type; k++)
373 (*psi_pt)(n, k) = psi(n, k);
375 for (
unsigned i = 0;
i <
Dim;
i++)
377 (*dpsids_pt)(n, k,
i) = dpsids(n, k,
i);
397 unsigned n_node =
nnode();
402 "FiniteElement::Node_pt must be resized to a value greater than\n";
404 "zero before calling pre_compute_d2shape_local_at_knots()";
407 error_message, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
417 unsigned n_deriv = 0;
430 oomph_info <<
"Really more than 3 dimensions?" << std::endl;
447 Shape psi(n_node, n_position_type);
448 DShape dpsids(n_node, n_position_type,
Dim);
449 DShape d2psids(n_node, n_position_type, n_deriv);
453 for (
unsigned ipt = 0; ipt < n_intpt; ipt++)
459 Shape* psi_pt =
new Shape(n_node, n_position_type);
461 DShape* d2psids_pt =
new DShape(n_node, n_position_type, n_deriv);
465 for (
unsigned n = 0; n < n_node; n++)
467 for (
unsigned k = 0; k < n_position_type; k++)
469 (*psi_pt)(n, k) = psi(n, k);
471 for (
unsigned i = 0;
i <
Dim;
i++)
473 (*dpsids_pt)(n, k,
i) = dpsids(n, k,
i);
476 for (
unsigned i = 0;
i < n_deriv;
i++)
478 (*d2psids_pt)(n, k,
i) = d2psids(n, k,
i);
507 for (
unsigned ipt = 0; ipt < n_intpt; ipt++)
525 unsigned n_node =
nnode();
541 Shape psi(n_node, n_position_type);
542 DShape dpsidx(n_node, n_position_type, n_dim);
546 for (
unsigned ipt = 0; ipt < n_intpt; ipt++)
555 DShape* dpsidx_pt =
new DShape(n_node, n_position_type, n_dim);
558 for (
unsigned l = 0; l < n_node; l++)
560 for (
unsigned k = 0; k < n_position_type; k++)
563 for (
unsigned i = 0;
i < n_dim;
i++)
565 (*dpsidx_pt)(l, k,
i) = dpsidx(l, k,
i);
586 unsigned n_node =
nnode();
593 unsigned n_deriv = 0;
606 oomph_info <<
"Really more than 3 dimensions?" << std::endl;
623 Shape psi(n_node, n_position_type);
624 DShape dpsidx(n_node, n_position_type, n_dim);
625 DShape d2psidx(n_node, n_position_type, n_deriv);
629 for (
unsigned ipt = 0; ipt < n_intpt; ipt++)
638 DShape* dpsidx_pt =
new DShape(n_node, n_position_type, n_dim);
639 DShape* d2psidx_pt =
new DShape(n_node, n_position_type, n_deriv);
642 for (
unsigned l = 0; l < n_node; l++)
644 for (
unsigned k = 0; k < n_position_type; k++)
647 for (
unsigned i = 0;
i < n_dim;
i++)
649 (*dpsidx_pt)(l, k,
i) = dpsidx(l, k,
i);
653 for (
unsigned i = 0;
i < n_deriv;
i++)
655 (*d2psidx_pt)(l, k,
i) = d2psidx(l, k,
i);
683 psi = (*Shape_stored_pt)[ipt];
705 psi = (*Shape_stored_pt)[ipt];
706 dpsids = (*DShape_local_stored_pt)[ipt];
728 psi = (*Shape_stored_pt)[ipt];
729 dpsids = (*DShape_local_stored_pt)[ipt];
730 d2psids = (*D2Shape_local_stored_pt)[ipt];
752 psi = (*Shape_stored_pt)[ipt];
753 dpsidx = (*DShape_eulerian_stored_pt)[ipt];
776 psi = (*Shape_stored_pt)[ipt];
777 dpsidx = (*DShape_eulerian_stored_pt)[ipt];
778 d2psidx = (*D2Shape_eulerian_stored_pt)[ipt];
818 "Element does not have stored shape functions\n";
821 error_message, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
903 for (
unsigned ipt = n_intpt; ipt > 0; ipt--)
905 delete (*DShape_lagrangian_stored_pt)[ipt - 1];
906 (*DShape_lagrangian_stored_pt)[ipt - 1] = 0;
928 for (
unsigned ipt = n_intpt; ipt > 0; ipt--)
930 delete (*D2Shape_lagrangian_stored_pt)[ipt - 1];
931 (*D2Shape_lagrangian_stored_pt)[ipt - 1] = 0;
966 unsigned n_node =
nnode();
969 unsigned n_lagrangian_type =
984 Shape psi(n_node, n_lagrangian_type);
985 DShape dpsidxi(n_node, n_lagrangian_type, n_lagrangian);
989 for (
unsigned ipt = 0; ipt < n_intpt; ipt++)
998 DShape* dpsidxi_pt =
new DShape(n_node, n_lagrangian_type, n_lagrangian);
1001 for (
unsigned l = 0; l < n_node; l++)
1003 for (
unsigned k = 0; k < n_lagrangian_type; k++)
1006 for (
unsigned i = 0;
i < n_lagrangian;
i++)
1008 (*dpsidxi_pt)(l, k,
i) = dpsidxi(l, k,
i);
1029 unsigned n_node =
nnode();
1032 unsigned n_lagrangian_type =
1038 unsigned n_deriv = 0;
1039 switch (n_lagrangian)
1051 oomph_info <<
"Really more than 3 dimensions?" << std::endl;
1068 Shape psi(n_node, n_lagrangian_type);
1069 DShape dpsidxi(n_node, n_lagrangian_type, n_lagrangian);
1070 DShape d2psidxi(n_node, n_lagrangian_type, n_deriv);
1074 for (
unsigned ipt = 0; ipt < n_intpt; ipt++)
1081 ipt, psi, dpsidxi, d2psidxi));
1084 DShape* dpsidxi_pt =
new DShape(n_node, n_lagrangian_type, n_lagrangian);
1085 DShape* d2psidxi_pt =
new DShape(n_node, n_lagrangian_type, n_deriv);
1088 for (
unsigned l = 0; l < n_node; l++)
1090 for (
unsigned k = 0; k < n_lagrangian_type; k++)
1093 for (
unsigned i = 0;
i < n_lagrangian;
i++)
1095 (*dpsidxi_pt)(l, k,
i) = dpsidxi(l, k,
i);
1099 for (
unsigned i = 0;
i < n_deriv;
i++)
1101 (*d2psidxi_pt)(l, k,
i) = d2psidxi(l, k,
i);
1120 const unsigned& ipt,
Shape& psi,
DShape& dpsidxi)
const
1131 dpsidxi = (*DShape_lagrangian_stored_pt)[ipt];
1150 ipt, psi, dpsidxi, d2psidxi);
1156 dpsidxi = (*DShape_lagrangian_stored_pt)[ipt];
1157 d2psidxi = (*D2Shape_lagrangian_stored_pt)[ipt];
A Class for the derivatives of shape functions The class design is essentially the same as Shape,...
virtual void dshape_local_at_knot(const unsigned &ipt, Shape &psi, DShape &dpsids) const
Return the geometric shape function and its derivative w.r.t. the local coordinates at the ipt-th int...
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
virtual double dshape_eulerian_at_knot(const unsigned &ipt, Shape &psi, DShape &dpsidx) const
Return the geometric shape functions and also first derivatives w.r.t. global coordinates at the ipt-...
unsigned nnodal_position_type() const
Return the number of coordinate types that the element requires to interpolate the geometry between t...
virtual void d2shape_local_at_knot(const unsigned &ipt, Shape &psi, DShape &dpsids, DShape &d2psids) const
Return the geometric shape function and its first and second derivatives w.r.t. the local coordinates...
unsigned dim() const
Return the spatial dimension of the element, i.e. the number of local coordinates required to paramet...
unsigned nnode() const
Return the number of nodes.
Integral *const & integral_pt() const
Return the pointer to the integration scheme (const version)
virtual double J_eulerian_at_knot(const unsigned &ipt) const
Return the Jacobian of the mapping from local to global coordinates at the ipt-th integration point.
unsigned nodal_dimension() const
Return the required Eulerian dimension of the nodes in this element.
virtual void set_integration_scheme(Integral *const &integral_pt)
Set the spatial integration scheme.
virtual void shape_at_knot(const unsigned &ipt, Shape &psi) const
Return the geometric shape function at the ipt-th integration point.
virtual double d2shape_eulerian_at_knot(const unsigned &ipt, Shape &psi, DShape &dpsidx, DShape &d2psidx) const
Return the geometric shape functions and also first and second derivatives w.r.t. global coordinates ...
unsigned nlagrangian() const
Access function to # of Lagrangian coordinates.
Generic class for numerical integration schemes:
virtual unsigned nweight() const =0
Return the number of integration points of the scheme.
An OomphLibError object which should be thrown when an run-time error is encountered....
A Class for shape functions. In simple cases, the shape functions have only one index that can be tho...
virtual double d2shape_lagrangian_at_knot(const unsigned &ipt, Shape &psi, DShape &dpsidxi, DShape &d2psidxi) const
Return the geometric shape functions and also first and second derivatives w.r.t. Lagrangian coordina...
virtual double dshape_lagrangian_at_knot(const unsigned &ipt, Shape &psi, DShape &dpsidxi) const
Return the geometric shape functions and also first derivatives w.r.t. Lagrangian coordinates at ipt-...
A Class for nodes that deform elastically (i.e. position is an unknown in the problem)....
Base class for elements that allow storage of precomputed shape functions and their derivatives w....
Vector< DShape * > *& dshape_eulerian_stored_pt()
Return a pointer to the vector of pointers to the stored first derivatives of the shape functions w....
void shape_at_knot(const unsigned &ipt, Shape &psi) const
Return the geometric shape function at the ipt-th integration point.
virtual void set_integration_scheme(Integral *const &integral_pt)
Set the spatial integration scheme – overloaded from the finite element base class since a change in ...
void delete_all_dshape_eulerian_stored()
Delete all storage related to deriatives of shape fcts w.r.t. to global Eulerian coords.
Vector< DShape * > * DShape_local_stored_pt
Pointer to storage for the pointers to the derivatives of the nodal shape functions w....
Vector< DShape * > * D2Shape_local_stored_pt
Pointer to storage for the pointers to the second derivatives of the nodal shape functions w....
virtual ~StorableShapeElementBase()
The destructor cleans up the static memory allocated for shape function storage. Internal and externa...
Vector< DShape * > * D2Shape_eulerian_stored_pt
Pointer to storage for the second derivatives of the shape functions w.r.t. global coordinates at int...
void delete_dshape_local_stored()
Delete stored derivatives of shape functions w.r.t. to local coordinates.
void delete_shape_local_stored()
Delete stored shape functions.
Vector< DShape * > *& dshape_local_stored_pt()
Return a pointer to the vector of pointers to the stored first derivatives of the shape functions w....
void delete_d2shape_local_stored()
Delete stored 2nd derivatives of shape functions w.r.t. to local coordinates.
Vector< DShape * > *& d2shape_eulerian_stored_pt()
Return a pointer to the vector of pointers to the stored second derivatives of the shape functions w....
double dshape_eulerian_at_knot(const unsigned &ipt, Shape &psi, DShape &dpsidx) const
Return the geometric shape functions and also first derivatives w.r.t. global coordinates at the ipt-...
Vector< DShape * > *& d2shape_local_stored_pt()
Return a pointer to the vector of pointers to the stored second derivatives of the shape functions w....
Vector< Shape * > * Shape_stored_pt
Pointer to storage for the pointers to the nodal shape functions at the integration points (knots)
void pre_compute_d2shape_eulerian_at_knots()
Calculate the first and second derivatives of the shape functions w.r.t global coordinates at the int...
Vector< double > * Jacobian_eulerian_stored_pt
Pointer to storage for the Jacobian of the element w.r.t global coordinates.
void delete_d2shape_eulerian_stored()
Delete stored second derivatives of shape functions w.r.t. to global Eulerian coordinates.
void dshape_local_at_knot(const unsigned &ipt, Shape &psi, DShape &dpsids) const
Return the geometric shape function and its derivative w.r.t. the local coordinates at the ipt-th int...
void pre_compute_dshape_eulerian_at_knots()
Calculate the first derivatives of the shape functions w.r.t the global coordinates at the integratio...
void set_shape_local_stored_from_element(StorableShapeElementBase *const &element_pt)
Set the shape functions pointed to internally to be those pointed to by the FiniteElement element_pt ...
void pre_compute_J_eulerian_at_knots()
Calculate the Jacobian of the mapping from local to global coordinates at the integration points and ...
double d2shape_eulerian_at_knot(const unsigned &ipt, Shape &psi, DShape &dpsidx, DShape &d2psidx) const
Return the geometric shape functions and also first and second derivatives w.r.t. global coordinates ...
void set_dshape_eulerian_stored_from_element(StorableShapeElementBase *const &element_pt)
Set the derivatives of stored shape functions with respect to the global coordinates to be the same a...
void delete_J_eulerian_stored()
Delete stored Jacobian of mapping between local and global (Eulerian) coordinates.
void pre_compute_dshape_local_at_knots()
Calculate the shape functions and first derivatives w.r.t. local coordinatess at the integration poin...
void delete_dshape_eulerian_stored()
Delete stored deriatives of shape fcts w.r.t. to global Eulerian coords.
bool Can_delete_dshape_eulerian_stored
Boolean to determine whether the element can delete the stored derivatives of shape functions w....
Vector< double > *& jacobian_eulerian_stored_pt()
Return a pointer to the vector of Jacobians of the mapping between the local and global (eulerian) co...
bool Can_delete_shape_local_stored
Boolean to determine whether the element can delete the stored local shape functions.
void pre_compute_shape_at_knots()
Calculate the shape functions at the integration points and store the results internally.
double J_eulerian_at_knot(const unsigned &ipt) const
Return the Jacobian of the mapping from local to global coordinates at the ipt-th integration point.
Vector< DShape * > * DShape_eulerian_stored_pt
Pointer to storage for the derivatives of the shape functions w.r.t. global coordinates at integratio...
void delete_all_shape_local_stored()
Delete all the objects stored in the [...]_local_stored_pt vectors and delete the vectors themselves.
void pre_compute_d2shape_local_at_knots()
Calculate the second derivatives of the shape functions w.r.t. local coordinates at the integration p...
void d2shape_local_at_knot(const unsigned &ipt, Shape &psi, DShape &dpsids, DShape &d2psids) const
Return the geometric shape function and its first and second derivatives w.r.t. the local coordinates...
Vector< Shape * > *& shape_stored_pt()
Return a pointer to the vector of pointers to the stored shape functions.
Base class for solid elements that allow storage of precomputed shape functions and their derivatives...
Vector< double > * Jacobian_lagrangian_stored_pt
Pointer to storage for the Jacobian of the mapping between the local and the global Lagrangian coordi...
Vector< DShape * > *& dshape_lagrangian_stored_pt()
Return a pointer to the vector of pointers to the stored first derivatives of the shape functions w....
void pre_compute_d2shape_lagrangian_at_knots()
Calculate the first and second derivatives of the shape functions w.r.t Lagrangian coordinates at the...
void pre_compute_dshape_lagrangian_at_knots()
Calculate the first derivatives of the shape functions w.r.t Lagrangian coordinates at the integratio...
double d2shape_lagrangian_at_knot(const unsigned &ipt, Shape &psi, DShape &dpsidxi, DShape &d2psidxi) const
Return the geometric shape functions and also first and second derivatives w.r.t. Lagrangian coordina...
Vector< DShape * > * D2Shape_lagrangian_stored_pt
Pointer to storage for the pointers to the second derivatives of the shape functions w....
double dshape_lagrangian_at_knot(const unsigned &ipt, Shape &psi, DShape &dpsidxi) const
Return the geometric shape functions and also first derivatives w.r.t. Lagrangian coordinates at ipt-...
void delete_J_lagrangian_stored()
Delete stored Jaocbian of mapping between local and Lagrangian coordinates.
Vector< DShape * > *& d2shape_lagrangian_stored_pt()
Return a pointer to the vector of pointers to the stored second derivatives of the shape functions w....
void delete_d2shape_lagrangian_stored()
Delete stored second derivatives of shape functions w.r.t. Lagrangian coordinates.
bool Can_delete_dshape_lagrangian_stored
Boolean to determine whether the element can delete the stored shape function derivatives w....
void delete_all_dshape_lagrangian_stored()
Delete all the objects stored in the [...]_lagrangian_stored_pt vectors and delete the vectors themse...
void delete_dshape_lagrangian_stored()
Delete all the objects stored in the Lagrangian_stored vectors.
Vector< DShape * > * DShape_lagrangian_stored_pt
Pointer to storage for the pointers to the derivatives of the shape functions w.r....
Vector< double > *& jacobian_lagrangian_stored_pt()
Return a pointer to the vector of Jacobians of the mapping between the local and global (eulerian) co...
void set_dshape_lagrangian_stored_from_element(StorableShapeSolidElementBase *const &element_pt)
Set the derivatives of stored shape functions with respect to the lagrangian coordinates to be the sa...
A slight extension to the standard template vector class so that we can include "graceful" array rang...
std::string string(const unsigned &i)
Return the i-th string or "" if the relevant string hasn't been defined.
unsigned Dim
Dimension of zeta tuples (set by get_dim_helper) – needed because we store the scalar coordinates in ...
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
OomphInfo oomph_info
Single (global) instantiation of the OomphInfo object – this is used throughout the library as a "rep...