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  class GlobalIndexer;
71 }
72 
73 namespace panzer
74 {
83  template<typename EvalT, typename TRAITS, typename LO, typename GO>
85 
96  template<typename TRAITS, typename LO, typename GO>
97  class GatherSolution_Epetra<panzer::Traits::Residual, TRAITS, LO, GO>
98  :
99  public panzer::EvaluatorWithBaseImpl<TRAITS>,
100  public PHX::EvaluatorDerived<panzer::Traits::Residual, TRAITS>,
102  {
103  public:
104 
115  :
116  globalIndexer_(indexer)
117  {
118  } // end of Constructor
119 
134  const Teuchos::ParameterList& p);
135 
144  void
145  postRegistrationSetup(
146  typename TRAITS::SetupData d,
148 
161  void
162  preEvaluate(
163  typename TRAITS::PreEvalData d);
164 
173  void
174  evaluateFields(
175  typename TRAITS::EvalData d);
176 
191  const Teuchos::ParameterList& pl) const
192  {
193  using panzer::Traits;
194  using Teuchos::rcp;
196  (globalIndexer_, pl));
197  } // end of clone()
198 
199  private:
200 
204  typedef typename panzer::Traits::Residual EvalT;
205 
210 
216 
220  std::vector<int> fieldIds_;
221 
225  std::vector<PHX::MDField<ScalarT, Cell, NODE>> gatherFields_;
226 
230  std::vector<std::string> indexerNames_;
231 
237 
241  std::string globalDataKey_;
242 
247 
254 
259 
270  std::vector<std::vector<PHX::MDField<const ScalarT, Cell, NODE>>>
272 
277 
278  }; // end of class GatherSolution_Epetra (Residual specialization)
279 
290  template<typename TRAITS, typename LO, typename GO>
291  class GatherSolution_Epetra<panzer::Traits::Tangent, TRAITS, LO, GO>
292  :
293  public panzer::EvaluatorWithBaseImpl<TRAITS>,
294  public PHX::EvaluatorDerived<panzer::Traits::Tangent, TRAITS>,
296  {
297  public:
298 
309  :
310  globalIndexer_(indexer)
311  {
312  } // end of Constructor
313 
328  const Teuchos::ParameterList& p);
329 
338  void
339  postRegistrationSetup(
340  typename TRAITS::SetupData d,
342 
355  void
356  preEvaluate(
357  typename TRAITS::PreEvalData d);
358 
368  void
369  evaluateFields(
370  typename TRAITS::EvalData d);
371 
386  const Teuchos::ParameterList& pl) const
387  {
388  using panzer::Traits;
389  using Teuchos::rcp;
391  (globalIndexer_, pl));
392  } // end of clone()
393 
394  private:
395 
399  typedef typename panzer::Traits::Tangent EvalT;
400 
405 
411 
415  std::vector<int> fieldIds_;
416 
420  std::vector<PHX::MDField<ScalarT, Cell, NODE>> gatherFields_;
421 
425  std::vector<std::string> indexerNames_;
426 
432 
436  std::string globalDataKey_;
437 
442 
449 
454 
460  std::vector<std::vector<PHX::MDField<const ScalarT, Cell, NODE>>>
462 
467 
468  }; // end of class GatherSolution_Epetra (Tangent specialization)
469 
480  template<typename TRAITS, typename LO, typename GO>
481  class GatherSolution_Epetra<panzer::Traits::Jacobian, TRAITS, LO, GO>
482  :
483  public panzer::EvaluatorWithBaseImpl<TRAITS>,
484  public PHX::EvaluatorDerived<panzer::Traits::Jacobian, TRAITS>,
486  {
487  public:
488 
499  :
500  globalIndexer_(indexer)
501  {
502  } // end of Constructor
503 
517  const Teuchos::ParameterList& p);
518 
527  void
528  postRegistrationSetup(
529  typename TRAITS::SetupData d,
531 
545  void
546  preEvaluate(
547  typename TRAITS::PreEvalData d);
548 
558  void
559  evaluateFields(
560  typename TRAITS::EvalData d);
561 
576  const Teuchos::ParameterList& pl) const
577  {
578  using panzer::Traits;
579  using Teuchos::rcp;
581  (globalIndexer_, pl));
582  } // end of clone()
583 
584  private:
585 
589  typedef typename panzer::Traits::Jacobian EvalT;
590 
595 
601 
605  std::vector<int> fieldIds_;
606 
610  std::vector<PHX::MDField<ScalarT, Cell, NODE>> gatherFields_;
611 
615  std::vector<std::string> indexerNames_;
616 
622 
627 
631  std::string sensitivitiesName_;
632 
638 
642  std::string globalDataKey_;
643 
650 
655 
662 
667 
668  }; // end of class GatherSolution_Epetra (Jacobian specialization)
669 
670 } // end of namespace panzer
671 
672 #ifdef Panzer_BUILD_HESSIAN_SUPPORT
674 #endif // Panzer_BUILD_HESSIAN_SUPPORT
675 
676 #endif // __Panzer_GatherSolution_Epetra_decl_hpp__
std::vector< PHX::MDField< ScalarT, Cell, NODE > > gatherFields_
The fields to be gathered.
GatherSolution_Epetra(const Teuchos::RCP< const panzer::GlobalIndexer > &indexer)
Constructor.
bool hasTangentFields_
A flag indicating whether or not we have tangent fields.
GatherSolution_Epetra(const Teuchos::RCP< const panzer::GlobalIndexer > &indexer)
Constructor.
Gathers solution values from the Newton solution vector into the nodal fields of the field manager...
Teuchos::RCP< const panzer::GlobalIndexer > globalIndexer_
Maps the local (field, element, basis) triplet to a global ID for scattering.
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.
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 .
Teuchos::RCP< const panzer::GlobalIndexer > globalIndexer_
Maps the local (field, element, basis) triplet to a global ID for scattering.
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.
virtual Teuchos::RCP< CloneableEvaluator > clone(const Teuchos::ParameterList &pl) const
Create a copy.
Teuchos::RCP< const panzer::GlobalIndexer > 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.
bool useTimeDerivativeSolutionVector_
A flag indicating whether we&#39;re to be working with or .
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.
GatherSolution_Epetra(const Teuchos::RCP< const panzer::GlobalIndexer > &indexer)
Constructor.
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.