• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

LaplaceBeltramiProblem.hpp

Go to the documentation of this file.
00001 //*****************************************************************//
00002 //    Albany 2.0:  Copyright 2012 Sandia Corporation               //
00003 //    This Software is released under the BSD license detailed     //
00004 //    in the file "license.txt" in the top-level Albany directory  //
00005 //*****************************************************************//
00006 
00007 #ifndef LABELTRAMIPROBLEM_HPP
00008 #define LABELTRAMIPROBLEM_HPP
00009 
00010 #include "Teuchos_RCP.hpp"
00011 #include "Teuchos_ParameterList.hpp"
00012 
00013 #include "Albany_AbstractProblem.hpp"
00014 
00015 #include "Phalanx.hpp"
00016 #include "PHAL_Workset.hpp"
00017 #include "PHAL_Dimension.hpp"
00018 #include "Albany_ProblemUtils.hpp"
00019 
00020 #include "Time.hpp"
00021 
00022 
00023 namespace Albany {
00024 
00029 class LaplaceBeltramiProblem : public AbstractProblem {
00030   public:
00031 
00033     LaplaceBeltramiProblem(const Teuchos::RCP<Teuchos::ParameterList>& params,
00034                            const Teuchos::RCP<ParamLib>& paramLib,
00035                            const int numDim_,
00036                            const Teuchos::RCP<const Epetra_Comm>& comm_);
00037 
00039     ~LaplaceBeltramiProblem();
00040 
00042     virtual int spatialDimension() const {
00043       return numDim;
00044     }
00045 
00047     virtual void buildProblem(
00048       Teuchos::ArrayRCP<Teuchos::RCP<Albany::MeshSpecsStruct> >  meshSpecs,
00049       StateManager& stateMgr);
00050 
00051     // Build evaluators
00052     virtual Teuchos::Array< Teuchos::RCP<const PHX::FieldTag> >
00053     buildEvaluators(
00054       PHX::FieldManager<PHAL::AlbanyTraits>& fm0,
00055       const Albany::MeshSpecsStruct& meshSpecs,
00056       Albany::StateManager& stateMgr,
00057       Albany::FieldManagerChoice fmchoice,
00058       const Teuchos::RCP<Teuchos::ParameterList>& responseList);
00059 
00061     Teuchos::RCP<const Teuchos::ParameterList> getValidProblemParameters() const;
00062 
00063   private:
00064 
00066     LaplaceBeltramiProblem(const LaplaceBeltramiProblem&);
00067 
00069     LaplaceBeltramiProblem& operator=(const LaplaceBeltramiProblem&);
00070 
00071   public:
00072 
00074     template <typename EvalT>
00075     Teuchos::RCP<const PHX::FieldTag>
00076     constructEvaluators(
00077       PHX::FieldManager<PHAL::AlbanyTraits>& fm0,
00078       const Albany::MeshSpecsStruct& meshSpecs,
00079       Albany::StateManager& stateMgr,
00080       Albany::FieldManagerChoice fmchoice,
00081       const Teuchos::RCP<Teuchos::ParameterList>& responseList);
00082 
00083     void constructDirichletEvaluators(const std::vector<std::string>& nodeSetIDs);
00084 
00085   protected:
00086 
00087     int numDim;
00088 
00089     Teuchos::RCP<const Epetra_Comm> comm;
00090 
00091     Teuchos::RCP<Albany::Layouts> dl;
00092 
00093 };
00094 
00095 }
00096 
00097 #include "Intrepid_FieldContainer.hpp"
00098 #include "Intrepid_DefaultCubatureFactory.hpp"
00099 #include "Shards_CellTopology.hpp"
00100 #include "Albany_Utils.hpp"
00101 #include "Albany_ProblemUtils.hpp"
00102 #include "Albany_EvaluatorUtils.hpp"
00103 #include "Albany_ResponseUtilities.hpp"
00104 
00105 #include "PHAL_SaveStateField.hpp"
00106 
00107 #include "LaplaceResid.hpp"
00108 #include "TPSLaplaceResid.hpp"
00109 #include "TPSALaplaceResid.hpp"
00110 #include "LaplaceBeltramiResid.hpp"
00111 #include "ContravariantTargetMetricTensor.hpp"
00112 #include "CalcInstantaneousCoords.hpp"
00113 
00114 template <typename EvalT>
00115 Teuchos::RCP<const PHX::FieldTag>
00116 Albany::LaplaceBeltramiProblem::constructEvaluators(
00117   PHX::FieldManager<PHAL::AlbanyTraits>& fm0,
00118   const Albany::MeshSpecsStruct& meshSpecs,
00119   Albany::StateManager& stateMgr,
00120   Albany::FieldManagerChoice fieldManagerChoice,
00121   const Teuchos::RCP<Teuchos::ParameterList>& responseList) {
00122   using Teuchos::RCP;
00123   using Teuchos::rcp;
00124   using Teuchos::ParameterList;
00125   using PHX::DataLayout;
00126   using PHX::MDALayout;
00127   using std::vector;
00128   using PHAL::AlbanyTraits;
00129 
00130   // get the name of the current element block
00131   std::string elementBlockName = meshSpecs.ebName;
00132 
00133   const CellTopologyData* const elem_top = &meshSpecs.ctd;
00134 
00135   RCP<Intrepid::Basis<RealType, Intrepid::FieldContainer<RealType> > >
00136   intrepidBasis = Albany::getIntrepidBasis(*elem_top);
00137   RCP<shards::CellTopology> cellType = rcp(new shards::CellTopology(elem_top));
00138 
00139 
00140   const int numNodes = intrepidBasis->getCardinality();
00141   const int worksetSize = meshSpecs.worksetSize;
00142 
00143   Intrepid::DefaultCubatureFactory<RealType> cubFactory;
00144   RCP <Intrepid::Cubature<RealType> > cubature = cubFactory.create(*cellType, meshSpecs.cubatureDegree);
00145 
00146   const int numQPtsCell = cubature->getNumPoints();
00147   const int numVertices = cellType->getNodeCount();
00148 
00149 
00150   *out << "Field Dimensions: Workset=" << worksetSize
00151        << ", Vertices= " << numVertices
00152        << ", Nodes= " << numNodes
00153        << ", QuadPts= " << numQPtsCell
00154        << ", Dim= " << numDim << std::endl;
00155 
00156   TEUCHOS_TEST_FOR_EXCEPTION(numNodes != numVertices,
00157                         std::logic_error,
00158                         "Error in LaplaceBeltrami problem: specification of coordinate vector vs. solution layout is incorrect."
00159                         << std::endl);
00160 
00161   dl = rcp(new Albany::Layouts(worksetSize, numVertices, numNodes, numQPtsCell, numDim));
00162   TEUCHOS_TEST_FOR_EXCEPTION(dl->vectorAndGradientLayoutsAreEquivalent == false, std::logic_error,
00163                              "Data Layout Usage in Laplace Beltrami problem assumes vecDim = numDim");
00164 
00165   Albany::EvaluatorUtils<EvalT, PHAL::AlbanyTraits> evalUtils(dl);
00166 
00167   // Temporary variable used numerous times below
00168   Teuchos::RCP<PHX::Evaluator<AlbanyTraits> > ev;
00169 
00170   std::string& method = params->get("Method", "Laplace");
00171   std::string& solution_strategy = params->get("Solution Method", "Steady");
00172 
00173   Teuchos::ArrayRCP<std::string> soln_name(1);
00174   Teuchos::ArrayRCP<std::string> soln_resid_name(1);
00175   Teuchos::ArrayRCP<std::string> tgt_name(1);
00176   Teuchos::ArrayRCP<std::string> tgt_resid_name(1);
00177 
00178   soln_name[0] = "Coordinates";
00179   tgt_name[0] = "Tgt Coords";
00180   soln_resid_name[0] = "Coordinates Residual";
00181   tgt_resid_name[0] = "Tgt Coords Residual";
00182 
00183   // vqp(cell,qp,i) += val_node(cell, node, i) * BF(cell, node, qp);
00184 //  fm0.template registerEvaluator<EvalT>
00185 //  (evalUtils.constructDOFVecInterpolationEvaluator(soln_name[0]));
00186 
00187  //grad_val_qp(cell,qp,i,dim) += val_node(cell, node, i) * GradBF(cell, node, qp, dim);
00188 //  fm0.template registerEvaluator<EvalT>
00189 //  (evalUtils.constructDOFVecGradInterpolationEvaluator(soln_name[0]));
00190 
00191   //gets solution vector
00192   fm0.template registerEvaluator<EvalT>
00193   (evalUtils.constructGatherSolutionEvaluator_noTransient(true, soln_name));
00194 
00195   // Puts residual vector
00196   fm0.template registerEvaluator<EvalT>
00197   (evalUtils.constructScatterResidualEvaluator(true, soln_resid_name));
00198 
00199   // Fills the coordVec field
00200   fm0.template registerEvaluator<EvalT>
00201   (evalUtils.constructGatherCoordinateVectorEvaluator());
00202 
00203   if(solution_strategy == "Continuation"){ // Time
00204 
00205     RCP<ParameterList> p = rcp(new ParameterList);
00206 
00207     p->set<std::string>("Time Name", "Time");
00208     p->set<std::string>("Delta Time Name", "Delta Time");
00209     p->set< RCP<DataLayout> >("Workset Scalar Data Layout", dl->workset_scalar);
00210     p->set<RCP<ParamLib> >("Parameter Library", paramLib);
00211     p->set<bool>("Disable Transient", true);
00212 
00213     ev = rcp(new LCM::Time<EvalT,AlbanyTraits>(*p));
00214     fm0.template registerEvaluator<EvalT>(ev);
00215     p = stateMgr.registerStateVariable("Time",dl->workset_scalar, dl->dummy, elementBlockName, "scalar", 0.0, true);
00216     ev = rcp(new PHAL::SaveStateField<EvalT,AlbanyTraits>(*p));
00217     fm0.template registerEvaluator<EvalT>(ev);
00218   }
00219 
00220 
00221   if(method == "Laplace"){
00222 
00223     // Laplace equation Resid
00224     RCP<ParameterList> p = rcp(new ParameterList("Laplace Resid"));
00225 
00226     //Input
00227     p->set<std::string>("Coordinate Vector Name", "Coord Vec");
00228     p->set< std::string >("Solution Vector Name", soln_name[0]);
00229 
00230     p->set< RCP<Intrepid::Cubature<RealType> > >("Cubature", cubature);
00231     p->set<RCP<shards::CellTopology> >("Cell Type", cellType);
00232     p->set< RCP<Intrepid::Basis<RealType, Intrepid::FieldContainer<RealType> > > >
00233          ("Intrepid Basis", intrepidBasis);
00234 
00235     //Output
00236     p->set<std::string>("Residual Name", soln_resid_name[0]);
00237 
00238     ev = rcp(new PHAL::LaplaceResid<EvalT, AlbanyTraits>(*p, dl));
00239     fm0.template registerEvaluator<EvalT>(ev);
00240 
00241   }
00242   else if(method == "TPSLaplace"){
00243 
00244     // Laplace equation Resid
00245     RCP<ParameterList> p = rcp(new ParameterList("TPS Laplace Resid"));
00246 
00247     //Input
00248     p->set< std::string >("Solution Vector Name", soln_name[0]);
00249 
00250     p->set< RCP<Intrepid::Cubature<RealType> > >("Cubature", cubature);
00251     p->set<RCP<shards::CellTopology> >("Cell Type", cellType);
00252     p->set< RCP<Intrepid::Basis<RealType, Intrepid::FieldContainer<RealType> > > >
00253          ("Intrepid Basis", intrepidBasis);
00254 
00255     //Output
00256     p->set<std::string>("Residual Name", soln_resid_name[0]);
00257 
00258     ev = rcp(new PHAL::TPSLaplaceResid<EvalT, AlbanyTraits>(*p, dl));
00259     fm0.template registerEvaluator<EvalT>(ev);
00260 
00261   }
00262   else if(method == "DispTPSLaplace"){
00263 
00264     {
00265       // Add coords and displacements to get instantaneous coordinates
00266       RCP<ParameterList> p = rcp(new ParameterList("Instantaneous Coordinates"));
00267 
00268       //Input
00269       p->set<std::string>("Coordinate Vector Name", "Coord Vec"); // Reference node coordinates
00270       p->set< std::string >("Solution Vector Name", soln_name[0]); // Displacements
00271 
00272       //Output
00273       p->set<std::string>("Instantaneous Coordinates Name", "Current Coords");
00274 
00275       ev = rcp(new PHAL::CalcInstantaneousCoords<EvalT, AlbanyTraits>(*p, dl));
00276       fm0.template registerEvaluator<EvalT>(ev);
00277     }
00278 
00279     {
00280       // Laplace equation Resid
00281       RCP<ParameterList> p = rcp(new ParameterList("Disp TPS Laplace Resid"));
00282 
00283       //Input
00284       p->set< std::string >("Solution Vector Name", "Current Coords");
00285 
00286       p->set< RCP<Intrepid::Cubature<RealType> > >("Cubature", cubature);
00287       p->set<RCP<shards::CellTopology> >("Cell Type", cellType);
00288       p->set< RCP<Intrepid::Basis<RealType, Intrepid::FieldContainer<RealType> > > >
00289          ("Intrepid Basis", intrepidBasis);
00290 
00291       //Output
00292       p->set<std::string>("Residual Name", soln_resid_name[0]);
00293 
00294       ev = rcp(new PHAL::TPSLaplaceResid<EvalT, AlbanyTraits>(*p, dl));
00295       fm0.template registerEvaluator<EvalT>(ev);
00296     }
00297 
00298   }
00299   else if(method == "TPSALaplace"){
00300 
00301     {
00302       // Add coords and displacements to get instantaneous coordinates
00303       RCP<ParameterList> p = rcp(new ParameterList("Instantaneous Coordinates"));
00304 
00305       //Input
00306       p->set<std::string>("Coordinate Vector Name", "Coord Vec"); // Reference node coordinates
00307       p->set< std::string >("Solution Vector Name", soln_name[0]); // Displacements
00308 
00309       //Output
00310       p->set<std::string>("Instantaneous Coordinates Name", "Current Coords");
00311 
00312       ev = rcp(new PHAL::CalcInstantaneousCoords<EvalT, AlbanyTraits>(*p, dl));
00313       fm0.template registerEvaluator<EvalT>(ev);
00314     }
00315 
00316     fm0.template registerEvaluator<EvalT>
00317       (evalUtils.constructComputeBasisFunctionsEvaluator(cellType, intrepidBasis, cubature));
00318 
00319     {
00320 
00321       // TPS Laplace Resid
00322       RCP<ParameterList> p = rcp(new ParameterList("TPSA Laplace Resid"));
00323 
00324       //Input
00325       p->set< std::string >("Solution Vector Name", "Current Coords");
00326       p->set<std::string>("Gradient BF Name", "Grad BF");
00327       p->set<std::string>("Weighted Gradient BF Name", "wGrad BF");
00328 
00329       //Output
00330       p->set<std::string>("Residual Name", soln_resid_name[0]);
00331 
00332       ev = rcp(new PHAL::TPSALaplaceResid<EvalT, AlbanyTraits>(*p, dl));
00333       fm0.template registerEvaluator<EvalT>(ev);
00334     }
00335 
00336   }
00337   else if(method == "LaplaceBeltrami"){
00338 
00339    // Add the target solution
00340 
00341     //gets solution vector
00342     fm0.template registerEvaluator<EvalT>
00343     (evalUtils.constructGatherSolutionEvaluator_noTransient(true, tgt_name, numDim));
00344 
00345     // Puts residual vector
00346     fm0.template registerEvaluator<EvalT>
00347     (evalUtils.constructScatterResidualEvaluator(true, tgt_resid_name, numDim));
00348 
00349     {
00350       // Laplace equation Resid - solve for the target space
00351       RCP<ParameterList> p = rcp(new ParameterList("Target Laplace Resid"));
00352 
00353       //Input
00354       // Target is calculated from the actual solution
00355       p->set< std::string >("Solution Vector Name", soln_name[0]);
00356 
00357       p->set< RCP<Intrepid::Cubature<RealType> > >("Cubature", cubature);
00358       p->set<RCP<shards::CellTopology> >("Cell Type", cellType);
00359       p->set< RCP<Intrepid::Basis<RealType, Intrepid::FieldContainer<RealType> > > >
00360          ("Intrepid Basis", intrepidBasis);
00361 
00362       //Output
00363       p->set<std::string>("Residual Name", tgt_resid_name[0]);
00364 
00365       ev = rcp(new PHAL::TPSLaplaceResid<EvalT, AlbanyTraits>(*p, dl));
00366       fm0.template registerEvaluator<EvalT>(ev);
00367     }
00368 
00369     {
00370       // Calculate the target metric tensor
00371 
00372       RCP<ParameterList> p =
00373         rcp(new ParameterList("Contravariant Metric Tensor"));
00374 
00375       // Inputs: 
00376       // Note that the target solution is used to build Gc
00377       p->set< std::string >("Solution Vector Name", tgt_name[0]);
00378       p->set< RCP<Intrepid::Cubature<RealType> > >("Cubature", cubature);
00379 
00380       p->set<RCP<shards::CellTopology> >("Cell Type", cellType);
00381 
00382       // Outputs: BF, weightBF, Grad BF, weighted-Grad BF, all in physical space
00383       p->set<std::string>("Contravariant Metric Tensor Name", "Gc");
00384 
00385       ev = rcp(new PHAL::ContravariantTargetMetricTensor<EvalT, AlbanyTraits>(*p, dl));
00386       fm0.template registerEvaluator<EvalT>(ev);
00387 
00388     }
00389 
00390     {
00391 
00392       // Laplace Beltrami Resid - Solve for the coordinates
00393       RCP<ParameterList> p = rcp(new ParameterList("Laplace Beltrami Resid"));
00394 
00395       //Input
00396       p->set< std::string >("Solution Vector Name", soln_name[0]);
00397       p->set<std::string>("Contravariant Metric Tensor Name", "Gc");
00398 
00399       p->set< RCP<Intrepid::Cubature<RealType> > >("Cubature", cubature);
00400       p->set<RCP<shards::CellTopology> >("Cell Type", cellType);
00401       p->set< RCP<Intrepid::Basis<RealType, Intrepid::FieldContainer<RealType> > > >
00402         ("Intrepid Basis", intrepidBasis);
00403 
00404       //Output
00405       p->set<std::string>("Residual Name", soln_resid_name[0]);
00406 
00407       ev = rcp(new PHAL::LaplaceBeltramiResid<EvalT, AlbanyTraits>(*p, dl));
00408       fm0.template registerEvaluator<EvalT>(ev);
00409     }
00410   }
00411   else if(method == "DispLaplaceBeltramiA"){
00412 
00413     {
00414       // Add coords and displacements to get instantaneous coordinates
00415       RCP<ParameterList> p = rcp(new ParameterList("Instantaneous Coordinates"));
00416 
00417       //Input
00418       p->set<std::string>("Coordinate Vector Name", "Coord Vec"); // Reference node coordinates
00419       p->set< std::string >("Solution Vector Name", soln_name[0]); // Displacements
00420 
00421       //Output
00422       p->set<std::string>("Instantaneous Coordinates Name", "Current Coords");
00423 
00424       ev = rcp(new PHAL::CalcInstantaneousCoords<EvalT, AlbanyTraits>(*p, dl));
00425       fm0.template registerEvaluator<EvalT>(ev);
00426     }
00427 
00428     {
00429       // Add coords and displacements to get instantaneous coordinates
00430       RCP<ParameterList> p = rcp(new ParameterList("Instantaneous Target Coordinates"));
00431 
00432       //Input
00433       p->set<std::string>("Coordinate Vector Name", "Coord Vec"); // Reference node coordinates
00434       p->set< std::string >("Solution Vector Name", tgt_name[0]); // Displacements
00435 
00436       //Output
00437       p->set<std::string>("Instantaneous Coordinates Name", "Current Tgt Coords");
00438 
00439       ev = rcp(new PHAL::CalcInstantaneousCoords<EvalT, AlbanyTraits>(*p, dl));
00440       fm0.template registerEvaluator<EvalT>(ev);
00441     }
00442 
00443    // Add the target solution
00444 
00445     //gets solution vector
00446     fm0.template registerEvaluator<EvalT>
00447     (evalUtils.constructGatherSolutionEvaluator_noTransient(true, tgt_name, numDim));
00448 
00449     // Puts residual vector
00450     fm0.template registerEvaluator<EvalT>
00451     (evalUtils.constructScatterResidualEvaluator(true, tgt_resid_name, numDim));
00452 
00453     {
00454       // Laplace equation Resid - solve for the target space
00455       RCP<ParameterList> p = rcp(new ParameterList("Disp Target Laplace Resid"));
00456 
00457       //Input
00458       // Target is calculated from the actual solution
00459       p->set< std::string >("Solution Vector Name", "Current Coords");
00460 
00461       p->set< RCP<Intrepid::Cubature<RealType> > >("Cubature", cubature);
00462       p->set<RCP<shards::CellTopology> >("Cell Type", cellType);
00463       p->set< RCP<Intrepid::Basis<RealType, Intrepid::FieldContainer<RealType> > > >
00464          ("Intrepid Basis", intrepidBasis);
00465 
00466       //Output
00467       p->set<std::string>("Residual Name", tgt_resid_name[0]);
00468 
00469       ev = rcp(new PHAL::TPSLaplaceResid<EvalT, AlbanyTraits>(*p, dl));
00470       fm0.template registerEvaluator<EvalT>(ev);
00471     }
00472 
00473     {
00474       // Calculate the target metric tensor
00475 
00476       RCP<ParameterList> p =
00477         rcp(new ParameterList("Disp Contravariant Metric Tensor"));
00478 
00479       // Inputs: 
00480       // Note that the target solution is used to build Gc
00481       p->set< std::string >("Solution Vector Name", "Current Tgt Coords");
00482       p->set< RCP<Intrepid::Cubature<RealType> > >("Cubature", cubature);
00483 
00484       p->set<RCP<shards::CellTopology> >("Cell Type", cellType);
00485 
00486       // Outputs
00487       p->set<std::string>("Contravariant Metric Tensor Name", "Gc");
00488 
00489       ev = rcp(new PHAL::ContravariantTargetMetricTensor<EvalT, AlbanyTraits>(*p, dl));
00490       fm0.template registerEvaluator<EvalT>(ev);
00491 
00492     }
00493 
00494     {
00495 
00496       // Laplace Beltrami Resid - Solve for the coordinates
00497       RCP<ParameterList> p = rcp(new ParameterList("Disp Laplace Beltrami Resid"));
00498 
00499       //Input
00500       p->set< std::string >("Solution Vector Name", "Current Coords");
00501       p->set<std::string>("Contravariant Metric Tensor Name", "Gc");
00502 
00503       p->set< RCP<Intrepid::Cubature<RealType> > >("Cubature", cubature);
00504       p->set<RCP<shards::CellTopology> >("Cell Type", cellType);
00505       p->set< RCP<Intrepid::Basis<RealType, Intrepid::FieldContainer<RealType> > > >
00506         ("Intrepid Basis", intrepidBasis);
00507 
00508       //Output
00509       p->set<std::string>("Residual Name", soln_resid_name[0]);
00510 
00511       ev = rcp(new PHAL::LaplaceBeltramiResid<EvalT, AlbanyTraits>(*p, dl));
00512       fm0.template registerEvaluator<EvalT>(ev);
00513     }
00514   }
00515   else if(method == "DispLaplaceBeltrami"){
00516 
00517     {
00518       // Add coords and displacements to get instantaneous coordinates
00519       RCP<ParameterList> p = rcp(new ParameterList("Instantaneous Coordinates"));
00520 
00521       //Input
00522       p->set<std::string>("Coordinate Vector Name", "Coord Vec"); // Reference node coordinates
00523       p->set< std::string >("Solution Vector Name", soln_name[0]); // Displacements
00524 
00525       //Output
00526       p->set<std::string>("Instantaneous Coordinates Name", "Current Coords");
00527 
00528       ev = rcp(new PHAL::CalcInstantaneousCoords<EvalT, AlbanyTraits>(*p, dl));
00529       fm0.template registerEvaluator<EvalT>(ev);
00530     }
00531 
00532     {
00533       // Add coords and displacements to get instantaneous coordinates
00534       RCP<ParameterList> p = rcp(new ParameterList("Instantaneous Target Coordinates"));
00535 
00536       //Input
00537       p->set<std::string>("Coordinate Vector Name", "Coord Vec"); // Reference node coordinates
00538       p->set< std::string >("Solution Vector Name", tgt_name[0]); // Displacements
00539 
00540       //Output
00541       p->set<std::string>("Instantaneous Coordinates Name", "Current Tgt Coords");
00542 
00543       ev = rcp(new PHAL::CalcInstantaneousCoords<EvalT, AlbanyTraits>(*p, dl));
00544       fm0.template registerEvaluator<EvalT>(ev);
00545     }
00546 
00547    // Add the target solution
00548 
00549     //gets solution vector
00550     fm0.template registerEvaluator<EvalT>
00551     (evalUtils.constructGatherSolutionEvaluator_noTransient(true, tgt_name, numDim));
00552 
00553     // Puts residual vector
00554     fm0.template registerEvaluator<EvalT>
00555     (evalUtils.constructScatterResidualEvaluator(true, tgt_resid_name, numDim));
00556 
00557     fm0.template registerEvaluator<EvalT>
00558       (evalUtils.constructComputeBasisFunctionsEvaluator(cellType, intrepidBasis, cubature));
00559 
00560     {
00561 
00562       // TPS Laplace Resid
00563       RCP<ParameterList> p = rcp(new ParameterList("Disp TPSA Laplace Resid"));
00564 
00565       //Input
00566       p->set< std::string >("Solution Vector Name", "Current Coords");
00567       p->set<std::string>("Gradient BF Name", "Grad BF");
00568       p->set<std::string>("Weighted Gradient BF Name", "wGrad BF");
00569 
00570       //Output
00571       p->set<std::string>("Residual Name", tgt_resid_name[0]);
00572 
00573       ev = rcp(new PHAL::TPSALaplaceResid<EvalT, AlbanyTraits>(*p, dl));
00574       fm0.template registerEvaluator<EvalT>(ev);
00575     }
00576 
00577     {
00578       // Calculate the target metric tensor
00579 
00580       RCP<ParameterList> p =
00581         rcp(new ParameterList("Disp Contravariant Metric Tensor"));
00582 
00583       // Inputs: 
00584       // Note that the target solution is used to build Gc
00585       p->set< std::string >("Solution Vector Name", "Current Tgt Coords");
00586       p->set< RCP<Intrepid::Cubature<RealType> > >("Cubature", cubature);
00587 
00588       p->set<RCP<shards::CellTopology> >("Cell Type", cellType);
00589 
00590       // Outputs
00591       p->set<std::string>("Contravariant Metric Tensor Name", "Gc");
00592 
00593       ev = rcp(new PHAL::ContravariantTargetMetricTensor<EvalT, AlbanyTraits>(*p, dl));
00594       fm0.template registerEvaluator<EvalT>(ev);
00595 
00596     }
00597 
00598     {
00599 
00600       // Laplace Beltrami Resid - Solve for the coordinates
00601       RCP<ParameterList> p = rcp(new ParameterList("Disp Laplace Beltrami Resid"));
00602 
00603       //Input
00604       p->set< std::string >("Solution Vector Name", "Current Coords");
00605       p->set<std::string>("Contravariant Metric Tensor Name", "Gc");
00606 
00607       p->set< RCP<Intrepid::Cubature<RealType> > >("Cubature", cubature);
00608       p->set<RCP<shards::CellTopology> >("Cell Type", cellType);
00609       p->set< RCP<Intrepid::Basis<RealType, Intrepid::FieldContainer<RealType> > > >
00610         ("Intrepid Basis", intrepidBasis);
00611 
00612       //Output
00613       p->set<std::string>("Residual Name", soln_resid_name[0]);
00614 
00615       ev = rcp(new PHAL::LaplaceBeltramiResid<EvalT, AlbanyTraits>(*p, dl));
00616       fm0.template registerEvaluator<EvalT>(ev);
00617     }
00618   }
00619   else {
00620 
00621      TEUCHOS_TEST_FOR_EXCEPTION(true, std::logic_error, "Smoothing method requested is not implemented.\n");
00622 
00623   }
00624 
00625   if(fieldManagerChoice == Albany::BUILD_RESID_FM)  {
00626     PHX::Tag<typename EvalT::ScalarT> res_tag("Scatter", dl->dummy);
00627     fm0.requireField<EvalT>(res_tag);
00628     return res_tag.clone();
00629   }
00630 
00631   else if(fieldManagerChoice == Albany::BUILD_RESPONSE_FM) {
00632     Albany::ResponseUtilities<EvalT, PHAL::AlbanyTraits> respUtils(dl);
00633     return respUtils.constructResponses(fm0, *responseList, Teuchos::null, stateMgr);
00634   }
00635 
00636   return Teuchos::null;
00637 
00638 }
00639 
00640 
00641 #endif // ALBANY_LAPLACEBELTRAMI_HPP

Generated on Wed Mar 26 2014 18:36:39 for Albany: a Trilinos-based PDE code by  doxygen 1.7.1