svZeroDSolver
Toggle main menu visibility
Loading...
Searching...
No Matches
model
Node.h
Go to the documentation of this file.
1
// SPDX-FileCopyrightText: Copyright (c) Stanford University, The Regents of the
2
// University of California, and others. SPDX-License-Identifier: BSD-3-Clause
3
/**
4
* @file Node.h
5
* @brief model::Node source file
6
*/
7
#ifndef SVZERODSOLVER_MODEL_NODE_HPP_
8
#define SVZERODSOLVER_MODEL_NODE_HPP_
9
10
#include <string>
11
#include <vector>
12
13
#include "
BlockType.h
"
14
#include "
DOFHandler.h
"
15
16
class
Block
;
17
class
Model
;
18
19
/**
20
* @brief Node
21
*
22
* Nodes connect two blocks with each other. Each node corresponds to a
23
* flow and pressure value of the system.
24
*
25
*/
26
class
Node
{
27
public
:
28
/**
29
* @brief Construct a new Node object
30
*
31
* @param id Global ID of the node
32
* @param inlet_eles Inlet element of the node
33
* @param outlet_eles Outlet element of the node
34
* @param model The model to which the node belongs
35
*/
36
Node
(
int
id
,
const
std::vector<Block*>&
inlet_eles
,
37
const
std::vector<Block*>&
outlet_eles
,
Model
*
model
);
38
39
int
id
;
///< Global ID of the block
40
std::vector<Block*>
inlet_eles
;
///< Inlet element of the node
41
std::vector<Block*>
outlet_eles
;
///< Outlet element of the node
42
Model
*
model
{
nullptr
};
///< The model to which the node belongs
43
44
int
flow_dof
{0};
///< Global flow degree-of-freedom of the node
45
int
pres_dof
{0};
///< Global pressure degree-of-freedom of the node
46
47
/**
48
* @brief Get the name of the node
49
*
50
* @return std::string Name of the node
51
*/
52
std::string
get_name
();
53
54
/**
55
* @brief Set up the degrees of freedom (DOF) of the block
56
*
57
* Set global_var_ids and global_eqn_ids of the element based on the
58
* number of equations and the number of internal variables of the
59
* element.
60
*
61
* @param dofhandler Degree-of-freedom handler to register variables and
62
* equations at
63
*/
64
void
setup_dofs
(
DOFHandler
& dofhandler);
65
};
66
67
#endif
// SVZERODSOLVER_MODEL_NODE_HPP_
BlockType.h
Specifies the types of blocks and their parameters.
DOFHandler.h
model::DOFHandler source file
Block
Base class for 0D model components.
Definition
Block.h:76
DOFHandler
Degree-of-freedom handler.
Definition
DOFHandler.h:21
Model
Model of 0D elements.
Definition
Model.h:55
Node::Node
Node(int id, const std::vector< Block * > &inlet_eles, const std::vector< Block * > &outlet_eles, Model *model)
Construct a new Node object.
Definition
Node.cpp:8
Node::model
Model * model
The model to which the node belongs.
Definition
Node.h:42
Node::get_name
std::string get_name()
Get the name of the node.
Definition
Node.cpp:24
Node::inlet_eles
std::vector< Block * > inlet_eles
Inlet element of the node.
Definition
Node.h:40
Node::pres_dof
int pres_dof
Global pressure degree-of-freedom of the node.
Definition
Node.h:45
Node::flow_dof
int flow_dof
Global flow degree-of-freedom of the node.
Definition
Node.h:44
Node::id
int id
Global ID of the block.
Definition
Node.h:39
Node::setup_dofs
void setup_dofs(DOFHandler &dofhandler)
Set up the degrees of freedom (DOF) of the block.
Definition
Node.cpp:26
Node::outlet_eles
std::vector< Block * > outlet_eles
Outlet element of the node.
Definition
Node.h:41
Generated by
1.17.0