Skip to content

Commit

Permalink
LCM: some corrections to the ConstitutiveDriverProblem
Browse files Browse the repository at this point in the history
Sorry, the last commit didn't actually compile
  • Loading branch information
jtostie committed Apr 23, 2015
1 parent 9add977 commit 559f168
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 11 deletions.
31 changes: 30 additions & 1 deletion src/LCM/models/ConstitutiveModelDriverPre.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,37 @@ namespace LCM {
typedef typename EvalT::ScalarT ScalarT;
typedef typename EvalT::MeshScalarT MeshScalarT;

};
///
/// solution field
///
PHX::MDField<ScalarT, Cell, Node, Dim, Dim> solution_;

///
/// def grad field
///
PHX::MDField<ScalarT, Cell, QuadPoint, Dim, Dim> def_grad_;

///
/// det def grad field
///
PHX::MDField<ScalarT, Cell, QuadPoint> j_;

///
/// Number of dimensions
///
std::size_t num_dims_;

///
/// Number of integration points
///
std::size_t num_pts_;

///
/// Number of integration points
///
std::size_t num_nodes_;

};
}

#endif
6 changes: 4 additions & 2 deletions src/LCM/models/ConstitutiveModelDriverPre_Def.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
// in the file "license.txt" in the top-level Albany directory //
//*****************************************************************//

#include <Intrepid_MiniTensor.h>

#include "Teuchos_TestForException.hpp"
#include "Teuchos_RCP.hpp"
#include "Phalanx_DataLayout.hpp"
Expand All @@ -21,7 +23,7 @@ ConstitutiveModelDriverPre(Teuchos::ParameterList& p,
j_(p.get<std::string>("J Name"),dl->qp_scalar)
{
std::vector<PHX::DataLayout::size_type> dims;
dl->node_qp_tensor->dimensions(dims);
dl->node_qp_vector->dimensions(dims);
num_nodes_ = dims[1];
num_pts_ = dims[2];
num_dims_ = dims[3];
Expand Down Expand Up @@ -50,7 +52,7 @@ evaluateFields(typename Traits::EvalData workset)
for (std::size_t pt = 0; pt < num_pts_; ++pt) {
for (std::size_t node = 0; node < num_nodes_; ++node) {
for (std::size_t dim = 0; dim < num_dims_; ++dim) {
def_grad_(cell, pt, ) = 0.0;
def_grad_(cell, pt, dim, dim) = 0.0;
}
}
}
Expand Down
16 changes: 8 additions & 8 deletions src/LCM/problems/ConstitutiveDriverProblem.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,12 +286,13 @@ constructEvaluators(PHX::FieldManager<PHAL::AlbanyTraits>& fm0,
// Temporary variable used numerous times below
Teuchos::RCP<PHX::Evaluator<PHAL::AlbanyTraits> > ev;

{ // Register the solution and residual fields
Teuchos::ArrayRCP<std::string> dof_names(1);
Teuchos::ArrayRCP<std::string> resid_names(1);
dof_names[0] = "driver deformation gradient";
resid_names[0] = "driver scatter";
// Register the solution and residual fields
Teuchos::ArrayRCP<std::string> dof_names(1);
Teuchos::ArrayRCP<std::string> resid_names(1);
dof_names[0] = "driver deformation gradient";
resid_names[0] = "driver scatter";

{ // Register the solution and residual fields
Teuchos::RCP<Teuchos::ParameterList> p =
Teuchos::rcp(new Teuchos::ParameterList("Gather Solution"));
p->set< Teuchos::ArrayRCP<std::string> >("Solution Names", dof_names);
Expand Down Expand Up @@ -336,9 +337,8 @@ constructEvaluators(PHX::FieldManager<PHAL::AlbanyTraits>& fm0,
p->set<std::string>("F Name", "F");
p->set<std::string>("J Name", "J");

cmdpEv =
Teuchos::rcp(new LCM::ConstitutiveModelDriver<EvalT, PHAL::AlbanyTraits>(*p,dl_));
fm0.template registerEvaluator<EvalT>(cmdpEv);
ev=Teuchos::rcp(new LCM::ConstitutiveModelDriver<EvalT, PHAL::AlbanyTraits>(*p,dl_));
fm0.template registerEvaluator<EvalT>(ev);
}

{ // Constitutive Model Parameters
Expand Down

0 comments on commit 559f168

Please sign in to comment.