svZeroDSolver
Loading...
Searching...
No Matches
State.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 State.h
32 * @brief State source file
33 */
34#ifndef SVZERODSOLVER_ALGEBRA_STATE_HPP_
35#define SVZERODSOLVER_ALGEBRA_STATE_HPP_
36
37#include <Eigen/Core>
38
39/**
40 * @brief State of the system.
41 *
42 * Stores the current state of a system, i.e. the current value and
43 * derivate of all variables.
44 *
45 */
46class State {
47 public:
48 Eigen::Matrix<double, Eigen::Dynamic, 1>
49 y; ///< Vector of solution quantities
50 Eigen::Matrix<double, Eigen::Dynamic, 1> ydot; ///< Derivate of \ref y
51
52 /**
53 * @brief Construct a new State object
54 *
55 */
56 State();
57
58 /**
59 * @brief Construct a new State object
60 *
61 * @param n Size of the state
62 */
63 State(int n);
64
65 /**
66 * @brief Destroy the State object
67 *
68 */
69 ~State();
70
71 /**
72 * @brief Copy a State object
73 *
74 * @param state
75 */
76 State(const State &state);
77
78 /**
79 * @brief Construct a new State object and initilaize with all zeros.
80 *
81 * @param n Size of the state
82 * @return New state initialized with all zeros
83 */
84 static State Zero(int n);
85};
86
87#endif // SVZERODSOLVER_ALGEBRA_STATE_HPP_
State of the system.
Definition State.h:46
static State Zero(int n)
Construct a new State object and initilaize with all zeros.
Definition State.cpp:47
Eigen::Matrix< double, Eigen::Dynamic, 1 > ydot
Derivate of y.
Definition State.h:50
State()
Construct a new State object.
Definition State.cpp:33
Eigen::Matrix< double, Eigen::Dynamic, 1 > y
Vector of solution quantities.
Definition State.h:49
~State()
Destroy the State object.
Definition State.cpp:40