Skip to content

Commit

Permalink
Remove option "MESH_DEPENDS_ON_SOLUTION", issue #840
Browse files Browse the repository at this point in the history
  • Loading branch information
mperego committed Oct 20, 2022
1 parent 312fd26 commit dbc9832
Show file tree
Hide file tree
Showing 15 changed files with 14 additions and 60 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -447,35 +447,30 @@ if (BUILD_ALB64)
set(TRILINSTALLDIR ${CTEST_INSTALL_DIRECTORY}/TrilinosInstall)
set(BUILDTYPE "RELEASE")
set(FPE_CHECK "OFF")
set(MESH_DEP_ON_SOLN "ON")
set(MESH_DEP_ON_PARAMS "OFF")
endif(BUILD_ALB64)
if (BUILD_INTEL_ALBANY)
set(TRILINSTALLDIR ${CTEST_INSTALL_DIRECTORY}/TrilinosIntelInstall)
set(BUILDTYPE "RELEASE")
set(FPE_CHECK "OFF")
set(MESH_DEP_ON_SOLN "OFF")
set(MESH_DEP_ON_PARAMS "ON")
endif (BUILD_INTEL_ALBANY)
if (BUILD_ALB64CLANG)
set(TRILINSTALLDIR ${CTEST_INSTALL_DIRECTORY}/TrilinosInstallC11)
set(BUILDTYPE "RELEASE")
set(FPE_CHECK "OFF")
set(MESH_DEP_ON_SOLN "OFF")
set(MESH_DEP_ON_PARAMS "OFF")
endif (BUILD_ALB64CLANG)
if (BUILD_ALB64CLANGDBG)
set(TRILINSTALLDIR ${CTEST_INSTALL_DIRECTORY}/TrilinosInstallC11Dbg)
set(BUILDTYPE "DEBUG")
set(FPE_CHECK "ON")
set(MESH_DEP_ON_SOLN "OFF")
set(MESH_DEP_ON_PARAMS "OFF")
endif (BUILD_ALB64CLANGDBG)
if (BUILD_ALB64DBG)
set(TRILINSTALLDIR ${CTEST_INSTALL_DIRECTORY}/TrilinosDbg)
set(BUILDTYPE "DEBUG")
set(FPE_CHECK "ON")
set(MESH_DEP_ON_SOLN "OFF")
set(MESH_DEP_ON_PARAMS "OFF")
endif (BUILD_ALB64DBG)

Expand All @@ -485,7 +480,6 @@ endif (BUILD_ALB64DBG)
"-DENABLE_LANDICE:BOOL=ON"
"-DENABLE_UNIT_TESTS:BOOL=ON"
"-DENABLE_STRONG_FPE_CHECK:BOOL=ON"
"-DENABLE_MESH_DEPENDS_ON_SOLUTION:BOOL=${MESH_DEP_ON_SOLN}"
"-DENABLE_MESH_DEPENDS_ON_PARAMETERS:BOOL=${MESH_DEP_ON_PARAMS}"
"-DCMAKE_BUILD_TYPE:STRING=${BUILDTYPE}"
"-DENABLE_STRONG_FPE_CHECK:BOOL=${FPE_CHECK}"
Expand Down
1 change: 0 additions & 1 deletion src/Albany_config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@

// Whether mesh and parameters depend on each others and/or solution
#cmakedefine ALBANY_MESH_DEPENDS_ON_PARAMETERS
#cmakedefine ALBANY_MESH_DEPENDS_ON_SOLUTION

// Cuda options
#cmakedefine ALBANY_CUDA_ERROR_CHECK
Expand Down
4 changes: 2 additions & 2 deletions src/LandIce/problems/LandIce_StokesFOBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ constructInterpolationEvaluators (PHX::FieldManager<PHAL::AlbanyTraits>& fm0)
// if (st==FieldScalarType::ParamScalar) {
// useMemoization &= !Albany::params_depend_on_solution();
// } else if (st==FieldScalarType::MeshScalar) {
// useMemoization &= !Albany::mesh_depends_on_solution() && !Albany::mesh_depends_on_parameters();
// useMemoization &= !Albany::mesh_depends_on_parameters();
// }

// Get the needs of this field
Expand Down Expand Up @@ -819,7 +819,7 @@ constructInterpolationEvaluators (PHX::FieldManager<PHAL::AlbanyTraits>& fm0)
// if (st==FieldScalarType::ParamScalar) {
// useMemoization &= !Albany::params_depend_on_solution();
// } else if (st==FieldScalarType::MeshScalar) {
// useMemoization &= !Albany::mesh_depends_on_solution() && !Albany::mesh_depends_on_parameters();
// useMemoization &= !Albany::mesh_depends_on_parameters();
// }

// Get the right evaluator utils for this field.
Expand Down
2 changes: 1 addition & 1 deletion src/LandIce/problems/LandIce_StokesFOThickness.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ void StokesFOThickness::setFieldsProperties () {
StokesFOBase::setFieldsProperties();

// Fix the scalar type of ice_thickness_name, since in StokesFOThickness it depends on the solution.
// Note: the ST of surface_height doesn't *need* to be Scalar if MESH_DEPENDS_ON_SOLUTION=OFF,
// Note: the ST of surface_height doesn't *need* to be Scalar,
// But if they don't match StokesFOLateralResid would need a second template argument.
// This simply makes life easier.
setSingleFieldProperties(ice_thickness_name, FRT::Scalar, FST::Scalar);
Expand Down
32 changes: 3 additions & 29 deletions src/LandIce/problems/LandIce_StokesFOThickness.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,35 +252,9 @@ void StokesFOThickness::constructThicknessEvaluators (PHX::FieldManager<PHAL::Al
ev = Teuchos::rcp(new LandIce::ThicknessResid<EvalT,PHAL::AlbanyTraits>(*p,dl));
fm0.template registerEvaluator<EvalT>(ev);

if (Albany::mesh_depends_on_solution()) {
//--- Gather Coordinates ---//
p = Teuchos::rcp(new Teuchos::ParameterList("Gather Coordinate Vector"));

// Output:: Coordinate Vector at vertices
p->set<std::string>("Coordinate Vector Name", "Coord Vec Old");

ev = Teuchos::rcp(new PHAL::GatherCoordinateVector<EvalT,PHAL::AlbanyTraits>(*p,dl));
fm0.template registerEvaluator<EvalT>(ev);

//--- Update Z Coordinate ---//
p = Teuchos::rcp(new Teuchos::ParameterList("Update Z Coordinate"));

// Input
p->set<std::string>("Old Coords Name", "Coord Vec Old");
p->set<std::string>("New Coords Name", Albany::coord_vec_name);
p->set<std::string>("Thickness Increment Name", "Extruded " + dof_names[1]);
p->set<std::string>("Past Thickness Name", initial_ice_thickness_name);
p->set<std::string>("Top Surface Name", surface_height_name);
p->set<std::string>("Bed Topography Name", bed_topography_name);
p->set<Teuchos::ParameterList*>("Physical Parameter List", &params->sublist("LandIce Physical Parameters"));

ev = Teuchos::rcp(new LandIce::UpdateZCoordinateMovingTop<EvalT,PHAL::AlbanyTraits>(*p, dl));
fm0.template registerEvaluator<EvalT>(ev);
} else {
//---- Gather coordinates
ev = evalUtils.constructGatherCoordinateVectorEvaluator();
fm0.template registerEvaluator<EvalT> (ev);
}
//---- Gather coordinates
ev = evalUtils.constructGatherCoordinateVectorEvaluator();
fm0.template registerEvaluator<EvalT> (ev);

//--- Compute actual thickness --- //
p = Teuchos::rcp(new Teuchos::ParameterList("Update Thickness"));
Expand Down
3 changes: 1 addition & 2 deletions src/evaluators/interpolation/PHAL_DOFGradInterpolation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class FastSolutionGradInterpolationBase : public DOFGradInterpolationBase<EvalT,
}
};

#ifndef ALBANY_MESH_DEPENDS_ON_SOLUTION //assumes that the bases gradients are not FAD types
//this class assumes that the bases gradients are not FAD types
template<typename Traits>
class FastSolutionGradInterpolationBase<PHAL::AlbanyTraits::Jacobian, Traits, typename PHAL::AlbanyTraits::Jacobian::ScalarT>
: public DOFGradInterpolationBase<PHAL::AlbanyTraits::Jacobian, Traits, typename PHAL::AlbanyTraits::Jacobian::ScalarT> {
Expand Down Expand Up @@ -156,7 +156,6 @@ class FastSolutionGradInterpolationBase<PHAL::AlbanyTraits::Jacobian, Traits, ty
#endif

};
#endif //ALBANY_MESH_DEPENDS_ON_SOLUTION

// Some shortcut names
template<typename EvalT, typename Traits>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ evaluateFields(typename Traits::EvalData workset)

}
//Specialization for Jacobian evaluation taking advantage of the sparsity of the derivatives
//Note, this assumes that the mesh is not FAD type
// *********************************************************************
#ifndef ALBANY_MESH_DEPENDS_ON_SOLUTION

// Kokkos kernel for Jacobian
#ifdef ALBANY_KOKKOS_UNDER_DEVELOPMENT
Expand Down Expand Up @@ -238,7 +238,6 @@ evaluateFields(typename Traits::EvalData workset)


}
#endif //ALBANY_MESH_DEPENDS_ON_SOLUTION

//**********************************************************************

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ class FastSolutionTensorGradInterpolationBase : public DOFTensorGradInterpolatio


//! Specialization for Jacobian evaluation taking advantage of known sparsity
#ifndef ALBANY_MESH_DEPENDS_ON_SOLUTION
template<typename Traits>
class FastSolutionTensorGradInterpolationBase<PHAL::AlbanyTraits::Jacobian, Traits, typename PHAL::AlbanyTraits::Jacobian::ScalarT>
: public DOFTensorGradInterpolationBase<PHAL::AlbanyTraits::Jacobian, Traits, typename PHAL::AlbanyTraits::Jacobian::ScalarT>
Expand Down Expand Up @@ -117,7 +116,6 @@ class FastSolutionTensorGradInterpolationBase<PHAL::AlbanyTraits::Jacobian, Trai

std::size_t offset;
};
#endif

// Some shortcut names
template<typename EvalT, typename Traits>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ namespace PHAL {
//Specialization for Jacobian evaluation taking advantage of the sparsity of the derivatives

//**********************************************************************
#ifndef ALBANY_MESH_DEPENDS_ON_SOLUTION
template<typename Traits>
void FastSolutionTensorGradInterpolationBase<PHAL::AlbanyTraits::Jacobian, Traits, typename PHAL::AlbanyTraits::Jacobian::ScalarT>::
evaluateFields(typename Traits::EvalData workset)
Expand Down Expand Up @@ -101,6 +100,5 @@ namespace PHAL {
}
}
}
#endif

} // Namespace PHAL
3 changes: 1 addition & 2 deletions src/evaluators/interpolation/PHAL_DOFTensorInterpolation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class FastSolutionTensorInterpolationBase : public DOFTensorInterpolationBase<Ev


//! Specialization for Jacobian evaluation taking advantage of known sparsity
#ifndef ALBANY_MESH_DEPENDS_ON_SOLUTION
//! This assumes that the mesh coordinates are not a FAD type
template<typename Traits>
class FastSolutionTensorInterpolationBase<PHAL::AlbanyTraits::Jacobian, Traits, typename PHAL::AlbanyTraits::Jacobian::ScalarT>
: public DOFTensorInterpolationBase<PHAL::AlbanyTraits::Jacobian, Traits, typename PHAL::AlbanyTraits::Jacobian::ScalarT>
Expand Down Expand Up @@ -110,7 +110,6 @@ class FastSolutionTensorInterpolationBase<PHAL::AlbanyTraits::Jacobian, Traits,

std::size_t offset;
};
#endif


// Some shortcut names
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ evaluateFields(typename Traits::EvalData workset)
//**********************************************************************
//! Specialization for Jacobian evaluation taking advantage of known sparsity

#ifndef ALBANY_MESH_DEPENDS_ON_SOLUTION
template<typename Traits>
void FastSolutionTensorInterpolationBase<PHAL::AlbanyTraits::Jacobian, Traits, typename PHAL::AlbanyTraits::Jacobian::ScalarT>::
evaluateFields(typename Traits::EvalData workset)
Expand Down Expand Up @@ -97,7 +96,6 @@ evaluateFields(typename Traits::EvalData workset)
}
}
}
#endif //ALBANY_MESH_DEPENDS_ON_SOLUTION
//**********************************************************************

} // Namespace PHAL
4 changes: 2 additions & 2 deletions src/evaluators/interpolation/PHAL_DOFVecGradInterpolation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ class FastSolutionVecGradInterpolationBase : public DOFVecGradInterpolationBase<
};

//! Specialization for Jacobian evaluation taking advantage of known sparsity
#ifndef ALBANY_MESH_DEPENDS_ON_SOLUTION
//! This assumes that the Mesh coordinates are not a FAD type

template<typename Traits>
class FastSolutionVecGradInterpolationBase<PHAL::AlbanyTraits::Jacobian, Traits, typename PHAL::AlbanyTraits::Jacobian::ScalarT>
: public DOFVecGradInterpolationBase<PHAL::AlbanyTraits::Jacobian, Traits, typename PHAL::AlbanyTraits::Jacobian::ScalarT>
Expand Down Expand Up @@ -147,7 +148,6 @@ class FastSolutionVecGradInterpolationBase<PHAL::AlbanyTraits::Jacobian, Traits,

#endif
};
#endif //ALBANY_MESH_DEPENDS_ON_SOLUTION

// Some shortcut names
template<typename EvalT, typename Traits>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@ namespace PHAL {
}

// Specialization for Jacobian evaluation taking advantage of known sparsity
// This assumes that mesh coordinates are not FAD types
//**********************************************************************
//Kokkos functor Jacobian
#ifndef ALBANY_MESH_DEPENDS_ON_SOLUTION
#ifdef ALBANY_KOKKOS_UNDER_DEVELOPMENT
template<typename Traits>
KOKKOS_INLINE_FUNCTION
Expand Down Expand Up @@ -192,6 +192,5 @@ namespace PHAL {

#endif
}
#endif //ALBANY_MESH_DEPENDS_ON_SOLUTION

} // Namespace PHAL
3 changes: 1 addition & 2 deletions src/evaluators/interpolation/PHAL_DOFVecInterpolation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class FastSolutionVecInterpolationBase
};

//! Specialization for Jacobian evaluation taking advantage of known sparsity
#ifndef ALBANY_MESH_DEPENDS_ON_SOLUTION
// This assumes that the Mesh coordinates are not of FAD type
template<typename Traits>
class FastSolutionVecInterpolationBase<PHAL::AlbanyTraits::Jacobian, Traits, typename PHAL::AlbanyTraits::Jacobian::ScalarT>
: public DOFVecInterpolationBase<PHAL::AlbanyTraits::Jacobian, Traits, typename PHAL::AlbanyTraits::Jacobian::ScalarT>
Expand Down Expand Up @@ -111,7 +111,6 @@ class FastSolutionVecInterpolationBase<PHAL::AlbanyTraits::Jacobian, Traits, typ

std::size_t offset;
};
#endif //ALBANY_MESH_DEPENDS_ON_SOLUTION

// Some shortcut names
template<typename EvalT, typename Traits>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,9 @@ std::cout<< "DOFVecInterpolationBase Residual time = " << millisec << " " <<
}

// Specialization for Jacobian evaluation taking advantage of known sparsity
// This assumes that the Mesh coordinates are not of FAD type
//**********************************************************************

#ifndef ALBANY_MESH_DEPENDS_ON_SOLUTION

//Kokkos kernel for Jacobian
template <typename ScalarT, class Device, class MDFieldType, class MDFieldTypeFad1, class MDFieldTypeFad2>
class VecInterpolationJacob {
Expand Down Expand Up @@ -221,6 +220,5 @@ evaluateFields(typename Traits::EvalData workset)
#endif

}
#endif //ALBANY_MESH_DEPENDS_ON_SOLUTION

}

0 comments on commit dbc9832

Please sign in to comment.