b2api
B2000++ API Reference Manual, VERSION 4.6
 
Loading...
Searching...
No Matches
b2000::Node Class Referenceabstract

#include "b2node.H"

Inheritance diagram for b2000::Node:
Collaboration diagram for b2000::Node:

Public Member Functions

virtual bool is_subnode (const Node *node) const
 
- Public Member Functions inherited from b2000::DegreesOfFreedom
virtual int get_number_of_dof () const
 
virtual size_t set_global_dof_numbering (size_t index)
 
virtual std::pair< size_t, size_t > get_global_dof_numbering () const
 
- Public Member Functions inherited from b2000::Object
virtual ~Object ()
 

Constructor and Initialization

size_t get_id () const
 
void set_id (size_t id_)
 
const std::string & get_object_name () const override
 
void set_object_name (const std::string &name)
 
virtual void init ()
 

Coordinates

virtual int get_number_of_coor () const =0
 
virtual void set_coor (const double *coor)=0
 
template<typename T >
std::pair< int, const T * > get_coor () const
 
virtual std::pair< int, const double * > get_coor_double () const =0
 
virtual std::pair< int, const b2000::csda< double > * > get_coor_csda () const =0
 
virtual double * get_coor (double *c) const =0
 
virtual void set_weight (const double &weight)=0
 
virtual double get_weight () const =0
 
static double * get_coor_s (double *c, const Node *node)
 

Degrees-of-freedom

static size_t * get_global_dof_numbering_s (size_t *index, const Node *node)
 

Additional Inherited Members

- Static Public Attributes inherited from b2000::Object
static ObjectType type
 

Detailed Description

In addition to degrees-of-freedom, Node instances have a uniqe ID, a unique name, and coordinates. The number of coordinates can be arbitrary (e.g. nodes in 1D, 2D, 3D). Each coordinate is represented by a real number.

Note
All methods are virtual, but these methods are generally called from an Element instance that knows the exact Node subclass. Thus, the Element can make a static_cast or a dynamic_cast on the Node pointer (in Element::set_nodes()) and so avoid the extra cost of the virtual function calls.

Member Function Documentation

◆ get_coor() [1/2]

template<typename T >
std::pair< int, const T * > b2000::Node::get_coor ( ) const

Utilized by elements etc.

Returns
A pair (first, second) with first the number of coordinates and second a pointer to an array containing the node coordinates in the branch reference frame.

◆ get_coor() [2/2]

virtual double * b2000::Node::get_coor ( double *  c) const
pure virtual

Copy the node coordinates.

Parameters
cA pointer to the destination array.
Returns
A pointer past the last copied coordinate in the destination array.
Note
The static version get_coor_s() allows to avoid the overhead of the virtual functions.

◆ get_coor_csda()

virtual std::pair< int, const b2000::csda< double > * > b2000::Node::get_coor_csda ( ) const
pure virtual

Must be overloaded by implementations of Node.

◆ get_coor_double()

virtual std::pair< int, const double * > b2000::Node::get_coor_double ( ) const
pure virtual

Must be overloaded by implementations of Node.

◆ get_coor_s()

static double * b2000::Node::get_coor_s ( double *  c,
const Node node 
)
inlinestatic

Copy the node coordinates (static version).

Parameters
cA pointer to the destination array.
nodeA pointer to the Node instance.
Returns
A pointer past the last copied coordinate in the destination array.

This function is overridden by all sub-classes of Node. Hence, the overhead of calling virtual functions can be avoided when the exact type of Node is known.

See also
Element::set_nodes()

◆ get_global_dof_numbering_s()

static size_t * b2000::Node::get_global_dof_numbering_s ( size_t *  index,
const Node node 
)
inlinestatic

Copy the indices of the node's degrees-of-freedom (static version).

Parameters
indexA pointer to the destination array.
nodeA pointer to the Node instance.
Returns
A pointer past the last copied index in the destination array.
Note
This function can be used to avoid the overhead of the virtual functions, in a similar way as get_coor_s().
See also
Element::set_nodes()

◆ get_id()

size_t b2000::Node::get_id ( ) const
inline
Returns
The internal node identifier assigned by the Domain object.
See also
set_id()

◆ get_number_of_coor()

virtual int b2000::Node::get_number_of_coor ( ) const
pure virtual
Returns
The number of coordinates of the node.

◆ get_object_name()

const std::string & b2000::Node::get_object_name ( ) const
inlineoverridevirtual
Returns
The name of the node assigned by the Domain object.
See also
set_object_name()

Reimplemented from b2000::Object.

◆ get_weight()

virtual double b2000::Node::get_weight ( ) const
pure virtual
Returns
The weight of the node.
See also
set_weight()

◆ init()

virtual void b2000::Node::init ( )
inlinevirtual

This function is called by the Domain object and performs no operation. Derived classes can override this function to perform initialization of internal data.

◆ is_subnode()

virtual bool b2000::Node::is_subnode ( const Node node) const
inlinevirtual
Parameters
nodeA pointer to a Node object.
Returns
true if this object is a subnode of the node.

◆ set_coor()

virtual void b2000::Node::set_coor ( const double *  coor)
pure virtual

Set the coordinates of the node. This function is called by the Domain object.

Parameters
coorA pointer to the array containing the coordinates. The length of the array must correspond to get_number_of_coor().

◆ set_id()

void b2000::Node::set_id ( size_t  id_)
inline

This function is called by the Domain object. In B2000++, internal node identifiers start from 0 and are consecutive.

◆ set_object_name()

void b2000::Node::set_object_name ( const std::string &  name)
inline

This function is called by the Domain object. In B2000++, the naming is "branch.nid", where 'branch' is the branch number and 'nid' is the node number as specified in the MDL input file and corresponding to the first column of the NODA.branch dataset of the database.

◆ set_weight()

virtual void b2000::Node::set_weight ( const double &  weight)
pure virtual

Set the weight of a Node. This function is called by the Domain object for nodes referenced by elements that have rational-curved boundaries. A value of 1 means that the boundaries are not rational.


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