Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
oomph::DShape Class Reference

A Class for the derivatives of shape functions The class design is essentially the same as Shape, but there is on additional index that is used to indicate the coordinate direction in which the derivative is taken. More...

#include <shape.h>

Public Member Functions

 DShape (const unsigned &N, const unsigned &P)
 Constructor with two parameters: a single-index shape function.
 
 DShape (const unsigned &N, const unsigned &M, const unsigned &P)
 Constructor with three paramters: a two-index shape function.
 
 DShape ()
 Default constructor - just assigns a null pointers and zero index sizes.
 
 DShape (const DShape &dshape)=delete
 Broken copy constructor.
 
void operator= (DShape &dshape)
 Assignment operator, shallow copy (not recommended so warning given)
 
void operator= (DShape *const &dshape_pt)
 Assignment operator, shallow copy (not reccomended so warning given)
 
void shallow_copy_from (DShape &dshape)
 This function does a shallow copy (resets the pointer to the data)
 
void shallow_copy_from (DShape *const &dshape_pt)
 This function does a shallow copy (resets the pointer to the data)
 
 ~DShape ()
 Destructor, clean up the memory allocated by this object.
 
double & operator() (const unsigned &i, const unsigned &k)
 Overload the round bracket operator for access to the data.
 
const double & operator() (const unsigned &i, const unsigned &k) const
 Overload the round bracket operator (const version)
 
double & operator() (const unsigned &i, const unsigned &j, const unsigned &k)
 Overload the round bracket operator, with 3 indices.
 
const double & operator() (const unsigned &i, const unsigned &j, const unsigned &k) const
 Overload the round bracket operator (const version)
 
double & raw_direct_access (const unsigned long &i)
 Direct access to internal storage of data in flat-packed C-style column-major format. WARNING: Only for experienced users. Only use this if raw speed is of the essence, as in the solid mechanics problems.
 
const double & raw_direct_access (const unsigned long &i) const
 Direct access to internal storage of data in flat-packed C-style column-major format. WARNING: Only for experienced users. Only use this if raw speed is of the essence, as in the solid mechanics problems.
 
unsigned offset (const unsigned long &i, const unsigned long &j) const
 Caculate the offset in flat-packed C-style, column-major format, required for a given i,j. WARNING: Only for experienced users. Only use this if raw speed is of the essence, as in the solid mechanics problems.
 
unsigned long nindex1 () const
 Return the range of index 1 of the derivatives of the shape functions.
 
unsigned long nindex2 () const
 Return the range of index 2 of the derivatives of the shape functions.
 
unsigned long nindex3 () const
 Return the range of index 3 of the derivatives of the shape functions.
 

Static Public Attributes

static bool Suppress_warning_about_assignment = false
 Boolean used to suppress warning about assignment operator.
 

Private Member Functions

void range_check (const unsigned &i, const unsigned &j, const unsigned &k) const
 Private function that checks whether the indices are in range.
 
void resize (const unsigned &N, const unsigned &P, const unsigned &M=1)
 Change the size of the storage. Note that (for some strange reason) index2 is the "optional" index, to conform with the existing constructor.
 

Private Attributes

double * DPsi
 Pointer that addresses the storage that will be used to read and set the shape-function derivatives. The values are packed into a flat array of doubles.
 
double * Allocated_storage
 Pointer that addresses the storage allocated by the object on construction. This will be the same as DPsi if the object is not copied.
 
unsigned Index1
 Size of the first index of the shape function.
 
unsigned Index2
 Size of the second index of the shape function.
 
unsigned Index3
 Size of the third index of the shape function.
 
bool Is_dpsi_copied
 Boolean to indicate whether the data has been copied.
 
bool Is_dpsi_a_copy
 Boolean to indicate whether the data is a copy.
 

Detailed Description

A Class for the derivatives of shape functions The class design is essentially the same as Shape, but there is on additional index that is used to indicate the coordinate direction in which the derivative is taken.

Definition at line 358 of file shape.h.

Constructor & Destructor Documentation

◆ DShape() [1/4]

oomph::DShape::DShape ( const unsigned &  N,
const unsigned &  P 
)
inline

Constructor with two parameters: a single-index shape function.

Definition at line 420 of file shape.h.

References Allocated_storage, and DPsi.

◆ DShape() [2/4]

oomph::DShape::DShape ( const unsigned &  N,
const unsigned &  M,
const unsigned &  P 
)
inline

Constructor with three paramters: a two-index shape function.

Definition at line 432 of file shape.h.

References Allocated_storage, and DPsi.

◆ DShape() [3/4]

oomph::DShape::DShape ( )
inline

Default constructor - just assigns a null pointers and zero index sizes.

Definition at line 445 of file shape.h.

◆ DShape() [4/4]

oomph::DShape::DShape ( const DShape &  dshape)
delete

Broken copy constructor.

◆ ~DShape()

oomph::DShape::~DShape ( )
inline

Destructor, clean up the memory allocated by this object.

Definition at line 547 of file shape.h.

References Allocated_storage.

Member Function Documentation

◆ nindex1()

unsigned long oomph::DShape::nindex1 ( ) const
inline

Return the range of index 1 of the derivatives of the shape functions.

Definition at line 656 of file shape.h.

References Index1.

◆ nindex2()

unsigned long oomph::DShape::nindex2 ( ) const
inline

Return the range of index 2 of the derivatives of the shape functions.

Definition at line 662 of file shape.h.

References Index2.

◆ nindex3()

unsigned long oomph::DShape::nindex3 ( ) const
inline

Return the range of index 3 of the derivatives of the shape functions.

Definition at line 668 of file shape.h.

References Index3.

◆ offset()

unsigned oomph::DShape::offset ( const unsigned long &  i,
const unsigned long &  j 
) const
inline

Caculate the offset in flat-packed C-style, column-major format, required for a given i,j. WARNING: Only for experienced users. Only use this if raw speed is of the essence, as in the solid mechanics problems.

Definition at line 649 of file shape.h.

References i, Index2, and Index3.

◆ operator()() [1/4]

double & oomph::DShape::operator() ( const unsigned &  i,
const unsigned &  j,
const unsigned &  k 
)
inline

Overload the round bracket operator, with 3 indices.

Definition at line 606 of file shape.h.

References DPsi, i, Index2, Index3, and range_check().

◆ operator()() [2/4]

const double & oomph::DShape::operator() ( const unsigned &  i,
const unsigned &  j,
const unsigned &  k 
) const
inline

Overload the round bracket operator (const version)

Definition at line 617 of file shape.h.

References DPsi, i, Index2, Index3, and range_check().

◆ operator()() [3/4]

double & oomph::DShape::operator() ( const unsigned &  i,
const unsigned &  k 
)
inline

Overload the round bracket operator for access to the data.

Definition at line 588 of file shape.h.

References DPsi, i, Index2, Index3, and range_check().

◆ operator()() [4/4]

const double & oomph::DShape::operator() ( const unsigned &  i,
const unsigned &  k 
) const
inline

Overload the round bracket operator (const version)

Definition at line 597 of file shape.h.

References DPsi, i, Index2, Index3, and range_check().

◆ operator=() [1/2]

void oomph::DShape::operator= ( DShape &  dshape)
inline

Assignment operator, shallow copy (not recommended so warning given)

Definition at line 460 of file shape.h.

References shallow_copy_from(), and Suppress_warning_about_assignment.

◆ operator=() [2/2]

void oomph::DShape::operator= ( DShape *const &  dshape_pt)
inline

Assignment operator, shallow copy (not reccomended so warning given)

Definition at line 489 of file shape.h.

References shallow_copy_from(), and Suppress_warning_about_assignment.

◆ range_check()

void oomph::DShape::range_check ( const unsigned &  i,
const unsigned &  j,
const unsigned &  k 
) const
inlineprivate

Private function that checks whether the indices are in range.

Definition at line 388 of file shape.h.

References i, Index1, Index2, and Index3.

Referenced by operator()(), operator()(), operator()(), and operator()().

◆ raw_direct_access() [1/2]

double & oomph::DShape::raw_direct_access ( const unsigned long &  i)
inline

Direct access to internal storage of data in flat-packed C-style column-major format. WARNING: Only for experienced users. Only use this if raw speed is of the essence, as in the solid mechanics problems.

Definition at line 631 of file shape.h.

References DPsi, and i.

◆ raw_direct_access() [2/2]

const double & oomph::DShape::raw_direct_access ( const unsigned long &  i) const
inline

Direct access to internal storage of data in flat-packed C-style column-major format. WARNING: Only for experienced users. Only use this if raw speed is of the essence, as in the solid mechanics problems.

Definition at line 640 of file shape.h.

References DPsi, and i.

◆ resize()

void oomph::DShape::resize ( const unsigned &  N,
const unsigned &  P,
const unsigned &  M = 1 
)
inlineprivate

Change the size of the storage. Note that (for some strange reason) index2 is the "optional" index, to conform with the existing constructor.

Definition at line 557 of file shape.h.

References Allocated_storage, DPsi, Index1, Index2, Index3, and Is_dpsi_copied.

◆ shallow_copy_from() [1/2]

void oomph::DShape::shallow_copy_from ( DShape &  dshape)
inline

◆ shallow_copy_from() [2/2]

void oomph::DShape::shallow_copy_from ( DShape *const &  dshape_pt)
inline

This function does a shallow copy (resets the pointer to the data)

Definition at line 533 of file shape.h.

References DPsi, Index1, Index2, Index3, and Is_dpsi_a_copy.

Member Data Documentation

◆ Allocated_storage

double* oomph::DShape::Allocated_storage
private

Pointer that addresses the storage allocated by the object on construction. This will be the same as DPsi if the object is not copied.

Definition at line 369 of file shape.h.

Referenced by DShape(), DShape(), resize(), and ~DShape().

◆ DPsi

double* oomph::DShape::DPsi
private

Pointer that addresses the storage that will be used to read and set the shape-function derivatives. The values are packed into a flat array of doubles.

Definition at line 364 of file shape.h.

Referenced by DShape(), DShape(), operator()(), operator()(), operator()(), operator()(), raw_direct_access(), raw_direct_access(), resize(), shallow_copy_from(), and shallow_copy_from().

◆ Index1

unsigned oomph::DShape::Index1
private

Size of the first index of the shape function.

Definition at line 372 of file shape.h.

Referenced by nindex1(), range_check(), resize(), shallow_copy_from(), and shallow_copy_from().

◆ Index2

unsigned oomph::DShape::Index2
private

Size of the second index of the shape function.

Definition at line 375 of file shape.h.

Referenced by nindex2(), offset(), operator()(), operator()(), operator()(), operator()(), range_check(), resize(), shallow_copy_from(), and shallow_copy_from().

◆ Index3

unsigned oomph::DShape::Index3
private

Size of the third index of the shape function.

Definition at line 378 of file shape.h.

Referenced by nindex3(), offset(), operator()(), operator()(), operator()(), operator()(), range_check(), resize(), shallow_copy_from(), and shallow_copy_from().

◆ Is_dpsi_a_copy

bool oomph::DShape::Is_dpsi_a_copy
private

Boolean to indicate whether the data is a copy.

Definition at line 384 of file shape.h.

Referenced by shallow_copy_from(), and shallow_copy_from().

◆ Is_dpsi_copied

bool oomph::DShape::Is_dpsi_copied
private

Boolean to indicate whether the data has been copied.

Definition at line 381 of file shape.h.

Referenced by resize().

◆ Suppress_warning_about_assignment

bool oomph::DShape::Suppress_warning_about_assignment = false
static

Boolean used to suppress warning about assignment operator.

Definition at line 674 of file shape.h.

Referenced by operator=(), and operator=().


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