oomph::ShapeWithDeepCopy Class Reference

#include <shape.h>

+ Inheritance diagram for oomph::ShapeWithDeepCopy:

Public Member Functions

 ShapeWithDeepCopy (const unsigned &N)
 Constructor for a single-index set of shape functions. More...
 
 ShapeWithDeepCopy (const unsigned &N, const unsigned &M)
 Constructor for a two-index set of shape functions. More...
 
 ShapeWithDeepCopy ()
 Default constructor. More...
 
 ShapeWithDeepCopy (const ShapeWithDeepCopy &old_shape)
 Deep copy constructor. More...
 
void operator= (const ShapeWithDeepCopy &old_shape)=delete
 Broken assignment operator. More...
 
 ~ShapeWithDeepCopy ()
 Destructor, clear up the memory allocated by the object. More...
 
- Public Member Functions inherited from oomph::Shape
 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...
 
doubleoperator[] (const unsigned &i)
 Overload the bracket operator to provide access to values. More...
 
const doubleoperator[] (const unsigned &i) const
 Overload the bracket operator (const version) More...
 
doubleoperator() (const unsigned &i)
 Overload the round bracket operator to provide access to values. More...
 
const doubleoperator() (const unsigned &i) const
 Overload the round bracket operator (const version) More...
 
doubleoperator() (const unsigned &i, const unsigned &j)
 Overload the round bracket operator, allowing for two indices. More...
 
const doubleoperator() (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...
 

Additional Inherited Members

- Protected Member Functions inherited from oomph::Shape
void range_check (const unsigned &i, const unsigned &j) const
 Private function that checks whether the index is in range. More...
 
- Protected Attributes inherited from oomph::Shape
doublePsi
 
doubleAllocated_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...
 

Detailed Description

A shape function with a deep copy constructor. This allows for use with stl operations (e.g. manipulating vectors of shape functions). A seperate class is needed because the basic shape function uses a shallow copy.

Constructor & Destructor Documentation

◆ ShapeWithDeepCopy() [1/4]

oomph::ShapeWithDeepCopy::ShapeWithDeepCopy ( const unsigned N)
inline

Constructor for a single-index set of shape functions.

522 : Shape(N) {}
Shape()
Definition: shape.h:137
@ N
Definition: constructor.cpp:22

◆ ShapeWithDeepCopy() [2/4]

oomph::ShapeWithDeepCopy::ShapeWithDeepCopy ( const unsigned N,
const unsigned M 
)
inline

Constructor for a two-index set of shape functions.

525 : Shape(N, M) {}
The matrix class, also used for vectors and row-vectors.
Definition: Eigen/Eigen/src/Core/Matrix.h:186

◆ ShapeWithDeepCopy() [3/4]

oomph::ShapeWithDeepCopy::ShapeWithDeepCopy ( )
inline

Default constructor.

528 : Shape() {}

◆ ShapeWithDeepCopy() [4/4]

oomph::ShapeWithDeepCopy::ShapeWithDeepCopy ( const ShapeWithDeepCopy old_shape)
inline

Deep copy constructor.

532  : Shape(old_shape.Index1, old_shape.Index2)
533  {
534  for (unsigned i = 0; i < Index1 * Index2; i++)
535  {
536  Psi[i] = old_shape.Psi[i];
537  }
538  }
int i
Definition: BiCGSTAB_step_by_step.cpp:9
unsigned Index1
Size of the first index of the shape function.
Definition: shape.h:89
unsigned Index2
Size of the second index of the shape function.
Definition: shape.h:92
double * Psi
Definition: shape.h:81

References i, oomph::Shape::Index1, oomph::Shape::Index2, and oomph::Shape::Psi.

◆ ~ShapeWithDeepCopy()

oomph::ShapeWithDeepCopy::~ShapeWithDeepCopy ( )
inline

Destructor, clear up the memory allocated by the object.

545  {
546  delete[] Allocated_storage;
547  Allocated_storage = 0;
548  }
double * Allocated_storage
Definition: shape.h:86

References oomph::Shape::Allocated_storage.

Member Function Documentation

◆ operator=()

void oomph::ShapeWithDeepCopy::operator= ( const ShapeWithDeepCopy old_shape)
delete

Broken assignment operator.


The documentation for this class was generated from the following file: