NimbleSM
NimbleSM is a solid mechanics simulation code for dynamic systems
Loading...
Searching...
No Matches
nimble_exodus_output.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_EXODUS_OUTPUT_H
45#define NIMBLE_EXODUS_OUTPUT_H
46
47#include "nimble_genesis_mesh.h"
48
49#ifdef NIMBLE_HAVE_DARMA
50#include "darma.h"
51#else
52#include <map>
53#include <vector>
54#endif
55
56namespace nimble {
57
59{
60 public:
62 : filename_("none"),
63 CPU_word_size_(sizeof(double)),
64 IO_word_size_(sizeof(double)),
65 dim_(0),
66 num_nodes_(0),
68 num_blocks_(0),
72 {
73 }
74
75#ifdef NIMBLE_HAVE_DARMA
76 template <typename ArchiveType>
77 void
78 serialize(ArchiveType& ar)
79 {
82 }
83#endif
84
85 void
86 Initialize(std::string const& filename, GenesisMesh const& genesis_mesh);
87
88 virtual ~ExodusOutput() {}
89
90 std::string
92 {
93 return filename_;
94 }
95
96 void
98 GenesisMesh const& genesis_mesh,
99 std::vector<std::string> const& global_data_names,
100 std::vector<std::string> const& node_data_names,
101 std::map<int, std::vector<std::string>> const& elem_data_names,
102 std::map<int, std::vector<std::string>> const& derived_elem_data_names);
103
104 void
105 WriteStep(
106 double time,
107 std::vector<double> const& global_data,
108 std::vector<std::vector<double>> const& node_data,
109 std::map<int, std::vector<std::string>> const& elem_data_names,
110 std::map<int, std::vector<std::vector<double>>> const& elem_data,
111 std::map<int, std::vector<std::string>> const& derived_elem_data_names,
112 std::map<int, std::vector<std::vector<double>>> const& derived_elem_data);
113
114 void
116 GenesisMesh const& genesis_mesh,
117 std::vector<std::string> const& global_data_names,
118 std::vector<std::string> const& node_data_names,
119 std::map<int, std::vector<std::string>> const& elem_data_names,
120 std::map<int, std::vector<std::string>> const& derived_elem_data_names);
121
122 void
124 double time,
125 std::vector<double> const& global_data,
126 std::vector<std::vector<double>> const& node_data,
127 std::map<int, std::vector<std::string>> const& elem_data_names,
128 std::map<int, std::vector<std::vector<double>>> const& elem_data,
129 std::map<int, std::vector<std::string>> const& derived_elem_data_names,
130 std::map<int, std::vector<std::vector<double>>> const& derived_elem_data);
131
132 protected:
133 void
134 ReportExodusError(int error_code, const char* method_name, const char* exodus_method_name);
135
136 void
137 WriteQARecord(int exodus_file_id);
138
139 std::string filename_;
142 int dim_;
147 std::vector<int> all_block_ids_;
148 std::vector<int> block_ids_;
152 std::map<std::string, int> elem_data_index_;
153};
154
155} // namespace nimble
156
157#endif // NIMBLE_OUTPUT_EXODUS_H
int num_side_sets_
Definition nimble_exodus_output.h:150
int num_nodes_
Definition nimble_exodus_output.h:143
void ReportExodusError(int error_code, const char *method_name, const char *exodus_method_name)
Definition nimble_exodus_output.cc:592
int num_node_sets_
Definition nimble_exodus_output.h:149
std::vector< int > all_block_ids_
Definition nimble_exodus_output.h:147
std::map< std::string, int > elem_data_index_
Definition nimble_exodus_output.h:152
std::string GetFileName() const
Definition nimble_exodus_output.h:91
std::vector< int > block_ids_
Definition nimble_exodus_output.h:148
int CPU_word_size_
Definition nimble_exodus_output.h:140
ExodusOutput()
Definition nimble_exodus_output.h:61
int num_global_blocks_
Definition nimble_exodus_output.h:146
void WriteStep(double time, std::vector< double > const &global_data, std::vector< std::vector< double > > const &node_data, std::map< int, std::vector< std::string > > const &elem_data_names, std::map< int, std::vector< std::vector< double > > > const &elem_data, std::map< int, std::vector< std::string > > const &derived_elem_data_names, std::map< int, std::vector< std::vector< double > > > const &derived_elem_data)
Definition nimble_exodus_output.cc:315
void WriteQARecord(int exodus_file_id)
Definition nimble_exodus_output.cc:552
int num_blocks_
Definition nimble_exodus_output.h:145
int exodus_write_count_
Definition nimble_exodus_output.h:151
int num_elements_
Definition nimble_exodus_output.h:144
std::string filename_
Definition nimble_exodus_output.h:139
void WriteStepTextFile(double time, std::vector< double > const &global_data, std::vector< std::vector< double > > const &node_data, std::map< int, std::vector< std::string > > const &elem_data_names, std::map< int, std::vector< std::vector< double > > > const &elem_data, std::map< int, std::vector< std::string > > const &derived_elem_data_names, std::map< int, std::vector< std::vector< double > > > const &derived_elem_data)
Definition nimble_exodus_output.cc:497
virtual ~ExodusOutput()
Definition nimble_exodus_output.h:88
int dim_
Definition nimble_exodus_output.h:142
int IO_word_size_
Definition nimble_exodus_output.h:141
void Initialize(std::string const &filename, GenesisMesh const &genesis_mesh)
Definition nimble_exodus_output.cc:65
void InitializeDatabase(GenesisMesh const &genesis_mesh, std::vector< std::string > const &global_data_names, std::vector< std::string > const &node_data_names, std::map< int, std::vector< std::string > > const &elem_data_names, std::map< int, std::vector< std::string > > const &derived_elem_data_names)
Definition nimble_exodus_output.cc:79
void InitializeDatabaseTextFile(GenesisMesh const &genesis_mesh, std::vector< std::string > const &global_data_names, std::vector< std::string > const &node_data_names, std::map< int, std::vector< std::string > > const &elem_data_names, std::map< int, std::vector< std::string > > const &derived_elem_data_names)
Definition nimble_exodus_output.cc:399
Definition nimble_genesis_mesh.h:59
Definition kokkos_contact_manager.h:49