Panzer Version of the Day
Loading...
Searching...
No Matches
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
58
59namespace panzer {
60
61
74Teuchos::RCP<Epetra_IntVector>
76
87Teuchos::RCP<const Epetra_IntVector>
89 const Teuchos::RCP<const Epetra_IntVector> & reducedVec=Teuchos::null);
90
105 std::vector<int> & fieldNumbers,
106 const Teuchos::RCP<const Epetra_IntVector> & reducedVec=Teuchos::null);
107
120template <typename ScalarT,typename ArrayT>
121void updateGhostedDataReducedVectorEpetra(const std::string & fieldName,const std::string blockId,
122 const GlobalIndexer & ugi,
123 const ArrayT & data,
124 Epetra_MultiVector & dataVector);
125
135Teuchos::RCP<const Epetra_BlockMap>
136getFieldMapEpetra(int fieldNum,const Epetra_IntVector & fieldVector);
137
138
142public:
146 ArrayToFieldVectorEpetra(const Teuchos::RCP<const GlobalIndexer> & ugi);
147
157 template <typename ScalarT,typename ArrayT>
158 Teuchos::RCP<Epetra_MultiVector>
159 getGhostedDataVector(const std::string & fieldName,const std::map<std::string,ArrayT> & data) const;
160
170 template <typename ScalarT,typename ArrayT>
171 Teuchos::RCP<Epetra_MultiVector>
172 getDataVector(const std::string & fieldName,const std::map<std::string,ArrayT> & data) const;
173
178 Teuchos::RCP<const Epetra_Map>
179 getFieldMap(const std::string & fieldName) const;
180
185 Teuchos::RCP<const Epetra_Map>
186 getFieldMap(int fieldNum) const;
187
188protected:
192
194 void buildFieldVector(const Epetra_IntVector & source) const;
195
197 Teuchos::RCP<const GlobalIndexer> ugi_;
198
199 Teuchos::RCP<const IntVector> gh_reducedFieldVector_;
200 Teuchos::RCP<const IntVector> gh_fieldVector_;
201
202 mutable std::map<int,Teuchos::RCP<const Map>> gh_reducedFieldMaps_;
203 mutable std::map<int,Teuchos::RCP<const Map>> gh_fieldMaps_;
204
205 mutable Teuchos::RCP<const IntVector> fieldVector_;
206 mutable std::map<int,Teuchos::RCP<const Map>> fieldMaps_;
207
208private:
209 // hide some constructors
212};
213
214
215} // end namspace panzer
216
218
219#endif
Teuchos::RCP< const GlobalIndexer > ugi_
DOF mapping.
ArrayToFieldVectorEpetra(const ArrayToFieldVectorEpetra &)
std::map< int, Teuchos::RCP< const Map > > gh_reducedFieldMaps_
ghosted field vector
std::map< int, Teuchos::RCP< const Map > > gh_fieldMaps_
Maps for each field (as needed)
ArrayToFieldVectorEpetra()
Maps for each field (as needed)
void buildFieldVector(const Epetra_IntVector &source) const
build unghosted field vector from ghosted field vector
Teuchos::RCP< const Epetra_Map > getFieldMap(const std::string &fieldName) const
Teuchos::RCP< const IntVector > gh_fieldVector_
ghosted reduced field vector
Teuchos::RCP< Epetra_MultiVector > getGhostedDataVector(const std::string &fieldName, const std::map< std::string, ArrayT > &data) const
ArrayToFieldVectorEpetra(const Teuchos::RCP< const GlobalIndexer > &ugi)
Teuchos::RCP< const IntVector > fieldVector_
Maps for each field (as needed)
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< const Epetra_Map > getFieldMap(int fieldNum) const
void updateGhostedDataReducedVectorEpetra(const std::string &fieldName, const std::string blockId, const GlobalIndexer &ugi, const ArrayT &data, Epetra_MultiVector &dataVector)
Teuchos::RCP< const Epetra_IntVector > buildGhostedFieldVectorEpetra(const GlobalIndexer &ugi, const Teuchos::RCP< const Epetra_IntVector > &reducedVec=Teuchos::null)
Teuchos::RCP< const Epetra_BlockMap > getFieldMapEpetra(int fieldNum, const Epetra_IntVector &fieldVector)
Teuchos::RCP< Epetra_IntVector > buildGhostedFieldReducedVectorEpetra(const GlobalIndexer &ugi)