Skip to content

Commit

Permalink
progress on #34 in QCAD
Browse files Browse the repository at this point in the history
  • Loading branch information
ibaned committed Feb 20, 2017
1 parent 5647db4 commit dc61243
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
16 changes: 8 additions & 8 deletions src/QCAD/evaluators/QCAD_PoissonResid.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,26 +41,26 @@ class PoissonResid : public PHX::EvaluatorWithBaseImpl<Traits>,
typedef typename EvalT::MeshScalarT MeshScalarT;

// Input:
PHX::MDField<MeshScalarT> wBF;
PHX::MDField<ScalarT> Potential;
PHX::MDField<ScalarT> Permittivity;
PHX::MDField<MeshScalarT> wGradBF;
PHX::MDField<ScalarT> PhiGrad;
PHX::MDField<ScalarT> PhiFlux;
PHX::MDField<ScalarT> Source;
PHX::MDField<const MeshScalarT> wBF;
PHX::MDField<const ScalarT> Potential;
PHX::MDField<const ScalarT> Permittivity;
PHX::MDField<const MeshScalarT> wGradBF;
PHX::MDField<const ScalarT> PhiGrad;
PHX::MDField<const ScalarT> Source;
//PHX::MDField<MeshScalarT,Cell,Node,QuadPoint> wBF;
//PHX::MDField<ScalarT,Cell,QuadPoint> Potential;
//PHX::MDField<ScalarT,Cell,QuadPoint> Permittivity;
//PHX::MDField<MeshScalarT,Cell,Node,QuadPoint,Dim> wGradBF;
//PHX::MDField<ScalarT,Cell,QuadPoint,Dim> PhiGrad;
//PHX::MDField<ScalarT,Cell,QuadPoint,Dim> PhiFlux;
//PHX::MDField<ScalarT,Cell,QuadPoint> Source;

bool haveSource;

// Output:
PHX::MDField<ScalarT> PhiResidual;
PHX::MDField<ScalarT> PhiFlux;
//PHX::MDField<ScalarT,Cell,Node> PhiResidual;
//PHX::MDField<ScalarT,Cell,QuadPoint,Dim> PhiFlux;
};
}

Expand Down
6 changes: 4 additions & 2 deletions src/QCAD/evaluators/QCAD_PoissonResid_Def.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "Phalanx_DataLayout.hpp"

#include "Intrepid2_FunctionSpaceTools.hpp"
#include "PHAL_Utilities.hpp"


//**********************************************************************
Expand Down Expand Up @@ -67,11 +68,12 @@ evaluateFields(typename Traits::EvalData workset)

FST::integrate(PhiResidual.get_view(), PhiFlux.get_view(), wGradBF.get_view(), false); // "false" overwrites

auto neg_source = PHAL::create_copy("neg_Source", Source.get_view());
if (haveSource) {
for (int i=0; i<Source.dimension(0); i++)
for (int j=0; j<Source.dimension(1); j++)
Source(i,j) *= -1.0;
FST::integrate(PhiResidual.get_view(), Source.get_view(), wBF.get_view(), true); // "true" sums into
neg_source(i,j) = -1.0 * Source(i,j);
FST::integrate(PhiResidual.get_view(), neg_source, wBF.get_view(), true); // "true" sums into
}
}
//**********************************************************************
Expand Down
4 changes: 2 additions & 2 deletions src/QCAD/evaluators/QCAD_ResponseRegionBoundary.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ namespace QCAD {
std::size_t numQPs;
std::size_t numDims;

PHX::MDField<MeshScalarT,Cell,QuadPoint,Dim> coordVec;
PHX::MDField<MeshScalarT,Cell,QuadPoint> weights;
PHX::MDField<const MeshScalarT,Cell,QuadPoint,Dim> coordVec;
PHX::MDField<const MeshScalarT,Cell,QuadPoint> weights;

//Region boundary: for now just min/max along each coordinate direction
// * just MeshScalarTs - no derivative information for region boundaries yet, as
Expand Down

0 comments on commit dc61243

Please sign in to comment.