![]() |
|
#include <shape.h>
Public Member Functions | |
Shape (const unsigned &N) | |
Constructor for a single-index set of shape functions. More... | |
Shape (const unsigned &N, const unsigned &M) | |
Constructor for a two-index set of shape functions. More... | |
Shape (const Shape &shape)=delete | |
Broken copy constructor. More... | |
Shape () | |
void | operator= (const Shape &shape) |
void | operator= (Shape *const &shape_pt) |
~Shape () | |
Destructor, clear up the memory allocated by the object. More... | |
void | resize (const unsigned &N, const unsigned &M=1) |
Change the size of the storage. More... | |
double & | operator[] (const unsigned &i) |
Overload the bracket operator to provide access to values. More... | |
const double & | operator[] (const unsigned &i) const |
Overload the bracket operator (const version) More... | |
double & | operator() (const unsigned &i) |
Overload the round bracket operator to provide access to values. More... | |
const double & | operator() (const unsigned &i) const |
Overload the round bracket operator (const version) More... | |
double & | operator() (const unsigned &i, const unsigned &j) |
Overload the round bracket operator, allowing for two indices. More... | |
const double & | operator() (const unsigned &i, const unsigned &j) const |
unsigned | nindex1 () const |
Return the range of index 1 of the shape function object. More... | |
unsigned | nindex2 () const |
Return the range of index 2 of the shape function object. More... | |
Protected Member Functions | |
void | range_check (const unsigned &i, const unsigned &j) const |
Private function that checks whether the index is in range. More... | |
Protected Attributes | |
double * | Psi |
double * | Allocated_storage |
unsigned | Index1 |
Size of the first index of the shape function. More... | |
unsigned | Index2 |
Size of the second index of the shape function. More... | |
A Class for shape functions. In simple cases, the shape functions have only one index that can be thought of as corresponding to the nodal points. In general, however, when quantities and their gradients are interpolated separately, the shape function have two indices: one corresponding to the nodal points, and the other to the "type" of quantity being interpolated: function, derivative, &c The second index can also represent the vector coordinate for vector-valued (Nedelec) shape functions.
The implementation of Shape functions is designed to permit fast copying of entire sets of values by resetting the internal pointer to the data, Psi; functionality that is required, for example, when setting the test functions in Galerkin elements and when reading pre-computed values of the shape functions. In general, we cannot know at construction time whether the pointer to the values will be reset or not and, therefore, whether the storage for values should be allocated by the object. We choose to allocate storage on construction and store an additional pointer Allocated_data that always addresses the storage allocated by the object. If the Psi pointer is reset then this storage will be "wasted", but only for the lifetime of the object. The cost for non-copied Shape functions is one additional pointer.
|
inline |
Constructor for a single-index set of shape functions.
References Allocated_storage, N, and Psi.
Constructor for a two-index set of shape functions.
References Allocated_storage, N, and Psi.
|
delete |
Broken copy constructor.
|
inline |
Default constructor - just assigns a null pointers and zero index sizes.
|
inline |
Destructor, clear up the memory allocated by the object.
References Allocated_storage.
|
inline |
Return the range of index 1 of the shape function object.
References Index1.
Referenced by oomph::LineDerivatives::compute_surface_derivatives(), oomph::AxisymmetricDerivatives::compute_surface_derivatives(), oomph::SurfaceDerivatives::compute_surface_derivatives(), oomph::ClampedHermiteShellBoundaryConditionElement::dshape_local(), and oomph::ClampedHermiteShellBoundaryConditionElement::shape().
|
inline |
Return the range of index 2 of the shape function object.
References Index2.
Referenced by oomph::ClampedHermiteShellBoundaryConditionElement::dshape_local(), oomph::TAxisymmetricPoroelasticityElement< ORDER >::scale_basis(), oomph::TRaviartThomasDarcyElement< ORDER >::scale_basis(), oomph::TPoroelasticityElement< ORDER >::scale_basis(), and oomph::ClampedHermiteShellBoundaryConditionElement::shape().
Overload the round bracket operator to provide access to values.
References i, Index2, Psi, and range_check().
Overload the round bracket operator (const version)
References i, Index2, Psi, and range_check().
|
inline |
The assignment operator does a shallow copy (resets the pointer to the data)
References Index1, Index2, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, Psi, and oomph::OneDimHermite::shape().
|
inline |
The assignment operator does a shallow copy (resets the pointer to the data)
References Index1, Index2, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, and Psi.
Overload the bracket operator to provide access to values.
References i, Index2, Psi, and range_check().
Overload the bracket operator (const version)
References i, Index2, Psi, and range_check().
Private function that checks whether the index is in range.
References i, Index1, Index2, j, OOMPH_CURRENT_FUNCTION, and OOMPH_EXCEPTION_LOCATION.
Referenced by operator()(), and operator[]().
|
protected |
Pointer that addresses the storage allocated by the object on construction. This will be the same as Psi if the object is not copied.
Referenced by resize(), Shape(), ~Shape(), and oomph::ShapeWithDeepCopy::~ShapeWithDeepCopy().
|
protected |
Size of the first index of the shape function.
Referenced by nindex1(), operator=(), range_check(), resize(), and oomph::ShapeWithDeepCopy::ShapeWithDeepCopy().
|
protected |
Size of the second index of the shape function.
Referenced by nindex2(), operator()(), operator=(), operator[](), range_check(), resize(), and oomph::ShapeWithDeepCopy::ShapeWithDeepCopy().
|
protected |
Pointer that addresses the storage that will be used to read and set the shape functions. The shape functions are packed into a flat array of doubles.
Referenced by operator()(), operator=(), operator[](), resize(), Shape(), and oomph::ShapeWithDeepCopy::ShapeWithDeepCopy().