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

QCAD_MeshRegion.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 QCAD_MESHREGION_HPP
00008 #define QCAD_MESHREGION_HPP
00009 
00010 #include "Teuchos_RCP.hpp"
00011 
00012 #include "Phalanx_MDField.hpp"
00013 #include "Phalanx_FieldManager.hpp"
00014 #include "Phalanx_Evaluator_WithBaseImpl.hpp"
00015 #include "Phalanx_Evaluator_Utilities.hpp"
00016 
00017 #include "Albany_Layouts.hpp"
00018 
00019 #include "QCAD_MaterialDatabase.hpp"
00020 
00021 namespace QCAD {
00022 
00028   template<typename EvalT, typename Traits>
00029   class MeshRegion
00030   {
00031   public:
00032     typedef typename EvalT::ScalarT ScalarT;
00033     typedef typename EvalT::MeshScalarT MeshScalarT;
00034 
00035     MeshRegion(std::string coordVecName, std::string weightsName,
00036          Teuchos::ParameterList& p, 
00037          const Teuchos::RCP<QCAD::MaterialDatabase> matDB,
00038          const Teuchos::RCP<Albany::Layouts>& dl_ );
00039     ~MeshRegion() { }
00040 
00041     void addDependentFields(PHX::EvaluatorWithBaseImpl<Traits>* evaluator);
00042     void postRegistrationSetup(PHX::FieldManager<Traits>& fm);
00043 
00044     bool elementBlockIsInRegion(std::string ebName) const;
00045     bool cellIsInRegion(std::size_t cell);
00046 
00047   private:
00048     std::size_t numQPs;
00049     std::size_t numDims;
00050     std::string coordVecFieldname, weightsFieldname;
00051     PHX::MDField<MeshScalarT,Cell,QuadPoint,Dim> coordVec;
00052     PHX::MDField<MeshScalarT,Cell,QuadPoint> weights;
00053     Teuchos::RCP<Albany::Layouts> dl;
00054 
00056     std::vector<std::string> ebNames; // restrict to these element blocks
00057     bool bQuantumEBsOnly;             // restrict to "quantum" element blocks
00058 
00060     bool limitX, limitY, limitZ;      // restrict along x,y,z
00061     double xmin, xmax, ymin, ymax, zmin, zmax;  // limits along x,y,z
00062 
00064     bool bRestrictToLevelSet;
00065     std::string levelSetFieldname;              
00066     double levelSetFieldMin, levelSetFieldMax;
00067     PHX::MDField<ScalarT> levelSetField;    
00068 
00070     Teuchos::RCP<QCAD::MaterialDatabase> materialDB;
00071 
00073     PHX::EvaluatorUtilities<EvalT,Traits> utils;
00074 
00075   public:
00076     static Teuchos::RCP<const Teuchos::ParameterList> getValidParameters()
00077     {
00078       Teuchos::RCP<Teuchos::ParameterList> validPL =
00079       rcp(new Teuchos::ParameterList("Valid MeshRegion Params"));;
00080 
00081       validPL->set<std::string>("Operation Domain", "", "Deprecated - does nothing"); //TODO: remove?
00082       
00083       validPL->set<std::string>("Element Block Name", "", "Element block name to restrict region to");
00084       validPL->set<std::string>("Element Block Names", "", "Element block names to restrict region to");
00085       validPL->set<bool>("Quantum Element Blocks Only", false, "Restricts region to quantum element blocks");
00086       
00087       validPL->set<double>("x min", 0.0, "Box domain minimum x coordinate");
00088       validPL->set<double>("x max", 0.0, "Box domain maximum x coordinate");
00089       validPL->set<double>("y min", 0.0, "Box domain minimum y coordinate");
00090       validPL->set<double>("y max", 0.0, "Box domain maximum y coordinate");
00091       validPL->set<double>("z min", 0.0, "Box domain minimum z coordinate");
00092       validPL->set<double>("z max", 0.0, "Box domain maximum z coordinate");
00093       
00094       validPL->set<std::string>("Level Set Field Name", "<field name>","Scalar Field to use for level set region");
00095       validPL->set<double>("Level Set Field Minimum", 0.0, "Minimum value of field to include in region");
00096       validPL->set<double>("Level Set Field Maximum", 0.0, "Maximum value of field to include in region");
00097       
00098       return validPL;
00099     }
00100 
00101   };
00102 
00103 }
00104 
00105 #endif
00106 
00107 

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