NimbleSM
NimbleSM is a solid mechanics simulation code for dynamic systems
Loading...
Searching...
No Matches
nimble_uq_model_data.h
Go to the documentation of this file.
1/*
2//@HEADER
3// ************************************************************************
4//
5// NimbleSM
6// Copyright 2018
7// National Technology & Engineering Solutions of Sandia, LLC (NTESS)
8//
9// Under the terms of Contract DE-NA0003525 with NTESS, the U.S. Government
10// retains certain rights in this software.
11//
12// Redistribution and use in source and binary forms, with or without
13// modification, are permitted provided that the following conditions are
14// met:
15//
16// 1. Redistributions of source code must retain the above copyright
17// notice, this list of conditions and the following disclaimer.
18//
19// 2. Redistributions in binary form must reproduce the above copyright
20// notice, this list of conditions and the following disclaimer in the
21// documentation and/or other materials provided with the distribution.
22//
23// 3. Neither the name of the Corporation nor the names of the
24// contributors may be used to endorse or promote products derived from
25// this software without specific prior written permission.
26//
27// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY EXPRESS OR IMPLIED
28// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
29// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
30// NO EVENT SHALL NTESS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
31// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
32// TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
33// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
34// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
35// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
36// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37//
38// Questions? Contact David Littlewood (djlittl@sandia.gov)
39//
40// ************************************************************************
41//@HEADER
42*/
43
44#ifndef NIMBLESM_NIMBLE_UQ_MODEL_DATA_H
45#define NIMBLESM_NIMBLE_UQ_MODEL_DATA_H
46
47#ifdef NIMBLE_HAVE_UQ
48
49#include <map>
50#include <memory>
51
52#include "nimble_model_data.h"
53#include "nimble_view.h"
54
55namespace nimble {
56class UqModel;
57class DataManager;
59
60} // namespace nimble
61
62namespace nimble_uq {
63
64class ModelData : public nimble::ModelData
65{
66 public:
67 ModelData() = default;
68
69 ~ModelData() override = default;
70
71 /// \brief Initialize the different blocks in the mesh
72 ///
73 /// \param data_manager Reference to the data manager
74 /// \param material_factory_base Shared pointer to the material factory
75 void
76 InitializeBlocks(
77 nimble::DataManager& data_manager,
78 const std::shared_ptr<nimble::MaterialFactoryBase>& material_factory_base) override;
79
80 /// \brief Compute the internal force
81 ///
82 /// \param[in] data_manager
83 /// \param[in] time_previous
84 /// \param[in] time_current
85 /// \param[in] is_output_step
86 /// \param[in] displacement
87 /// \param[out] internal_force Output for internal force
88 void
89 ComputeInternalForce(
90 nimble::DataManager& data_manager,
91 double time_previous,
92 double time_current,
93 bool is_output_step,
94 const nimble::Viewify<2>& displacement,
95 nimble::Viewify<2>& force) override;
96
97 /// \brief Write output of simulation in Exodus format
98 ///
99 /// \param[in] data_manager Reference to data manager
100 /// \param[in] time_current Time value
101 void
102 WriteExodusOutput(nimble::DataManager& data_manager, double time_current) override;
103
104 /// \brief Apply initial conditions
105 void
106 ApplyInitialConditions(nimble::DataManager& data_manager) override;
107
108 /// \brief Apply kinematic conditions
109 void
110 ApplyKinematicConditions(nimble::DataManager& data_manager, double time_current, double time_previous) override;
111
112 /// \brief Update model with new velocity
113 ///
114 /// \param[in] data_manager Reference to the data manager
115 /// \param[in] dt Current time step
116 ///
117 /// \note This routine is usually empty.
118 /// The UQ model data is one case using this routine.
119 void
120 UpdateWithNewVelocity(nimble::DataManager& data_manager, double dt) override;
121
122 /// \brief Update model with new displacement
123 ///
124 /// \param[in] data_manager Reference to the data manager
125 /// \param[in] dt Current time step
126 ///
127 /// \note This routine is usually empty.
128 /// The UQ model data is one case using this routine.
129 void
130 UpdateWithNewDisplacement(nimble::DataManager& data_manager, double dt) override;
131
132 protected:
133 std::shared_ptr<nimble::UqModel> uq_model_;
134 std::vector<nimble::Viewify<2>> displacement_views_;
135 std::vector<nimble::Viewify<2>> velocity_views_;
136 std::vector<nimble::Viewify<2>> force_views_;
137 int nunknowns_;
138};
139
140} // namespace nimble_uq
141
142#endif
143
144#endif // NIMBLESM_NIMBLE_UQ_MODEL_DATA_H
Definition nimble_data_manager.h:70
Definition nimble_material_factory_base.h:61
Definition nimble_uq.h:60
Definition kokkos_contact_manager.h:49