From c2bcef920c492e272ea20885207338c758ce950b Mon Sep 17 00:00:00 2001 From: Dan Ibanez Date: Wed, 15 Feb 2017 08:36:19 -0700 Subject: [PATCH] got through issue #34 in responses thanks to @rppawlo for resolving trilinos/Trilinos#1063 which made this progress possible. --- ...ELIX_ResponseBoundarySquaredL2Norm_Def.hpp | 4 +-- .../FELIX_ResponseSMBMismatch_Def.hpp | 2 +- .../PHAL_ResponseFieldIntegralT_Def.hpp | 6 ++-- .../PHAL_ResponseFieldIntegral_Def.hpp | 6 ++-- .../PHAL_ResponseSquaredL2ErrorSide_Def.hpp | 10 +++---- .../PHAL_ResponseSquaredL2Error_Def.hpp | 10 +++---- .../PHAL_ResponseThermalEnergyT_Def.hpp | 10 +++---- .../PHAL_ScatterScalarResponse_Def.hpp | 3 +- .../PHAL_SeparableScatterScalarResponse.hpp | 1 + ...AL_SeparableScatterScalarResponseT_Def.hpp | 3 +- ...HAL_SeparableScatterScalarResponse_Def.hpp | 10 +++---- .../QCAD_ResponseCenterOfMass_Def.hpp | 18 ++++++------ .../QCAD_ResponseFieldAverage_Def.hpp | 18 ++++++------ .../QCAD_ResponseFieldIntegral_Def.hpp | 14 +++++----- .../QCAD_ResponseFieldValue_Def.hpp | 28 +++++++++---------- 15 files changed, 71 insertions(+), 72 deletions(-) diff --git a/src/FELIX/evaluators/FELIX_ResponseBoundarySquaredL2Norm_Def.hpp b/src/FELIX/evaluators/FELIX_ResponseBoundarySquaredL2Norm_Def.hpp index 0492dba896..fa62b85edf 100644 --- a/src/FELIX/evaluators/FELIX_ResponseBoundarySquaredL2Norm_Def.hpp +++ b/src/FELIX/evaluators/FELIX_ResponseBoundarySquaredL2Norm_Def.hpp @@ -82,7 +82,7 @@ postRegistrationSetup(typename Traits::SetupData d, PHX::FieldManager& f template void FELIX::ResponseBoundarySquaredL2Norm::preEvaluate(typename Traits::PreEvalData workset) { - PHAL::set(this->global_response, 0.0); + PHAL::set(this->global_response_eval, 0.0); p_reg = 0; @@ -98,7 +98,7 @@ void FELIX::ResponseBoundarySquaredL2Norm::evaluateFields(typenam "Side sets defined in input file but not properly specified on the mesh" << std::endl); // Zero out local response - PHAL::set(this->local_response, 0.0); + PHAL::set(this->local_response_eval, 0.0); // ----------------- Surface side ---------------- // diff --git a/src/FELIX/evaluators/FELIX_ResponseSMBMismatch_Def.hpp b/src/FELIX/evaluators/FELIX_ResponseSMBMismatch_Def.hpp index 1e7d63b43f..666d588d2d 100644 --- a/src/FELIX/evaluators/FELIX_ResponseSMBMismatch_Def.hpp +++ b/src/FELIX/evaluators/FELIX_ResponseSMBMismatch_Def.hpp @@ -106,7 +106,7 @@ void FELIX::ResponseSMBMismatch::postRegistrationSetup(typename T // ********************************************************************** template void FELIX::ResponseSMBMismatch::preEvaluate(typename Traits::PreEvalData workset) { - PHAL::set(this->global_response, 0.0); + PHAL::set(this->global_response_eval, 0.0); p_resp = p_reg = p_misH =0; diff --git a/src/evaluators/PHAL_ResponseFieldIntegralT_Def.hpp b/src/evaluators/PHAL_ResponseFieldIntegralT_Def.hpp index eff0a00e08..60dda08ce1 100644 --- a/src/evaluators/PHAL_ResponseFieldIntegralT_Def.hpp +++ b/src/evaluators/PHAL_ResponseFieldIntegralT_Def.hpp @@ -168,7 +168,7 @@ template void PHAL::ResponseFieldIntegralT:: preEvaluate(typename Traits::PreEvalData workset) { - PHAL::set(this->global_response, 0.0); + PHAL::set(this->global_response_eval, 0.0); // Do global initialization PHAL::SeparableScatterScalarResponseT::preEvaluate(workset); } @@ -179,7 +179,7 @@ void PHAL::ResponseFieldIntegralT:: evaluateFields(typename Traits::EvalData workset) { // Zero out local response - PHAL::set(this->local_response, 0.0); + PHAL::set(this->local_response_eval, 0.0); if( ebNames.size() == 0 || std::find(ebNames.begin(), ebNames.end(), workset.EBName) != ebNames.end() ) { @@ -232,7 +232,7 @@ void PHAL::ResponseFieldIntegralT:: postEvaluate(typename Traits::PostEvalData workset) { PHAL::reduceAll(*workset.comm, Teuchos::REDUCE_SUM, - this->global_response); + this->global_response_eval); PHAL::SeparableScatterScalarResponseT::postEvaluate(workset); } diff --git a/src/evaluators/PHAL_ResponseFieldIntegral_Def.hpp b/src/evaluators/PHAL_ResponseFieldIntegral_Def.hpp index df255806ef..e3a87023c7 100644 --- a/src/evaluators/PHAL_ResponseFieldIntegral_Def.hpp +++ b/src/evaluators/PHAL_ResponseFieldIntegral_Def.hpp @@ -167,7 +167,7 @@ template void PHAL::ResponseFieldIntegral:: preEvaluate(typename Traits::PreEvalData workset) { - PHAL::set(this->global_response, 0.0); + PHAL::set(this->global_response_eval, 0.0); // Do global initialization PHAL::SeparableScatterScalarResponse::preEvaluate(workset); } @@ -178,7 +178,7 @@ void PHAL::ResponseFieldIntegral:: evaluateFields(typename Traits::EvalData workset) { // Zero out local response - PHAL::set(this->local_response, 0.0); + PHAL::set(this->local_response_eval, 0.0); if( ebNames.size() == 0 || std::find(ebNames.begin(), ebNames.end(), workset.EBName) != ebNames.end() ) { @@ -231,7 +231,7 @@ void PHAL::ResponseFieldIntegral:: postEvaluate(typename Traits::PostEvalData workset) { PHAL::reduceAll(*workset.comm, Teuchos::REDUCE_SUM, - this->global_response); + this->global_response_eval); // Do global scattering PHAL::SeparableScatterScalarResponse::postEvaluate(workset); } diff --git a/src/evaluators/PHAL_ResponseSquaredL2ErrorSide_Def.hpp b/src/evaluators/PHAL_ResponseSquaredL2ErrorSide_Def.hpp index fcedc9f545..c97b28b5bc 100644 --- a/src/evaluators/PHAL_ResponseSquaredL2ErrorSide_Def.hpp +++ b/src/evaluators/PHAL_ResponseSquaredL2ErrorSide_Def.hpp @@ -90,7 +90,7 @@ postRegistrationSetup(typename Traits::SetupData d, PHX::FieldManager& f template void PHAL::ResponseSquaredL2ErrorSideBase::preEvaluate(typename Traits::PreEvalData workset) { - PHAL::set(this->global_response, 0.0); + PHAL::set(this->global_response_eval, 0.0); // Do global initialization PHAL::SeparableScatterScalarResponse::preEvaluate(workset); @@ -104,7 +104,7 @@ void PHAL::ResponseSquaredL2ErrorSideBase::evaluat "Side sets defined in input file but not properly specified on the mesh" << std::endl); // Zero out local response - PHAL::set(this->local_response, 0.0); + PHAL::set(this->local_response_eval, 0.0); if (workset.sideSets->find(sideSetName) != workset.sideSets->end()) { @@ -133,8 +133,8 @@ void PHAL::ResponseSquaredL2ErrorSideBase::evaluat sum += sq * w_measure(cell,side,qp); } - this->local_response(cell, 0) += sum*scaling; - this->global_response(0) += sum*scaling; + this->local_response_eval(cell, 0) += sum*scaling; + this->global_response_eval(0) += sum*scaling; } } @@ -146,7 +146,7 @@ void PHAL::ResponseSquaredL2ErrorSideBase::evaluat template void PHAL::ResponseSquaredL2ErrorSideBase::postEvaluate(typename Traits::PostEvalData workset) { - PHAL::reduceAll(*workset.comm, Teuchos::REDUCE_SUM, this->global_response); + PHAL::reduceAll(*workset.comm, Teuchos::REDUCE_SUM, this->global_response_eval); if(workset.comm->getRank()==0) std::cout << "resp: " << Sacado::ScalarValue::eval(this->global_response(0)) << "\n" << std::flush; diff --git a/src/evaluators/PHAL_ResponseSquaredL2Error_Def.hpp b/src/evaluators/PHAL_ResponseSquaredL2Error_Def.hpp index 54adc29f6d..de9eea7460 100644 --- a/src/evaluators/PHAL_ResponseSquaredL2Error_Def.hpp +++ b/src/evaluators/PHAL_ResponseSquaredL2Error_Def.hpp @@ -85,7 +85,7 @@ postRegistrationSetup(typename Traits::SetupData d, PHX::FieldManager& f template void PHAL::ResponseSquaredL2ErrorBase::preEvaluate(typename Traits::PreEvalData workset) { - PHAL::set(this->global_response, 0.0); + PHAL::set(this->global_response_eval, 0.0); // Do global initialization PHAL::SeparableScatterScalarResponse::preEvaluate(workset); @@ -96,7 +96,7 @@ template void PHAL::ResponseSquaredL2ErrorBase::evaluateFields(typename Traits::EvalData workset) { // Zero out local response - PHAL::set(this->local_response, 0.0); + PHAL::set(this->local_response_eval, 0.0); for (int cell=0; cell::evaluateFie sum += sq * w_measure(cell,qp); } - this->local_response(cell, 0) += sum*scaling; - this->global_response(0) += sum*scaling; + this->local_response_eval(cell, 0) += sum*scaling; + this->global_response_eval(0) += sum*scaling; } // Do any local-scattering necessary @@ -130,7 +130,7 @@ void PHAL::ResponseSquaredL2ErrorBase::evaluateFie template void PHAL::ResponseSquaredL2ErrorBase::postEvaluate(typename Traits::PostEvalData workset) { - PHAL::reduceAll(*workset.comm, Teuchos::REDUCE_SUM, this->global_response); + PHAL::reduceAll(*workset.comm, Teuchos::REDUCE_SUM, this->global_response_eval); if(workset.comm->getRank()==0) std::cout << "resp: " << Sacado::ScalarValue::eval(this->global_response(0)) << "\n" << std::flush; diff --git a/src/evaluators/PHAL_ResponseThermalEnergyT_Def.hpp b/src/evaluators/PHAL_ResponseThermalEnergyT_Def.hpp index 867903aabb..10a15ce32f 100644 --- a/src/evaluators/PHAL_ResponseThermalEnergyT_Def.hpp +++ b/src/evaluators/PHAL_ResponseThermalEnergyT_Def.hpp @@ -104,7 +104,7 @@ template void PHAL::ResponseThermalEnergyT:: preEvaluate(typename Traits::PreEvalData workset) { - PHAL::set(this->global_response, 0.0); + PHAL::set(this->global_response_eval, 0.0); // Do global initialization PHAL::SeparableScatterScalarResponseT::preEvaluate(workset); } @@ -115,7 +115,7 @@ void PHAL::ResponseThermalEnergyT:: evaluateFields(typename Traits::EvalData workset) { // Zero out local response - PHAL::set(this->local_response, 0.0); + PHAL::set(this->local_response_eval, 0.0); ScalarT s; for (std::size_t cell = 0; cell < workset.numCells; ++cell) @@ -123,8 +123,8 @@ evaluateFields(typename Traits::EvalData workset) for (std::size_t qp = 0; qp < numQPs; ++qp) { s = density * heat_capacity * field(cell, qp) * weights(cell, qp); - this->local_response(cell, 0) += s; - this->global_response(0) += s; + this->local_response_eval(cell, 0) += s; + this->global_response_eval(0) += s; } } @@ -138,7 +138,7 @@ void PHAL::ResponseThermalEnergyT:: postEvaluate(typename Traits::PostEvalData workset) { PHAL::reduceAll(*workset.comm, Teuchos::REDUCE_SUM, - this->global_response); + this->global_response_eval); PHAL::SeparableScatterScalarResponseT::postEvaluate(workset); } diff --git a/src/evaluators/PHAL_ScatterScalarResponse_Def.hpp b/src/evaluators/PHAL_ScatterScalarResponse_Def.hpp index ddd75dfe61..57a7d5c7d6 100644 --- a/src/evaluators/PHAL_ScatterScalarResponse_Def.hpp +++ b/src/evaluators/PHAL_ScatterScalarResponse_Def.hpp @@ -43,7 +43,6 @@ setup(const Teuchos::ParameterList& p, const Teuchos::RCP& dl) // Setup fields we require auto global_response_tag = p.get >("Global Response Field Tag"); - global_response = PHX::MDField(global_response_tag); global_response = decltype(global_response)(global_response_tag); if (stand_alone) { this->addDependentField(global_response); @@ -130,7 +129,7 @@ postEvaluate(typename Traits::PostEvalData workset) Teuchos::RCP gpT = workset.dgdpT; for (PHAL::MDFieldIterator gr(this->global_response); ! gr.done(); ++gr) { - typename PHAL::Ref::type val = *gr; + auto val = *gr; const int res = gr.idx(); if (gT != Teuchos::null){ Teuchos::ArrayRCP gT_nonconstView = gT->get1dViewNonConst(); diff --git a/src/evaluators/PHAL_SeparableScatterScalarResponse.hpp b/src/evaluators/PHAL_SeparableScatterScalarResponse.hpp index 90c931d52a..0c7426f682 100644 --- a/src/evaluators/PHAL_SeparableScatterScalarResponse.hpp +++ b/src/evaluators/PHAL_SeparableScatterScalarResponse.hpp @@ -45,6 +45,7 @@ class SeparableScatterScalarResponseBase protected: typedef typename EvalT::ScalarT ScalarT; + bool stand_alone; PHX::MDField local_response; PHX::MDField local_response_eval; }; diff --git a/src/evaluators/PHAL_SeparableScatterScalarResponseT_Def.hpp b/src/evaluators/PHAL_SeparableScatterScalarResponseT_Def.hpp index 521a4b7846..4032d1ce34 100644 --- a/src/evaluators/PHAL_SeparableScatterScalarResponseT_Def.hpp +++ b/src/evaluators/PHAL_SeparableScatterScalarResponseT_Def.hpp @@ -43,8 +43,7 @@ setup(const Teuchos::ParameterList& p, const Teuchos::RCP& dl) // Setup fields we require auto local_response_tag = p.get >("Local Response Field Tag"); - local_response = decltype(local_response)( - local_response_tag.name(), local_response_tag.dataLayout()); + local_response = decltype(local_response)(local_response_tag); if (stand_alone) { this->addDependentField(local_response); } else { diff --git a/src/evaluators/PHAL_SeparableScatterScalarResponse_Def.hpp b/src/evaluators/PHAL_SeparableScatterScalarResponse_Def.hpp index a2095a75cc..975d39602c 100644 --- a/src/evaluators/PHAL_SeparableScatterScalarResponse_Def.hpp +++ b/src/evaluators/PHAL_SeparableScatterScalarResponse_Def.hpp @@ -43,13 +43,13 @@ void SeparableScatterScalarResponseBase:: setup(const Teuchos::ParameterList& p, const Teuchos::RCP& dl) { - stand_alone = p.get("Stand-alone Evaluator"); + this->stand_alone = p.get("Stand-alone Evaluator"); // Setup fields we require auto local_response_tag = p.get >("Local Response Field Tag"); local_response = decltype(local_response)(local_response_tag); - if (stand_alone) { + if (this->stand_alone) { this->addDependentField(local_response); } else { local_response_eval = decltype(local_response_eval)(local_response_tag); @@ -111,7 +111,7 @@ evaluateFields(typename Traits::EvalData workset) // Loop over responses for (std::size_t res = 0; res < this->global_response.size(); res++) { - typename PHAL::Ref::type val = this->local_response(cell, res); + auto val = this->local_response(cell, res); // Loop over nodes in cell for (unsigned int node_dof=0; node_dof& elNodeID = wsElNodeID[elem_LID]; for (std::size_t res = 0; res < this->global_response.size(); res++) { - typename PHAL::Ref::type val = this->local_response(elem_LID, res); + auto val = this->local_response(elem_LID, res); LO base_id, ilayer; for (int i = 0; i < numSideNodes; ++i) { std::size_t node = side.node[i]; @@ -202,7 +202,7 @@ postEvaluate(typename Traits::PostEvalData workset) Teuchos::RCP gT = workset.gT; if (gT != Teuchos::null) { Teuchos::ArrayRCP gT_nonconstView = gT->get1dViewNonConst(); - for (PHAL::MDFieldIterator gr(this->global_response); + for (PHAL::MDFieldIterator gr(this->global_response); ! gr.done(); ++gr) gT_nonconstView[gr.idx()] = gr.ref().val(); } diff --git a/src/evaluators/QCAD_ResponseCenterOfMass_Def.hpp b/src/evaluators/QCAD_ResponseCenterOfMass_Def.hpp index fdeeb4c3e5..4b5b872c84 100644 --- a/src/evaluators/QCAD_ResponseCenterOfMass_Def.hpp +++ b/src/evaluators/QCAD_ResponseCenterOfMass_Def.hpp @@ -99,7 +99,7 @@ void QCAD::ResponseCenterOfMass:: preEvaluate(typename Traits::PreEvalData workset) { // Zero out global response - PHAL::set(this->global_response, 0.0); + PHAL::set(this->global_response_eval, 0.0); // Do global initialization PHAL::SeparableScatterScalarResponse::preEvaluate(workset); @@ -111,7 +111,7 @@ void QCAD::ResponseCenterOfMass:: evaluateFields(typename Traits::EvalData workset) { // Zero out local response - PHAL::set(this->local_response, 0.0); + PHAL::set(this->local_response_eval, 0.0); ScalarT integral, moment; @@ -125,13 +125,13 @@ evaluateFields(typename Traits::EvalData workset) // Add to running total volume and mass moment for (std::size_t qp=0; qp < numQPs; ++qp) { integral = field(cell,qp) * weights(cell,qp); - this->local_response(cell,3) += integral; - this->global_response(3) += integral; + this->local_response_eval(cell,3) += integral; + this->global_response_eval(3) += integral; for(std::size_t i=0; ilocal_response(cell,i) += moment; - this->global_response(i) += moment; + this->local_response_eval(cell,i) += moment; + this->global_response_eval(i) += moment; } } @@ -146,15 +146,15 @@ template void QCAD::ResponseCenterOfMass:: postEvaluate(typename Traits::PostEvalData workset) { - PHAL::reduceAll(*workset.comm, Teuchos::REDUCE_SUM, this->global_response); + PHAL::reduceAll(*workset.comm, Teuchos::REDUCE_SUM, this->global_response_eval); int iNormalizer = 3; if( fabs(this->global_response(iNormalizer)) > 1e-9 ) { for( int i=0; i < this->global_response.size(); i++) { if( i == iNormalizer ) continue; - this->global_response(i) /= this->global_response(iNormalizer); + this->global_response_eval(i) /= this->global_response_eval(iNormalizer); } - this->global_response(iNormalizer) = 1.0; + this->global_response_eval(iNormalizer) = 1.0; } // Do global scattering diff --git a/src/evaluators/QCAD_ResponseFieldAverage_Def.hpp b/src/evaluators/QCAD_ResponseFieldAverage_Def.hpp index 64799084d3..dd380fc681 100644 --- a/src/evaluators/QCAD_ResponseFieldAverage_Def.hpp +++ b/src/evaluators/QCAD_ResponseFieldAverage_Def.hpp @@ -99,7 +99,7 @@ void QCAD::ResponseFieldAverage:: preEvaluate(typename Traits::PreEvalData workset) { // Zero out global response - PHAL::set(this->global_response, 0.0); + PHAL::set(this->global_response_eval, 0.0); // Do global initialization PHAL::SeparableScatterScalarResponse::preEvaluate(workset); @@ -111,7 +111,7 @@ void QCAD::ResponseFieldAverage:: evaluateFields(typename Traits::EvalData workset) { // Zero out local response - PHAL::set(this->local_response, 0.0); + PHAL::set(this->local_response_eval, 0.0); ScalarT t; @@ -125,12 +125,12 @@ evaluateFields(typename Traits::EvalData workset) // Add to running total volume and field integral for (std::size_t qp=0; qp < numQPs; ++qp) { t = field(cell,qp) * weights(cell,qp); //component of integrated field - this->local_response(cell,0) += t; - this->global_response(0) += t; + this->local_response_eval(cell,0) += t; + this->global_response_eval(0) += t; t = weights(cell,qp); //component of integrated volume - this->local_response(cell,1) += t; - this->global_response(1) += t; + this->local_response_eval(cell,1) += t; + this->global_response_eval(1) += t; } } @@ -144,13 +144,13 @@ template void QCAD::ResponseFieldAverage:: postEvaluate(typename Traits::PostEvalData workset) { - PHAL::reduceAll(*workset.comm, Teuchos::REDUCE_SUM, this->global_response); + PHAL::reduceAll(*workset.comm, Teuchos::REDUCE_SUM, this->global_response_eval); int iNormalizer = 1; - if( fabs(this->global_response(iNormalizer)) > 1e-9 ) { + if( fabs(this->global_response_eval(iNormalizer)) > 1e-9 ) { for( int i=0; i < this->global_response.size(); i++) { if( i == iNormalizer ) continue; - this->global_response(i) /= this->global_response(iNormalizer); + this->global_response_eval(i) /= this->global_response_eval(iNormalizer); } } diff --git a/src/evaluators/QCAD_ResponseFieldIntegral_Def.hpp b/src/evaluators/QCAD_ResponseFieldIntegral_Def.hpp index 2dd68bdf5c..60b576aa52 100644 --- a/src/evaluators/QCAD_ResponseFieldIntegral_Def.hpp +++ b/src/evaluators/QCAD_ResponseFieldIntegral_Def.hpp @@ -171,7 +171,7 @@ void QCAD::ResponseFieldIntegral:: preEvaluate(typename Traits::PreEvalData workset) { // Zero out global response - PHAL::set(this->global_response, 0.0); + PHAL::set(this->global_response_eval, 0.0); // Do global initialization PHAL::SeparableScatterScalarResponse::preEvaluate(workset); @@ -183,7 +183,7 @@ void QCAD::ResponseFieldIntegral:: evaluateFields(typename Traits::EvalData workset) { // Zero out local response - PHAL::set(this->local_response, 0.0); + PHAL::set(this->local_response_eval, 0.0); if(opRegion->elementBlockIsInRegion(workset.EBName)) { @@ -252,8 +252,8 @@ evaluateFields(typename Traits::EvalData workset) //std::cout << "local response size = " << this->local_response.size() << std::endl; //std::cout << "cell = " << cell << std::endl; //std::cout << "workset size = " << workset.numCells << std::endl; - this->local_response(cell,0) += val; - this->global_response(0) += val; + this->local_response_eval(cell,0) += val; + this->global_response_eval(0) += val; } } @@ -278,10 +278,10 @@ template void QCAD::ResponseFieldIntegral:: postEvaluate(typename Traits::PostEvalData workset) { - PHAL::reduceAll(*workset.comm, Teuchos::REDUCE_SUM, this->global_response); + PHAL::reduceAll(*workset.comm, Teuchos::REDUCE_SUM, this->global_response_eval); - if (bPositiveOnly && this->global_response(0) < 1e-6) { - this->global_response(0) = 1e+100; + if (bPositiveOnly && this->global_response_eval(0) < 1e-6) { + this->global_response_eval(0) = 1e+100; } // Do global scattering diff --git a/src/evaluators/QCAD_ResponseFieldValue_Def.hpp b/src/evaluators/QCAD_ResponseFieldValue_Def.hpp index df4ab2e101..9659f5823a 100644 --- a/src/evaluators/QCAD_ResponseFieldValue_Def.hpp +++ b/src/evaluators/QCAD_ResponseFieldValue_Def.hpp @@ -159,7 +159,7 @@ postEvaluate(typename Traits::PostEvalData workset) Teuchos::RCP< Stokhos::EpetraVectorOrthogPoly > g_sg = workset.sg_g; if (g_sg != Teuchos::null) { for (int res = 0; res < this->field_components.size(); res++) { - typename PHAL::Ref::type val = this->global_response(this->field_components[res]); + auto val = this->global_response(this->field_components[res]); for (int block=0; blocksize(); block++) (*g_sg)[block][res] = val.val().coeff(block); } @@ -193,7 +193,7 @@ postEvaluate(typename Traits::PostEvalData workset) // Loop over responses for (int res = 0; res < this->field_components.size(); res++) { - ScalarT& val = this->global_response(this->field_components[res]); + auto val = this->global_response(this->field_components[res]); // Loop over nodes in cell for (int node_dof=0; node_dof g_mp = workset.mp_g; if (g_mp != Teuchos::null) { for (int res = 0; res < this->field_components.size(); res++) { - typename PHAL::Ref::type val = this->global_response(this->field_components[res]); + auto val = this->global_response(this->field_components[res]); for (int block=0; blocksize(); block++) (*g_mp)[block][res] = val.val().coeff(block); } @@ -271,7 +271,7 @@ postEvaluate(typename Traits::PostEvalData workset) // Loop over responses for (int res = 0; res < this->field_components.size(); res++) { - typename PHAL::Ref::type val = this->global_response(this->field_components[res]); + auto val = this->global_response(this->field_components[res]); // Loop over nodes in cell for (int node_dof=0; node_dof::size_type i=0; iglobal_response.size(); i++) - this->global_response(i) = initVals[i]; + this->global_response_eval(i) = initVals[i]; // Do global initialization QCAD::FieldValueScatterScalarResponse::preEvaluate(workset); @@ -477,7 +477,7 @@ evaluateFields(typename Traits::EvalData workset) max_nodeID = workset.wsElNodeEqID[cell]; // set g[0] = value of return field at the current cell (avg) - this->global_response(0)=0.0; + this->global_response_eval(0)=0.0; if(bReturnOpField) { for (std::size_t qp=0; qp < numQPs; ++qp) { qpVal = 0.0; @@ -487,7 +487,7 @@ evaluateFields(typename Traits::EvalData workset) } } else qpVal = opField(cell,qp); - this->global_response(0) += qpVal * weights(cell,qp); + this->global_response_eval(0) += qpVal * weights(cell,qp); } } else { @@ -499,20 +499,20 @@ evaluateFields(typename Traits::EvalData workset) } } else qpVal = retField(cell,qp); - this->global_response(0) += qpVal * weights(cell,qp); + this->global_response_eval(0) += qpVal * weights(cell,qp); } } - this->global_response(0) /= cellVol; + this->global_response_eval(0) /= cellVol; // set g[1] = value of the field operated on at the current cell (avg) - this->global_response(1) = opVal; + this->global_response_eval(1) = opVal; // set g[2+] = average qp coordinate values of the current cell for(std::size_t i=0; iglobal_response(i+2) = 0.0; + this->global_response_eval(i+2) = 0.0; for (std::size_t qp=0; qp < numQPs; ++qp) - this->global_response(i+2) += coordVec(cell,qp,i); - this->global_response(i+2) /= numQPs; + this->global_response_eval(i+2) += coordVec(cell,qp,i); + this->global_response_eval(i+2) /= numQPs; } } @@ -547,7 +547,7 @@ postEvaluate(typename Traits::PostEvalData workset) Teuchos::reduceAll( *workset.comm, Teuchos::REDUCE_MAX, 1, &procToBcast, &winner); - PHAL::broadcast(*workset.comm, winner, this->global_response); + PHAL::broadcast(*workset.comm, winner, this->global_response_eval); // Do global scattering if (workset.comm->getRank() == winner)