Panzer Version of the Day
Loading...
Searching...
No Matches
Panzer_STK_SetupUtilities_impl.hpp
Go to the documentation of this file.
1// @HEADER
2// *****************************************************************************
3// Panzer: A partial differential equation assembly
4// engine for strongly coupled complex multiphysics systems
5//
6// Copyright 2011 NTESS and the Panzer contributors.
7// SPDX-License-Identifier: BSD-3-Clause
8// *****************************************************************************
9// @HEADER
10
11#ifndef PANZER_STK_SETUP_UTILITIES_IMPL_HPP
12#define PANZER_STK_SETUP_UTILITIES_IMPL_HPP
13
14namespace panzer_stk {
15namespace workset_utils {
16
18template<typename ArrayT>
20 std::string blockId,
21 std::vector<std::size_t>& localIds,
22 ArrayT & vertices) {
23
24 std::vector<stk::mesh::Entity> elements;
25 mesh.getMyElements(blockId,elements);
26
27 // loop over elements of this block
28 for(std::size_t elm=0;elm<elements.size();++elm) {
29 stk::mesh::Entity element = elements[elm];
30
31 localIds.push_back(mesh.elementLocalId(element));
32 }
33
34 // get vertices (this is slightly faster then the local id version)
35 mesh.getElementVertices(elements,blockId,vertices);
36}
38
39template<typename ArrayT>
41 std::string blockId,
42 std::vector<std::size_t>& localIds,
43 ArrayT & nodes) {
44
45 std::vector<stk::mesh::Entity> elements;
46 mesh.getMyElements(blockId,elements);
47
48 // loop over elements of this block
49 for(std::size_t elm=0;elm<elements.size();++elm) {
50 stk::mesh::Entity element = elements[elm];
51
52 localIds.push_back(mesh.elementLocalId(element));
53 }
54
55 // get nodes (this is slightly faster then the local id version)
56 mesh.getElementNodes(elements,blockId,nodes);
57}
58}
59}
60
61#endif
void getElementVertices(const std::vector< std::size_t > &localIds, ArrayT &vertices) const
void getElementNodes(const std::vector< std::size_t > &localIds, ArrayT &nodes) const
std::size_t elementLocalId(stk::mesh::Entity elmt) const
void getMyElements(std::vector< stk::mesh::Entity > &elements) const
void getIdsAndNodes(const panzer_stk::STK_Interface &mesh, std::string blockId, std::vector< std::size_t > &localIds, ArrayT &nodes)
void getIdsAndVertices(const panzer_stk::STK_Interface &mesh, std::string blockId, std::vector< std::size_t > &localIds, ArrayT &vertices)