Panzer  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Panzer_GlobalIndexer_EpetraUtilities.hpp
Go to the documentation of this file.
1 // @HEADER
2 // ***********************************************************************
3 //
4 // Panzer: A partial differential equation assembly
5 // engine for strongly coupled complex multiphysics systems
6 // Copyright (2011) Sandia Corporation
7 //
8 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
9 // the U.S. Government retains certain rights in this software.
10 //
11 // Redistribution and use in source and binary forms, with or without
12 // modification, are permitted provided that the following conditions are
13 // met:
14 //
15 // 1. Redistributions of source code must retain the above copyright
16 // notice, this list of conditions and the following disclaimer.
17 //
18 // 2. Redistributions in binary form must reproduce the above copyright
19 // notice, this list of conditions and the following disclaimer in the
20 // documentation and/or other materials provided with the distribution.
21 //
22 // 3. Neither the name of the Corporation nor the names of the
23 // contributors may be used to endorse or promote products derived from
24 // this software without specific prior written permission.
25 //
26 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
27 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
30 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
31 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
32 // 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 Roger P. Pawlowski (rppawlo@sandia.gov) and
39 // Eric C. Cyr (eccyr@sandia.gov)
40 // ***********************************************************************
41 // @HEADER
42 
43 #ifndef __Panzer_GlobalIndexer_EpetraUtilities_decl_hpp__
44 #define __Panzer_GlobalIndexer_EpetraUtilities_decl_hpp__
45 
46 #include <map>
47 #include <string>
48 
49 #include <unordered_map>
50 
51 #include <Panzer_NodeType.hpp>
52 #include <Epetra_Vector.h>
53 #include <Epetra_IntVector.h>
54 #include <Epetra_MultiVector.h>
55 
56 #include "Panzer_GlobalIndexer.hpp"
57 #include "Panzer_FieldPattern.hpp"
58 
59 namespace panzer {
60 
61 
75 buildGhostedFieldReducedVectorEpetra(const GlobalIndexer & ugi);
76 
88 buildGhostedFieldVectorEpetra(const GlobalIndexer & ugi,
89  const Teuchos::RCP<const Epetra_IntVector> & reducedVec=Teuchos::null);
90 
104 void buildGhostedFieldVectorEpetra(const GlobalIndexer & ugi,
105  std::vector<int> & fieldNumbers,
106  const Teuchos::RCP<const Epetra_IntVector> & reducedVec=Teuchos::null);
107 
120 template <typename ScalarT,typename ArrayT>
121 void updateGhostedDataReducedVectorEpetra(const std::string & fieldName,const std::string blockId,
122  const GlobalIndexer & ugi,
123  const ArrayT & data,
124  Epetra_MultiVector & dataVector);
125 
136 getFieldMapEpetra(int fieldNum,const Epetra_IntVector & fieldVector);
137 
138 
142 public:
147 
157  template <typename ScalarT,typename ArrayT>
159  getGhostedDataVector(const std::string & fieldName,const std::map<std::string,ArrayT> & data) const;
160 
170  template <typename ScalarT,typename ArrayT>
172  getDataVector(const std::string & fieldName,const std::map<std::string,ArrayT> & data) const;
173 
179  getFieldMap(const std::string & fieldName) const;
180 
186  getFieldMap(int fieldNum) const;
187 
188 protected:
192 
194  void buildFieldVector(const Epetra_IntVector & source) const;
195 
198 
201 
202  mutable std::map<int,Teuchos::RCP<const Map>> gh_reducedFieldMaps_;
203  mutable std::map<int,Teuchos::RCP<const Map>> gh_fieldMaps_;
204 
206  mutable std::map<int,Teuchos::RCP<const Map>> fieldMaps_;
207 
208 private:
209  // hide some constructors
212 };
213 
214 
215 } // end namspace panzer
216 
218 
219 #endif
std::map< int, Teuchos::RCP< const Map > > fieldMaps_
(unghosted) field vector (as needed)
Teuchos::RCP< Epetra_MultiVector > getDataVector(const std::string &fieldName, const std::map< std::string, ArrayT > &data) const
Teuchos::RCP< Epetra_IntVector > buildGhostedFieldReducedVectorEpetra(const GlobalIndexer &ugi)
Teuchos::RCP< const IntVector > fieldVector_
Maps for each field (as needed)
Teuchos::RCP< const Epetra_IntVector > buildGhostedFieldVectorEpetra(const GlobalIndexer &ugi, const Teuchos::RCP< const Epetra_IntVector > &reducedVec=Teuchos::null)
Teuchos::RCP< const Epetra_Map > getFieldMap(const std::string &fieldName) const
void buildFieldVector(const Epetra_IntVector &source) const
build unghosted field vector from ghosted field vector
std::map< int, Teuchos::RCP< const Map > > gh_fieldMaps_
Maps for each field (as needed)
Teuchos::RCP< const IntVector > gh_fieldVector_
ghosted reduced field vector
Teuchos::RCP< const GlobalIndexer > ugi_
DOF mapping.
Teuchos::RCP< Epetra_MultiVector > getGhostedDataVector(const std::string &fieldName, const std::map< std::string, ArrayT > &data) const
std::map< int, Teuchos::RCP< const Map > > gh_reducedFieldMaps_
ghosted field vector
Teuchos::RCP< const Epetra_BlockMap > getFieldMapEpetra(int fieldNum, const Epetra_IntVector &fieldVector)
ArrayToFieldVectorEpetra()
Maps for each field (as needed)
void updateGhostedDataReducedVectorEpetra(const std::string &fieldName, const std::string blockId, const GlobalIndexer &ugi, const ArrayT &data, Epetra_MultiVector &dataVector)