oomph::MacroElementNodeUpdateNode Class Reference

#include <macro_element_node_update_element.h>

+ Inheritance diagram for oomph::MacroElementNodeUpdateNode:

Public Member Functions

 MacroElementNodeUpdateNode (const unsigned &n_dim, const unsigned &n_position_type, const unsigned &initial_nvalue)
 
 MacroElementNodeUpdateNode (TimeStepper *time_stepper_pt, const unsigned &n_dim, const unsigned &n_position_type, const unsigned &initial_nvalue)
 
 MacroElementNodeUpdateNode (const MacroElementNodeUpdateNode &)=delete
 Broken copy constructor. More...
 
virtual ~MacroElementNodeUpdateNode ()
 Broken assignment operator. More...
 
void node_update (const bool &update_all_time_levels_for_new_node=false)
 
FiniteElement *& node_update_element_pt ()
 
Vector< double > & s_in_node_update_element ()
 
unsigned ngeom_object () const
 Number of geometric objects involved in node update function. More...
 
Vector< GeomObject * > & geom_object_pt ()
 
GeomObjectgeom_object_pt (const unsigned &i)
 
Vector< GeomObject * > & vector_geom_object_pt ()
 
GeomObject ** all_geom_object_pt ()
 Return all geometric objects that affect the node update. More...
 
void set_node_update_info (FiniteElement *node_update_element_pt, const Vector< double > &s_in_node_update_element, const Vector< GeomObject * > &geom_object_pt)
 
- Public Member Functions inherited from oomph::Node
 Node ()
 Default constructor. More...
 
 Node (const unsigned &n_dim, const unsigned &n_position_type, const unsigned &initial_n_value, const bool &allocate_x_position=true)
 
 Node (TimeStepper *const &time_stepper_pt, const unsigned &n_dim, const unsigned &n_position_type, const unsigned &initial_n_value, const bool &allocate_x_position=true)
 
virtual ~Node ()
 Destructor: Clean up the memory allocated for nodal position. More...
 
 Node (const Node &node)=delete
 Broken copy constructor. More...
 
void operator= (const Node &)=delete
 Broken assignment operator. More...
 
unsigned nposition_type () const
 
TimeStepper *& position_time_stepper_pt ()
 Return a pointer to the position timestepper. More...
 
TimeStepper *const & position_time_stepper_pt () const
 Return a pointer to the position timestepper (const version). More...
 
virtual void set_position_time_stepper (TimeStepper *const &position_time_stepper_pt, const bool &preserve_existing_data)
 
virtual bool does_pointer_correspond_to_position_data (double *const &parameter_pt)
 
virtual void assign_eqn_numbers (unsigned long &global_ndof, Vector< double * > &dof_pt)
 
unsigned ndim () const
 Return (Eulerian) spatial dimension of the node. More...
 
doublex (const unsigned &i)
 Return the i-th nodal coordinate. More...
 
const doublex (const unsigned &i) const
 Return the i-th nodal coordinate (const version). More...
 
doublex (const unsigned &t, const unsigned &i)
 
const doublex (const unsigned &t, const unsigned &i) const
 
double dx_dt (const unsigned &i) const
 Return the i-th component of nodal velocity: dx/dt. More...
 
double dx_dt (const unsigned &j, const unsigned &i) const
 
virtual Nodecopied_node_pt () const
 
virtual bool position_is_a_copy () const
 Return whether any position coordinate has been copied (always false) More...
 
virtual bool position_is_a_copy (const unsigned &i) const
 Return whether the position coordinate i has been copied (always false) More...
 
doublex_gen (const unsigned &k, const unsigned &i)
 
const doublex_gen (const unsigned &k, const unsigned &i) const
 
doublex_gen (const unsigned &t, const unsigned &k, const unsigned &i)
 
const doublex_gen (const unsigned &t, const unsigned &k, const unsigned &i) const
 
double dx_gen_dt (const unsigned &k, const unsigned &i) const
 
double dx_gen_dt (const unsigned &j, const unsigned &k, const unsigned &i) const
 
doublex_pt (const unsigned &t, const unsigned &i)
 
void copy (Node *orig_node_pt)
 Copy all nodal data from specified Node object. More...
 
virtual void dump (std::ostream &dump_file) const
 Dump nodal position and associated data to file for restart. More...
 
void read (std::ifstream &restart_file)
 Read nodal position and associated data from file for restart. More...
 
virtual void pin_all ()
 
virtual void unpin_all ()
 
unsigned hang_code ()
 
HangInfo *const & hanging_pt () const
 
HangInfo *const & hanging_pt (const int &i) const
 Return pointer to hanging node data for value i (const version) More...
 
bool is_hanging () const
 Test whether the node is geometrically hanging. More...
 
bool is_hanging (const int &i) const
 Test whether the i-th value is hanging. More...
 
void set_hanging_pt (HangInfo *const &hang_pt, const int &i)
 Set the hanging data for the i-th value. (hang_pt=0 to make non-hanging) More...
 
void set_nonhanging ()
 Label node as non-hanging node by removing all hanging node data. More...
 
void resize (const unsigned &n_value)
 Resize the number of equations. More...
 
virtual void constrain_positions ()
 
virtual void unconstrain_positions ()
 
virtual void make_periodic (Node *const &node_pt)
 
virtual void make_periodic_nodes (const Vector< Node * > &periodic_nodes_pt)
 
virtual void get_boundaries_pt (std::set< unsigned > *&boundaries_pt)
 
virtual bool is_on_boundary () const
 
virtual bool is_on_boundary (const unsigned &b) const
 
virtual void add_to_boundary (const unsigned &b)
 
virtual void remove_from_boundary (const unsigned &b)
 
virtual unsigned ncoordinates_on_boundary (const unsigned &b)
 
virtual bool boundary_coordinates_have_been_set_up ()
 
virtual void get_coordinates_on_boundary (const unsigned &b, const unsigned &k, Vector< double > &boundary_zeta)
 
virtual void set_coordinates_on_boundary (const unsigned &b, const unsigned &k, const Vector< double > &boundary_zeta)
 
virtual void get_coordinates_on_boundary (const unsigned &b, Vector< double > &boundary_zeta)
 
virtual void set_coordinates_on_boundary (const unsigned &b, const Vector< double > &boundary_zeta)
 
void set_obsolete ()
 Mark node as obsolete. More...
 
void set_non_obsolete ()
 Mark node as non-obsolete. More...
 
bool is_obsolete ()
 Test whether node is obsolete. More...
 
double raw_value (const unsigned &i) const
 
double raw_value (const unsigned &t, const unsigned &i) const
 
double value (const unsigned &i) const
 
double value (const unsigned &t, const unsigned &i) const
 
void value (Vector< double > &values) const
 
Vector< doublevalue () const
 Return vector of values calculated using value(vector). More...
 
void value (const unsigned &t, Vector< double > &values) const
 
void position (Vector< double > &pos) const
 
Vector< doubleposition () const
 Return vector of position of node at current time. More...
 
void position (const unsigned &t, Vector< double > &pos) const
 
double position (const unsigned &i) const
 
double position (const unsigned &t, const unsigned &i) const
 
double position_gen (const unsigned &k, const unsigned &i) const
 
double position_gen (const unsigned &t, const unsigned &k, const unsigned &i) const
 
double dposition_dt (const unsigned &i) const
 
double dposition_dt (const unsigned &j, const unsigned &i) const
 
double dposition_gen_dt (const unsigned &k, const unsigned &i) const
 
double dposition_gen_dt (const unsigned &j, const unsigned &k, const unsigned &i) const
 
void set_auxiliary_node_update_fct_pt (AuxNodeUpdateFctPt aux_node_update_fct_pt)
 
bool has_auxiliary_node_update_fct_pt ()
 
void perform_auxiliary_node_update_fct ()
 
virtual unsigned ngeom_data () const
 
virtual Data ** all_geom_data_pt ()
 
void output (std::ostream &outfile)
 Output nodal position. More...
 
- Public Member Functions inherited from oomph::Data
virtual void clear_copied_pointers ()
 
 Data ()
 Default constructor. More...
 
 Data (const unsigned &initial_n_value)
 
 Data (TimeStepper *const &time_stepper_pt, const unsigned &initial_n_value, const bool &allocate_storage=true)
 
 Data (const Data &data)=delete
 Broken copy constructor. More...
 
void operator= (const Data &)=delete
 Broken assignment operator. More...
 
virtual ~Data ()
 Destructor, deallocates memory assigned for data. More...
 
void set_time_stepper (TimeStepper *const &time_stepper_pt, const bool &preserve_existing_data)
 
TimeStepper *& time_stepper_pt ()
 Return the pointer to the timestepper. More...
 
TimeStepper *const & time_stepper_pt () const
 Return the pointer to the timestepper (const version). More...
 
virtual bool is_a_copy () const
 
virtual bool is_a_copy (const unsigned &i) const
 
void set_value (const unsigned &i, const double &value_)
 
void set_value (const unsigned &t, const unsigned &i, const double &value_)
 
double value (const unsigned &i) const
 
double value (const unsigned &t, const unsigned &i) const
 
void value (Vector< double > &values) const
 Compute Vector of values for the Data value. More...
 
void value (const unsigned &t, Vector< double > &values) const
 
doublevalue_pt (const unsigned &i) const
 
doublevalue_pt (const unsigned &t, const unsigned &i) const
 
bool does_pointer_correspond_to_value (double *const &parameter_pt)
 Check whether the pointer parameter_pt addresses internal data values. More...
 
void copy (Data *orig_data_pt)
 Copy Data values from specified Data object. More...
 
void dump (std::ostream &dump_file) const
 Dump the data object to a file. More...
 
void read (std::ifstream &restart_file)
 Read data object from a file. More...
 
long * eqn_number_pt (const unsigned &i)
 Return the pointer to the equation number of the i-th stored variable. More...
 
long & eqn_number (const unsigned &i)
 Return the equation number of the i-th stored variable. More...
 
long eqn_number (const unsigned &i) const
 Return the equation number of the i-th stored variable. More...
 
void pin (const unsigned &i)
 Pin the i-th stored variable. More...
 
void unpin (const unsigned &i)
 Unpin the i-th stored variable. More...
 
void pin_all ()
 Pin all the stored variables. More...
 
void unpin_all ()
 Unpin all the stored variables. More...
 
bool is_pinned (const unsigned &i) const
 Test whether the i-th variable is pinned (1: true; 0: false). More...
 
bool is_segregated_solve_pinned (const unsigned &i)
 
void constrain (const unsigned &i)
 
void unconstrain (const unsigned &i)
 
void constrain_all ()
 Constrain all the stored variables when the data is made hanging. More...
 
void unconstrain_all ()
 Unconstrain all the stored variables when the data is made nonhanging. More...
 
bool is_constrained (const unsigned &i)
 
unsigned self_test ()
 
unsigned nvalue () const
 Return number of values stored in data object (incl pinned ones). More...
 
unsigned ntstorage () const
 
virtual void describe_dofs (std::ostream &out, const std::string &current_string) const
 
virtual void add_value_pt_to_map (std::map< unsigned, double * > &map_of_value_pt)
 

Private Attributes

FiniteElementNode_update_element_pt
 
Vector< doubleS_in_node_update_element
 
Vector< GeomObject * > Geom_object_pt
 

Additional Inherited Members

- Public Types inherited from oomph::Node
typedef void(* AuxNodeUpdateFctPt) (Node *)
 Function pointer to auxiliary node update function. More...
 
- Static Public Attributes inherited from oomph::Node
static unsigned No_independent_position = 10
 
- Static Public Attributes inherited from oomph::Data
static long Is_pinned = -1
 Static "Magic number" to indicate pinned values. More...
 
static long Is_segregated_solve_pinned = -3
 
static long Is_unclassified = -10
 
static long Is_constrained = -2
 
- Protected Member Functions inherited from oomph::Node
void x_gen_range_check (const unsigned &t, const unsigned &k, const unsigned &i) const
 
doublex_position_pt (const unsigned &i)
 Direct access to the pointer to the i-th stored coordinate data. More...
 
- Protected Member Functions inherited from oomph::Data
virtual void reset_copied_pointers ()
 
- Protected Attributes inherited from oomph::Node
double ** X_position
 
TimeStepperPosition_time_stepper_pt
 Pointer to the timestepper associated with the position data. More...
 
HangInfo ** Hanging_pt
 
unsigned Ndim
 Eulerian dimension of the node. More...
 
unsigned Nposition_type
 
bool Obsolete
 
AuxNodeUpdateFctPt Aux_node_update_fct_pt
 
- Protected Attributes inherited from oomph::Data
Data ** Copy_of_data_pt
 
unsigned Ncopies
 
- Static Protected Attributes inherited from oomph::Data
static TimeStepperDefault_static_time_stepper_pt = new Steady<0>()
 Default (static) timestepper used in steady problems. More...
 

Detailed Description

//////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////// MacroElementNodeUpdate nodes are nodes with a positional update function, based on their element's MacroElement representation.

Constructor & Destructor Documentation

◆ MacroElementNodeUpdateNode() [1/3]

oomph::MacroElementNodeUpdateNode::MacroElementNodeUpdateNode ( const unsigned n_dim,
const unsigned n_position_type,
const unsigned initial_nvalue 
)
inline

Constructor for steady node of spatial dimension n_dim, with n_position_type generalised coordinates and with initial_nvalue dofs.

57  : Node(n_dim, n_position_type, initial_nvalue)
58  {
59  // By default, only the nodal position is updated and no auxiliary
60  // updates of function values are performed.
61  }
Node()
Default constructor.
Definition: nodes.cc:1574

◆ MacroElementNodeUpdateNode() [2/3]

oomph::MacroElementNodeUpdateNode::MacroElementNodeUpdateNode ( TimeStepper time_stepper_pt,
const unsigned n_dim,
const unsigned n_position_type,
const unsigned initial_nvalue 
)
inline

Constructor for bog-standard node of spatial dimension n_dim, with n_position_type generalised coordinates, with initial_nvalue dofs and with time dependence.

70  : Node(time_stepper_pt, n_dim, n_position_type, initial_nvalue)
71  {
72  // By default, only the nodal position is updated and no auxiliary
73  // updates of function values are performed.
74  }
TimeStepper *& time_stepper_pt()
Return the pointer to the timestepper.
Definition: nodes.h:238

◆ MacroElementNodeUpdateNode() [3/3]

oomph::MacroElementNodeUpdateNode::MacroElementNodeUpdateNode ( const MacroElementNodeUpdateNode )
delete

Broken copy constructor.

◆ ~MacroElementNodeUpdateNode()

virtual oomph::MacroElementNodeUpdateNode::~MacroElementNodeUpdateNode ( )
inlinevirtual

Broken assignment operator.

Destructor (empty)

88 {}

Member Function Documentation

◆ all_geom_object_pt()

GeomObject** oomph::MacroElementNodeUpdateNode::all_geom_object_pt ( )
inlinevirtual

Return all geometric objects that affect the node update.

Reimplemented from oomph::Node.

145  {
146  if (Geom_object_pt.size() > 0)
147  {
148  return &(Geom_object_pt[0]);
149  }
150  else
151  {
152  return 0;
153  }
154  }
Vector< GeomObject * > Geom_object_pt
Definition: macro_element_node_update_element.h:182

References Geom_object_pt.

◆ geom_object_pt() [1/2]

Vector<GeomObject*>& oomph::MacroElementNodeUpdateNode::geom_object_pt ( )
inline

Vector of (pointers to) geometric objects involved in node update function

123  {
124  return Geom_object_pt;
125  }

References Geom_object_pt.

Referenced by set_node_update_info().

◆ geom_object_pt() [2/2]

GeomObject* oomph::MacroElementNodeUpdateNode::geom_object_pt ( const unsigned i)
inline

Pointer to i-th geometric object involved in node update function

131  {
132  return Geom_object_pt[i];
133  }
int i
Definition: BiCGSTAB_step_by_step.cpp:9

References Geom_object_pt, and i.

◆ ngeom_object()

unsigned oomph::MacroElementNodeUpdateNode::ngeom_object ( ) const
inlinevirtual

Number of geometric objects involved in node update function.

Reimplemented from oomph::Node.

116  {
117  return Geom_object_pt.size();
118  }

References Geom_object_pt.

◆ node_update()

void oomph::MacroElementNodeUpdateNode::node_update ( const bool update_all_time_levels_for_new_node = false)
virtual

Update the current nodal position. If required, perform the auxiliary update of nodal values. If update_all_time_levels_for_new_node==true, previous positions are also updated – as indicated by the name of this flag, this should only be done for newly created nodes, when this function is called from MacroElementNodeUpdateElementBase::build_macro_element_node_update_node(...)

//////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////// Excute the update function: Update the current (and if update_all_time_levels_for_new_node==true also the previous) nodal position. Also update the current nodal values if an auxiliary update function is defined. Note: Updating of previous positions is only required (and should only be performed for) newly created MacroElementNodeUpdateNodes i.e. when this function is called from... If a node is hanging, its position is determined via its hanging node constraints after updating the position of its master nodes.

Reimplemented from oomph::Node.

50  {
51  // Number of time levels that need to be updated
52  unsigned ntime;
53  if (update_all_time_levels_for_new_node)
54  {
55  // Present value plus the previous values
57  }
58  else
59  {
60  // Just the present value
61  ntime = 1;
62  }
63 
64  // Is it a hanging node?
65  if (is_hanging())
66  {
67  // Loop over all master nodes and update their position
68  // That's all we need to update the position of hanging nodes!
69  // (Recall that for hanging nodes Node::x(...) is not
70  // guaranteed to be kept up-to-date; the (constrained!) nodal
71  // position of hanging nodes must be determined via
72  // Node::position() which determines the position
73  // via the hanging node constraints from the position of
74  // the master nodes)
75  unsigned nmaster = hanging_pt()->nmaster();
76  for (unsigned imaster = 0; imaster < nmaster; imaster++)
77  {
78  dynamic_cast<MacroElementNodeUpdateNode*>(
79  hanging_pt()->master_node_pt(imaster))
80  ->node_update(update_all_time_levels_for_new_node);
81  }
82  }
83  // Node isn't hanging --> update it directly
84  else
85  {
86  // If no update element is defined, keep the nodal positions where
87  // they were (i.e. don't do anything), else update
88  if (Node_update_element_pt != 0)
89  {
90  // Vector of local coordinates
91  unsigned n_dim = ndim();
92  Vector<double> x_new(n_dim);
93 
94  // Loop over time levels
95  for (unsigned t = 0; t < ntime; t++)
96  {
97  // Update via macro element representation
99  for (unsigned i = 0; i < n_dim; i++)
100  {
101  x(t, i) = x_new[i];
102  }
103  }
104  }
105  }
106 
107  // Perform auxiliary update of function values? Node passes itself
108  // to this function so its position etc. is available to the auxiliary
109  // node update function.
110  if (Aux_node_update_fct_pt != 0)
111  {
113  }
114  }
void get_x(const Vector< double > &s, Vector< double > &x) const
Definition: elements.h:1885
Node *const & master_node_pt(const unsigned &i) const
Return a pointer to the i-th master node.
Definition: nodes.h:791
unsigned nmaster() const
Return the number of master nodes.
Definition: nodes.h:785
void node_update(const bool &update_all_time_levels_for_new_node=false)
Definition: macro_element_node_update_element.cc:48
MacroElementNodeUpdateNode(const unsigned &n_dim, const unsigned &n_position_type, const unsigned &initial_nvalue)
Definition: macro_element_node_update_element.h:54
Vector< double > S_in_node_update_element
Definition: macro_element_node_update_element.h:178
FiniteElement * Node_update_element_pt
Definition: macro_element_node_update_element.h:174
double & x(const unsigned &i)
Return the i-th nodal coordinate.
Definition: nodes.h:1060
HangInfo *const & hanging_pt() const
Definition: nodes.h:1228
unsigned ndim() const
Return (Eulerian) spatial dimension of the node.
Definition: nodes.h:1054
AuxNodeUpdateFctPt Aux_node_update_fct_pt
Definition: nodes.h:967
TimeStepper * Position_time_stepper_pt
Pointer to the timestepper associated with the position data.
Definition: nodes.h:932
bool is_hanging() const
Test whether the node is geometrically hanging.
Definition: nodes.h:1285
virtual unsigned nprev_values() const =0
Number of previous values available: 0 for static, 1 for BDF<1>,...
t
Definition: plotPSD.py:36

References oomph::Node::Aux_node_update_fct_pt, oomph::FiniteElement::get_x(), oomph::Node::hanging_pt(), i, oomph::Node::is_hanging(), oomph::HangInfo::master_node_pt(), oomph::Node::ndim(), oomph::HangInfo::nmaster(), Node_update_element_pt, oomph::TimeStepper::nprev_values(), oomph::Node::Position_time_stepper_pt, S_in_node_update_element, plotPSD::t, and oomph::Node::x().

Referenced by oomph::MacroElementNodeUpdateMesh::node_update().

◆ node_update_element_pt()

FiniteElement*& oomph::MacroElementNodeUpdateNode::node_update_element_pt ( )
inline

Pointer to finite element that performs the update by referring to its macro-element representation (Access required...)

102  {
103  return Node_update_element_pt;
104  }

References Node_update_element_pt.

Referenced by set_node_update_info().

◆ s_in_node_update_element()

Vector<double>& oomph::MacroElementNodeUpdateNode::s_in_node_update_element ( )
inline

Vector of local coordinates of node with the finite element that performs the MacroElement-based node update operation

110  {
112  }

References S_in_node_update_element.

Referenced by set_node_update_info().

◆ set_node_update_info()

void oomph::MacroElementNodeUpdateNode::set_node_update_info ( FiniteElement node_update_element_pt,
const Vector< double > &  s_in_node_update_element,
const Vector< GeomObject * > &  geom_object_pt 
)
inline

Set node update information for node: Pass the pointer to the element that performs the update operation, the vector containing the node's local coordinates in that element and the vector of (pointers to) the geometric objects that affect the node update.

164  {
168  }
Vector< double > & s_in_node_update_element()
Definition: macro_element_node_update_element.h:109
Vector< GeomObject * > & geom_object_pt()
Definition: macro_element_node_update_element.h:122
FiniteElement *& node_update_element_pt()
Definition: macro_element_node_update_element.h:101

References geom_object_pt(), Geom_object_pt, node_update_element_pt(), Node_update_element_pt, s_in_node_update_element(), and S_in_node_update_element.

◆ vector_geom_object_pt()

Vector<GeomObject*>& oomph::MacroElementNodeUpdateNode::vector_geom_object_pt ( )
inline

Return vector of geometric objects involved in node update function

139  {
140  return Geom_object_pt;
141  }

References Geom_object_pt.

Member Data Documentation

◆ Geom_object_pt

Vector<GeomObject*> oomph::MacroElementNodeUpdateNode::Geom_object_pt
private

Vector of geometric objects that are involved in the node update operation

Referenced by all_geom_object_pt(), geom_object_pt(), ngeom_object(), set_node_update_info(), and vector_geom_object_pt().

◆ Node_update_element_pt

FiniteElement* oomph::MacroElementNodeUpdateNode::Node_update_element_pt
private

Pointer to finite element that performs the node update by referring to its macro-element representation

Referenced by node_update(), node_update_element_pt(), and set_node_update_info().

◆ S_in_node_update_element

Vector<double> oomph::MacroElementNodeUpdateNode::S_in_node_update_element
private

Vector containing the node's local coordinates in node update element.

Referenced by node_update(), s_in_node_update_element(), and set_node_update_info().


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