Skip to content

Commit

Permalink
more progress on #34 in ATO
Browse files Browse the repository at this point in the history
  • Loading branch information
ibaned committed Feb 1, 2017
1 parent cabb5a8 commit 725a8a4
Show file tree
Hide file tree
Showing 15 changed files with 31 additions and 35 deletions.
6 changes: 3 additions & 3 deletions src/ATO/evaluators/ATO_AddForce.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ class AddVector : public PHX::EvaluatorWithBaseImpl<Traits>,
typedef typename EvalT::MeshScalarT MeshScalarT;

// Input:
PHX::MDField<ScalarT,Cell,QuadPoint,Dim> add_vector;
PHX::MDField<MeshScalarT,Cell,Node,QuadPoint> w_bf;
PHX::MDField<const ScalarT,Cell,QuadPoint,Dim> add_vector;
PHX::MDField<const MeshScalarT,Cell,Node,QuadPoint> w_bf;
PHX::MDField<const ScalarT,Cell,Node,Dim> inResidual;

// Output:
PHX::MDField<ScalarT,Cell,Node,Dim> inResidual;
PHX::MDField<ScalarT,Cell,Node,Dim> outResidual;

std::size_t numNodes;
Expand Down
8 changes: 4 additions & 4 deletions src/ATO/evaluators/ATO_AddForce_Def.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ AddVector(const Teuchos::ParameterList& p) :
numDims = dims[2];

if(p.isType<std::string>("In Residual Name")){
inResidual = PHX::MDField<ScalarT,Cell,Node,Dim>(p.get<std::string>("In Residual Name"),
inResidual = decltype(inResidual)(p.get<std::string>("In Residual Name"),
p.get<Teuchos::RCP<PHX::DataLayout> >("Node Vector Data Layout") );
this->addDependentField(inResidual);
plusEquals = true;
} else
plusEquals = false;

if(p.isType<std::string>("Weighted BF Name")){
w_bf = PHX::MDField<MeshScalarT,Cell,Node,QuadPoint>(p.get<std::string>("Weighted BF Name"),
w_bf = decltype(w_bf)(p.get<std::string>("Weighted BF Name"),
p.get<Teuchos::RCP<PHX::DataLayout> >("Weighted BF Data Layout") );
this->addDependentField(w_bf);
projectFromQPs = true;
Expand Down Expand Up @@ -159,15 +159,15 @@ AddScalar(const Teuchos::ParameterList& p) :
numNodes = dims[1];

if(p.isType<std::string>("In Residual Name")){
inResidual = PHX::MDField<ScalarT,Cell,Node>(p.get<std::string>("In Residual Name"),
inResidual = decltype(inResidual)(p.get<std::string>("In Residual Name"),
p.get<Teuchos::RCP<PHX::DataLayout> >("Node Scalar Data Layout") );
this->addDependentField(inResidual);
plusEquals = true;
} else
plusEquals = false;

if(p.isType<std::string>("Weighted BF Name")){
w_bf = PHX::MDField<MeshScalarT,Cell,Node,QuadPoint>(p.get<std::string>("Weighted BF Name"),
w_bf = decltype(w_bf)(p.get<std::string>("Weighted BF Name"),
p.get<Teuchos::RCP<PHX::DataLayout> >("Weighted BF Data Layout") );
this->addDependentField(w_bf);
projectFromQPs = true;
Expand Down
4 changes: 3 additions & 1 deletion src/ATO/evaluators/ATO_BodyForce.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@ class BodyForce : public PHX::EvaluatorWithBaseImpl<Traits>,

Teuchos::Array<RealType> bodyForceVector;

// Input:
PHX::MDField<const ScalarT,Cell,QuadPoint> density;

// Output:
PHX::MDField<ScalarT,Cell,QuadPoint> density;
PHX::MDField<ScalarT,Cell,QuadPoint,Dim> outVector;

};
Expand Down
4 changes: 2 additions & 2 deletions src/ATO/evaluators/ATO_DirichletTerm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class DirichletVectorTerm : public PHX::EvaluatorWithBaseImpl<Traits>,
PHX::MDField<ScalarT,Cell,QuadPoint,Dim> outVector;

// Input:
PHX::MDField<ScalarT,Cell,QuadPoint,Dim> dirVector;
PHX::MDField<const ScalarT,Cell,QuadPoint,Dim> dirVector;

};

Expand Down Expand Up @@ -73,7 +73,7 @@ class DirichletScalarTerm : public PHX::EvaluatorWithBaseImpl<Traits>,
PHX::MDField<ScalarT,Cell,QuadPoint> outValue;

// Input:
PHX::MDField<ScalarT,Cell,QuadPoint> dirValue;
PHX::MDField<const ScalarT,Cell,QuadPoint> dirValue;

};
}
Expand Down
4 changes: 2 additions & 2 deletions src/ATO/evaluators/ATO_Mixture.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ class Mixture : public PHX::EvaluatorWithBaseImpl<Traits>,
typedef typename EvalT::MeshScalarT MeshScalarT;

// Input:
std::vector<PHX::MDField<ScalarT> > constituentVar;
PHX::MDField<RealType,Cell,Node,QuadPoint> BF;
std::vector<PHX::MDField<const ScalarT> > constituentVar;
PHX::MDField<const RealType,Cell,Node,QuadPoint> BF;


unsigned int numQPs;
Expand Down
2 changes: 1 addition & 1 deletion src/ATO/evaluators/ATO_Mixture_Def.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ BF(p.get<std::string> ("BF Name"), dl->node_qp_scalar)
int nMats = inVarNames.size();
constituentVar.resize(nMats);
for(int i=0; i<nMats; i++){
PHX::MDField<ScalarT> _constituentVar(inVarNames[i], layout);
PHX::MDField<const ScalarT> _constituentVar(inVarNames[i], layout);
constituentVar[i] = _constituentVar;
this->addDependentField(constituentVar[i]);
}
Expand Down
2 changes: 1 addition & 1 deletion src/ATO/evaluators/ATO_ResidualStrain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class ResidualStrain :

int numQPs;
int numDims;
PHX::MDField<MeshScalarT,Cell,QuadPoint,Dim> coordVec;
PHX::MDField<const MeshScalarT,Cell,QuadPoint,Dim> coordVec;
PHX::MDField<ScalarT,Cell,QuadPoint,Dim,Dim> strain;

//! Exponential random field
Expand Down
4 changes: 1 addition & 3 deletions src/ATO/evaluators/ATO_ResidualStrain_Def.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ ResidualStrain(Teuchos::ParameterList& p) :

Teuchos::RCP<PHX::DataLayout> vector_dl =
p.get< Teuchos::RCP<PHX::DataLayout>>("QP Vector Data Layout");
PHX::MDField<MeshScalarT,Cell,QuadPoint,Dim>
fx(p.get<std::string>("QP Coordinate Vector Name"), vector_dl);
coordVec = fx;
coordVec = decltype(coordVec)(p.get<std::string>("QP Coordinate Vector Name"), vector_dl);
this->addDependentField(coordVec);

if(residStrainParams->isSublist("Shear XY")){
Expand Down
2 changes: 1 addition & 1 deletion src/ATO/evaluators/ATO_ScaleVector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class ScaleVector : public PHX::EvaluatorWithBaseImpl<Traits>,
typedef typename EvalT::MeshScalarT MeshScalarT;

// Input:
PHX::MDField<ScalarT,Cell,QuadPoint,Dim> inVector;
PHX::MDField<const ScalarT,Cell,QuadPoint,Dim> inVector;
double coefficient;

unsigned int numQPs;
Expand Down
2 changes: 1 addition & 1 deletion src/ATO/evaluators/ATO_Stress.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class Stress : public PHX::EvaluatorWithBaseImpl<Traits>,
typedef typename EvalT::MeshScalarT MeshScalarT;

// Input:
PHX::MDField<ScalarT,Cell,QuadPoint,Dim,Dim> strain;
PHX::MDField<const ScalarT,Cell,QuadPoint,Dim,Dim> strain;
double elasticModulus;
double poissonsRatio;

Expand Down
6 changes: 3 additions & 3 deletions src/ATO/evaluators/ATO_TopologyFieldWeighting.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ class TopologyFieldWeighting : public PHX::EvaluatorWithBaseImpl<Traits>,
typedef typename EvalT::ParamScalarT ParamScalarT;

// Input:
PHX::MDField<ParamScalarT,Cell,Node> topo;
PHX::MDField<ScalarT> unWeightedVar;
PHX::MDField<RealType,Cell,Node,QuadPoint> BF;
PHX::MDField<const ParamScalarT,Cell,Node> topo;
PHX::MDField<const ScalarT> unWeightedVar;
PHX::MDField<const RealType,Cell,Node,QuadPoint> BF;

// Output:
PHX::MDField<ScalarT> weightedVar;
Expand Down
8 changes: 3 additions & 5 deletions src/ATO/evaluators/ATO_TopologyFieldWeighting_Def.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ BF(p.get<std::string> ("BF Name"), dl->node_qp_scalar)
Teuchos::Exceptions::InvalidParameter, std::endl
<< "Error! TopologyFieldWeighting requires 'Distributed Parameter' based topology" << std::endl);

topo = PHX::MDField<ParamScalarT,Cell,Node>(topology->getName(),dl->node_scalar);
topo = decltype(topo)(topology->getName(),dl->node_scalar);


std::string strLayout = p.get<std::string>("Variable Layout");
Expand All @@ -46,10 +46,8 @@ BF(p.get<std::string> ("BF Name"), dl->node_qp_scalar)
"!" << std::endl << "Options are (QP Tensor3, QP Tensor, QP Vector)" <<
std::endl);

PHX::MDField<ScalarT> _unWeightedVar(p.get<std::string>("Unweighted Variable Name"), layout);
unWeightedVar = _unWeightedVar;
PHX::MDField<ScalarT> _weightedVar(p.get<std::string>("Weighted Variable Name"), layout);
weightedVar = _weightedVar;
unWeightedVar = decltype(unWeightedVar)(p.get<std::string>("Unweighted Variable Name"), layout);
weightedVar = decltype(weightedVar)(p.get<std::string>("Weighted Variable Name"), layout);


// Pull out numQPs and numDims from a Layout
Expand Down
4 changes: 2 additions & 2 deletions src/ATO/evaluators/ATO_TopologyWeighting.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ class TopologyWeighting : public PHX::EvaluatorWithBaseImpl<Traits>,
typedef typename EvalT::MeshScalarT MeshScalarT;

// Input:
PHX::MDField<ScalarT> unWeightedVar;
PHX::MDField<RealType,Cell,Node,QuadPoint> BF;
PHX::MDField<const ScalarT> unWeightedVar;
PHX::MDField<const RealType,Cell,Node,QuadPoint> BF;


unsigned int numQPs;
Expand Down
6 changes: 2 additions & 4 deletions src/ATO/evaluators/ATO_TopologyWeighting_Def.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,8 @@ BF(p.get<std::string> ("BF Name"), dl->node_qp_scalar)
std::endl << "Options are (QP Tensor3, QP Tensor, QP Vector, QP Scalar)" <<
std::endl);

PHX::MDField<ScalarT> _unWeightedVar(p.get<std::string>("Unweighted Variable Name"), layout);
unWeightedVar = _unWeightedVar;
PHX::MDField<ScalarT> _weightedVar(p.get<std::string>("Weighted Variable Name"), layout);
weightedVar = _weightedVar;
unWeightedVar = decltype(unWeightedVar)(p.get<std::string>("Unweighted Variable Name"), layout);
weightedVar = decltype(weightedVar)(p.get<std::string>("Weighted Variable Name"), layout);

this->addDependentField(unWeightedVar);
this->addDependentField(BF);
Expand Down
4 changes: 2 additions & 2 deletions src/ATO/evaluators/ATO_VectorResidual.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ class VectorResidual : public PHX::EvaluatorWithBaseImpl<Traits>,
typedef typename EvalT::MeshScalarT MeshScalarT;

// Input:
PHX::MDField<ScalarT,Cell,QuadPoint,Dim> vector;
PHX::MDField<MeshScalarT,Cell,Node,QuadPoint,Dim> wGradBF;
PHX::MDField<const ScalarT,Cell,QuadPoint,Dim> vector;
PHX::MDField<const MeshScalarT,Cell,Node,QuadPoint,Dim> wGradBF;

// Output:
PHX::MDField<ScalarT,Cell,Node> ExResidual;
Expand Down

0 comments on commit 725a8a4

Please sign in to comment.