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  class GlobalIndexer;
77 }
78 namespace Thyra
79 {
80  template<typename> class ProductVectorBase;
81 }
82 
83 namespace panzer
84 {
93  template<typename EvalT, typename TRAITS, typename LO, typename GO>
95  :
96  public panzer::EvaluatorWithBaseImpl<TRAITS>,
97  public PHX::EvaluatorDerived<panzer::Traits::Residual, TRAITS>,
99  {
100  public:
101 
105  typedef typename EvalT::ScalarT ScalarT;
106 
116  const Teuchos::ParameterList& p)
117  {
118  } // end of Constructor
119 
134  const Teuchos::ParameterList& pl) const
135  {
136  return Teuchos::rcp(new
138  } // end of clone()
139 
148  void
150  typename TRAITS::SetupData d,
152  {
153  } // end of postRegistrationSetup()
154 
163  void
165  typename TRAITS::EvalData d)
166  {
167  using PHX::print;
168  using std::cout;
169  using std::endl;
170  cout << "Unspecialized version of \"GatherSolution_BlockedEpetra::" \
171  "evaluateFields\" on " + print<EvalT>() + "\" should not " \
172  "be used!" << endl;
173  TEUCHOS_ASSERT(false);
174  } // end of evaluateFields()
175 
176  }; // end of class GatherSolution_BlockedEpetra
177 
188  template<typename TRAITS, typename LO, typename GO>
189  class GatherSolution_BlockedEpetra<panzer::Traits::Residual, TRAITS, LO, GO>
190  :
191  public panzer::EvaluatorWithBaseImpl<TRAITS>,
192  public PHX::EvaluatorDerived<panzer::Traits::Residual, TRAITS>,
194  {
195  public:
196 
206  const std::vector<Teuchos::RCP<const GlobalIndexer>>&
207  indexers)
208  :
209  indexers_(indexers)
210  {
211  } // end of Constructor
212 
226  const std::vector<Teuchos::RCP<const GlobalIndexer>>&
227  indexers,
228  const Teuchos::ParameterList& p);
229 
239  void
241  typename TRAITS::SetupData d,
243 
254  void
255  preEvaluate(
256  typename TRAITS::PreEvalData d);
257 
266  void
268  typename TRAITS::EvalData d);
269 
284  const Teuchos::ParameterList& pl) const
285  {
286  using panzer::Traits;
287  using Teuchos::rcp;
288  return rcp(new
290  (indexers_, pl));
291  } // end of clone()
292 
293  private:
294 
298  typedef typename panzer::Traits::Residual EvalT;
299 
304 
309  std::vector<Teuchos::RCP<const GlobalIndexer>> indexers_;
310 
314  std::vector<int> indexerIds_;
315 
319  std::vector<int> subFieldIds_;
320 
324  std::vector<PHX::MDField<ScalarT, Cell, NODE>> gatherFields_;
325 
329  std::vector<std::string> indexerNames_;
330 
336 
340  std::string globalDataKey_;
341 
346 
353 
358 
369  std::vector<std::vector<PHX::MDField<const ScalarT, Cell, NODE>>>
371 
376 
377  }; // end of class GatherSolution_BlockedEpetra (Residual Specialization)
378 
389  template<typename TRAITS, typename LO, typename GO>
390  class GatherSolution_BlockedEpetra<panzer::Traits::Tangent, TRAITS, LO, GO>
391  :
392  public panzer::EvaluatorWithBaseImpl<TRAITS>,
393  public PHX::EvaluatorDerived<panzer::Traits::Tangent, TRAITS>,
395  {
396  public:
397 
407  const std::vector<Teuchos::RCP<const GlobalIndexer>>&
408  indexers)
409  :
410  indexers_(indexers)
411  {
412  } // end of Constructor
413 
427  const std::vector<Teuchos::RCP<const GlobalIndexer>>&
428  indexers,
429  const Teuchos::ParameterList& p);
430 
440  void
442  typename TRAITS::SetupData d,
444 
455  void
456  preEvaluate(
457  typename TRAITS::PreEvalData d);
458 
468  void
470  typename TRAITS::EvalData d);
471 
486  const Teuchos::ParameterList& pl) const
487  {
488  using panzer::Traits;
489  using Teuchos::rcp;
490  return rcp(new
492  (indexers_, pl));
493  } // end of clone()
494 
495  private:
496 
500  typedef typename panzer::Traits::Tangent EvalT;
501 
506 
511  std::vector<Teuchos::RCP<const GlobalIndexer>> indexers_;
512 
516  std::vector<int> indexerIds_;
517 
521  std::vector<int> subFieldIds_;
522 
526  std::vector<PHX::MDField<ScalarT, Cell, NODE>> gatherFields_;
527 
531  std::vector<std::string> indexerNames_;
532 
538 
542  std::string globalDataKey_;
543 
548 
555 
560 
571  std::vector<std::vector<PHX::MDField<const ScalarT, Cell, NODE>>>
573 
578 
579  }; // end of class GatherSolution_BlockedEpetra (Tangent Specialization)
580 
591  template<typename TRAITS, typename LO, typename GO>
592  class GatherSolution_BlockedEpetra<panzer::Traits::Jacobian, TRAITS, LO, GO>
593  :
594  public panzer::EvaluatorWithBaseImpl<TRAITS>,
595  public PHX::EvaluatorDerived<panzer::Traits::Jacobian, TRAITS>,
597  {
598  public:
599 
609  const std::vector<Teuchos::RCP<const GlobalIndexer>>&
610  indexers)
611  :
612  indexers_(indexers)
613  {
614  } // end of Constructor
615 
629  const std::vector<Teuchos::RCP<const GlobalIndexer>>&
630  indexers,
631  const Teuchos::ParameterList& p);
632 
642  void
644  typename TRAITS::SetupData d,
646 
658  void
659  preEvaluate(
660  typename TRAITS::PreEvalData d);
661 
671  void
673  typename TRAITS::EvalData d);
674 
689  const Teuchos::ParameterList& pl) const
690  {
691  using panzer::Traits;
692  using Teuchos::rcp;
693  return rcp(new
695  (indexers_, pl));
696  } // end of clone()
697 
698  private:
699 
703  typedef typename panzer::Traits::Jacobian EvalT;
704 
709 
714  std::vector<Teuchos::RCP<const GlobalIndexer>> indexers_;
715 
719  std::vector<int> indexerIds_;
720 
724  std::vector<int> subFieldIds_;
725 
729  std::vector<PHX::MDField<ScalarT, Cell, NODE>> gatherFields_;
730 
734  std::vector<std::string> indexerNames_;
735 
741 
746 
750  std::string sensitivitiesName_;
751 
757 
761  std::string globalDataKey_;
762 
769 
774 
781 
786 
787  }; // end of class GatherSolution_BlockedEpetra (Jacobian Specialization)
788 
789 } // end of namespace panzer
790 
791 #ifdef Panzer_BUILD_HESSIAN_SUPPORT
793 #endif // Panzer_BUILD_HESSIAN_SUPPORT
794 
795 #endif // __Panzer_GatherSolution_BlockedEpetra_decl_hpp__
std::vector< Teuchos::RCP< const GlobalIndexer > > 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.
GatherSolution_BlockedEpetra(const std::vector< Teuchos::RCP< const GlobalIndexer >> &indexers)
Constructor.
std::vector< std::vector< PHX::MDField< const ScalarT, Cell, NODE > > > tangentFields_
Fields for storing the tangent components of the solution vector .
std::vector< Teuchos::RCP< const GlobalIndexer > > indexers_
These map 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.
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.
GatherSolution_BlockedEpetra(const std::vector< Teuchos::RCP< const GlobalIndexer >> &indexers)
Constructor.
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.
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.
GatherSolution_BlockedEpetra(const std::vector< Teuchos::RCP< const GlobalIndexer >> &indexers)
Constructor.
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.
std::vector< Teuchos::RCP< const GlobalIndexer > > indexers_
These map the local (field, element, basis) triplet to a global ID for scattering.
#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.