 |
waves
Basic FE playground
|
Go to the documentation of this file. 1 #ifndef KATOPTRON_SOURCESLIST_H
2 #define KATOPTRON_SOURCESLIST_H
10 #include <Tpetra_Map.hpp>
11 #include <Tpetra_Vector.hpp>
12 #include <Teuchos_RCP.hpp>
13 #include <Kokkos_ViewFactory.hpp>
21 template <
typename scalar>
40 SourcesList(
Problem &pbl, Teuchos::RCP<Map> map, Teuchos::RCP<ElementsList> elementsList);
106 template <
typename scalar>
112 sources_number = pbl.
Sources.size();
115 std::vector<std::vector<global_ordinal_type>> SourceElems = {};
117 for (
auto i = 0; i < sources_number; ++i)
119 std::vector<global_ordinal_type> mySourceElems = {};
121 for (
auto j = 0; j < pbl.
Sources[i]->tag->elems.size(); ++j)
125 if (elementsList->getElementType(e) ==
static_cast<int>(tbox::ELTYPE::TETRA4))
127 else if (elementsList->getElementType(e) ==
static_cast<int>(tbox::ELTYPE::HEX8))
132 mySourceElems.push_back(e);
135 SourceElems.push_back(mySourceElems);
136 if (maxNumElemsPerSource < mySourceElems.size())
137 maxNumElemsPerSource = mySourceElems.size();
141 sources_elements = 1;
142 sources_elementsList = Kokkos::View<int **, Kokkos::LayoutRight>(
"R", sources_number, sources_elements + maxNumElemsPerSource);
144 for (
auto i = 0; i < sources_number; ++i)
146 sources_elementsList(i, sources_size) = SourceElems[i].size();
148 for (
auto j = 0; j < SourceElems[i].size(); ++j)
149 sources_elementsList(i, sources_elements + j) = SourceElems[i][j];
154 sources_values_list = Kokkos::View<scalar ***, Kokkos::LayoutRight>(
"R", sources_number, 1, 2);
155 for (
auto i = 0; i < sources_number; ++i)
157 sources_values_list(i, 0, sources_time) = 0.;
159 sources_values_list(i, 0, sources_values) = pbl.
Sources[i]->value;
164 #endif //KATOPTRON_SOURCESLIST_H
int local_ordinal_type
Definition: Map.h:27
local_ordinal_type sources_values
Definition: SourcesList.h:36
Map::local_ordinal_type local_ordinal_type
Definition: SourcesList.h:24
local_ordinal_type sources_elements
Definition: SourcesList.h:33
local_ordinal_type getSourceElement(local_ordinal_type i, local_ordinal_type ea)
Return the local ID of the element e1 of a source.
Definition: SourcesList.h:71
scalar getSourceValue(local_ordinal_type i)
Return the value of the source.
Definition: SourcesList.h:84
int global_ordinal_type
Definition: Map.h:28
Class which is used to store the list of the volumetric heat sources.
Definition: SourcesList.h:22
katoptron::Map::local_ordinal_type local_ordinal_type
Definition: ResultsETI.cpp:4
local_ordinal_type getSourceNumber()
Return the number of sources.
Definition: SourcesList.h:45
Kokkos::View< scalar ***, Kokkos::LayoutRight > sources_values_list
Definition: SourcesList.h:29
local_ordinal_type sources_time
Definition: SourcesList.h:35
std::vector< Source * > Sources
Definition: wProblem.h:30
Map::global_ordinal_type global_ordinal_type
Definition: SourcesList.h:25
katoptron namespace
Definition: Algebraic.h:18
local_ordinal_type sources_size
Definition: SourcesList.h:32
Class which is used to specify in Python the thermomechanical to solve.
Definition: wProblem.h:19
local_ordinal_type sources_number
Definition: SourcesList.h:31
Kokkos::View< int **, Kokkos::LayoutRight > sources_elementsList
Definition: SourcesList.h:28
local_ordinal_type getSourceSize(local_ordinal_type i)
Return the number of elements for a given source.
Definition: SourcesList.h:56
katoptron::Map::global_ordinal_type global_ordinal_type
Definition: ResultsETI.cpp:5