dtk_adapter.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2014 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
3 
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License, or (at your option) any later version.
8 
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
13 
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 
18 
19 
20 #ifndef DTKADAPTER_H
21 #define DTKADAPTER_H
22 
23 #include "libmesh/libmesh_config.h"
24 
25 #ifdef LIBMESH_HAVE_DTK
26 
27 #include "libmesh/dtk_evaluator.h"
28 
29 #include <DTK_MeshManager.hpp>
30 #include <DTK_MeshContainer.hpp>
31 #include <DTK_MeshTraits.hpp>
32 #include <DTK_MeshTraitsFieldAdapter.hpp>
33 #include <DTK_FieldManager.hpp>
34 #include <DTK_FieldContainer.hpp>
35 #include <DTK_FieldEvaluator.hpp>
36 
37 #include <Teuchos_RCP.hpp>
38 #include <Teuchos_ArrayRCP.hpp>
39 
40 namespace libMesh {
41 
43 {
44 public:
45  DTKAdapter(Teuchos::RCP<const Teuchos::Comm<int> > in_comm, EquationSystems & in_es);
46 
47  typedef DataTransferKit::MeshContainer<int> MeshContainerType;
48  typedef DataTransferKit::FieldContainer<double> FieldContainerType;
49  typedef DataTransferKit::MeshTraits<MeshContainerType>::global_ordinal_type GlobalOrdinal;
50  typedef DataTransferKit::FieldEvaluator<GlobalOrdinal,FieldContainerType> EvaluatorType;
51  typedef Teuchos::RCP<EvaluatorType> RCP_Evaluator;
52 
53 
54  Teuchos::RCP<DataTransferKit::MeshManager<MeshContainerType> > get_mesh_manager() { return mesh_manager; }
55  RCP_Evaluator get_variable_evaluator(std::string var_name);
56  Teuchos::RCP<DataTransferKit::FieldManager<MeshContainerType> > get_target_coords() { return target_coords; }
57  Teuchos::RCP<DataTransferKit::FieldManager<FieldContainerType> > get_values_to_fill(std::string var_name);
58 
63  void update_variable_values(std::string var_name);
64 
65 protected:
71  System * find_sys(std::string var_name);
72 
76  DataTransferKit::DTK_ElementTopology get_element_topology(const Elem * elem);
77 
82  void get_semi_local_nodes(std::set<unsigned int> & semi_local_nodes);
83 
84  Teuchos::RCP<const Teuchos::Comm<int> > comm;
86  const MeshBase & mesh;
87  unsigned int dim;
88 
89  unsigned int num_local_nodes;
90  Teuchos::ArrayRCP<int> vertices;
91 
92  Teuchos::RCP<DataTransferKit::MeshManager<MeshContainerType> > mesh_manager;
94  Teuchos::RCP<DataTransferKit::FieldManager<MeshContainerType> > target_coords;
95 
97  std::map<std::string, Teuchos::RCP<DataTransferKit::FieldManager<FieldContainerType> > > values_to_fill;
98 
100  std::map<std::string, RCP_Evaluator> evaluators;
101 };
102 
103 } // namespace libMesh
104 
105 #endif // #ifdef LIBMESH_HAVE_DTK
106 
107 #endif // #define DTKADAPTER_H

Site Created By: libMesh Developers
Last modified: February 07 2014 16:57:04 UTC

Hosted By:
SourceForge.net Logo