NimbleSM
NimbleSM is a solid mechanics simulation code for dynamic systems
Loading...
Searching...
No Matches
nimble_data_utils.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_DATA_UTILS_H
45#define NIMBLE_DATA_UTILS_H
46
47#ifdef NIMBLE_HAVE_DARMA
48#include "darma.h"
49#else
50#include <map>
51#include <string>
52#include <vector>
53#endif
54
55namespace nimble {
56
64
94
101
102int
103LengthToInt(Length length, int dim);
104
105std::string
106AddIntegrationPointPrefix(std::string label, int ipt_number);
107
108std::string
109RemoveIntegrationPointPrefix(std::string label);
110
111bool
112HasIntegrationPointPrefix(std::string label);
113
114int
115LabelToIntegrationPointNumber(std::string label);
116
117std::vector<std::string>
118GetComponentLabels(std::string label, Length length, int dim);
119
120std::string
121GetComponentLabel(std::string label, Length length, int dim, int component_index, int ipt);
122
123class Field
124{
125 public:
127
128 virtual ~Field() {}
129
130#ifdef NIMBLE_HAVE_DARMA
131 template <typename ArchiveType>
132 void
133 serialize(ArchiveType& ar)
134 {
135 ar | id_ | label_ | relation_ | length_;
136 }
137#endif
138
139 int id_;
140 std::string label_;
143};
144
145Length
146LabelToLength(std::string label, std::map<int, Field> const& data_fields, int dim);
147
148} // namespace nimble
149
150#endif
Field()
Definition nimble_data_utils.h:126
Length length_
Definition nimble_data_utils.h:142
Relation relation_
Definition nimble_data_utils.h:141
virtual ~Field()
Definition nimble_data_utils.h:128
std::string label_
Definition nimble_data_utils.h:140
int id_
Definition nimble_data_utils.h:139
Definition kokkos_contact_manager.h:49
std::string RemoveIntegrationPointPrefix(std::string label)
Definition nimble_data_utils.cc:99
Length LabelToLength(std::string label, std::map< int, Field > const &data_fields, int dim)
Definition nimble_data_utils.cc:269
int LabelToIntegrationPointNumber(std::string label)
Definition nimble_data_utils.cc:132
Length
Definition nimble_data_utils.h:66
@ LENGTH_18
Definition nimble_data_utils.h:85
@ LENGTH_8
Definition nimble_data_utils.h:75
@ LENGTH_20
Definition nimble_data_utils.h:87
@ LENGTH_10
Definition nimble_data_utils.h:77
@ LENGTH_3
Definition nimble_data_utils.h:70
@ LENGTH_14
Definition nimble_data_utils.h:81
@ LENGTH_15
Definition nimble_data_utils.h:82
@ LENGTH_17
Definition nimble_data_utils.h:84
@ LENGTH_1
Definition nimble_data_utils.h:68
@ LENGTH_13
Definition nimble_data_utils.h:80
@ SCALAR
Definition nimble_data_utils.h:88
@ LENGTH_16
Definition nimble_data_utils.h:83
@ LENGTH_9
Definition nimble_data_utils.h:76
@ LENGTH_12
Definition nimble_data_utils.h:79
@ LENGTH_7
Definition nimble_data_utils.h:74
@ LENGTH_5
Definition nimble_data_utils.h:72
@ VECTOR
Definition nimble_data_utils.h:89
@ LENGTH_19
Definition nimble_data_utils.h:86
@ SYMMETRIC_TENSOR
Definition nimble_data_utils.h:90
@ LENGTH_0
Definition nimble_data_utils.h:67
@ LENGTH_11
Definition nimble_data_utils.h:78
@ LENTGH_6
Definition nimble_data_utils.h:73
@ LENGTH_4
Definition nimble_data_utils.h:71
@ UNDEFINED_LENGTH
Definition nimble_data_utils.h:92
@ FULL_TENSOR
Definition nimble_data_utils.h:91
@ LENGTH_2
Definition nimble_data_utils.h:69
std::string AddIntegrationPointPrefix(std::string label, int ipt_number)
Definition nimble_data_utils.cc:85
int LengthToInt(Length length, int dim)
Definition nimble_data_utils.cc:57
std::string GetComponentLabel(std::string label, Length length, int dim, int component_index, int ipt)
Definition nimble_data_utils.cc:210
std::vector< std::string > GetComponentLabels(std::string label, Length length, int dim)
Definition nimble_data_utils.cc:159
Relation
Definition nimble_data_utils.h:58
@ NODE
Definition nimble_data_utils.h:60
@ GLOBAL
Definition nimble_data_utils.h:62
@ UNDEFINED_RELATION
Definition nimble_data_utils.h:59
@ ELEMENT
Definition nimble_data_utils.h:61
Step
Definition nimble_data_utils.h:96
@ UNDEFINED_STEP
Definition nimble_data_utils.h:97
@ STEP_NP1
Definition nimble_data_utils.h:99
@ STEP_N
Definition nimble_data_utils.h:98
bool HasIntegrationPointPrefix(std::string label)
Definition nimble_data_utils.cc:124