Panzer  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Panzer_GatherSolution_BlockedEpetra_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_BlockedEpetra_decl_hpp__
44 #define __Panzer_GatherSolution_BlockedEpetra_decl_hpp__
45 
47 //
48 // Include Files
49 //
51 
52 // Panzer
55 #include "Panzer_Dimension.hpp"
56 #include "PanzerDiscFE_config.hpp"
58 #include "Panzer_Traits.hpp"
59 
60 // Phalanx
61 #include "Phalanx_config.hpp"
62 #include "Phalanx_Evaluator_Macros.hpp"
63 #include "Phalanx_MDField.hpp"
64 
65 // Teuchos
67 
69 //
70 // Forward Declarations
71 //
73 
74 namespace panzer
75 {
76  template<typename LocalOrdinalT, typename GlobalOrdinalT>
77  class UniqueGlobalIndexer;
78 }
79 namespace Thyra
80 {
81  template<typename> class ProductVectorBase;
82 }
83 
84 namespace panzer
85 {
94  template<typename EvalT, typename TRAITS, typename LO, typename GO>
96  :
97  public panzer::EvaluatorWithBaseImpl<TRAITS>,
98  public PHX::EvaluatorDerived<panzer::Traits::Residual, TRAITS>,
100  {
101  public:
102 
106  typedef typename EvalT::ScalarT ScalarT;
107 
117  const Teuchos::ParameterList& p)
118  {
119  } // end of Constructor
120 
135  const Teuchos::ParameterList& pl) const
136  {
137  return Teuchos::rcp(new
139  } // end of clone()
140 
149  void
151  typename TRAITS::SetupData d,
153  {
154  } // end of postRegistrationSetup()
155 
164  void
166  typename TRAITS::EvalData d)
167  {
168  using PHX::typeAsString;
169  using std::cout;
170  using std::endl;
171  cout << "Unspecialized version of \"GatherSolution_BlockedEpetra::" \
172  "evaluateFields\" on " + typeAsString<EvalT>() + "\" should not " \
173  "be used!" << endl;
174  TEUCHOS_ASSERT(false);
175  } // end of evaluateFields()
176 
177  }; // end of class GatherSolution_BlockedEpetra
178 
189  template<typename TRAITS, typename LO, typename GO>
190  class GatherSolution_BlockedEpetra<panzer::Traits::Residual, TRAITS, LO, GO>
191  :
192  public panzer::EvaluatorWithBaseImpl<TRAITS>,
193  public PHX::EvaluatorDerived<panzer::Traits::Residual, TRAITS>,
195  {
196  public:
197 
207  const std::vector<Teuchos::RCP<const UniqueGlobalIndexer<LO, int>>>&
208  indexers)
209  :
210  indexers_(indexers)
211  {
212  } // end of Constructor
213 
227  const std::vector<Teuchos::RCP<const UniqueGlobalIndexer<LO, int>>>&
228  indexers,
229  const Teuchos::ParameterList& p);
230 
240  void
242  typename TRAITS::SetupData d,
244 
255  void
256  preEvaluate(
257  typename TRAITS::PreEvalData d);
258 
267  void
269  typename TRAITS::EvalData d);
270 
285  const Teuchos::ParameterList& pl) const
286  {
287  using panzer::Traits;
288  using Teuchos::rcp;
289  return rcp(new
291  (indexers_, pl));
292  } // end of clone()
293 
294  private:
295 
299  typedef typename panzer::Traits::Residual EvalT;
300 
305 
310  std::vector<Teuchos::RCP<const UniqueGlobalIndexer<LO, int>>> indexers_;
311 
315  std::vector<int> indexerIds_;
316 
320  std::vector<int> subFieldIds_;
321 
325  std::vector<PHX::MDField<ScalarT, Cell, NODE>> gatherFields_;
326 
330  std::vector<std::string> indexerNames_;
331 
337 
341  std::string globalDataKey_;
342 
347 
354 
359 
370  std::vector<std::vector<PHX::MDField<const ScalarT, Cell, NODE>>>
372 
377 
378  }; // end of class GatherSolution_BlockedEpetra (Residual Specialization)
379 
390  template<typename TRAITS, typename LO, typename GO>
391  class GatherSolution_BlockedEpetra<panzer::Traits::Tangent, TRAITS, LO, GO>
392  :
393  public panzer::EvaluatorWithBaseImpl<TRAITS>,
394  public PHX::EvaluatorDerived<panzer::Traits::Tangent, TRAITS>,
396  {
397  public:
398 
408  const std::vector<Teuchos::RCP<const UniqueGlobalIndexer<LO, int>>>&
409  indexers)
410  :
411  indexers_(indexers)
412  {
413  } // end of Constructor
414 
428  const std::vector<Teuchos::RCP<const UniqueGlobalIndexer<LO, int>>>&
429  indexers,
430  const Teuchos::ParameterList& p);
431 
441  void
443  typename TRAITS::SetupData d,
445 
456  void
457  preEvaluate(
458  typename TRAITS::PreEvalData d);
459 
469  void
471  typename TRAITS::EvalData d);
472 
487  const Teuchos::ParameterList& pl) const
488  {
489  using panzer::Traits;
490  using Teuchos::rcp;
491  return rcp(new
493  (indexers_, pl));
494  } // end of clone()
495 
496  private:
497 
501  typedef typename panzer::Traits::Tangent EvalT;
502 
507 
512  std::vector<Teuchos::RCP<const UniqueGlobalIndexer<LO, int>>> indexers_;
513 
517  std::vector<int> indexerIds_;
518 
522  std::vector<int> subFieldIds_;
523 
527  std::vector<PHX::MDField<ScalarT, Cell, NODE>> gatherFields_;
528 
532  std::vector<std::string> indexerNames_;
533 
539 
543  std::string globalDataKey_;
544 
549 
556 
561 
572  std::vector<std::vector<PHX::MDField<const ScalarT, Cell, NODE>>>
574 
579 
580  }; // end of class GatherSolution_BlockedEpetra (Tangent Specialization)
581 
592  template<typename TRAITS, typename LO, typename GO>
593  class GatherSolution_BlockedEpetra<panzer::Traits::Jacobian, TRAITS, LO, GO>
594  :
595  public panzer::EvaluatorWithBaseImpl<TRAITS>,
596  public PHX::EvaluatorDerived<panzer::Traits::Jacobian, TRAITS>,
598  {
599  public:
600 
610  const std::vector<Teuchos::RCP<const UniqueGlobalIndexer<LO, int>>>&
611  indexers)
612  :
613  indexers_(indexers)
614  {
615  } // end of Constructor
616 
630  const std::vector<Teuchos::RCP<const UniqueGlobalIndexer<LO, int>>>&
631  indexers,
632  const Teuchos::ParameterList& p);
633 
643  void
645  typename TRAITS::SetupData d,
647 
659  void
660  preEvaluate(
661  typename TRAITS::PreEvalData d);
662 
672  void
674  typename TRAITS::EvalData d);
675 
690  const Teuchos::ParameterList& pl) const
691  {
692  using panzer::Traits;
693  using Teuchos::rcp;
694  return rcp(new
696  (indexers_, pl));
697  } // end of clone()
698 
699  private:
700 
704  typedef typename panzer::Traits::Jacobian EvalT;
705 
710 
715  std::vector<Teuchos::RCP<const UniqueGlobalIndexer<LO, int>>> indexers_;
716 
720  std::vector<int> indexerIds_;
721 
725  std::vector<int> subFieldIds_;
726 
730  std::vector<PHX::MDField<ScalarT, Cell, NODE>> gatherFields_;
731 
735  std::vector<std::string> indexerNames_;
736 
742 
747 
751  std::string sensitivitiesName_;
752 
758 
762  std::string globalDataKey_;
763 
770 
775 
782 
787 
788  }; // end of class GatherSolution_BlockedEpetra (Jacobian Specialization)
789 
790 } // end of namespace panzer
791 
792 #ifdef Panzer_BUILD_HESSIAN_SUPPORT
794 #endif // Panzer_BUILD_HESSIAN_SUPPORT
795 
796 #endif // __Panzer_GatherSolution_BlockedEpetra_decl_hpp__
virtual Teuchos::RCP< CloneableEvaluator > clone(const Teuchos::ParameterList &pl) const
Create a copy.
std::vector< Teuchos::RCP< const UniqueGlobalIndexer< LO, int > > > indexers_
These map the local (field, element, basis) triplet to a global ID for scattering.
std::vector< Teuchos::RCP< const UniqueGlobalIndexer< LO, int > > > indexers_
These map the local (field, element, basis) triplet to a global ID for scattering.
std::vector< std::vector< PHX::MDField< const ScalarT, Cell, NODE > > > tangentFields_
Fields for storing the tangent components of the solution vector .
std::vector< std::string > indexerNames_
A list of the names of the fields to be gathered.
GatherSolution_BlockedEpetra(const std::vector< Teuchos::RCP< const UniqueGlobalIndexer< LO, int >>> &indexers)
Constructor.
std::vector< Teuchos::RCP< const UniqueGlobalIndexer< LO, int > > > indexers_
These map 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.
Teuchos::RCP< panzer::BlockedVector_ReadOnly_GlobalEvaluationData > xBvRoGed_
The GlobalEvaluationData containing both the owned and ghosted solution vectors.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Wrapper to PHX::EvaluatorWithBaseImpl that implements Panzer-specific helpers.
std::vector< PHX::MDField< ScalarT, Cell, NODE > > gatherFields_
The fields to be gathered.
bool applySensitivities_
Used by evaluateFields() to turn on/off a certain set of sensitivities.
GatherSolution_BlockedEpetra(const std::vector< Teuchos::RCP< const UniqueGlobalIndexer< LO, int >>> &indexers)
Constructor.
GatherSolution_BlockedEpetra(const std::vector< Teuchos::RCP< const UniqueGlobalIndexer< LO, int >>> &indexers)
Constructor.
std::vector< PHX::MDField< ScalarT, Cell, NODE > > gatherFields_
The fields to be gathered.
void postRegistrationSetup(typename TRAITS::SetupData d, PHX::FieldManager< TRAITS > &fm)
Post-Registration Setup.
GatherSolution_BlockedEpetra(const Teuchos::ParameterList &p)
Constructor.
std::vector< std::vector< PHX::MDField< const ScalarT, Cell, NODE > > > tangentFields_
Fields for storing the tangent components of the solution vector .
virtual Teuchos::RCP< CloneableEvaluator > clone(const Teuchos::ParameterList &pl) const
Create a copy.
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.
std::vector< std::string > indexerNames_
A list of the names of the fields to be gathered.
virtual Teuchos::RCP< CloneableEvaluator > clone(const Teuchos::ParameterList &pl) const
Create a copy.
void evaluateFields(typename TRAITS::EvalData d)
Evaluate Fields.
std::vector< PHX::MDField< ScalarT, Cell, NODE > > gatherFields_
The fields to be gathered.
#define TEUCHOS_ASSERT(assertion_test)
Teuchos::RCP< panzer::BlockedVector_ReadOnly_GlobalEvaluationData > xBvRoGed_
The GlobalEvaluationData containing both the owned and ghosted solution vectors.
Non-templated empty base class for template managers.
Teuchos::RCP< panzer::BlockedVector_ReadOnly_GlobalEvaluationData > xBvRoGed_
The GlobalEvaluationData containing both the owned and ghosted solution vectors.