73 for(
unsigned ipt=n_intpt;ipt>0;ipt--)
75 delete (*Shape_stored_pt)[ipt-1];
76 (*Shape_stored_pt)[ipt-1] = 0;
96 for(
unsigned ipt=n_intpt;ipt>0;ipt--)
98 delete (*DShape_local_stored_pt)[ipt-1];
99 (*DShape_local_stored_pt)[ipt-1] = 0;
119 for(
unsigned ipt=n_intpt;ipt>0;ipt--)
121 delete (*D2Shape_local_stored_pt)[ipt-1];
122 (*D2Shape_local_stored_pt)[ipt-1] = 0;
154 for(
unsigned ipt=n_intpt;ipt>0;ipt--)
156 delete (*DShape_eulerian_stored_pt)[ipt-1];
157 (*DShape_eulerian_stored_pt)[ipt-1] = 0;
180 for(
unsigned ipt=n_intpt;ipt>0;ipt--)
182 delete (*D2Shape_eulerian_stored_pt)[ipt-1];
183 (*D2Shape_eulerian_stored_pt)[ipt-1] = 0;
275 unsigned n_node =
nnode();
280 "FiniteElement::Node_pt must be resized to a value greater than\n";
282 "zero before calling pre_compute_shape_at_knots()";
285 OOMPH_CURRENT_FUNCTION,
286 OOMPH_EXCEPTION_LOCATION);
301 Shape psi(n_node,n_position_type);
305 for(
unsigned ipt=0;ipt<n_intpt;ipt++)
311 Shape *psi_pt =
new Shape(n_node,n_position_type);
315 for(
unsigned n=0;n<n_node;n++)
317 for(
unsigned k=0;k<n_position_type;k++)
319 (*psi_pt)(n,k) = psi(n,k);
336 unsigned n_node =
nnode();
341 "FiniteElement::Node_pt must be resized to a value greater than\n";
343 "zero before calling pre_compute_dshape_local_at_knots()";
347 OOMPH_CURRENT_FUNCTION,
348 OOMPH_EXCEPTION_LOCATION);
367 Shape psi(n_node,n_position_type);
368 DShape dpsids(n_node,n_position_type,Dim);
372 for(
unsigned ipt=0;ipt<n_intpt;ipt++)
378 Shape *psi_pt =
new Shape(n_node,n_position_type);
379 DShape *dpsids_pt =
new DShape(n_node,n_position_type,Dim);
383 for(
unsigned n=0;n<n_node;n++)
385 for(
unsigned k=0;k<n_position_type;k++)
387 (*psi_pt)(n,k) = psi(n,k);
389 for(
unsigned i=0;
i<
Dim;
i++)
390 {(*dpsids_pt)(n,k,
i) = dpsids(n,k,
i);}
409 unsigned n_node =
nnode();
414 "FiniteElement::Node_pt must be resized to a value greater than\n";
416 "zero before calling pre_compute_d2shape_local_at_knots()";
420 OOMPH_CURRENT_FUNCTION,
421 OOMPH_EXCEPTION_LOCATION);
434 case 1: n_deriv = 1;
break;
435 case 2: n_deriv = 3;
break;
436 case 3: n_deriv = 6;
break;
437 default:
oomph_info <<
"Really more than 3 dimensions?" << std::endl;
break;
453 Shape psi(n_node,n_position_type);
454 DShape dpsids(n_node,n_position_type,Dim);
455 DShape d2psids(n_node,n_position_type,n_deriv);
459 for(
unsigned ipt=0;ipt<n_intpt;ipt++)
465 Shape *psi_pt =
new Shape(n_node,n_position_type);
466 DShape *dpsids_pt =
new DShape(n_node,n_position_type,Dim);
467 DShape *d2psids_pt =
new DShape(n_node,n_position_type,n_deriv);
471 for(
unsigned n=0;n<n_node;n++)
473 for(
unsigned k=0;k<n_position_type;k++)
475 (*psi_pt)(n,k) = psi(n,k);
477 for(
unsigned i=0;
i<
Dim;
i++)
478 {(*dpsids_pt)(n,k,
i) = dpsids(n,k,
i);}
480 for(
unsigned i=0;
i<n_deriv;
i++)
481 {(*d2psids_pt)(n,k,
i) = d2psids(n,k,
i);}
509 for(
unsigned ipt=0;ipt<n_intpt;ipt++)
527 unsigned n_node =
nnode();
543 Shape psi(n_node,n_position_type);
544 DShape dpsidx(n_node,n_position_type,n_dim);
548 for(
unsigned ipt=0;ipt<n_intpt;ipt++)
557 DShape* dpsidx_pt =
new DShape(n_node,n_position_type,n_dim);
560 for(
unsigned l=0;l<n_node;l++)
562 for(
unsigned k=0;k<n_position_type;k++)
565 for(
unsigned i=0;
i<n_dim;
i++) {(*dpsidx_pt)(l,k,
i) = dpsidx(l,k,
i);}
585 unsigned n_node =
nnode();
595 case 1: n_deriv = 1;
break;
596 case 2: n_deriv = 3;
break;
597 case 3: n_deriv = 6;
break;
598 default:
oomph_info <<
"Really more than 3 dimensions?" << std::endl;
break;
614 Shape psi(n_node,n_position_type);
615 DShape dpsidx(n_node,n_position_type,n_dim);
616 DShape d2psidx(n_node,n_position_type,n_deriv);
620 for(
unsigned ipt=0;ipt<n_intpt;ipt++)
629 DShape *dpsidx_pt =
new DShape(n_node,n_position_type,n_dim);
630 DShape *d2psidx_pt =
new DShape(n_node,n_position_type,n_deriv);
633 for(
unsigned l=0;l<n_node;l++)
635 for(
unsigned k=0;k<n_position_type;k++)
638 for(
unsigned i=0;
i<n_dim;
i++)
639 {(*dpsidx_pt)(l,k,
i) = dpsidx(l,k,
i);}
642 for(
unsigned i=0;
i<n_deriv;
i++)
643 {(*d2psidx_pt)(l,k,
i) = d2psidx(l,k,
i);}
670 psi = (*Shape_stored_pt)[ipt];
692 psi = (*Shape_stored_pt)[ipt];
693 dpsids = (*DShape_local_stored_pt)[ipt];
715 psi = (*Shape_stored_pt)[ipt];
716 dpsids = (*DShape_local_stored_pt)[ipt];
717 d2psids = (*D2Shape_local_stored_pt)[ipt];
739 psi = (*Shape_stored_pt)[ipt];
740 dpsidx = (*DShape_eulerian_stored_pt)[ipt];
764 psi = (*Shape_stored_pt)[ipt];
765 dpsidx = (*DShape_eulerian_stored_pt)[ipt];
766 d2psidx = (*D2Shape_eulerian_stored_pt)[ipt];
807 "Element does not have stored shape functions\n";
811 OOMPH_CURRENT_FUNCTION,
812 OOMPH_EXCEPTION_LOCATION);
878 delete_dshape_lagrangian_stored();
879 delete_d2shape_lagrangian_stored();
880 delete_J_lagrangian_stored();
891 if((Can_delete_dshape_lagrangian_stored) && (DShape_lagrangian_stored_pt))
894 unsigned n_intpt = DShape_lagrangian_stored_pt->size();
896 for(
unsigned ipt=n_intpt;ipt>0;ipt--)
898 delete (*DShape_lagrangian_stored_pt)[ipt-1];
899 (*DShape_lagrangian_stored_pt)[ipt-1] = 0;
902 delete DShape_lagrangian_stored_pt;
905 DShape_lagrangian_stored_pt = 0;
916 if((Can_delete_dshape_lagrangian_stored) && (D2Shape_lagrangian_stored_pt))
919 unsigned n_intpt = D2Shape_lagrangian_stored_pt->size();
921 for(
unsigned ipt=n_intpt;ipt>0;ipt--)
923 delete (*D2Shape_lagrangian_stored_pt)[ipt-1];
924 (*D2Shape_lagrangian_stored_pt)[ipt-1] = 0;
927 delete D2Shape_lagrangian_stored_pt;
930 D2Shape_lagrangian_stored_pt = 0;
940 if(Can_delete_dshape_lagrangian_stored)
943 delete Jacobian_lagrangian_stored_pt;
946 Jacobian_lagrangian_stored_pt = 0;
959 unsigned n_node =
nnode();
962 unsigned n_lagrangian_type =
964 unsigned n_lagrangian =
968 delete_J_lagrangian_stored();
969 delete_dshape_lagrangian_stored();
971 Can_delete_dshape_lagrangian_stored=
true;
978 Shape psi(n_node,n_lagrangian_type);
979 DShape dpsidxi(n_node,n_lagrangian_type,n_lagrangian);
983 for(
unsigned ipt=0;ipt<n_intpt;ipt++)
988 Jacobian_lagrangian_stored_pt->
992 DShape* dpsidxi_pt =
new DShape(n_node,n_lagrangian_type,n_lagrangian);
995 for(
unsigned l=0;l<n_node;l++)
997 for(
unsigned k=0;k<n_lagrangian_type;k++)
1000 for(
unsigned i=0;
i<n_lagrangian;
i++)
1001 {(*dpsidxi_pt)(l,k,
i) = dpsidxi(l,k,
i);}
1006 DShape_lagrangian_stored_pt->push_back(dpsidxi_pt);
1021 unsigned n_node =
nnode();
1024 unsigned n_lagrangian_type =
1026 unsigned n_lagrangian =
1032 switch(n_lagrangian)
1034 case 1: n_deriv = 1;
break;
1035 case 2: n_deriv = 3;
break;
1036 case 3: n_deriv = 6;
break;
1037 default:
oomph_info <<
"Really more than 3 dimensions?" << std::endl;
break;
1041 delete_J_lagrangian_stored();
1042 delete_dshape_lagrangian_stored();
1043 delete_d2shape_lagrangian_stored();
1045 Can_delete_dshape_lagrangian_stored=
true;
1053 Shape psi(n_node,n_lagrangian_type);
1054 DShape dpsidxi(n_node,n_lagrangian_type,n_lagrangian);
1055 DShape d2psidxi(n_node,n_lagrangian_type,n_deriv);
1059 for(
unsigned ipt=0;ipt<n_intpt;ipt++)
1064 Jacobian_lagrangian_stored_pt->
1069 DShape *dpsidxi_pt =
new DShape(n_node,n_lagrangian_type,n_lagrangian);
1070 DShape *d2psidxi_pt =
new DShape(n_node,n_lagrangian_type,n_deriv);
1073 for(
unsigned l=0;l<n_node;l++)
1075 for(
unsigned k=0;k<n_lagrangian_type;k++)
1078 for(
unsigned i=0;
i<n_lagrangian;
i++)
1079 {(*dpsidxi_pt)(l,k,
i) = dpsidxi(l,k,
i);}
1082 for(
unsigned i=0;
i<n_deriv;
i++)
1083 {(*d2psidxi_pt)(l,k,
i) = d2psidxi(l,k,
i);}
1089 DShape_lagrangian_stored_pt->push_back(dpsidxi_pt);
1090 D2Shape_lagrangian_stored_pt->push_back(d2psidxi_pt);
1105 if(DShape_lagrangian_stored_pt==0)
1113 dpsidxi = (*DShape_lagrangian_stored_pt)[ipt];
1116 return ((*Jacobian_lagrangian_stored_pt)[ipt]);
1130 if(D2Shape_lagrangian_stored_pt==0)
1139 dpsidxi = (*DShape_lagrangian_stored_pt)[ipt];
1140 d2psidxi = (*D2Shape_lagrangian_stored_pt)[ipt];
1143 return ((*Jacobian_lagrangian_stored_pt)[ipt]);
1167 delete_all_dshape_lagrangian_stored();
1170 Can_delete_dshape_lagrangian_stored =
false;
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...
void pre_compute_dshape_lagrangian_at_knots()
Calculate the first derivatives of the shape functions w.r.t Lagrangian coordinates at the integratio...
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 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_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...
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...
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< double > * Jacobian_eulerian_stored_pt
Pointer to storage for the Jacobian of the element w.r.t global coordinates.
Vector< Shape * > *& shape_stored_pt()
Return a pointer to the vector of pointers to the stored shape functions.
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-...
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 delete_dshape_eulerian_stored()
Delete stored deriatives of shape fcts w.r.t. to global Eulerian coords.
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< DShape * > * DShape_local_stored_pt
Pointer to storage for the pointers to the derivatives of the nodal shape functions w...
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 void set_integration_scheme(Integral *const &integral_pt)
Set the spatial integration scheme.
void delete_all_dshape_lagrangian_stored()
Delete all the objects stored in the [...]_lagrangian_stored_pt vectors and delete the vectors themse...
Vector< DShape * > *& dshape_lagrangian_stored_pt()
Return a pointer to the vector of pointers to the stored first derivatives of the shape functions w...
virtual ~StorableShapeElementBase()
The destructor cleans up the static memory allocated for shape function storage. Internal and externa...
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...
void delete_d2shape_lagrangian_stored()
Delete stored second derivatives of shape functions w.r.t. Lagrangian coordinates.
bool Can_delete_dshape_eulerian_stored
Boolean to determine whether the element can delete the stored derivatives of shape functions w...
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_dshape_local_stored()
Delete stored derivatives of shape functions w.r.t. to local coordinates.
unsigned Dim
Dimension of zeta tuples (set by get_dim_helper) – needed because we store the scalar coordinates in...
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...
Vector< DShape * > *& d2shape_lagrangian_stored_pt()
Return a pointer to the vector of pointers to the stored second derivatives of the shape functions w...
unsigned nnodal_position_type() const
Return the number of coordinate types that the element requires to interpolate the geometry between t...
Vector< DShape * > *& dshape_local_stored_pt()
Return a pointer to the vector of pointers to the stored first derivatives of the shape functions w...
unsigned nlagrangian() const
Access function to # of Lagrangian coordinates.
unsigned nodal_dimension() const
Return the required Eulerian dimension of the nodes in this element.
Vector< DShape * > *& d2shape_eulerian_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) ...
Integral *const & integral_pt() const
Return the pointer to the integration scheme (const version)
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 ...
virtual void shape_at_knot(const unsigned &ipt, Shape &psi) const
Return the geometric shape function at the ipt-th integration point.
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-...
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 pre_compute_d2shape_local_at_knots()
Calculate the second derivatives of the shape functions w.r.t. local coordinates at the integration p...
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 ...
void pre_compute_J_eulerian_at_knots()
Calculate the Jacobian of the mapping from local to global coordinates at the integration points and ...
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_lagrangian_stored()
Delete all the objects stored in the Lagrangian_stored vectors.
Vector< double > *& jacobian_eulerian_stored_pt()
Return a pointer to the vector of Jacobians of the mapping between the local and global (eulerian) co...
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
void delete_all_dshape_eulerian_stored()
Delete all storage related to deriatives of shape fcts w.r.t. to global Eulerian coords.
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_lagrangian_stored_pt()
Return a pointer to the vector of Jacobians of the mapping between the local and global (eulerian) co...
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 dim() const
Return the spatial dimension of the element, i.e. the number of local coordinates required to paramet...
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.
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...
void delete_d2shape_local_stored()
Delete stored 2nd derivatives of shape functions w.r.t. to local coordinates.
void delete_d2shape_eulerian_stored()
Delete stored second derivatives of shape functions w.r.t. to global Eulerian coordinates.
virtual unsigned nweight() const =0
Return the number of integration points of the scheme.
void delete_J_lagrangian_stored()
Delete stored Jaocbian of mapping between local and Lagrangian coordinates.
std::string string(const unsigned &i)
Return the i-th string or "" if the relevant string hasn't been defined.
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...
Vector< DShape * > * D2Shape_local_stored_pt
Pointer to storage for the pointers to the second derivatives of the nodal shape functions w...
void delete_all_shape_local_stored()
Delete all the objects stored in the [...]_local_stored_pt vectors and delete the vectors themselves...
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 pre_compute_shape_at_knots()
Calculate the shape functions at the integration points and store the results internally.
bool Can_delete_shape_local_stored
Boolean to determine whether the element can delete the stored local shape functions.
unsigned nnode() const
Return the number of nodes.
void shape_at_knot(const unsigned &ipt, Shape &psi) const
Return the geometric shape function at the ipt-th integration point.
void delete_shape_local_stored()
Delete stored shape functions.
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 ...
Vector< DShape * > *& d2shape_local_stored_pt()
Return a pointer to the vector of pointers to the stored second derivatives of the shape functions w...