MAST
Multidisciplinary-design Adaptation and Sensitivity Toolkit (MAST)
system_initialization.h
Go to the documentation of this file.
1 /*
2  * MAST: Multidisciplinary-design Adaptation and Sensitivity Toolkit
3  * Copyright (C) 2013-2020 Manav Bhatia and MAST authors
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18  */
19 
20 #ifndef __mast__system_initialization__
21 #define __mast__system_initialization__
22 
23 // C++ includes
24 #include <memory>
25 #include <vector>
26 
27 // MAST includes
28 #include "base/mast_data_types.h"
29 
30 // libMesh includes
31 #include "libmesh/fe_type.h"
32 
33 
34 namespace MAST {
35 
36  // Forward declerations
37  class NonlinearSystem;
38  template <typename ValType> class FieldFunction;
39 
40 
42  public:
49  const std::string& prefix);
50 
54  virtual ~SystemInitialization();
55 
56 
60  unsigned int n_vars() const;
61 
66  const libMesh::FEType& fetype(unsigned int i) const;
67 
68 
74  return _system;
75  }
76 
81  const MAST::NonlinearSystem& system() const {
82  return _system;
83  }
84 
88  const std::vector<unsigned int> vars() const {
89  return _vars;
90  }
91 
96  const std::string& prefix() const {
97  return _prefix;
98  }
99 
100 
105  void initialize_solution(const RealVectorX& sol);
106 
112 
113 
114  protected:
115 
117 
118  std::vector<unsigned int> _vars;
119 
120  std::string _prefix;
121  };
122 }
123 
124 
125 #endif //__mast__system_initialization__
const MAST::NonlinearSystem & system() const
MAST::NonlinearSystem & system()
void initialize_solution(const RealVectorX &sol)
initializes the FE solution vector to the constant solution provided in sol.
std::vector< unsigned int > _vars
This class implements a system for solution of nonlinear systems.
const std::string & prefix() const
virtual ~SystemInitialization()
virtual destructor
const libMesh::FEType & fetype(unsigned int i) const
SystemInitialization(MAST::NonlinearSystem &sys, const std::string &prefix)
initialize the variables in the provided system sys of order and family.
Matrix< Real, Dynamic, 1 > RealVectorX
const std::vector< unsigned int > vars() const
MAST::NonlinearSystem & _system