Node Class Reference

To describe a node. More...

`#include <Node.h>`

Public Member Functions

Node ()
Default constructor.

Node (size_t label, const Point< real_t > &x)
Constructor with label and coordinates.

Node (const Node &node)
Copy Constructor.

~Node ()
Destructor.

void setLabel (size_t label)
Define label of node.

void setNbDOF (size_t n)
Define number of DOF.

void setFirstDOF (size_t n)
Define First DOF.

void setCode (size_t dof, int code)
Define code for a given DOF of node.

void setCode (const vector< int > &code)
Define codes for all node DOFs.

void setCode (int *code)
Define codes for all node DOFs.

void setCode (const string &exp, int code, size_t dof=1)
Define code by a boolean algebraic expression invoking node coordinates.

void setCoord (size_t i, real_t x)
Set i-th coordinate.

void DOF (size_t i, size_t dof)
Define label of DOF.

void setDOF (size_t &first_dof, size_t nb_dof)
Define number of DOF.

void setOnBoundary ()
Set node as boundary node.

size_t n () const
Return label of node.

size_t getNbDOF () const
Return number of degrees of freedom (DOF)

int getCode (size_t dof=1) const
Return code for a given DOF of node.

real_t getCoord (size_t i) const
Return i-th coordinate of node. i = 1..3.

Point< real_t > getCoord () const
Return coordinates of node.

real_t getX () const
Return x-coordinate of node.

real_t getY () const
Return y-coordinate of node.

real_t getZ () const
Return z-coordinate of node.

Point< real_t > getXYZ () const
Return coordinates of node.

size_t getDOF (size_t i) const
Return label of i-th dof.

size_t getNbNeigEl () const
Return number of neighbor elements.

ElementgetNeigEl (size_t i) const
Return i-th neighbor element.

size_t getFirstDOF () const
Return label of first DOF of node.

bool isOnBoundary () const
Say if node is a boundary node.

Add element pointed by `el` as neighbor element to node.

void setLevel (int level)
Assign a level to current node.

int getLevel () const
Return node level.

Detailed Description

To describe a node.

A node is characterized by its label, its coordinates, its number of degrees of freedom (DOF) and codes that are associated to each DOF.

Remarks
Once the mesh is constructed, information on neighboring elements of node can be retrieved (see appropriate member functions). However, the member function getNodeNeighborElements of Mesh must have been called before. If this is not the case, the program crashes down since no preliminary checking is done for efficiency reasons.

◆ Node() [1/2]

 Node ( )

Default constructor.

Initialize data to zero

◆ Node() [2/2]

 Node ( size_t label, const Point< real_t > & x )

Constructor with label and coordinates.

Parameters
 [in] label Label of node [in] x Node coordinates

◆ DOF()

 void DOF ( size_t i, size_t dof )

Define label of DOF.

Parameters
 [in] i DOF index [in] dof Label of DOF

◆ getCode()

 int getCode ( size_t dof = `1` ) const

Return code for a given DOF of node.

Parameters
 [in] dof label of degree of freedom for which code is to be returned. Default value is 1.

◆ getCoord()

 Point< real_t > getCoord ( ) const

Return coordinates of node.

Return value is an instance of class Point

◆ getLevel()

 int getLevel ( ) const

Return node level.

Node level decreases when element is refined (starting from 0). If the level is 0, then the element has no parents

◆ getNbNeigEl()

 size_t getNbNeigEl ( ) const

Return number of neighbor elements.

Neighbor elements are those that share node. Note that the returned information is valid only if the Mesh member function getNodeNeighborElements() has been invoked before

◆ getNeigEl()

 Element * getNeigEl ( size_t i ) const

Return i-th neighbor element.

Note that the returned information is valid only if the Mesh member function getNodeNeighborElements() has been invoked before

◆ getXYZ()

 Point< real_t > getXYZ ( ) const

Return coordinates of node.

Return value is an instance of class Point

◆ isOnBoundary()

 bool isOnBoundary ( ) const

Say if node is a boundary node.

Note this information is available only if boundary sides (and nodes) were determined (See class Mesh).

◆ setCode() [1/4]

 void setCode ( const string & exp, int code, size_t dof = `1` )

Define code by a boolean algebraic expression invoking node coordinates.

Parameters
 [in] exp Boolean algebraic expression as required by `fparser` [in] code Code to assign to node if the algebraic expression is true [in] dof Degree of Freedom for which code is assigned [Default: 1]

◆ setCode() [2/4]

 void setCode ( const vector< int > & code )

Define codes for all node DOFs.

Parameters
 [in] code vector instance that contains code for each DOF of current node

◆ setCode() [3/4]

 void setCode ( int * code )

Define codes for all node DOFs.

Parameters
 [in] code C-array that contains code for each DOF of current node

◆ setCode() [4/4]

 void setCode ( size_t dof, int code )

Define code for a given DOF of node.

Parameters
 [in] dof DOF index [in] code Code to assign to DOF

◆ setCoord()

 void setCoord ( size_t i, real_t x )

Set i-th coordinate.

Parameters
 [in] i Coordinate index (1..3) [in] x Coordinate value

◆ setDOF()

 void setDOF ( size_t & first_dof, size_t nb_dof )

Define number of DOF.

Parameters
 [in,out] first_dof Label of the first DOF in input that is actualized [in] nb_dof Number of DOF

◆ setLevel()

 void setLevel ( int level )

Assign a level to current node.

This member function is useful for mesh adaption.
Default node's level is zero

◆ setOnBoundary()

 void setOnBoundary ( )

Set node as boundary node.

This function is mostly internally used (Especially in class Mesh)