Panzer  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Panzer_GatherSolution_Epetra_decl.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_GatherSolution_Epetra_decl_hpp__
44 #define __Panzer_GatherSolution_Epetra_decl_hpp__
45 
47 //
48 // Include Files
49 //
51 
52 // Panzer
56 #include "Panzer_Traits.hpp"
57 
58 // Phalanx
59 #include "Phalanx_Evaluator_Macros.hpp"
60 #include "Phalanx_MDField.hpp"
61 
63 //
64 // Forward Declarations
65 //
67 
68 namespace panzer
69 {
70  template<typename LocalOrdinalT, typename GlobalOrdinalT>
71  class UniqueGlobalIndexer;
72 }
73 
74 namespace panzer
75 {
84  template<typename EvalT, typename TRAITS, typename LO, typename GO>
86 
97  template<typename TRAITS, typename LO, typename GO>
98  class GatherSolution_Epetra<panzer::Traits::Residual, TRAITS, LO, GO>
99  :
100  public panzer::EvaluatorWithBaseImpl<TRAITS>,
101  public PHX::EvaluatorDerived<panzer::Traits::Residual, TRAITS>,
103  {
104  public:
105 
116  :
117  globalIndexer_(indexer)
118  {
119  } // end of Constructor
120 
135  const Teuchos::ParameterList& p);
136 
145  void
146  postRegistrationSetup(
147  typename TRAITS::SetupData d,
149 
162  void
163  preEvaluate(
164  typename TRAITS::PreEvalData d);
165 
174  void
175  evaluateFields(
176  typename TRAITS::EvalData d);
177 
192  const Teuchos::ParameterList& pl) const
193  {
194  using panzer::Traits;
195  using Teuchos::rcp;
197  (globalIndexer_, pl));
198  } // end of clone()
199 
200  private:
201 
205  typedef typename panzer::Traits::Residual EvalT;
206 
211 
217 
221  std::vector<int> fieldIds_;
222 
226  std::vector<PHX::MDField<ScalarT, Cell, NODE>> gatherFields_;
227 
231  std::vector<std::string> indexerNames_;
232 
238 
242  std::string globalDataKey_;
243 
248 
255 
260 
271  std::vector<std::vector<PHX::MDField<const ScalarT, Cell, NODE>>>
273 
278 
279  }; // end of class GatherSolution_Epetra (Residual specialization)
280 
291  template<typename TRAITS, typename LO, typename GO>
292  class GatherSolution_Epetra<panzer::Traits::Tangent, TRAITS, LO, GO>
293  :
294  public panzer::EvaluatorWithBaseImpl<TRAITS>,
295  public PHX::EvaluatorDerived<panzer::Traits::Tangent, TRAITS>,
297  {
298  public:
299 
310  :
311  globalIndexer_(indexer)
312  {
313  } // end of Constructor
314 
329  const Teuchos::ParameterList& p);
330 
339  void
340  postRegistrationSetup(
341  typename TRAITS::SetupData d,
343 
356  void
357  preEvaluate(
358  typename TRAITS::PreEvalData d);
359 
369  void
370  evaluateFields(
371  typename TRAITS::EvalData d);
372 
387  const Teuchos::ParameterList& pl) const
388  {
389  using panzer::Traits;
390  using Teuchos::rcp;
392  (globalIndexer_, pl));
393  } // end of clone()
394 
395  private:
396 
400  typedef typename panzer::Traits::Tangent EvalT;
401 
406 
412 
416  std::vector<int> fieldIds_;
417 
421  std::vector<PHX::MDField<ScalarT, Cell, NODE>> gatherFields_;
422 
426  std::vector<std::string> indexerNames_;
427 
433 
437  std::string globalDataKey_;
438 
443 
450 
455 
461  std::vector<std::vector<PHX::MDField<const ScalarT, Cell, NODE>>>
463 
468 
469  }; // end of class GatherSolution_Epetra (Tangent specialization)
470 
481  template<typename TRAITS, typename LO, typename GO>
482  class GatherSolution_Epetra<panzer::Traits::Jacobian, TRAITS, LO, GO>
483  :
484  public panzer::EvaluatorWithBaseImpl<TRAITS>,
485  public PHX::EvaluatorDerived<panzer::Traits::Jacobian, TRAITS>,
487  {
488  public:
489 
500  :
501  globalIndexer_(indexer)
502  {
503  } // end of Constructor
504 
518  const Teuchos::ParameterList& p);
519 
528  void
529  postRegistrationSetup(
530  typename TRAITS::SetupData d,
532 
546  void
547  preEvaluate(
548  typename TRAITS::PreEvalData d);
549 
559  void
560  evaluateFields(
561  typename TRAITS::EvalData d);
562 
577  const Teuchos::ParameterList& pl) const
578  {
579  using panzer::Traits;
580  using Teuchos::rcp;
582  (globalIndexer_, pl));
583  } // end of clone()
584 
585  private:
586 
590  typedef typename panzer::Traits::Jacobian EvalT;
591 
596 
602 
606  std::vector<int> fieldIds_;
607 
611  std::vector<PHX::MDField<ScalarT, Cell, NODE>> gatherFields_;
612 
616  std::vector<std::string> indexerNames_;
617 
623 
628 
632  std::string sensitivitiesName_;
633 
639 
643  std::string globalDataKey_;
644 
651 
656 
663 
668 
669  }; // end of class GatherSolution_Epetra (Jacobian specialization)
670 
671 } // end of namespace panzer
672 
673 #ifdef Panzer_BUILD_HESSIAN_SUPPORT
675 #endif // Panzer_BUILD_HESSIAN_SUPPORT
676 
677 #endif // __Panzer_GatherSolution_Epetra_decl_hpp__
std::vector< PHX::MDField< ScalarT, Cell, NODE > > gatherFields_
The fields to be gathered.
Teuchos::RCP< const panzer::UniqueGlobalIndexer< LO, GO > > globalIndexer_
Maps the local (field, element, basis) triplet to a global ID for scattering.
bool hasTangentFields_
A flag indicating whether or not we have tangent fields.
Gathers solution values from the Newton solution vector into the nodal fields of the field manager...
std::vector< std::string > indexerNames_
A list of the names of the fields to be gathered.
bool hasTangentFields_
A flag indicating whether or not we have tangent fields.
std::string sensitivitiesName_
Sets which gather operations have sensitivities.
std::vector< std::string > indexerNames_
A list of the names of the fields to be gathered.
Teuchos::RCP< panzer::EpetraVector_ReadOnly_GlobalEvaluationData > xEvRoGed_
The GlobalEvaluationData containing both the owned and ghosted vectors.
std::vector< std::string > indexerNames_
A list of the names of the fields to be gathered.
Teuchos::RCP< panzer::EpetraVector_ReadOnly_GlobalEvaluationData > xEvRoGed_
The GlobalEvaluationData containing both the owned and ghosted vectors.
GatherSolution_Epetra(const Teuchos::RCP< const panzer::UniqueGlobalIndexer< LO, GO >> &indexer)
Constructor.
std::vector< std::vector< PHX::MDField< const ScalarT, Cell, NODE > > > tangentFields_
Fields for storing the tangent components of the solution vector .
bool useTimeDerivativeSolutionVector_
A flag indicating whether we&#39;re to be working with or .
bool applySensitivities_
Used by evaluateFields() to turn on/off a certain set of sensitivities.
bool useTimeDerivativeSolutionVector_
A flag indicating whether we should be working with or .
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Wrapper to PHX::EvaluatorWithBaseImpl that implements Panzer-specific helpers.
Teuchos::RCP< panzer::EpetraVector_ReadOnly_GlobalEvaluationData > xEvRoGed_
The GlobalEvaluationData containing both the owned and ghosted vectors.
std::vector< PHX::MDField< ScalarT, Cell, NODE > > gatherFields_
The fields to be gathered.
Teuchos::RCP< const panzer::UniqueGlobalIndexer< LO, GO > > globalIndexer_
Maps the local (field, element, basis) triplet to a global ID for scattering.
virtual Teuchos::RCP< CloneableEvaluator > clone(const Teuchos::ParameterList &pl) const
Create a copy.
GatherSolution_Epetra(const Teuchos::RCP< const panzer::UniqueGlobalIndexer< LO, GO >> &indexer)
Constructor.
virtual Teuchos::RCP< CloneableEvaluator > clone(const Teuchos::ParameterList &pl) const
Create a copy.
bool useTimeDerivativeSolutionVector_
A flag indicating whether we&#39;re to be working with or .
Teuchos::RCP< const panzer::UniqueGlobalIndexer< LO, GO > > globalIndexer_
Maps the local (field, element, basis) triplet to a global ID for scattering.
GatherSolution_Epetra(const Teuchos::RCP< const panzer::UniqueGlobalIndexer< LO, GO >> &indexer)
Constructor.
virtual Teuchos::RCP< CloneableEvaluator > clone(const Teuchos::ParameterList &pl) const
Create a copy.
std::vector< PHX::MDField< ScalarT, Cell, NODE > > gatherFields_
The fields to be gathered.
std::vector< std::vector< PHX::MDField< const ScalarT, Cell, NODE > > > tangentFields_
Fields for storing the tangent components of the solution vector .
Non-templated empty base class for template managers.