NimbleSM
NimbleSM is a solid mechanics simulation code for dynamic systems
Loading...
Searching...
No Matches
nimble_block_base.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 NIMBLE_BLOCK_BASE_H
45#define NIMBLE_BLOCK_BASE_H
46
47#include <memory>
48
49#include "nimble_genesis_mesh.h"
50#include "nimble_material.h"
51#include "nimble_view.h"
52
53namespace nimble {
54
55class Element;
56
58{
59 public:
60 BlockBase() = default;
61
62 virtual ~BlockBase() = default;
63
64 virtual void
66
67 double
68 GetDensity() const
69 {
70 return material_->GetDensity();
71 }
72
73 double
75 {
76 return material_->GetBulkModulus();
77 }
78
79 double
81 {
82 return material_->GetShearModulus();
83 }
84
85 std::shared_ptr<Material>
87 {
88 return material_;
89 }
90
91 std::shared_ptr<Element>
93 {
94 return element_;
95 }
96
97 virtual double
99 const nimble::Viewify<2>& node_reference_coordinates,
100 const nimble::Viewify<2>& node_displacements,
101 int num_elem,
102 const int* elem_conn) const;
103
104 template <typename MatT>
105 void
107 int num_global_unknowns,
108 const double* const reference_coordinates,
109 const double* const displacement,
110 int num_elem,
111 const int* const elem_conn,
112 const int* const global_node_ids,
113 MatT& tangent_stiffness) const;
114
115 protected:
116 std::string model_material_parameters_ = "none";
117 std::shared_ptr<Element> element_ = nullptr;
118 std::shared_ptr<Material> material_ = nullptr;
119};
120
121} // namespace nimble
122
123#endif // NIMBLE_BLOCK_BASE_H
std::string model_material_parameters_
Definition nimble_block_base.h:116
std::shared_ptr< Material > material_
Definition nimble_block_base.h:118
void ComputeTangentStiffnessMatrix(int num_global_unknowns, const double *const reference_coordinates, const double *const displacement, int num_elem, const int *const elem_conn, const int *const global_node_ids, MatT &tangent_stiffness) const
Definition nimble_block_base.cc:88
double GetBulkModulus() const
Definition nimble_block_base.h:74
double GetDensity() const
Definition nimble_block_base.h:68
BlockBase()=default
std::shared_ptr< Element > element_
Definition nimble_block_base.h:117
double GetShearModulus() const
Definition nimble_block_base.h:80
virtual void InstantiateElement()=0
std::shared_ptr< Material > GetMaterialPointer() const
Definition nimble_block_base.h:86
virtual ~BlockBase()=default
virtual double ComputeCriticalTimeStep(const nimble::Viewify< 2 > &node_reference_coordinates, const nimble::Viewify< 2 > &node_displacements, int num_elem, const int *elem_conn) const
Definition nimble_block_base.cc:52
std::shared_ptr< Element > GetElementPointer() const
Definition nimble_block_base.h:92
Abstract class for representing an element.
Definition nimble_element.h:57
Definition nimble_view.h:72
Definition kokkos_contact_manager.h:49