svZeroDSolver
Loading...
Searching...
No Matches
Node.h
Go to the documentation of this file.
1// Copyright (c) Stanford University, The Regents of the University of
2// California, and others.
3//
4// All Rights Reserved.
5//
6// See Copyright-SimVascular.txt for additional details.
7//
8// Permission is hereby granted, free of charge, to any person obtaining
9// a copy of this software and associated documentation files (the
10// "Software"), to deal in the Software without restriction, including
11// without limitation the rights to use, copy, modify, merge, publish,
12// distribute, sublicense, and/or sell copies of the Software, and to
13// permit persons to whom the Software is furnished to do so, subject
14// to the following conditions:
15//
16// The above copyright notice and this permission notice shall be included
17// in all copies or substantial portions of the Software.
18//
19// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
20// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
23// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
24// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
26// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
27// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30/**
31 * @file Node.h
32 * @brief model::Node source file
33 */
34#ifndef SVZERODSOLVER_MODEL_NODE_HPP_
35#define SVZERODSOLVER_MODEL_NODE_HPP_
36
37#include <string>
38#include <vector>
39
40#include "BlockType.h"
41#include "DOFHandler.h"
42
43class Block;
44class Model;
45
46/**
47 * @brief Node
48 *
49 * Nodes connect two blocks with each other. Each node corresponds to a
50 * flow and pressure value of the system.
51 *
52 */
53class Node {
54 public:
55 /**
56 * @brief Construct a new Node object
57 *
58 * @param id Global ID of the node
59 * @param inlet_eles Inlet element of the node
60 * @param outlet_eles Outlet element of the node
61 * @param model The model to which the node belongs
62 */
63 Node(int id, const std::vector<Block *> &inlet_eles,
64 const std::vector<Block *> &outlet_eles, Model *model);
65
66 int id; ///< Global ID of the block
67 std::vector<Block *> inlet_eles; ///< Inlet element of the node
68 std::vector<Block *> outlet_eles; ///< Outlet element of the node
69 Model *model{nullptr}; ///< The model to which the node belongs
70
71 int flow_dof{0}; ///< Global flow degree-of-freedom of the node
72 int pres_dof{0}; ///< Global pressure degree-of-freedom of the node
73
74 /**
75 * @brief Get the name of the node
76 *
77 * @return std::string Name of the node
78 */
79 std::string get_name();
80
81 /**
82 * @brief Set up the degrees of freedom (DOF) of the block
83 *
84 * Set global_var_ids and global_eqn_ids of the element based on the
85 * number of equations and the number of internal variables of the
86 * element.
87 *
88 * @param dofhandler Degree-of-freedom handler to register variables and
89 * equations at
90 */
91 void setup_dofs(DOFHandler &dofhandler);
92};
93
94#endif // SVZERODSOLVER_MODEL_NODE_HPP_
Specifies the types of blocks and their parameters.
model::DOFHandler source file
Base class for 0D model components.
Definition Block.h:101
Degree-of-freedom handler.
Definition DOFHandler.h:48
Model of 0D elements.
Definition Model.h:75
Node.
Definition Node.h:53
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:36
Model * model
The model to which the node belongs.
Definition Node.h:69
std::vector< Block * > inlet_eles
Inlet element of the node.
Definition Node.h:67
std::string get_name()
Get the name of the node.
Definition Node.cpp:52
int pres_dof
Global pressure degree-of-freedom of the node.
Definition Node.h:72
int flow_dof
Global flow degree-of-freedom of the node.
Definition Node.h:71
int id
Global ID of the block.
Definition Node.h:66
std::vector< Block * > outlet_eles
Outlet element of the node.
Definition Node.h:68
void setup_dofs(DOFHandler &dofhandler)
Set up the degrees of freedom (DOF) of the block.
Definition Node.cpp:54