oomph::HijackedElementBase Class Reference

#include <hijacked_elements.h>

+ Inheritance diagram for oomph::HijackedElementBase:

Public Member Functions

 HijackedElementBase ()
 
virtual ~HijackedElementBase ()
 Destructor, destroy the storage for the equation numbers. More...
 
void unhijack_all_data ()
 
const doubleresidual_multiplier () const
 Return the value of the residual multiplier. More...
 
double *& residual_multiplier_pt ()
 Return the pointer to the residual multiplier. More...
 

Protected Member Functions

void hijack_global_eqn (long *const &global_eqn_pt)
 
void unhijack_global_eqn (long *const &global_eqn_pt)
 

Protected Attributes

std::set< long * > * Hijacked_global_eqn_number_pt
 
Vector< int > * Hijacked_local_eqn_number_pt
 
doubleResidual_multiplier_pt
 

Static Protected Attributes

static double Default_residual_multiplier = 0.0
 

Detailed Description

HijackedElement base class that provides storage and access funcitons for pointers to the global equation numbers that are hijacked by the HijackedElement. A default residuals multiplier is also provided.

Constructor & Destructor Documentation

◆ HijackedElementBase()

oomph::HijackedElementBase::HijackedElementBase ( )
inline

Constructor, initialise the pointer to the equation numbers for the storage to zero

51  {
52  // Set the default value of the pointer to the residuals multiplier.
53  // The default value is zero, so that the element is "completely hijacked"
54  // and the exisiting contributions to the residuals and jacobian are
55  // totally wiped
57  }
double * Residual_multiplier_pt
Definition: hijacked_elements.h:98
std::set< long * > * Hijacked_global_eqn_number_pt
Definition: hijacked_elements.h:86
Vector< int > * Hijacked_local_eqn_number_pt
Definition: hijacked_elements.h:91
static double Default_residual_multiplier
Definition: hijacked_elements.h:102

References Default_residual_multiplier, and Residual_multiplier_pt.

◆ ~HijackedElementBase()

oomph::HijackedElementBase::~HijackedElementBase ( )
virtual

Destructor, destroy the storage for the equation numbers.

Destructor that cleans up any memory allocated by the class.

42  {
43  // If the hijacked equation number storage has been alloacted
44  // clear it
46  {
48  }
49 
50  // If the hijacked equation number storage has been alloacted
51  // clear it
53  {
55  }
56  }

References Hijacked_global_eqn_number_pt, and Hijacked_local_eqn_number_pt.

Member Function Documentation

◆ hijack_global_eqn()

void oomph::HijackedElementBase::hijack_global_eqn ( long *const &  global_eqn_pt)
protected

Mark the global equation, addressed by global_eqn_pt, as hijacked by this element.

63  {
64  // If the storage has not been allocated, allocate it
66  {
67  Hijacked_global_eqn_number_pt = new std::set<long*>;
68  }
69 
70  // Now insert the value, note that this prevents multiple inclusions,
71  // which is neater, but possibly inefficient.
72  Hijacked_global_eqn_number_pt->insert(global_eqn_pt);
73  }

References Hijacked_global_eqn_number_pt.

Referenced by oomph::Hijacked< ELEMENT >::hijack_external_value(), oomph::Hijacked< ELEMENT >::hijack_internal_value(), oomph::Hijacked< ELEMENT >::hijack_nodal_position_value(), oomph::Hijacked< ELEMENT >::hijack_nodal_spine_value(), and oomph::Hijacked< ELEMENT >::hijack_nodal_value().

◆ residual_multiplier()

const double& oomph::HijackedElementBase::residual_multiplier ( ) const
inline

Return the value of the residual multiplier.

71  {
72  return *Residual_multiplier_pt;
73  }

References Residual_multiplier_pt.

Referenced by oomph::Hijacked< ELEMENT >::get_jacobian(), and oomph::Hijacked< ELEMENT >::get_residuals().

◆ residual_multiplier_pt()

double*& oomph::HijackedElementBase::residual_multiplier_pt ( )
inline

Return the pointer to the residual multiplier.

77  {
79  }

References Residual_multiplier_pt.

◆ unhijack_all_data()

void oomph::HijackedElementBase::unhijack_all_data ( )
inline

Reset the hijacked data pt, so that none of the equations in the element are hijacked.

65  {
67  }

References Hijacked_global_eqn_number_pt.

◆ unhijack_global_eqn()

void oomph::HijackedElementBase::unhijack_global_eqn ( long *const &  global_eqn_pt)
protected

The global equation, addressed by global_eqn_pt, is no longer hijacked by this element.

80  {
81  // Check that the storage has been allocated
83  {
84  Hijacked_global_eqn_number_pt->erase(global_eqn_pt);
85  }
86  }

References Hijacked_global_eqn_number_pt.

Member Data Documentation

◆ Default_residual_multiplier

double oomph::HijackedElementBase::Default_residual_multiplier = 0.0
staticprotected

Static default value for the double that multiplies the original residuals

Static default value of the multiplier for the original residuals The contribution to the total residuals is the product of the multiplier and the original value of the residuals

Referenced by HijackedElementBase().

◆ Hijacked_global_eqn_number_pt

std::set<long*>* oomph::HijackedElementBase::Hijacked_global_eqn_number_pt
protected

Pointer to a Set of pointers to the equation numbers that will be hijacked by this element. Note that these MUST be pointers because hijacking information is set BEFORE global equation numbers have been assigned.

Referenced by oomph::Hijacked< ELEMENT >::assign_local_eqn_numbers(), hijack_global_eqn(), unhijack_all_data(), unhijack_global_eqn(), and ~HijackedElementBase().

◆ Hijacked_local_eqn_number_pt

Vector<int>* oomph::HijackedElementBase::Hijacked_local_eqn_number_pt
protected

Pointer to a vector of integers containing the local equation numbers of any hijacked variables in the element.

Referenced by oomph::Hijacked< ELEMENT >::assign_local_eqn_numbers(), oomph::Hijacked< ELEMENT >::get_jacobian(), oomph::Hijacked< ELEMENT >::get_residuals(), and ~HijackedElementBase().

◆ Residual_multiplier_pt

double* oomph::HijackedElementBase::Residual_multiplier_pt
protected

Pointer to a double that multiplies the contribution to the residuals from the original element. This is usually used as a homotopy parameter to permit a smooth transition between different types of boundary conditions, rather than switching them on or off abruptly

Referenced by HijackedElementBase(), residual_multiplier(), and residual_multiplier_pt().


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