waves
Basic FE playground
PreloadList.h
Go to the documentation of this file.
1 #ifndef KATOPTRON_PRELOADLIST_H
2 #define KATOPTRON_PRELOADLIST_H
3 
4 #include "katoptron.h"
5 
6 #include "Map.h"
7 #include "wContact.h"
8 #include "wTag.h"
9 
10 #include <Tpetra_Map.hpp>
11 #include <Tpetra_Vector.hpp>
12 #include <Teuchos_RCP.hpp>
13 #include <Kokkos_ViewFactory.hpp>
14 
15 #include "EnsembleTraits.h"
16 
17 namespace katoptron
18 {
19 
23 template <typename scalar>
25 {
28 
29 private:
30  Kokkos::View<scalar *, Kokkos::LayoutRight> contacts_dg;
31 
32 public:
33  PreloadList(Problem &pbl, Teuchos::RCP<Map> map, Teuchos::RCP<ElementsList> elementsList);
34 
45  {
46  return contacts_dg(i);
47  }
48 };
49 
62 template <typename scalar>
63 PreloadList<scalar>::PreloadList(Problem &pbl, Teuchos::RCP<Map> map, Teuchos::RCP<ElementsList> elementsList)
64 {
65  int contacts_number = pbl.Contacts.size();
66 
67  typedef EnsembleTraits<scalar> ET;
68  const int ensemble_size = ET::size;
69 
70  contacts_dg = Kokkos::View<scalar *, Kokkos::LayoutRight>("R", contacts_number);
71  for (auto i = 0; i < contacts_number; ++i)
72  for (int j = 0; j < ensemble_size; ++j)
73  ET::coeff(contacts_dg(i), j) = pbl.Contacts[i]->dg_vector[j];
74 }
75 }; // namespace katoptron
76 
77 #endif //KATOPTRON_PRELOADLIST_H
katoptron::Map::local_ordinal_type
int local_ordinal_type
Definition: Map.h:27
katoptron::PreloadList::global_ordinal_type
Map::global_ordinal_type global_ordinal_type
Definition: PreloadList.h:27
katoptron::Map::global_ordinal_type
int global_ordinal_type
Definition: Map.h:28
katoptron::PreloadList::getPreloadValue
scalar getPreloadValue(local_ordinal_type i)
Return the value of the preload for a given contact interface.
Definition: PreloadList.h:44
wContact.h
katoptron::PreloadList::contacts_dg
Kokkos::View< scalar *, Kokkos::LayoutRight > contacts_dg
Definition: PreloadList.h:30
EnsembleTraits
Definition: EnsembleTraits.h:8
katoptron
katoptron namespace
Definition: Algebraic.h:18
EnsembleTraits.h
katoptron::Problem
Class which is used to specify in Python the thermomechanical to solve.
Definition: wProblem.h:19
katoptron::Problem::Contacts
std::vector< Contact * > Contacts
Definition: wProblem.h:29
katoptron.h
katoptron::PreloadList::local_ordinal_type
Map::local_ordinal_type local_ordinal_type
Definition: PreloadList.h:26
Map.h
katoptron::PreloadList::PreloadList
PreloadList(Problem &pbl, Teuchos::RCP< Map > map, Teuchos::RCP< ElementsList > elementsList)
NeumannList constructor.
Definition: PreloadList.h:63
katoptron::PreloadList
Class which is used to store the list of the preloads.
Definition: PreloadList.h:24