From 19a6c5397bb47b1aeb4201f4f7064396f54d2daa Mon Sep 17 00:00:00 2001 From: Matthias Mayr Date: Fri, 17 Apr 2020 07:08:16 +0200 Subject: [PATCH 01/17] MueLu: make some documentation doxygen-compatible --- .../src/MueCentral/MueLu_Hierarchy_decl.hpp | 49 ++++++++++--------- 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/packages/muelu/src/MueCentral/MueLu_Hierarchy_decl.hpp b/packages/muelu/src/MueCentral/MueLu_Hierarchy_decl.hpp index cad87cbcab28..dad302ff975f 100644 --- a/packages/muelu/src/MueCentral/MueLu_Hierarchy_decl.hpp +++ b/packages/muelu/src/MueCentral/MueLu_Hierarchy_decl.hpp @@ -315,7 +315,7 @@ namespace MueLu { void describe(Teuchos::FancyOStream& out, const VerbLevel verbLevel = Default) const; void describe(Teuchos::FancyOStream& out, const Teuchos::EVerbosityLevel verbLevel = Teuchos::VERB_HIGH) const; - // Hierarchy::print is local hierarchy function, thus the statistics can be different from global ones + //! Hierarchy::print is local hierarchy function, thus the statistics can be different from global ones void print(std::ostream& out = std::cout, const VerbLevel verbLevel = (MueLu::Parameters | MueLu::Statistics0)) const; /*! Indicate whether the multigrid method is a preconditioner or a solver. @@ -335,7 +335,7 @@ namespace MueLu { void setlib(Xpetra::UnderlyingLib inlib) { lib_ = inlib; } Xpetra::UnderlyingLib lib() { return lib_; } - // force recreation of cached description_ next time description() is called: + //! force recreation of cached description_ next time description() is called: void ResetDescription() { description_ = ""; } @@ -355,45 +355,48 @@ namespace MueLu { //! Container for Level objects Array > Levels_; - // We replace coordinates GIDs to make them consistent with matrix GIDs, - // even if user does not do that. Ideally, though, we should completely - // remove any notion of coordinate GIDs, and deal only with LIDs, assuming - // that they are consistent with matrix block IDs + //! We replace coordinates GIDs to make them consistent with matrix GIDs, + //! even if user does not do that. Ideally, though, we should completely + //! remove any notion of coordinate GIDs, and deal only with LIDs, assuming + //! that they are consistent with matrix block IDs void ReplaceCoordinateMap(Level& level); - // Minimum size of a matrix on any level. If we fall below that, we stop - // the coarsening + //! Minimum size of a matrix on any level. If we fall below that, we stop + //! the coarsening Xpetra::global_size_t maxCoarseSize_; - // Potential speed up of the setup by skipping R construction, and using - // transpose matrix-matrix product for RAP + //! Potential speed up of the setup by skipping R construction, and using + //! transpose matrix-matrix product for RAP bool implicitTranspose_; - // Potential speed up of the solve by fusing prolongation and update steps. - // This can lead to more iterations to round-off error accumulation. + //! Potential speed up of the solve by fusing prolongation and update steps. + //! This can lead to more iterations to round-off error accumulation. bool fuseProlongationAndUpdate_; - // Potential speed up of the setup by skipping rebalancing of P and R, and - // doing extra import during solve + //! Potential speed up of the setup by skipping rebalancing of P and R, and + //! doing extra import during solve bool doPRrebalance_; - // Hierarchy may be used in a standalone mode, or as a preconditioner + //! Hierarchy may be used in a standalone mode, or as a preconditioner bool isPreconditioner_; - // V- or W-cycle + //! V- or W-cycle CycleType Cycle_; - // Scaling factor to be applied to coarse grid correction. + //! Scaling factor to be applied to coarse grid correction. double scalingFactor_; - // Epetra/Tpetra mode + //! Epetra/Tpetra mode Xpetra::UnderlyingLib lib_; - // cache description to avoid recreating in each call to description() - use ResetDescription() to force recreation in Setup, SetupRe, etc. + //! cache description to avoid recreating in each call to description() - use ResetDescription() to force recreation in Setup, SetupRe, etc. mutable std::string description_ = ""; // mutable so that we can lazily initialize in description(), which is declared const - //! Graph dumping - // If enabled, we dump the graph on a specified level into a specified file + /*! + @brief Graph dumping + + If enabled, we dump the graph on a specified level into a specified file + */ bool isDumpingEnabled_; int dumpLevel_; std::string dumpFile_; @@ -401,10 +404,10 @@ namespace MueLu { //! Convergece rate MagnitudeType rate_; - // Level managers used during the Setup + //! Level managers used during the Setup Array > levelManagers_; - // Caching (Multi)Vectors used in Hierarchy::Iterate() + //! Caching (Multi)Vectors used in Hierarchy::Iterate() int sizeOfAllocatedLevelMultiVectors_; Array > residual_, coarseRhs_, coarseX_, coarseImport_, coarseExport_, correction_; From 7be7eacf3fec918c9b9ec8b6f9d0d0b1272b4ac9 Mon Sep 17 00:00:00 2001 From: Matthias Mayr Date: Fri, 17 Apr 2020 08:08:49 +0200 Subject: [PATCH 02/17] MueLu: remove some trailing white spaces --- packages/muelu/src/MueCentral/MueLu_Hierarchy_decl.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/muelu/src/MueCentral/MueLu_Hierarchy_decl.hpp b/packages/muelu/src/MueCentral/MueLu_Hierarchy_decl.hpp index dad302ff975f..38a1fa77bad2 100644 --- a/packages/muelu/src/MueCentral/MueLu_Hierarchy_decl.hpp +++ b/packages/muelu/src/MueCentral/MueLu_Hierarchy_decl.hpp @@ -305,7 +305,7 @@ namespace MueLu { //@{ //! Return a simple one-line description of this object. - std::string description() const; + std::string description() const; /*! @brief Print the Hierarchy with some verbosity level to a FancyOStream object. @@ -335,7 +335,7 @@ namespace MueLu { void setlib(Xpetra::UnderlyingLib inlib) { lib_ = inlib; } Xpetra::UnderlyingLib lib() { return lib_; } - //! force recreation of cached description_ next time description() is called: + //! force recreation of cached description_ next time description() is called: void ResetDescription() { description_ = ""; } @@ -394,7 +394,7 @@ namespace MueLu { /*! @brief Graph dumping - + If enabled, we dump the graph on a specified level into a specified file */ bool isDumpingEnabled_; @@ -410,7 +410,7 @@ namespace MueLu { //! Caching (Multi)Vectors used in Hierarchy::Iterate() int sizeOfAllocatedLevelMultiVectors_; Array > residual_, coarseRhs_, coarseX_, coarseImport_, coarseExport_, correction_; - + }; //class Hierarchy From a767968dee89ac53147d9c992d47f4a33ba036b1 Mon Sep 17 00:00:00 2001 From: Matthias Mayr Date: Fri, 17 Apr 2020 07:09:55 +0200 Subject: [PATCH 03/17] MueLu: use Teuchos::null --- .../src/Misc/MueLu_InterfaceAggregationFactory_def.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/muelu/src/Misc/MueLu_InterfaceAggregationFactory_def.hpp b/packages/muelu/src/Misc/MueLu_InterfaceAggregationFactory_def.hpp index ae1e7d5920db..3e8c2f4770dd 100644 --- a/packages/muelu/src/Misc/MueLu_InterfaceAggregationFactory_def.hpp +++ b/packages/muelu/src/Misc/MueLu_InterfaceAggregationFactory_def.hpp @@ -61,9 +61,9 @@ RCP InterfaceAggregationFactory validParamList = rcp(new ParameterList()); - validParamList->set>("A", null, "Generating factory of A"); - validParamList->set>("Aggregates", null, "Generating factory of the Aggregates (for block 0,0)"); - validParamList->set>("DualNodeID2PrimalNodeID", null, "Generating factory of the DualNodeID2PrimalNodeID map"); + validParamList->set>("A", Teuchos::null, "Generating factory of A"); + validParamList->set>("Aggregates", Teuchos::null, "Generating factory of the Aggregates (for block 0,0)"); + validParamList->set>("DualNodeID2PrimalNodeID", Teuchos::null, "Generating factory of the DualNodeID2PrimalNodeID map"); validParamList->set("number of DOFs per dual node", Teuchos::ScalarTraits::one(), "Number of DOFs per dual node"); From 6af3e1ad99f40626da565eb1a3930352c9585de5 Mon Sep 17 00:00:00 2001 From: Matthias Mayr Date: Fri, 17 Apr 2020 08:01:46 +0200 Subject: [PATCH 04/17] MueLu: get dual/primal node mapping from user data For InterfaceAggregationFactory, the dual-to-primal node mapping needs to be provided by the user on the "user data" sublist. Then, it is treated as non-serializable data and added to the hierarchy during CreateXpetraPreconditioner(). Adapted the test. Part of #7164. --- .../MueLu_InterfaceAggregationFactory_def.hpp | 30 ++++++++----------- .../MueCentral/MueLu_HierarchyUtils_def.hpp | 15 ++++++++-- packages/muelu/src/Utils/MueLu_Utilities.cpp | 2 +- .../MeshTyingBlocked_SimpleSmoother.cpp | 15 ++++------ packages/muelu/test/meshtying/myXML.xml | 2 +- 5 files changed, 31 insertions(+), 33 deletions(-) diff --git a/packages/muelu/src/Misc/MueLu_InterfaceAggregationFactory_def.hpp b/packages/muelu/src/Misc/MueLu_InterfaceAggregationFactory_def.hpp index 3e8c2f4770dd..95ec7ca5e171 100644 --- a/packages/muelu/src/Misc/MueLu_InterfaceAggregationFactory_def.hpp +++ b/packages/muelu/src/Misc/MueLu_InterfaceAggregationFactory_def.hpp @@ -67,16 +67,6 @@ RCP InterfaceAggregationFactoryset("number of DOFs per dual node", Teuchos::ScalarTraits::one(), "Number of DOFs per dual node"); - /* - DualNodeID2PrimalNodeID represents the mapping between the Dual Node IDs to the Primal Node IDs. - This map makes one assumption: the number of dofs per dual node is a constant and has to be set in - the parameter list as "number of DOFs per dual node". - - Layout of the std::map: - - key: local ID of dual node - - value: local ID of primal node - */ - validParamList->set>>("DualNodeID2PrimalNodeID - level 0", null, ""); return validParamList; } @@ -86,7 +76,17 @@ void InterfaceAggregationFactory::Dec Input(currentLevel, "A"); Input(currentLevel, "Aggregates"); - if (currentLevel.GetLevelID() != 0) + if (currentLevel.GetLevelID() == 0) + { + if(currentLevel.IsAvailable("DualNodeID2PrimalNodeID", NoFactory::get())) { + currentLevel.DeclareInput("DualNodeID2PrimalNodeID", NoFactory::get(), this); + } else { + TEUCHOS_TEST_FOR_EXCEPTION(currentLevel.IsAvailable("DualNodeID2PrimalNodeID", NoFactory::get()), + Exceptions::RuntimeError, + "DualNodeID2PrimalNodeID was not provided by the user on level 0!"); + } + } + else { Input(currentLevel, "DualNodeID2PrimalNodeID"); } @@ -114,15 +114,9 @@ void InterfaceAggregationFactory::Bui RCP lagr2dof; if (currentLevel.GetLevelID() == 0) - { - lagr2dof = pL.get>("DualNodeID2PrimalNodeID - level 0"); - - TEUCHOS_TEST_FOR_EXCEPTION(lagr2dof.is_null(), std::runtime_error, prefix << " MueLu requires a provided DualNodeID2PrimalNodeID map on the finest level."); - } + lagr2dof = currentLevel.Get>("DualNodeID2PrimalNodeID", NoFactory::get()); else - { lagr2dof = Get>(currentLevel, "DualNodeID2PrimalNodeID"); - } const LocalOrdinal nDOFPerDualNode = pL.get("number of DOFs per dual node"); diff --git a/packages/muelu/src/MueCentral/MueLu_HierarchyUtils_def.hpp b/packages/muelu/src/MueCentral/MueLu_HierarchyUtils_def.hpp index e11671049847..a03f8450b79d 100644 --- a/packages/muelu/src/MueCentral/MueLu_HierarchyUtils_def.hpp +++ b/packages/muelu/src/MueCentral/MueLu_HierarchyUtils_def.hpp @@ -94,7 +94,7 @@ namespace MueLu { const std::string& name = it2->first; TEUCHOS_TEST_FOR_EXCEPTION(name != "A" && name != "P" && name != "R" && name != "K" && name != "M" && name != "Mdiag" && name != "Nullspace" && name != "Coordinates" && name != "pcoarsen: element to node map" && - name != "Node Comm" && + name != "Node Comm" && name != "DualNodeID2PrimalNodeID" && !IsParamMuemexVariable(name), Exceptions::InvalidArgument, std::string("MueLu::Utils::AddNonSerializableDataToHierarchy: parameter list contains unknown data type(") + name + ")"); @@ -131,7 +131,11 @@ namespace MueLu { level->AddKeepFlag(name,NoFactory::get(),MueLu::UserData); level->Set(name, Teuchos::getValue > >(it2->second), NoFactory::get()); } - + else if(name == "DualNodeID2PrimalNodeID") + { + level->AddKeepFlag(name,NoFactory::get(),MueLu::UserData); + level->Set(name, Teuchos::getValue>>(it2->second), NoFactory::get()); + } #ifdef HAVE_MUELU_INTREPID2 else if (name == "pcoarsen: element to node map") { @@ -187,7 +191,7 @@ namespace MueLu { const std::string& name = it2->first; TEUCHOS_TEST_FOR_EXCEPTION(name != "P" && name != "R" && name != "K" && name != "M" && name != "Mdiag" && name != "Nullspace" && name != "Coordinates" && name != "pcoarsen: element to node map" && - name != "Node Comm" && + name != "Node Comm" && name != "DualNodeID2PrimalNodeID" && !IsParamValidVariable(name), Exceptions::InvalidArgument, std::string("MueLu::Utils::AddNonSerializableDataToHierarchy: user data parameter list contains unknown data type (") + name + ")"); if( name == "P" || name == "R" || name == "K" || name == "M") { @@ -210,6 +214,11 @@ namespace MueLu { level->AddKeepFlag(name,NoFactory::get(),MueLu::UserData); level->Set(name, Teuchos::getValue > >(it2->second), NoFactory::get()); } + else if(name == "DualNodeID2PrimalNodeID") + { + level->AddKeepFlag(name,NoFactory::get(),MueLu::UserData); + level->Set(name, Teuchos::getValue>>(it2->second), NoFactory::get()); + } #ifdef HAVE_MUELU_INTREPID2 else if (name == "pcoarsen: element to node map") { diff --git a/packages/muelu/src/Utils/MueLu_Utilities.cpp b/packages/muelu/src/Utils/MueLu_Utilities.cpp index b13c8027dd74..e5c0bbbd4ac3 100644 --- a/packages/muelu/src/Utils/MueLu_Utilities.cpp +++ b/packages/muelu/src/Utils/MueLu_Utilities.cpp @@ -93,7 +93,7 @@ namespace MueLu { for (ParameterList::ConstIterator it2 = levelList.begin(); it2 != levelList.end(); it2++) { const std::string& name = it2->first; if (name == "A" || name == "P" || name == "R" || name== "M" || name == "Mdiag" || name == "K" || name == "Nullspace" || name == "Coordinates" - || name == "Node Comm" + || name == "Node Comm" || name == "DualNodeID2PrimalNodeID" #ifdef HAVE_MUELU_INTREPID2 // For the IntrepidPCoarsenFactory || name == "pcoarsen: element to node map" #endif diff --git a/packages/muelu/test/meshtying/MeshTyingBlocked_SimpleSmoother.cpp b/packages/muelu/test/meshtying/MeshTyingBlocked_SimpleSmoother.cpp index 9f9692ee73dc..1568b380a516 100644 --- a/packages/muelu/test/meshtying/MeshTyingBlocked_SimpleSmoother.cpp +++ b/packages/muelu/test/meshtying/MeshTyingBlocked_SimpleSmoother.cpp @@ -45,6 +45,7 @@ // @HEADER // MueLu +#include #include #include @@ -209,17 +210,11 @@ int main(int argc, char *argv[]) std::string xmlFile = "myXML.xml"; RCP params = Teuchos::getParametersFromXmlFile(xmlFile); - RCP paramsF, paramsI; - paramsF = sublist(params, "Factories"); - paramsI = sublist(paramsF, "myInterfaceAggs2"); - paramsI->set>>("DualNodeID2PrimalNodeID - level 0", rcpFromRef(myLagr2Dof)); - - ParameterListInterpreter mueLuFactory(*params, comm); - RCP H = mueLuFactory.CreateHierarchy(); - H->GetLevel(0)->Set("A", rcp_dynamic_cast(blockedMatrix)); + ParameterList& userDataParams = params->sublist("user data"); + userDataParams.set>>("DualNodeID2PrimalNodeID", rcpFromRef(myLagr2Dof)); + + RCP H = MueLu::CreateXpetraPreconditioner(Teuchos::rcp_dynamic_cast(blockedMatrix, true), *params); H->IsPreconditioner(true); - H->SetDefaultVerbLevel(MueLu::Extreme); - mueLuFactory.SetupHierarchy(*H); // Create the preconditioned GMRES solver typedef xpetra_mvector_type MV; diff --git a/packages/muelu/test/meshtying/myXML.xml b/packages/muelu/test/meshtying/myXML.xml index 73665fb086be..dd39beeb8278 100644 --- a/packages/muelu/test/meshtying/myXML.xml +++ b/packages/muelu/test/meshtying/myXML.xml @@ -217,7 +217,7 @@ - + From 87bb388bacc125c2cd5ab5642f14d03435e0257d Mon Sep 17 00:00:00 2001 From: Matthias Mayr Date: Fri, 17 Apr 2020 08:07:10 +0200 Subject: [PATCH 05/17] MueLu: adapt doc of non-serializable data - Use proper doxygen code formatting - Update lists of non-serializable data and make future extensions easier --- .../MueCentral/MueLu_HierarchyUtils_decl.hpp | 28 +++++++++++++--- packages/muelu/src/Utils/MueLu_Utilities.cpp | 6 ---- .../muelu/src/Utils/MueLu_Utilities_decl.hpp | 32 ++++++++++++++++--- 3 files changed, 52 insertions(+), 14 deletions(-) diff --git a/packages/muelu/src/MueCentral/MueLu_HierarchyUtils_decl.hpp b/packages/muelu/src/MueCentral/MueLu_HierarchyUtils_decl.hpp index 05312ceb64c8..acb210e3360e 100644 --- a/packages/muelu/src/MueCentral/MueLu_HierarchyUtils_decl.hpp +++ b/packages/muelu/src/MueCentral/MueLu_HierarchyUtils_decl.hpp @@ -105,10 +105,30 @@ namespace MueLu { #include "MueLu_UseShortNames.hpp" public: /*! - * This routine is used by the CreateE/TpetraPreconditioner routines. - * Adds the following non-serializable data (A,P,R,Nullspace,Coordinates) from level-specific sublist nonSerialList, - * calling AddNewLevel as appropriate. - */ + \brief Add non-serializable data to Hierarchy + + Add non-serializable data given level-specific sublist \c nonSerialList to the Hierarchy \c H. + Calling \c AddLevel() along the way, if necessary. + + Non-serializable data to be added: + - Operator "A" + - Prolongator "P" + - Restrictor "R" + - "M" + - "Mdiag" + - "K" + - Nullspace information "Nullspace" + - Coordinate information "Coordinates" + - "Node Comm" + - Primal-to-dual node mapping "DualNodeID2PrimalNodeID" + - "pcoarsen: element to node map + + This routine is used by the CreateXpetraPreconditioner() routine. + + @param HM + @param H + @param nonSerialList Parameter list containing non-serializable data + */ static void AddNonSerializableDataToHierarchy(HierarchyManager& HM, Hierarchy& H, const ParameterList& nonSerialList); }; diff --git a/packages/muelu/src/Utils/MueLu_Utilities.cpp b/packages/muelu/src/Utils/MueLu_Utilities.cpp index e5c0bbbd4ac3..c8ee57576872 100644 --- a/packages/muelu/src/Utils/MueLu_Utilities.cpp +++ b/packages/muelu/src/Utils/MueLu_Utilities.cpp @@ -62,12 +62,6 @@ namespace MueLu { - /* Removes the following non-serializable data (A,P,R,Nullspace,Coordinates) - from level-specific sublists from inList - and moves it to nonSerialList. Everything else is copied to serialList. - This function returns the level number of the highest level for which - non-serializable data was provided. - */ long ExtractNonSerializableData(const Teuchos::ParameterList& inList, Teuchos::ParameterList& serialList, Teuchos::ParameterList& nonSerialList) { using Teuchos::ParameterList; diff --git a/packages/muelu/src/Utils/MueLu_Utilities_decl.hpp b/packages/muelu/src/Utils/MueLu_Utilities_decl.hpp index 30bc43a51d50..9e7b60ce654f 100644 --- a/packages/muelu/src/Utils/MueLu_Utilities_decl.hpp +++ b/packages/muelu/src/Utils/MueLu_Utilities_decl.hpp @@ -892,10 +892,34 @@ namespace MueLu { - /*! Removes the following non-serializable data (A,P,R,Nullspace,Coordinates) from level-specific sublists from inList - and moves it to nonSerialList. Everything else is copied to serialList. This function returns the level number of the highest level - for which non-serializable data was provided. - */ + /*! + \bfief Extract non-serializable data from level-specific sublist and move to separate parameter list + + Look through the level-specific sublists form \c inList, extract non-serializable data and move it to \c nonSerialList. + Everything else is copied to the \c serialList. + + \note Data is considered "non-serializable" if it is not the same on every rank/processor. + + Non-serializable data to be moved: + - Operator "A" + - Prolongator "P" + - Restrictor "R" + - "M" + - "Mdiag" + - "K" + - Nullspace information "Nullspace" + - Coordinate information "Coordinates" + - "Node Comm" + - Primal-to-dual node mapping "DualNodeID2PrimalNodeID" + - "pcoarsen: element to node map + + @param[in] inList List with all input parameters/data as provided by the user + @param[out] serialList All serializable data from the input list + @param[out] nonSerialList All non-serializable, i.e. rank-specific data form the input list + + @return This function returns the level number of the highest level for which non-serializable data was provided. + + */ long ExtractNonSerializableData(const Teuchos::ParameterList& inList, Teuchos::ParameterList& serialList, Teuchos::ParameterList& nonSerialList); From 39e4d95c93a44fde59233e7e870896d313cffc49 Mon Sep 17 00:00:00 2001 From: Matthias Mayr Date: Fri, 17 Apr 2020 09:26:04 +0200 Subject: [PATCH 06/17] MueLu: fix typos --- packages/muelu/src/Utils/MueLu_Utilities_decl.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/muelu/src/Utils/MueLu_Utilities_decl.hpp b/packages/muelu/src/Utils/MueLu_Utilities_decl.hpp index 9e7b60ce654f..2e1a19694e77 100644 --- a/packages/muelu/src/Utils/MueLu_Utilities_decl.hpp +++ b/packages/muelu/src/Utils/MueLu_Utilities_decl.hpp @@ -893,7 +893,7 @@ namespace MueLu { /*! - \bfief Extract non-serializable data from level-specific sublist and move to separate parameter list + \brief Extract non-serializable data from level-specific sublists and move it to a separate parameter list Look through the level-specific sublists form \c inList, extract non-serializable data and move it to \c nonSerialList. Everything else is copied to the \c serialList. @@ -915,7 +915,7 @@ namespace MueLu { @param[in] inList List with all input parameters/data as provided by the user @param[out] serialList All serializable data from the input list - @param[out] nonSerialList All non-serializable, i.e. rank-specific data form the input list + @param[out] nonSerialList All non-serializable, i.e. rank-specific data from the input list @return This function returns the level number of the highest level for which non-serializable data was provided. From f338d6178b357e32054a06f7f06ca9a353a08faf Mon Sep 17 00:00:00 2001 From: "Roscoe A. Bartlett" Date: Sun, 19 Apr 2020 15:42:49 -0600 Subject: [PATCH 07/17] ATDM: cee-rhel6: switch from clang-5.0.1 to clang-9.0.1 (ATDV-322) I tried to add a 'dbg' build but the test suite is very slow and there are a lot of timeouts. --- ...6_clang-9.0.1_openmpi-4.0.2_serial_static_dbg.sh | 5 +++++ ..._clang-9.0.1_openmpi-4.0.2_serial_static_opt.sh} | 0 cmake/std/atdm/cee-rhel6/all_supported_builds.sh | 6 +++++- cmake/std/atdm/cee-rhel6/custom_builds.sh | 13 +++++++++++-- cmake/std/atdm/cee-rhel6/environment.sh | 13 +++++++++++++ 5 files changed, 34 insertions(+), 3 deletions(-) create mode 100755 cmake/ctest/drivers/atdm/cee-rhel6/drivers/Trilinos-atdm-cee-rhel6_clang-9.0.1_openmpi-4.0.2_serial_static_dbg.sh rename cmake/ctest/drivers/atdm/cee-rhel6/drivers/{Trilinos-atdm-cee-rhel6_clang-5.0.1_openmpi-4.0.2_serial_static_opt.sh => Trilinos-atdm-cee-rhel6_clang-9.0.1_openmpi-4.0.2_serial_static_opt.sh} (100%) diff --git a/cmake/ctest/drivers/atdm/cee-rhel6/drivers/Trilinos-atdm-cee-rhel6_clang-9.0.1_openmpi-4.0.2_serial_static_dbg.sh b/cmake/ctest/drivers/atdm/cee-rhel6/drivers/Trilinos-atdm-cee-rhel6_clang-9.0.1_openmpi-4.0.2_serial_static_dbg.sh new file mode 100755 index 000000000000..0faf252db14a --- /dev/null +++ b/cmake/ctest/drivers/atdm/cee-rhel6/drivers/Trilinos-atdm-cee-rhel6_clang-9.0.1_openmpi-4.0.2_serial_static_dbg.sh @@ -0,0 +1,5 @@ +#!/bin/bash +if [ "${Trilinos_TRACK}" == "" ]; then + export Trilinos_TRACK=Experimental +fi +$WORKSPACE/Trilinos/cmake/ctest/drivers/atdm/cee-rhel6/local-driver.sh diff --git a/cmake/ctest/drivers/atdm/cee-rhel6/drivers/Trilinos-atdm-cee-rhel6_clang-5.0.1_openmpi-4.0.2_serial_static_opt.sh b/cmake/ctest/drivers/atdm/cee-rhel6/drivers/Trilinos-atdm-cee-rhel6_clang-9.0.1_openmpi-4.0.2_serial_static_opt.sh similarity index 100% rename from cmake/ctest/drivers/atdm/cee-rhel6/drivers/Trilinos-atdm-cee-rhel6_clang-5.0.1_openmpi-4.0.2_serial_static_opt.sh rename to cmake/ctest/drivers/atdm/cee-rhel6/drivers/Trilinos-atdm-cee-rhel6_clang-9.0.1_openmpi-4.0.2_serial_static_opt.sh diff --git a/cmake/std/atdm/cee-rhel6/all_supported_builds.sh b/cmake/std/atdm/cee-rhel6/all_supported_builds.sh index 790a84823fb6..c65d9ccd4e8f 100644 --- a/cmake/std/atdm/cee-rhel6/all_supported_builds.sh +++ b/cmake/std/atdm/cee-rhel6/all_supported_builds.sh @@ -3,8 +3,12 @@ export ATDM_CONFIG_CTEST_S_BUILD_NAME_PREFIX=Trilinos-atdm- export ATDM_CONFIG_ALL_SUPPORTED_BUILDS=( - cee-rhel6_clang-5.0.1_openmpi-4.0.2_serial_static_opt # SPARC CI build + #cee-rhel6_clang-9.0.1_openmpi-4.0.2_serial_static_dbg # SPARC has installs with this build + cee-rhel6_clang-9.0.1_openmpi-4.0.2_serial_static_opt # SPARC CI build cee-rhel6_gnu-7.2.0_openmpi-4.0.2_serial_shared_opt # SPARC CI build cee-rhel6_intel-18.0.2_mpich2-3.2_openmp_static_opt # SPARC CI build cee-rhel6_intel-19.0.3_intelmpi-2018.4_serial_static_opt # SPARC Nightly bulid ) + +# NOTE: Above, we have commented out the 'dbg' build because it was running +# the test suite very slow and had many timeouts (see ATDV-322) diff --git a/cmake/std/atdm/cee-rhel6/custom_builds.sh b/cmake/std/atdm/cee-rhel6/custom_builds.sh index d74691a793d7..3f6db808f74f 100644 --- a/cmake/std/atdm/cee-rhel6/custom_builds.sh +++ b/cmake/std/atdm/cee-rhel6/custom_builds.sh @@ -16,10 +16,18 @@ elif [[ $ATDM_CONFIG_BUILD_NAME == *"clang-5.0.1-openmpi-4.0.2"* ]] \ || [[ $ATDM_CONFIG_BUILD_NAME == *"clang-5.0.1_openmpi-4.0.2"* ]] \ || [[ $ATDM_CONFIG_BUILD_NAME == *"clang-5.0.1"* ]] \ || [[ $ATDM_CONFIG_BUILD_NAME == *"clang-5"* ]] \ + ; then + export ATDM_CONFIG_COMPILER=CLANG-5.0.1_OPENMPI-4.0.2 + # Must list the default clang build last for correct matching of of defaults + +elif [[ $ATDM_CONFIG_BUILD_NAME == *"clang-9.0.1-openmpi-4.0.2"* ]] \ + || [[ $ATDM_CONFIG_BUILD_NAME == *"clang-9.0.1_openmpi-4.0.2"* ]] \ + || [[ $ATDM_CONFIG_BUILD_NAME == *"clang-9.0.1"* ]] \ + || [[ $ATDM_CONFIG_BUILD_NAME == *"clang-5"* ]] \ || [[ $ATDM_CONFIG_BUILD_NAME == *"clang"* ]] \ || [[ $ATDM_CONFIG_BUILD_NAME == *"default" ]] \ ; then - export ATDM_CONFIG_COMPILER=CLANG-5.0.1_OPENMPI-4.0.2 + export ATDM_CONFIG_COMPILER=CLANG-9.0.1_OPENMPI-4.0.2 # Must list the default clang build last for correct matching of of defaults elif [[ $ATDM_CONFIG_BUILD_NAME == *"gnu-7.2.0-openmpi-1.10.2"* ]] \ @@ -60,7 +68,8 @@ else echo "*** Supported compilers include:" echo "***" echo "**** clang-5.0.1-openmpi-1.10.2 (DEPRECATED)" - echo "**** clang-5.0.1-openmpi-4.0.2 (default, default clang)" + echo "**** clang-5.0.1-openmpi-4.0.2 (DEPRECATED)" + echo "**** clang-9.0.1-openmpi-4.0.2 (default, default clang)" echo "**** gnu-7.2.0-openmpi-1.10.2 (DEPRECATED)" echo "**** gnu-7.2.0-openmpi-4.0.2 (default gnu)" echo "**** intel-18.0.2-mpich2-3.2 (DEPRECATED)" diff --git a/cmake/std/atdm/cee-rhel6/environment.sh b/cmake/std/atdm/cee-rhel6/environment.sh index 9575a9d36e1c..252721d01af5 100755 --- a/cmake/std/atdm/cee-rhel6/environment.sh +++ b/cmake/std/atdm/cee-rhel6/environment.sh @@ -88,6 +88,19 @@ elif [[ "$ATDM_CONFIG_COMPILER" == "CLANG-5.0.1_OPENMPI-4.0.2" ]]; then fi export ATDM_CONFIG_MKL_ROOT=${CBLAS_ROOT} +elif [[ "$ATDM_CONFIG_COMPILER" == "CLANG-9.0.1_OPENMPI-4.0.2" ]]; then + module load sparc-dev/clang-9.0.1_openmpi-4.0.2 + export OMPI_CXX=`which clang++` + export OMPI_CC=`which clang` + export OMPI_FC=`which gfortran` + export MPICC=`which mpicc` + export MPICXX=`which mpicxx` + export MPIF90=`which mpif90` + if [[ "$ATDM_CONFIG_ENABLE_STRONG_WARNINGS" == "1" ]]; then + export ATDM_CONFIG_CXX_FLAGS="${ATDM_CONFIG_GNU_CXX_WARNINGS}" + fi + export ATDM_CONFIG_MKL_ROOT=${CBLAS_ROOT} + elif [[ "$ATDM_CONFIG_COMPILER" == "GNU-7.2.0_OPENMPI-1.10.2" ]] ; then module load sparc-dev/gcc-7.2.0_openmpi-1.10.2 unset OMP_NUM_THREADS # SPARC module sets these and we must unset! From 80d8a8d103c02ad8eab2ec8867272176c4fe0c4a Mon Sep 17 00:00:00 2001 From: "Roscoe A. Bartlett" Date: Mon, 20 Apr 2020 08:54:36 -0600 Subject: [PATCH 08/17] ATDM: cee-rhel6: fixed clang-5 typo to clang-9 (ATDV-322) --- cmake/std/atdm/cee-rhel6/custom_builds.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/std/atdm/cee-rhel6/custom_builds.sh b/cmake/std/atdm/cee-rhel6/custom_builds.sh index 3f6db808f74f..b4fbeeb6b75b 100644 --- a/cmake/std/atdm/cee-rhel6/custom_builds.sh +++ b/cmake/std/atdm/cee-rhel6/custom_builds.sh @@ -23,7 +23,7 @@ elif [[ $ATDM_CONFIG_BUILD_NAME == *"clang-5.0.1-openmpi-4.0.2"* ]] \ elif [[ $ATDM_CONFIG_BUILD_NAME == *"clang-9.0.1-openmpi-4.0.2"* ]] \ || [[ $ATDM_CONFIG_BUILD_NAME == *"clang-9.0.1_openmpi-4.0.2"* ]] \ || [[ $ATDM_CONFIG_BUILD_NAME == *"clang-9.0.1"* ]] \ - || [[ $ATDM_CONFIG_BUILD_NAME == *"clang-5"* ]] \ + || [[ $ATDM_CONFIG_BUILD_NAME == *"clang-9"* ]] \ || [[ $ATDM_CONFIG_BUILD_NAME == *"clang"* ]] \ || [[ $ATDM_CONFIG_BUILD_NAME == *"default" ]] \ ; then From d63778bb1e0257980356342f8c0dd5aea20283d5 Mon Sep 17 00:00:00 2001 From: "Roscoe A. Bartlett" Date: Mon, 20 Apr 2020 15:36:29 -0600 Subject: [PATCH 09/17] ATDM: cee-rhel6: Remove support for deprecated clang and gnu compilers/mpi (ATDV-322) I also removed the "DEPRECATED" label from the intel-18.0.2-mpich2-3.2 compiler because SPARC's CI build on the CEE system machines is still using this compiler and *not* the updated intel-19.0.3-intelmpi-2018.4 for some reason. --- cmake/std/atdm/cee-rhel6/custom_builds.sh | 25 +----------- cmake/std/atdm/cee-rhel6/environment.sh | 47 +---------------------- 2 files changed, 3 insertions(+), 69 deletions(-) diff --git a/cmake/std/atdm/cee-rhel6/custom_builds.sh b/cmake/std/atdm/cee-rhel6/custom_builds.sh index b4fbeeb6b75b..696e96002255 100644 --- a/cmake/std/atdm/cee-rhel6/custom_builds.sh +++ b/cmake/std/atdm/cee-rhel6/custom_builds.sh @@ -7,20 +7,7 @@ # Custom compiler selection logic -if [[ $ATDM_CONFIG_BUILD_NAME == *"clang-5.0.1-openmpi-1.10.2"* ]] \ - || [[ $ATDM_CONFIG_BUILD_NAME == *"clang-5.0.1_openmpi-1.10.2"* ]] \ - ; then - export ATDM_CONFIG_COMPILER=CLANG-5.0.1_OPENMPI-1.10.2 - -elif [[ $ATDM_CONFIG_BUILD_NAME == *"clang-5.0.1-openmpi-4.0.2"* ]] \ - || [[ $ATDM_CONFIG_BUILD_NAME == *"clang-5.0.1_openmpi-4.0.2"* ]] \ - || [[ $ATDM_CONFIG_BUILD_NAME == *"clang-5.0.1"* ]] \ - || [[ $ATDM_CONFIG_BUILD_NAME == *"clang-5"* ]] \ - ; then - export ATDM_CONFIG_COMPILER=CLANG-5.0.1_OPENMPI-4.0.2 - # Must list the default clang build last for correct matching of of defaults - -elif [[ $ATDM_CONFIG_BUILD_NAME == *"clang-9.0.1-openmpi-4.0.2"* ]] \ +if [[ $ATDM_CONFIG_BUILD_NAME == *"clang-9.0.1-openmpi-4.0.2"* ]] \ || [[ $ATDM_CONFIG_BUILD_NAME == *"clang-9.0.1_openmpi-4.0.2"* ]] \ || [[ $ATDM_CONFIG_BUILD_NAME == *"clang-9.0.1"* ]] \ || [[ $ATDM_CONFIG_BUILD_NAME == *"clang-9"* ]] \ @@ -30,11 +17,6 @@ elif [[ $ATDM_CONFIG_BUILD_NAME == *"clang-9.0.1-openmpi-4.0.2"* ]] \ export ATDM_CONFIG_COMPILER=CLANG-9.0.1_OPENMPI-4.0.2 # Must list the default clang build last for correct matching of of defaults -elif [[ $ATDM_CONFIG_BUILD_NAME == *"gnu-7.2.0-openmpi-1.10.2"* ]] \ - || [[ $ATDM_CONFIG_BUILD_NAME == *"gnu-7.2.0_openmpi-1.10.2"* ]] \ - ; then - export ATDM_CONFIG_COMPILER=GNU-7.2.0_OPENMPI-1.10.2 - elif [[ $ATDM_CONFIG_BUILD_NAME == *"gnu-7.2.0-openmpi-4.0.2"* ]] \ || [[ $ATDM_CONFIG_BUILD_NAME == *"gnu-7.2.0_openmpi-4.0.2"* ]] \ || [[ $ATDM_CONFIG_BUILD_NAME == *"gnu-7.2.0"* ]] \ @@ -67,12 +49,9 @@ else echo "***" echo "*** Supported compilers include:" echo "***" - echo "**** clang-5.0.1-openmpi-1.10.2 (DEPRECATED)" - echo "**** clang-5.0.1-openmpi-4.0.2 (DEPRECATED)" echo "**** clang-9.0.1-openmpi-4.0.2 (default, default clang)" - echo "**** gnu-7.2.0-openmpi-1.10.2 (DEPRECATED)" echo "**** gnu-7.2.0-openmpi-4.0.2 (default gnu)" - echo "**** intel-18.0.2-mpich2-3.2 (DEPRECATED)" + echo "**** intel-18.0.2-mpich2-3.2" echo "**** intel-19.0.3-intelmpi-2018.4 (default intel)" echo "***" return diff --git a/cmake/std/atdm/cee-rhel6/environment.sh b/cmake/std/atdm/cee-rhel6/environment.sh index 252721d01af5..6d6ab916b00e 100755 --- a/cmake/std/atdm/cee-rhel6/environment.sh +++ b/cmake/std/atdm/cee-rhel6/environment.sh @@ -62,33 +62,7 @@ if [[ "${ATDM_CONFIG_ENABLE_STRONG_WARNINGS}" == "" ]] ; then export ATDM_CONFIG_ENABLE_STRONG_WARNINGS=1 fi -if [[ "$ATDM_CONFIG_COMPILER" == "CLANG-5.0.1_OPENMPI-1.10.2" ]]; then - module load sparc-dev/clang-5.0.1_openmpi-1.10.2 - export OMPI_CXX=`which clang++` - export OMPI_CC=`which clang` - export OMPI_FC=`which gfortran` - export MPICC=`which mpicc` - export MPICXX=`which mpicxx` - export MPIF90=`which mpif90` - if [[ "$ATDM_CONFIG_ENABLE_STRONG_WARNINGS" == "1" ]]; then - export ATDM_CONFIG_CXX_FLAGS="${ATDM_CONFIG_GNU_CXX_WARNINGS}" - fi - export ATDM_CONFIG_MKL_ROOT=${CBLAS_ROOT} - -elif [[ "$ATDM_CONFIG_COMPILER" == "CLANG-5.0.1_OPENMPI-4.0.2" ]]; then - module load sparc-dev/clang-5.0.1_openmpi-4.0.2 - export OMPI_CXX=`which clang++` - export OMPI_CC=`which clang` - export OMPI_FC=`which gfortran` - export MPICC=`which mpicc` - export MPICXX=`which mpicxx` - export MPIF90=`which mpif90` - if [[ "$ATDM_CONFIG_ENABLE_STRONG_WARNINGS" == "1" ]]; then - export ATDM_CONFIG_CXX_FLAGS="${ATDM_CONFIG_GNU_CXX_WARNINGS}" - fi - export ATDM_CONFIG_MKL_ROOT=${CBLAS_ROOT} - -elif [[ "$ATDM_CONFIG_COMPILER" == "CLANG-9.0.1_OPENMPI-4.0.2" ]]; then +if [[ "$ATDM_CONFIG_COMPILER" == "CLANG-9.0.1_OPENMPI-4.0.2" ]]; then module load sparc-dev/clang-9.0.1_openmpi-4.0.2 export OMPI_CXX=`which clang++` export OMPI_CC=`which clang` @@ -101,25 +75,6 @@ elif [[ "$ATDM_CONFIG_COMPILER" == "CLANG-9.0.1_OPENMPI-4.0.2" ]]; then fi export ATDM_CONFIG_MKL_ROOT=${CBLAS_ROOT} -elif [[ "$ATDM_CONFIG_COMPILER" == "GNU-7.2.0_OPENMPI-1.10.2" ]] ; then - module load sparc-dev/gcc-7.2.0_openmpi-1.10.2 - unset OMP_NUM_THREADS # SPARC module sets these and we must unset! - unset OMP_PROC_BIND - unset OMP_PLACES - export OMPI_CXX=`which g++` - export OMPI_CC=`which gcc` - export OMPI_FC=`which gfortran` - export MPICC=`which mpicc` - export MPICXX=`which mpicxx` - export MPIF90=`which mpif90` - if [[ "$ATDM_CONFIG_ENABLE_STRONG_WARNINGS" == "1" ]]; then - export ATDM_CONFIG_CXX_FLAGS="${ATDM_CONFIG_GNU_CXX_WARNINGS}" - fi - export ATDM_CONFIG_MKL_ROOT=${CBLAS_ROOT} - export ATDM_CONFIG_MPI_EXEC=mpirun - export ATDM_CONFIG_MPI_EXEC_NUMPROCS_FLAG=-np - export ATDM_CONFIG_MPI_PRE_FLAGS="--bind-to;none" - elif [[ "$ATDM_CONFIG_COMPILER" == "GNU-7.2.0_OPENMPI-4.0.2" ]] ; then module load sparc-dev/gcc-7.2.0_openmpi-4.0.2 unset OMP_NUM_THREADS # SPARC module sets these and we must unset! From 96de5ceb267369393b9e5080cc2e17a7b3bf61bb Mon Sep 17 00:00:00 2001 From: Alan Williams Date: Mon, 20 Apr 2020 16:24:27 -0600 Subject: [PATCH 10/17] Make timer unit-tests more robust to prevent failures due to noise. Put the tolerance in terms of milliseconds and make it looser. If this doesn't help we may need to rethink these tests. --- .../stk_util/diag/UnitTestTimer.cpp | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/packages/stk/stk_unit_tests/stk_util/diag/UnitTestTimer.cpp b/packages/stk/stk_unit_tests/stk_util/diag/UnitTestTimer.cpp index 89a5b984f306..090c5abdfe86 100644 --- a/packages/stk/stk_unit_tests/stk_util/diag/UnitTestTimer.cpp +++ b/packages/stk/stk_unit_tests/stk_util/diag/UnitTestTimer.cpp @@ -159,6 +159,8 @@ struct Object } // namespace +constexpr double millisecTolerance = 1.e-2; //10 millis for robustness + TEST(UnitTestTimer, UnitTest) { stk::diag::TimeBlock root_time_block(unitTestTimer()); @@ -175,21 +177,21 @@ TEST(UnitTestTimer, UnitTest) std::ostringstream oss; oss << x << std::endl; - std::this_thread::sleep_for(std::chrono::milliseconds(10)); + std::this_thread::sleep_for(std::chrono::milliseconds(20)); lap_timer.lap(); stk::diag::MetricTraits::Type lap_time = lap_timer.getMetric().getLap(); - EXPECT_NEAR(0.01, lap_time, 1.0e-3); + EXPECT_NEAR(0.02, lap_time, millisecTolerance); - std::this_thread::sleep_for(std::chrono::milliseconds(10)); + std::this_thread::sleep_for(std::chrono::milliseconds(20)); lap_timer.stop(); lap_time = lap_timer.getMetric().getLap(); - EXPECT_NEAR(0.02, lap_time, 1.0e-3); + EXPECT_NEAR(0.04, lap_time, millisecTolerance); } { @@ -362,17 +364,17 @@ TEST(UnitTestTimer, MultipleStarts) { stk::diag::TimeBlock childBlock(childTimer); - std::this_thread::sleep_for(std::chrono::milliseconds(10)); + std::this_thread::sleep_for(std::chrono::milliseconds(20)); } { childTimer.start(); childTimer.start(); - std::this_thread::sleep_for(std::chrono::milliseconds(10)); + std::this_thread::sleep_for(std::chrono::milliseconds(20)); childTimer.stop(); childTimer.stop(); } - std::this_thread::sleep_for(std::chrono::milliseconds(10)); - EXPECT_NEAR(childTimer.getMetric().getAccumulatedLap(), 0.02, 2.0e-3); + std::this_thread::sleep_for(std::chrono::milliseconds(50)); + EXPECT_NEAR(childTimer.getMetric().getAccumulatedLap(), 0.04, millisecTolerance); EXPECT_EQ(childTimer.getMetric().getAccumulatedLap(), 2u); stk::diag::printTimersTable(strout, rootTimer, stk::diag::METRICS_ALL, false, MPI_COMM_WORLD); } @@ -390,13 +392,13 @@ TEST(UnitTestTimer, NestedTimers) { stk::diag::TimeBlock childBlock(childTimer); stk::diag::TimeBlock grandChildBlock(grandChildTimer); - std::this_thread::sleep_for(std::chrono::milliseconds(10)); + std::this_thread::sleep_for(std::chrono::milliseconds(50)); } { stk::diag::TimeBlock lap_timer(grandChildTimer); - std::this_thread::sleep_for(std::chrono::milliseconds(10)); + std::this_thread::sleep_for(std::chrono::milliseconds(50)); } - EXPECT_GE(childTimer.getMetric().getAccumulatedLap(), 0.02); + EXPECT_GE(childTimer.getMetric().getAccumulatedLap(), (0.1 - millisecTolerance)); EXPECT_EQ(childTimer.getMetric().getAccumulatedLap(), 2u); stk::diag::printTimersTable(strout, rootTimer, stk::diag::METRICS_ALL, false, MPI_COMM_WORLD); } From b11eaa2a82ce16ce231992df8a76c5800198c6e6 Mon Sep 17 00:00:00 2001 From: "Roscoe A. Bartlett" Date: Mon, 20 Apr 2020 16:50:01 -0600 Subject: [PATCH 11/17] ATDM: Fix atdm/utils/set_build_options.sh on all platforms/envs (#5939) This makes it robust in case you already have an ATDM Trilinos env loaded. --- cmake/std/atdm/test/unit_tests/set_build_options_unit_tests.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmake/std/atdm/test/unit_tests/set_build_options_unit_tests.sh b/cmake/std/atdm/test/unit_tests/set_build_options_unit_tests.sh index 3e594fb73d45..2384a6bcee22 100755 --- a/cmake/std/atdm/test/unit_tests/set_build_options_unit_tests.sh +++ b/cmake/std/atdm/test/unit_tests/set_build_options_unit_tests.sh @@ -7,6 +7,9 @@ ATDM_CONFIG_SCRIPT_DIR=`readlink -f ${CURRENT_SCRIPTS_DIR}/../..` # Test compiler parsing # +# Make work on all systems reguardless of ATDM Trilinos env loaded +unset ATDM_CONFIG_SYSTEM_NAME +unset ATDM_CONFIG_SYSTEM_DIR testAllDefaults() { ATDM_CONFIG_BUILD_NAME=default From c9e95fba6c6937785f4882f851c1d93a930bc62b Mon Sep 17 00:00:00 2001 From: "Roscoe A. Bartlett" Date: Mon, 20 Apr 2020 16:51:58 -0600 Subject: [PATCH 12/17] ATDM: Add unit tests for cee-rhel6/custom_builds.sh (#5939, ATDV-322) --- cmake/std/atdm/CMakeLists.txt | 1 + cmake/std/atdm/cee-rhel6/CMakeLists.txt | 11 ++ cmake/std/atdm/cee-rhel6/custom_builds.sh | 2 +- .../cee-rhel6/custom_builds_unit_tests.sh | 107 ++++++++++++++++++ 4 files changed, 120 insertions(+), 1 deletion(-) create mode 100644 cmake/std/atdm/cee-rhel6/CMakeLists.txt create mode 100755 cmake/std/atdm/cee-rhel6/custom_builds_unit_tests.sh diff --git a/cmake/std/atdm/CMakeLists.txt b/cmake/std/atdm/CMakeLists.txt index 1fbec3f1fcdc..56e490d2dcbd 100644 --- a/cmake/std/atdm/CMakeLists.txt +++ b/cmake/std/atdm/CMakeLists.txt @@ -1,4 +1,5 @@ TRIBITS_PACKAGE(TrilinosATDMConfigTests) TRIBITS_ADD_TEST_DIRECTORIES(test) +TRIBITS_ADD_TEST_DIRECTORIES(cee-rhel6) TRIBITS_ADD_TEST_DIRECTORIES(van1-tx2) TRIBITS_PACKAGE_POSTPROCESS() diff --git a/cmake/std/atdm/cee-rhel6/CMakeLists.txt b/cmake/std/atdm/cee-rhel6/CMakeLists.txt new file mode 100644 index 000000000000..de2669465590 --- /dev/null +++ b/cmake/std/atdm/cee-rhel6/CMakeLists.txt @@ -0,0 +1,11 @@ +TRIBITS_ADD_ADVANCED_TEST( cee-rhel6_custom_builds_unit_tests + OVERALL_WORKING_DIRECTORY TEST_NAME + OVERALL_NUM_MPI_PROCS 1 + TEST_0 CMND env + ARGS SHUNIT_COLOR=none ${CMAKE_CURRENT_SOURCE_DIR}/custom_builds_unit_tests.sh + PASS_REGULAR_EXPRESSION_ALL + "ERROR: A supported compiler was not selected for 'cee-rhel6' env in buildname 'anything-unsupported-compiler'" + "Ran 1 test" + "[^]OK[$]" + ALWAYS_FAIL_ON_NONZERO_RETURN + ) diff --git a/cmake/std/atdm/cee-rhel6/custom_builds.sh b/cmake/std/atdm/cee-rhel6/custom_builds.sh index 696e96002255..e2af2f0d0f7f 100644 --- a/cmake/std/atdm/cee-rhel6/custom_builds.sh +++ b/cmake/std/atdm/cee-rhel6/custom_builds.sh @@ -45,7 +45,7 @@ elif [[ $ATDM_CONFIG_BUILD_NAME == *"intel-19.0.3-intelmpi-2018.4"* ]] \ else echo echo "***" - echo "*** ERROR: A supported compiler was not selected for 'cee-rhel6' env" + echo "*** ERROR: A supported compiler was not selected for 'cee-rhel6' env in buildname '${ATDM_CONFIG_BUILD_NAME}'" echo "***" echo "*** Supported compilers include:" echo "***" diff --git a/cmake/std/atdm/cee-rhel6/custom_builds_unit_tests.sh b/cmake/std/atdm/cee-rhel6/custom_builds_unit_tests.sh new file mode 100755 index 000000000000..286f54227460 --- /dev/null +++ b/cmake/std/atdm/cee-rhel6/custom_builds_unit_tests.sh @@ -0,0 +1,107 @@ +#!/bin/bash + +CURRENT_SCRIPTS_DIR=`echo $BASH_SOURCE | sed "s/\(.*\)\/.*\.sh/\1/g"` +ATDM_CONFIG_SCRIPT_DIR=`readlink -f ${CURRENT_SCRIPTS_DIR}/..` + +# +# Test compiler parsing +# + + +testAll() { + + ATDM_CONFIG_SYSTEM_DIR=${ATDM_CONFIG_SCRIPT_DIR}/cee-rhel6 + + ATDM_CONFIG_BUILD_NAME=default + . ${ATDM_CONFIG_SCRIPT_DIR}/utils/set_build_options.sh + ${_ASSERT_EQUALS_} ${ATDM_CONFIG_COMPILER} CLANG-9.0.1_OPENMPI-4.0.2 + + ATDM_CONFIG_BUILD_NAME=before-clang-9.0.1-openmpi-4.0.2_after + . ${ATDM_CONFIG_SCRIPT_DIR}/utils/set_build_options.sh + ${_ASSERT_EQUALS_} ${ATDM_CONFIG_COMPILER} CLANG-9.0.1_OPENMPI-4.0.2 + + ATDM_CONFIG_BUILD_NAME=before-clang-9.0_1-openmpi-4.0.2_after + . ${ATDM_CONFIG_SCRIPT_DIR}/utils/set_build_options.sh + ${_ASSERT_EQUALS_} ${ATDM_CONFIG_COMPILER} CLANG-9.0.1_OPENMPI-4.0.2 + + ATDM_CONFIG_BUILD_NAME=before-clang-9.0_1-after + . ${ATDM_CONFIG_SCRIPT_DIR}/utils/set_build_options.sh + ${_ASSERT_EQUALS_} ${ATDM_CONFIG_COMPILER} CLANG-9.0.1_OPENMPI-4.0.2 + + ATDM_CONFIG_BUILD_NAME=before-clang-9-after + . ${ATDM_CONFIG_SCRIPT_DIR}/utils/set_build_options.sh + ${_ASSERT_EQUALS_} ${ATDM_CONFIG_COMPILER} CLANG-9.0.1_OPENMPI-4.0.2 + + ATDM_CONFIG_BUILD_NAME=before-clang-after + . ${ATDM_CONFIG_SCRIPT_DIR}/utils/set_build_options.sh + ${_ASSERT_EQUALS_} ${ATDM_CONFIG_COMPILER} CLANG-9.0.1_OPENMPI-4.0.2 + + ATDM_CONFIG_BUILD_NAME=before_gnu-7.2.0-openmpi-4.0.2-after + . ${ATDM_CONFIG_SCRIPT_DIR}/utils/set_build_options.sh + ${_ASSERT_EQUALS_} ${ATDM_CONFIG_COMPILER} GNU-7.2.0_OPENMPI-4.0.2 + + ATDM_CONFIG_BUILD_NAME=before_gnu-7.2.0_openmpi-4.0.2-after + . ${ATDM_CONFIG_SCRIPT_DIR}/utils/set_build_options.sh + ${_ASSERT_EQUALS_} ${ATDM_CONFIG_COMPILER} GNU-7.2.0_OPENMPI-4.0.2 + + ATDM_CONFIG_BUILD_NAME=before_gnu-7.2.0-after + . ${ATDM_CONFIG_SCRIPT_DIR}/utils/set_build_options.sh + ${_ASSERT_EQUALS_} ${ATDM_CONFIG_COMPILER} GNU-7.2.0_OPENMPI-4.0.2 + + ATDM_CONFIG_BUILD_NAME=before_gnu-7-after + . ${ATDM_CONFIG_SCRIPT_DIR}/utils/set_build_options.sh + ${_ASSERT_EQUALS_} ${ATDM_CONFIG_COMPILER} GNU-7.2.0_OPENMPI-4.0.2 + + ATDM_CONFIG_BUILD_NAME=before_gnu-after + . ${ATDM_CONFIG_SCRIPT_DIR}/utils/set_build_options.sh + ${_ASSERT_EQUALS_} ${ATDM_CONFIG_COMPILER} GNU-7.2.0_OPENMPI-4.0.2 + + ATDM_CONFIG_BUILD_NAME=before_intel-18.0.2-mpich2-3.2-after + . ${ATDM_CONFIG_SCRIPT_DIR}/utils/set_build_options.sh + ${_ASSERT_EQUALS_} ${ATDM_CONFIG_COMPILER} INTEL-18.0.2_MPICH2-3.2 + + ATDM_CONFIG_BUILD_NAME=before_intel-18.0.2_mpich2-3.2-after + . ${ATDM_CONFIG_SCRIPT_DIR}/utils/set_build_options.sh + ${_ASSERT_EQUALS_} ${ATDM_CONFIG_COMPILER} INTEL-18.0.2_MPICH2-3.2 + + ATDM_CONFIG_BUILD_NAME=before_intel-18.0.2-after + . ${ATDM_CONFIG_SCRIPT_DIR}/utils/set_build_options.sh + ${_ASSERT_EQUALS_} ${ATDM_CONFIG_COMPILER} INTEL-18.0.2_MPICH2-3.2 + + ATDM_CONFIG_BUILD_NAME=before_intel-18-after + . ${ATDM_CONFIG_SCRIPT_DIR}/utils/set_build_options.sh + ${_ASSERT_EQUALS_} ${ATDM_CONFIG_COMPILER} INTEL-18.0.2_MPICH2-3.2 + + ATDM_CONFIG_BUILD_NAME=before-intel-19.0.3-intelmpi-2018.4_after + . ${ATDM_CONFIG_SCRIPT_DIR}/utils/set_build_options.sh + ${_ASSERT_EQUALS_} ${ATDM_CONFIG_COMPILER} INTEL-19.0.3_INTELMPI-2018.4 + + ATDM_CONFIG_BUILD_NAME=before-intel-19.0.3_intelmpi-2018.4_after + . ${ATDM_CONFIG_SCRIPT_DIR}/utils/set_build_options.sh + ${_ASSERT_EQUALS_} ${ATDM_CONFIG_COMPILER} INTEL-19.0.3_INTELMPI-2018.4 + + ATDM_CONFIG_BUILD_NAME=before-intel-19.0.3_after + . ${ATDM_CONFIG_SCRIPT_DIR}/utils/set_build_options.sh + ${_ASSERT_EQUALS_} ${ATDM_CONFIG_COMPILER} INTEL-19.0.3_INTELMPI-2018.4 + + ATDM_CONFIG_BUILD_NAME=before-intel-19_after + . ${ATDM_CONFIG_SCRIPT_DIR}/utils/set_build_options.sh + ${_ASSERT_EQUALS_} ${ATDM_CONFIG_COMPILER} INTEL-19.0.3_INTELMPI-2018.4 + + ATDM_CONFIG_BUILD_NAME=before-intel_after + . ${ATDM_CONFIG_SCRIPT_DIR}/utils/set_build_options.sh + ${_ASSERT_EQUALS_} ${ATDM_CONFIG_COMPILER} INTEL-19.0.3_INTELMPI-2018.4 + + # Run the error case + ATDM_CONFIG_BUILD_NAME=anything-unsupported-compiler + . ${ATDM_CONFIG_SCRIPT_DIR}/utils/set_build_options.sh + ${_ASSERT_EQUALS_} ${ATDM_CONFIG_COMPILER} DEFAULT + +} + + +# +# Run the unit tests +# + +. ${ATDM_CONFIG_SCRIPT_DIR}/test/shunit2/shunit2 From 2623c40261b3157a806c858e948922a2120dc455 Mon Sep 17 00:00:00 2001 From: "Roscoe A. Bartlett" Date: Mon, 20 Apr 2020 17:18:50 -0600 Subject: [PATCH 13/17] ATDM: Switch cee-rhel6/environment.sh to keyword matching and strengthen unit tests (ATDV-322, #5939) --- cmake/std/atdm/cee-rhel6/CMakeLists.txt | 1 - cmake/std/atdm/cee-rhel6/custom_builds.sh | 53 +++++++++++-------- .../cee-rhel6/custom_builds_unit_tests.sh | 36 +++++++++++-- 3 files changed, 62 insertions(+), 28 deletions(-) diff --git a/cmake/std/atdm/cee-rhel6/CMakeLists.txt b/cmake/std/atdm/cee-rhel6/CMakeLists.txt index de2669465590..5b1fab7c941e 100644 --- a/cmake/std/atdm/cee-rhel6/CMakeLists.txt +++ b/cmake/std/atdm/cee-rhel6/CMakeLists.txt @@ -4,7 +4,6 @@ TRIBITS_ADD_ADVANCED_TEST( cee-rhel6_custom_builds_unit_tests TEST_0 CMND env ARGS SHUNIT_COLOR=none ${CMAKE_CURRENT_SOURCE_DIR}/custom_builds_unit_tests.sh PASS_REGULAR_EXPRESSION_ALL - "ERROR: A supported compiler was not selected for 'cee-rhel6' env in buildname 'anything-unsupported-compiler'" "Ran 1 test" "[^]OK[$]" ALWAYS_FAIL_ON_NONZERO_RETURN diff --git a/cmake/std/atdm/cee-rhel6/custom_builds.sh b/cmake/std/atdm/cee-rhel6/custom_builds.sh index e2af2f0d0f7f..b2ae254199a5 100644 --- a/cmake/std/atdm/cee-rhel6/custom_builds.sh +++ b/cmake/std/atdm/cee-rhel6/custom_builds.sh @@ -7,40 +7,47 @@ # Custom compiler selection logic -if [[ $ATDM_CONFIG_BUILD_NAME == *"clang-9.0.1-openmpi-4.0.2"* ]] \ - || [[ $ATDM_CONFIG_BUILD_NAME == *"clang-9.0.1_openmpi-4.0.2"* ]] \ - || [[ $ATDM_CONFIG_BUILD_NAME == *"clang-9.0.1"* ]] \ - || [[ $ATDM_CONFIG_BUILD_NAME == *"clang-9"* ]] \ - || [[ $ATDM_CONFIG_BUILD_NAME == *"clang"* ]] \ - || [[ $ATDM_CONFIG_BUILD_NAME == *"default" ]] \ +if atdm_match_any_buildname_keyword \ + clang-9.0.1-openmpi-4.0.2 \ + clang-9.0.1_openmpi-4.0.2 \ + clang-9.0.1 \ + clang-9 \ + clang \ + default \ ; then export ATDM_CONFIG_COMPILER=CLANG-9.0.1_OPENMPI-4.0.2 - # Must list the default clang build last for correct matching of of defaults + # Must list the default clang build last of all the 'clang' builds for + # correct matching of of defaults -elif [[ $ATDM_CONFIG_BUILD_NAME == *"gnu-7.2.0-openmpi-4.0.2"* ]] \ - || [[ $ATDM_CONFIG_BUILD_NAME == *"gnu-7.2.0_openmpi-4.0.2"* ]] \ - || [[ $ATDM_CONFIG_BUILD_NAME == *"gnu-7.2.0"* ]] \ - || [[ $ATDM_CONFIG_BUILD_NAME == *"gnu-7"* ]] \ - || [[ $ATDM_CONFIG_BUILD_NAME == *"gnu"* ]] \ +elif atdm_match_any_buildname_keyword \ + gnu-7.2.0-openmpi-4.0.2 \ + gnu-7.2.0_openmpi-4.0.2 \ + gnu-7.2.0 \ + gnu-7 \ + gnu \ ; then export ATDM_CONFIG_COMPILER=GNU-7.2.0_OPENMPI-4.0.2 - # List default "gnu"* build last for correct matching of defaults + # List default "gnu"* build last of all the 'gnu' builds for correct + # matching of defaults -elif [[ $ATDM_CONFIG_BUILD_NAME == *"intel-18.0.2-mpich2-3.2"* ]] \ - || [[ $ATDM_CONFIG_BUILD_NAME == *"intel-18.0.2_mpich2-3.2"* ]] \ - || [[ $ATDM_CONFIG_BUILD_NAME == *"intel-18.0.2"* ]] \ - || [[ $ATDM_CONFIG_BUILD_NAME == *"intel-18"* ]] \ +elif atdm_match_any_buildname_keyword \ + intel-18.0.2-mpich2-3.2 \ + intel-18.0.2_mpich2-3.2 \ + intel-18.0.2 \ + intel-18 \ ; then export ATDM_CONFIG_COMPILER=INTEL-18.0.2_MPICH2-3.2 -elif [[ $ATDM_CONFIG_BUILD_NAME == *"intel-19.0.3-intelmpi-2018.4"* ]] \ - || [[ $ATDM_CONFIG_BUILD_NAME == *"intel-19.0.3_intelmpi-2018.4"* ]] \ - || [[ $ATDM_CONFIG_BUILD_NAME == *"intel-19.0.3"* ]] \ - || [[ $ATDM_CONFIG_BUILD_NAME == *"intel-19"* ]] \ - || [[ $ATDM_CONFIG_BUILD_NAME == *"intel"* ]] \ +elif atdm_match_any_buildname_keyword \ + intel-19.0.3-intelmpi-2018.4 \ + intel-19.0.3_intelmpi-2018.4 \ + intel-19.0.3 \ + intel-19 \ + intel \ ; then export ATDM_CONFIG_COMPILER=INTEL-19.0.3_INTELMPI-2018.4 - # List default "intel"* build last for correct matching! + # List default intel build last of all the 'intel' builds for correct + # matching! else echo diff --git a/cmake/std/atdm/cee-rhel6/custom_builds_unit_tests.sh b/cmake/std/atdm/cee-rhel6/custom_builds_unit_tests.sh index 286f54227460..5a243f0f9a43 100755 --- a/cmake/std/atdm/cee-rhel6/custom_builds_unit_tests.sh +++ b/cmake/std/atdm/cee-rhel6/custom_builds_unit_tests.sh @@ -16,6 +16,10 @@ testAll() { . ${ATDM_CONFIG_SCRIPT_DIR}/utils/set_build_options.sh ${_ASSERT_EQUALS_} ${ATDM_CONFIG_COMPILER} CLANG-9.0.1_OPENMPI-4.0.2 + ATDM_CONFIG_BUILD_NAME=default-after + . ${ATDM_CONFIG_SCRIPT_DIR}/utils/set_build_options.sh + ${_ASSERT_EQUALS_} ${ATDM_CONFIG_COMPILER} CLANG-9.0.1_OPENMPI-4.0.2 + ATDM_CONFIG_BUILD_NAME=before-clang-9.0.1-openmpi-4.0.2_after . ${ATDM_CONFIG_SCRIPT_DIR}/utils/set_build_options.sh ${_ASSERT_EQUALS_} ${ATDM_CONFIG_COMPILER} CLANG-9.0.1_OPENMPI-4.0.2 @@ -56,6 +60,16 @@ testAll() { . ${ATDM_CONFIG_SCRIPT_DIR}/utils/set_build_options.sh ${_ASSERT_EQUALS_} ${ATDM_CONFIG_COMPILER} GNU-7.2.0_OPENMPI-4.0.2 + # Check that 'gnus' does not match 'gnu'! (Shows true keyword matching is + # working) + ATDM_CONFIG_BUILD_NAME=before_gnus-after + STDOUT=$(. ${ATDM_CONFIG_SCRIPT_DIR}/utils/set_build_options.sh 2>&1) + GREP_LINE=$(echo "${STDOUT}" | grep "ERROR: A supported compiler was not selected") + GREP_LINE_EXPECTED="*** ERROR: A supported compiler was not selected for 'cee-rhel6' env in buildname 'before_gnus-after'" + #echo "GREP_LINE = [${GREP_LINE}]" + echo "GREP_LINE_EXPECTED = [${GREP_LINE_EXPECTED}]" + ${_ASSERT_EQUALS_} '"${GREP_LINE}"' '"${GREP_LINE_EXPECTED}"' + ATDM_CONFIG_BUILD_NAME=before_intel-18.0.2-mpich2-3.2-after . ${ATDM_CONFIG_SCRIPT_DIR}/utils/set_build_options.sh ${_ASSERT_EQUALS_} ${ATDM_CONFIG_COMPILER} INTEL-18.0.2_MPICH2-3.2 @@ -92,10 +106,24 @@ testAll() { . ${ATDM_CONFIG_SCRIPT_DIR}/utils/set_build_options.sh ${_ASSERT_EQUALS_} ${ATDM_CONFIG_COMPILER} INTEL-19.0.3_INTELMPI-2018.4 - # Run the error case - ATDM_CONFIG_BUILD_NAME=anything-unsupported-compiler - . ${ATDM_CONFIG_SCRIPT_DIR}/utils/set_build_options.sh - ${_ASSERT_EQUALS_} ${ATDM_CONFIG_COMPILER} DEFAULT + # Check that 'somethingintel' does not match 'intl'! (Shows true keyword + # matching is working) + ATDM_CONFIG_BUILD_NAME=somethingintel + STDOUT=$(. ${ATDM_CONFIG_SCRIPT_DIR}/utils/set_build_options.sh 2>&1) + GREP_LINE=$(echo "${STDOUT}" | grep "ERROR: A supported compiler was not selected") + GREP_LINE_EXPECTED="*** ERROR: A supported compiler was not selected for 'cee-rhel6' env in buildname 'somethingintel'" + #echo "GREP_LINE = [${GREP_LINE}]" + echo "GREP_LINE_EXPECTED = [${GREP_LINE_EXPECTED}]" + ${_ASSERT_EQUALS_} '"${GREP_LINE}"' '"${GREP_LINE_EXPECTED}"' + + # Check that missing compiler prints right error messagematch 'gnu'! + ATDM_CONFIG_BUILD_NAME=help + STDOUT=$(. ${ATDM_CONFIG_SCRIPT_DIR}/utils/set_build_options.sh 2>&1) + GREP_LINE=$(echo "${STDOUT}" | grep "ERROR: A supported compiler was not selected") + GREP_LINE_EXPECTED="*** ERROR: A supported compiler was not selected for 'cee-rhel6' env in buildname 'help'" + #echo "GREP_LINE = [${GREP_LINE}]" + echo "GREP_LINE_EXPECTED = [${GREP_LINE_EXPECTED}]" + ${_ASSERT_EQUALS_} '"${GREP_LINE}"' '"${GREP_LINE_EXPECTED}"' } From 4dd875f67c9a28b3ac9bb972f81247a5bac02000 Mon Sep 17 00:00:00 2001 From: Matthias Mayr Date: Tue, 21 Apr 2020 05:02:24 +0200 Subject: [PATCH 14/17] Xpetra: add build target for doxygen documentation Add the build target 'doc_xpetra' to create Xpetra's doxygen documentation in the build directory via running 'make doc_xpetra'. The new build target uses the same doxygen configuration as the existing in-source script `build_docs`. Note: This follows the example of MueLu. Part of #7218. --- packages/xpetra/CMakeLists.txt | 5 + packages/xpetra/doc/CMakeLists.txt | 10 + packages/xpetra/doc/Doxyfile | 33 +-- packages/xpetra/doc/Doxyfile.in | 5 + packages/xpetra/doc/Doxyfile.options | 349 ++++++++++++++++++++++----- packages/xpetra/doc/README.md | 8 + packages/xpetra/doc/build_docs | 15 +- packages/xpetra/doc/build_docs_guts | 14 -- 8 files changed, 337 insertions(+), 102 deletions(-) create mode 100644 packages/xpetra/doc/CMakeLists.txt create mode 100644 packages/xpetra/doc/Doxyfile.in create mode 100644 packages/xpetra/doc/README.md delete mode 100755 packages/xpetra/doc/build_docs_guts diff --git a/packages/xpetra/CMakeLists.txt b/packages/xpetra/CMakeLists.txt index b318940828c3..253f0414fc3d 100644 --- a/packages/xpetra/CMakeLists.txt +++ b/packages/xpetra/CMakeLists.txt @@ -195,6 +195,11 @@ TRIBITS_ADD_OPTION_AND_DEFINE( ADD_SUBDIRECTORY(src) ADD_SUBDIRECTORY(sup) +IF (IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/doc + AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/doc/CMakeLists.txt) + ADD_SUBDIRECTORY(doc) +ENDIF() + TRIBITS_ADD_EXAMPLE_DIRECTORIES(example) TRIBITS_ADD_EXAMPLE_DIRECTORIES(research) TRIBITS_ADD_TEST_DIRECTORIES(test) diff --git a/packages/xpetra/doc/CMakeLists.txt b/packages/xpetra/doc/CMakeLists.txt new file mode 100644 index 000000000000..c1417a7514ff --- /dev/null +++ b/packages/xpetra/doc/CMakeLists.txt @@ -0,0 +1,10 @@ +# add a target to generate API documentation with Doxygen +find_package(Doxygen) +if(DOXYGEN_FOUND) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY) +add_custom_target(doc_xpetra +TRILINOS_HOME=${PROJECT_SOURCE_DIR} ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile +WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} +COMMENT "Generating ${PACKAGE_NAME} API documentation with Doxygen" VERBATIM +) +endif(DOXYGEN_FOUND) diff --git a/packages/xpetra/doc/Doxyfile b/packages/xpetra/doc/Doxyfile index 746db0f713b4..cccdc7610d79 100644 --- a/packages/xpetra/doc/Doxyfile +++ b/packages/xpetra/doc/Doxyfile @@ -1,35 +1,4 @@ # Note: all relative paths are relative to package/doc! # @INCLUDE = Doxyfile.options -TAGFILES += \ - $(TRILINOS_HOME)/packages/common/tag_files/teuchos.tag=$(TRILINOS_HOME)/packages/teuchos/doc/html \ - $(TRILINOS_HOME)/packages/common/tag_files/epetra.tag=$(TRILINOS_HOME)/packages/epetra/doc/html \ - $(TRILINOS_HOME)/packages/common/tag_files/epetra.tag=$(TRILINOS_HOME)/packages/tpetra/doc/html -# -# Package options -# -PROJECT_NAME = "Xpetra" -OUTPUT_DIRECTORY = . -# -# What and how documentation is extracted -# -INPUT = ../src ./Xpetra_DoxygenDocumentation.hpp ../sup -#FILE_PATTERNS = *.h *c *.hpp *.cpp -RECURSIVE = YES -EXCLUDE = -EXCLUDE_PATTERNS = *.x *.o *.out -EXAMPLE_PATTERNS = -EXAMPLE_PATH = ../examples . -IMAGE_PATH = ./images -INPUT_FILTER = -ALPHABETICAL_INDEX = YES -IGNORE_PREFIX = -EXTRACT_ALL = YES -EXTRACT_PRIVATE = YES -# -# Links to other packages -# -ALLEXTERNALS = NO -EXTERNAL_GROUPS = NO -GENERATE_TAGFILE = $(TRILINOS_HOME)/packages/common/tag_files/xpetra.tag -HTML_HEADER = header.html +INPUT = ./Xpetra_DoxygenDocumentation.hpp ../src ../sup diff --git a/packages/xpetra/doc/Doxyfile.in b/packages/xpetra/doc/Doxyfile.in new file mode 100644 index 000000000000..46551b49b4bd --- /dev/null +++ b/packages/xpetra/doc/Doxyfile.in @@ -0,0 +1,5 @@ +# +# This file is used by doxygen for building documentation in the build tree +# +@INCLUDE = @CMAKE_CURRENT_SOURCE_DIR@/Doxyfile.options +INPUT = @CMAKE_CURRENT_SOURCE_DIR@/Xpetra_DoxygenDocumentation.hpp @CMAKE_CURRENT_SOURCE_DIR@/../src @CMAKE_CURRENT_SOURCE_DIR@/../sup diff --git a/packages/xpetra/doc/Doxyfile.options b/packages/xpetra/doc/Doxyfile.options index 5a7800ce3f3c..e6cd15cdb438 100755 --- a/packages/xpetra/doc/Doxyfile.options +++ b/packages/xpetra/doc/Doxyfile.options @@ -1,87 +1,328 @@ +# Doxyfile 1.8.6 + # # Include the global look and feel options # @INCLUDE_PATH = $(TRILINOS_HOME)/packages @INCLUDE = common/Doxyfile -# -# Package options -# -OUTPUT_LANGUAGE = English + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +DOXYFILE_ENCODING = UTF-8 +PROJECT_NAME = "Xpetra" PROJECT_NUMBER = "Version of the Day" -# -# What and how documentation is extracted -# -EXAMPLE_PATH = ../examples . -SUBGROUPING = NO -EXTRACT_ALL = NO -EXTRACT_PRIVATE = NO -EXTRACT_STATIC = YES -EXTRACT_LOCAL_CLASSES = NO -HIDE_UNDOC_MEMBERS = YES -HIDE_UNDOC_CLASSES = YES +PROJECT_BRIEF = +PROJECT_LOGO = +OUTPUT_DIRECTORY = . +CREATE_SUBDIRS = NO +OUTPUT_LANGUAGE = English BRIEF_MEMBER_DESC = YES REPEAT_BRIEF = YES +ABBREVIATE_BRIEF = ALWAYS_DETAILED_SEC = YES -#DETAILS_AT_TOP = YES DETAILS_AT_TOP = NO +INLINE_INHERITED_MEMB = NO FULL_PATH_NAMES = NO STRIP_FROM_PATH = +STRIP_FROM_INC_PATH = SHOW_DIRECTORIES = YES +SHORT_NAMES = NO +JAVADOC_AUTOBRIEF = NO +QT_AUTOBRIEF = NO +MULTILINE_CPP_IS_BRIEF = NO +INLINE_INFO = YES +SEPARATE_MEMBER_PAGES = NO +TAB_SIZE = 2 +ALIASES = +TCL_SUBST = +OPTIMIZE_OUTPUT_FOR_C = NO +OPTIMIZE_OUTPUT_JAVA = NO +OPTIMIZE_FOR_FORTRAN = NO +OPTIMIZE_OUTPUT_VHDL = NO +EXTENSION_MAPPING = +MARKDOWN_SUPPORT = YES +AUTOLINK_SUPPORT = YES +BUILTIN_STL_SUPPORT = NO +CPP_CLI_SUPPORT = NO +SIP_SUPPORT = NO +IDL_PROPERTY_SUPPORT = YES +DISTRIBUTE_GROUP_DOC = NO +SUBGROUPING = NO +INLINE_GROUPED_CLASSES = NO +INLINE_SIMPLE_STRUCTS = NO +TYPEDEF_HIDES_STRUCT = NO +LOOKUP_CACHE_SIZE = 0 +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- +EXTRACT_ALL = YES +EXTRACT_PRIVATE = YES +EXTRACT_PACKAGE = NO +EXTRACT_STATIC = YES +EXTRACT_LOCAL_CLASSES = NO +EXTRACT_LOCAL_METHODS = YES +EXTRACT_ANON_NSPACES = NO +HIDE_UNDOC_MEMBERS = YES +HIDE_UNDOC_CLASSES = YES +HIDE_FRIEND_COMPOUNDS = NO +HIDE_IN_BODY_DOCS = NO INTERNAL_DOCS = NO -CLASS_DIAGRAMS = YES -SOURCE_BROWSER = YES -INLINE_SOURCES = NO -STRIP_CODE_COMMENTS = YES -REFERENCED_BY_RELATION = NO -REFERENCES_RELATION = NO CASE_SENSE_NAMES = YES HIDE_SCOPE_NAMES = NO -VERBATIM_HEADERS = YES SHOW_INCLUDE_FILES = YES -JAVADOC_AUTOBRIEF = NO -INHERIT_DOCS = YES +SHOW_GROUPED_MEMB_INC = NO +FORCE_LOCAL_INCLUDES = NO INLINE_INFO = YES SORT_MEMBER_DOCS = NO -TAB_SIZE = 2 -ENABLED_SECTIONS = +SORT_BRIEF_DOCS = NO +SORT_MEMBERS_CTORS_1ST = NO +SORT_GROUP_NAMES = NO +SORT_BY_SCOPE_NAME = NO +STRICT_PROTO_MATCHING = NO GENERATE_TODOLIST = YES GENERATE_TESTLIST = YES +GENERATE_BUGLIST = YES +GENERATE_DEPRECATEDLIST= YES +ENABLED_SECTIONS = +MAX_INITIALIZER_LINES = 30 +SHOW_USED_FILES = YES +SHOW_FILES = YES +SHOW_NAMESPACES = YES +FILE_VERSION_FILTER = +LAYOUT_FILE = +CITE_BIB_FILES = +#--------------------------------------------------------------------------- +# Configuration options related to warning and progress messages +#--------------------------------------------------------------------------- QUIET = NO WARNINGS = YES WARN_IF_UNDOCUMENTED = YES +WARN_IF_DOC_ERROR = NO +WARN_NO_PARAMDOC = NO WARN_FORMAT = "$file:$line: $text" +WARN_LOGFILE = +#--------------------------------------------------------------------------- +# Configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = +INPUT_ENCODING = UTF-8 +FILE_PATTERNS = +RECURSIVE = YES +EXCLUDE = +EXCLUDE_SYMLINKS = NO +EXCLUDE_PATTERNS = *.x \ + *.o \ + *.out +EXCLUDE_SYMBOLS = +EXAMPLE_PATH = ../examples \ + . +EXAMPLE_PATTERNS = +EXAMPLE_RECURSIVE = YES +IMAGE_PATH = $(TRILINOS_HOME)/packages/xpetra/doc/images \ + . +INPUT_FILTER = +FILTER_PATTERNS = +FILTER_SOURCE_FILES = NO +FILTER_SOURCE_PATTERNS = +USE_MDFILE_AS_MAINPAGE = +#--------------------------------------------------------------------------- +# Configuration options related to source browsing +#--------------------------------------------------------------------------- +SOURCE_BROWSER = YES +INLINE_SOURCES = NO +STRIP_CODE_COMMENTS = YES +REFERENCED_BY_RELATION = NO +REFERENCES_RELATION = NO +REFERENCES_LINK_SOURCE = YES +SOURCE_TOOLTIPS = YES +USE_HTAGS = NO +VERBATIM_HEADERS = YES +#--------------------------------------------------------------------------- +# Configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- ALPHABETICAL_INDEX = YES COLS_IN_ALPHA_INDEX = 5 -# -# What diagrams are created -# -CLASS_GRAPH = YES -COLLABORATION_GRAPH = NO -INCLUDE_GRAPH = YES -INCLUDED_BY_GRAPH = YES -GRAPHICAL_HIERARCHY = YES -#UML_LOOK = YES -TEMPLATE_RELATIONS = YES -#TEMPLATE_RELATIONS = NO -#MAX_DOT_GRAPH_WIDTH = 500 -HIDE_UNDOC_RELATIONS = YES -# -# Preprocessing -# -ENABLE_PREPROCESSING = YES -MACRO_EXPANSION = YES -EXPAND_ONLY_PREDEF = YES -SEARCH_INCLUDES = YES -INCLUDE_FILE_PATTERNS = -PREDEFINED = DOXYGEN_COMPILE DOXYGEN_SHOULD_SKIP_THIS EPETRA_MPI HAVE_XPETRA_TPETRA HAVE_XPETRA_EPETRA HAVE_XPETRA_EPETRAEXT - -# -# What kind of documentation is generated -# +IGNORE_PREFIX = +#--------------------------------------------------------------------------- +# Configuration options related to the HTML output +#--------------------------------------------------------------------------- +GENERATE_HTML = YES +HTML_OUTPUT = html +HTML_FILE_EXTENSION = .html +HTML_HEADER = +HTML_FOOTER = +HTML_STYLESHEET = +HTML_EXTRA_STYLESHEET = +HTML_EXTRA_FILES = +HTML_COLORSTYLE_HUE = 220 +HTML_COLORSTYLE_SAT = 100 +HTML_COLORSTYLE_GAMMA = 80 +HTML_TIMESTAMP = YES +HTML_DYNAMIC_SECTIONS = NO +HTML_INDEX_NUM_ENTRIES = 100 +GENERATE_DOCSET = NO +DOCSET_FEEDNAME = "Doxygen generated docs" +DOCSET_BUNDLE_ID = org.doxygen.Project +DOCSET_PUBLISHER_ID = org.doxygen.Publisher +DOCSET_PUBLISHER_NAME = Publisher GENERATE_HTMLHELP = NO +CHM_FILE = +HHC_LOCATION = +GENERATE_CHI = NO +CHM_INDEX_ENCODING = +BINARY_TOC = NO +TOC_EXPAND = NO +GENERATE_QHP = NO +QCH_FILE = +QHP_NAMESPACE = org.doxygen.Project +QHP_VIRTUAL_FOLDER = doc +QHP_CUST_FILTER_NAME = +QHP_CUST_FILTER_ATTRS = +QHP_SECT_FILTER_ATTRS = +QHG_LOCATION = +GENERATE_ECLIPSEHELP = NO +ECLIPSE_DOC_ID = org.doxygen.Project DISABLE_INDEX = NO +GENERATE_TREEVIEW = YES +ENUM_VALUES_PER_LINE = 4 +TREEVIEW_WIDTH = 250 +EXT_LINKS_IN_WINDOW = NO +FORMULA_FONTSIZE = 10 +FORMULA_TRANSPARENT = YES +USE_MATHJAX = YES +MATHJAX_FORMAT = HTML-CSS +MATHJAX_RELPATH = https://cdn.mathjax.org/mathjax/latest +MATHJAX_EXTENSIONS = +MATHJAX_CODEFILE = +SEARCHENGINE = YES +SERVER_BASED_SEARCH = NO +EXTERNAL_SEARCH = NO +SEARCHENGINE_URL = +SEARCHDATA_FILE = searchdata.xml +EXTERNAL_SEARCH_ID = +EXTRA_SEARCH_MAPPINGS = +#--------------------------------------------------------------------------- +# Configuration options related to the LaTeX output +#--------------------------------------------------------------------------- GENERATE_LATEX = NO +LATEX_OUTPUT = latex +LATEX_CMD_NAME = latex +MAKEINDEX_CMD_NAME = makeindex +COMPACT_LATEX = NO +PAPER_TYPE = letter +EXTRA_PACKAGES = +LATEX_HEADER = +LATEX_FOOTER = +LATEX_EXTRA_FILES = +PDF_HYPERLINKS = YES +USE_PDFLATEX = YES +LATEX_BATCHMODE = YES +LATEX_HIDE_INDICES = NO +LATEX_SOURCE_CODE = NO +LATEX_BIB_STYLE = plain +#--------------------------------------------------------------------------- +# Configuration options related to the RTF output +#--------------------------------------------------------------------------- GENERATE_RTF = NO +RTF_OUTPUT = rtf +COMPACT_RTF = NO +RTF_HYPERLINKS = NO +RTF_STYLESHEET_FILE = +RTF_EXTENSIONS_FILE = +#--------------------------------------------------------------------------- +# Configuration options related to the man page output +#--------------------------------------------------------------------------- GENERATE_MAN = NO +MAN_OUTPUT = man +MAN_EXTENSION = .3 +MAN_LINKS = NO +#--------------------------------------------------------------------------- +# Configuration options related to the XML output +#--------------------------------------------------------------------------- GENERATE_XML = NO -HAVE_DOT = NO +XML_OUTPUT = xml +XML_SCHEMA = +XML_DTD = +XML_PROGRAMLISTING = YES +#--------------------------------------------------------------------------- +# Configuration options related to the DOCBOOK output +#--------------------------------------------------------------------------- +GENERATE_DOCBOOK = NO +DOCBOOK_OUTPUT = docbook +#--------------------------------------------------------------------------- +# Configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- +GENERATE_AUTOGEN_DEF = NO +#--------------------------------------------------------------------------- +# Configuration options related to the Perl module output +#--------------------------------------------------------------------------- +GENERATE_PERLMOD = NO +PERLMOD_LATEX = NO +PERLMOD_PRETTY = YES +PERLMOD_MAKEVAR_PREFIX = +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = YES +EXPAND_ONLY_PREDEF = YES +SEARCH_INCLUDES = YES +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = +PREDEFINED = DOXYGEN_COMPILE \ + DOXYGEN_SHOULD_SKIP_THIS \ + EPETRA_MPI \ + HAVE_XPETRA_TPETRA \ + HAVE_XPETRA_EPETRA \ + HAVE_XPETRA_EPETRAEXT +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES +#--------------------------------------------------------------------------- +# Configuration options related to external references +#--------------------------------------------------------------------------- +TAGFILES = +\ + $(TRILINOS_HOME)/packages/common/tag_files/teuchos.tag=$(TRILINOS_HOME)/packages/teuchos/doc/html \ + $(TRILINOS_HOME)/packages/common/tag_files/epetra.tag=$(TRILINOS_HOME)/packages/epetra/doc/html \ + $(TRILINOS_HOME)/packages/common/tag_files/epetra.tag=$(TRILINOS_HOME)/packages/tpetra/doc/html +GENERATE_TAGFILE = +ALLEXTERNALS = NO +EXTERNAL_GROUPS = NO +EXTERNAL_PAGES = NO +PERL_PATH = /usr/bin/perl +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- +CLASS_DIAGRAMS = YES +MSCGEN_PATH = +DIA_PATH = +HIDE_UNDOC_RELATIONS = YES +HAVE_DOT = NO +DOT_NUM_THREADS = 0 +DOT_FONTNAME = Helvetica +DOT_FONTSIZE = 10 +DOT_FONTPATH = +CLASS_GRAPH = YES +COLLABORATION_GRAPH = NO +GROUP_GRAPHS = YES +UML_LOOK = NO +UML_LIMIT_NUM_FIELDS = 10 +TEMPLATE_RELATIONS = YES +INCLUDE_GRAPH = YES +INCLUDED_BY_GRAPH = YES +CALL_GRAPH = NO +CALLER_GRAPH = NO +GRAPHICAL_HIERARCHY = YES +DIRECTORY_GRAPH = YES +DOT_IMAGE_FORMAT = gif +INTERACTIVE_SVG = NO +DOT_PATH = +DOTFILE_DIRS = +MSCFILE_DIRS = +DIAFILE_DIRS = +DOT_GRAPH_MAX_NODES = 50 +MAX_DOT_GRAPH_DEPTH = 0 +DOT_TRANSPARENT = NO +DOT_MULTI_TARGETS = NO +GENERATE_LEGEND = YES +DOT_CLEANUP = YES diff --git a/packages/xpetra/doc/README.md b/packages/xpetra/doc/README.md new file mode 100644 index 000000000000..34eaf51d3462 --- /dev/null +++ b/packages/xpetra/doc/README.md @@ -0,0 +1,8 @@ +# Doxygen + +`Xpetra`'s documentation is built in the build tree: + +1. Run your `cmake` configure line or script. +1. In the ``, type `make doc_xpetra`. + +The documentation will be placed in `/packages/Xpetra/doc/html`. diff --git a/packages/xpetra/doc/build_docs b/packages/xpetra/doc/build_docs index 0ae66e58a6a1..16e459e5751b 100755 --- a/packages/xpetra/doc/build_docs +++ b/packages/xpetra/doc/build_docs @@ -3,7 +3,7 @@ # Remove the directories to make sure that we don't have rebuild problems # that can sometimes happen with doxygen -rm -rf html +rm -r html # Create new directories manually since the doxygen exe under windows # seems to be messing this up. @@ -12,4 +12,15 @@ mkdir html # Build the documentation -./build_docs_guts +if [ $TRILINOS_HOME ]; then + echo "TRILINOS_HOME has already been set!" +else + echo "TRILINOS_HOME has not been set. Setting it!" + export TRILINOS_HOME=`pwd`/../../.. +fi + +echo +echo "Generating main documentation page for Xpetra ..." +echo + +doxygen Doxyfile diff --git a/packages/xpetra/doc/build_docs_guts b/packages/xpetra/doc/build_docs_guts deleted file mode 100755 index ce130bcad16f..000000000000 --- a/packages/xpetra/doc/build_docs_guts +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -if [ $TRILINOS_HOME ]; then - echo "TRILINOS_HOME has already been set!" -else - echo "TRILINOS_HOME has not been set. Setting it!" - export TRILINOS_HOME=`pwd`/../../.. -fi - -echo -echo "Generating main documentation page for Xpetra ..." -echo - -doxygen Doxyfile From 8706f49e8b0df316c35816b6b6422ecbc4ab62aa Mon Sep 17 00:00:00 2001 From: Matthias Mayr Date: Tue, 21 Apr 2020 05:14:41 +0200 Subject: [PATCH 15/17] MueLu: adapt doxygen build to changes in Xpetra - Build target had to be renamed from the generic 'doc' to 'doc_muelu'. - Convert README to README.md Part of #7218. --- packages/muelu/doc/CMakeLists.txt | 4 ++-- packages/muelu/doc/Doxyfile | 2 +- packages/muelu/doc/Doxyfile.in | 2 +- packages/muelu/doc/README | 13 ------------- packages/muelu/doc/README.md | 13 +++++++++++++ 5 files changed, 17 insertions(+), 17 deletions(-) delete mode 100644 packages/muelu/doc/README create mode 100644 packages/muelu/doc/README.md diff --git a/packages/muelu/doc/CMakeLists.txt b/packages/muelu/doc/CMakeLists.txt index eb21f133b419..305929b30e41 100644 --- a/packages/muelu/doc/CMakeLists.txt +++ b/packages/muelu/doc/CMakeLists.txt @@ -2,10 +2,10 @@ find_package(Doxygen) if(DOXYGEN_FOUND) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY) -add_custom_target(doc +add_custom_target(doc_muelu TRILINOS_HOME=${PROJECT_SOURCE_DIR} ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} -COMMENT "Generating API documentation with Doxygen" VERBATIM +COMMENT "Generating ${PACKAGE_NAME} API documentation with Doxygen" VERBATIM ) endif(DOXYGEN_FOUND) diff --git a/packages/muelu/doc/Doxyfile b/packages/muelu/doc/Doxyfile index d5e8ac4cf865..706ddf3a9e36 100644 --- a/packages/muelu/doc/Doxyfile +++ b/packages/muelu/doc/Doxyfile @@ -2,4 +2,4 @@ # This file is used by doxygen for building documentation in the source tree # @INCLUDE = Doxyfile.options -INPUT = ./MueLu_DoxygenDocumentation.hpp ../src ../adapters ./MueLu_groups ../matlab/src +INPUT = ./MueLu_DoxygenDocumentation.hpp ./MueLu_groups ../src ../adapters ../matlab/src diff --git a/packages/muelu/doc/Doxyfile.in b/packages/muelu/doc/Doxyfile.in index a9d8f06b14ef..6ce255196b9f 100644 --- a/packages/muelu/doc/Doxyfile.in +++ b/packages/muelu/doc/Doxyfile.in @@ -2,4 +2,4 @@ # This file is used by doxygen for building documentation in the build tree # @INCLUDE = @CMAKE_CURRENT_SOURCE_DIR@/Doxyfile.options -INPUT = @CMAKE_CURRENT_SOURCE_DIR@/../src @CMAKE_CURRENT_SOURCE_DIR@/../adapters @CMAKE_CURRENT_SOURCE_DIR@/MueLu_DoxygenDocumentation.hpp @CMAKE_CURRENT_SOURCE_DIR@/../matlab/src +INPUT = @CMAKE_CURRENT_SOURCE_DIR@/MueLu_DoxygenDocumentation.hpp @CMAKE_CURRENT_SOURCE_DIR@/MueLu_groups @CMAKE_CURRENT_SOURCE_DIR@/../src @CMAKE_CURRENT_SOURCE_DIR@/../adapters @CMAKE_CURRENT_SOURCE_DIR@/../matlab/src diff --git a/packages/muelu/doc/README b/packages/muelu/doc/README deleted file mode 100644 index 6442fcb386c7..000000000000 --- a/packages/muelu/doc/README +++ /dev/null @@ -1,13 +0,0 @@ -Doxygen -------- -MueLu's documentation is built in the build tree: - - a) Run your cmake configure line or script. - b) In the *build* directory in the subdirectory muelu/doc, - type "make doc". The documentation will be placed in muelu/doc/html. - -User's Guide ------------- -The user's guide is in muelu/doc/UsersGuide. -To build the guide, simply run "make", which should produce "mueluguide.pdf". - diff --git a/packages/muelu/doc/README.md b/packages/muelu/doc/README.md new file mode 100644 index 000000000000..53695290ae2c --- /dev/null +++ b/packages/muelu/doc/README.md @@ -0,0 +1,13 @@ +# Doxygen + +`MueLu`'s documentation is built in the build tree: + +1. Run your `cmake` configure line or script. +1. In the , type `make doc_muelu`. + +The documentation will be placed in `/packages/muelu/doc/html`. + +# User's Guide + +The user's guide is in `muelu/doc/UsersGuide`. +To build the guide, simply run `make` in `muelu/doc/UsersGuide`, which should produce `mueluguide.pdf`. From c528426b5e998a6cc63858f50ab25afddbb4df1b Mon Sep 17 00:00:00 2001 From: "Curtis C. Ober" Date: Tue, 14 Apr 2020 14:18:57 -0600 Subject: [PATCH 16/17] Tempus: Adding AppAction for IMEX RK and Partition * Added new constructor with AppAction instead of the old Observer. * Marked all old Observer usage as DEPRECATED, e.g., observe member data setObserver, observer calls, ... * Added unit tests to cover the new constructors basic usage of the AppAction for IMEX RK and IMEX RK Partition. Other changes: * Documented all IMEX RK and IMEX RK Partition tableaus currently available. * Added unit tests to check the stepper's order. * Added unit tests for SDIRK_3Stage2ndOrder, SSPDIRK22, SSPDIRK32, SSPDIRK23 and SSPDIRK33. * Cleaned up RK unit tests (e.g., call support functions with stepper instead of stepperType). All tests pass on my Mac. --- .../tempus/src/Tempus_SolutionState_impl.hpp | 2 - .../tempus/src/Tempus_StepperDIRK_decl.hpp | 2 +- .../tempus/src/Tempus_StepperDIRK_impl.hpp | 3 +- .../src/Tempus_StepperExplicitRK_decl.hpp | 2 +- .../src/Tempus_StepperExplicitRK_impl.hpp | 1 - .../Tempus_StepperIMEX_RK_Partition_decl.hpp | 128 +++++-- .../Tempus_StepperIMEX_RK_Partition_impl.hpp | 86 +++++ .../tempus/src/Tempus_StepperIMEX_RK_decl.hpp | 121 +++++-- .../tempus/src/Tempus_StepperIMEX_RK_impl.hpp | 105 +++++- .../tempus/src/Tempus_StepperRKAppAction.hpp | 65 +--- .../src/Tempus_StepperRKButcherTableau.hpp | 12 +- packages/tempus/test/BDF2/Tempus_BDF2Test.cpp | 20 - packages/tempus/test/DIRK/Tempus_DIRKTest.cpp | 17 - .../test/ExplicitRK/Tempus_ExplicitRKTest.cpp | 18 +- .../test/HHTAlpha/Tempus_HHTAlphaTest.cpp | 18 +- .../test/IMEX_RK/Tempus_IMEX_RKTest.cpp | 9 - .../Tempus_IMEX_RK_PartitionedTest.cpp | 8 - .../test/Leapfrog/Tempus_LeapfrogTest.cpp | 9 +- .../Tempus_OperatorSplitTest.cpp | 9 +- .../test/Subcycling/Tempus_SubcyclingTest.cpp | 15 - .../Trapezoidal/Tempus_TrapezoidalTest.cpp | 14 - packages/tempus/unit_test/CMakeLists.txt | 35 ++ .../tempus/unit_test/Tempus_UnitTest_BDF2.cpp | 10 +- .../Tempus_UnitTest_BackwardEuler.cpp | 5 +- ...us_UnitTest_DIRK_1Stage1stOrderRadauIA.cpp | 10 +- .../Tempus_UnitTest_DIRK_1StageTheta.cpp | 14 +- ...nitTest_DIRK_2Stage2ndOrderLobattoIIIB.cpp | 10 +- .../Tempus_UnitTest_DIRK_BackwardEuler.cpp | 10 +- .../Tempus_UnitTest_DIRK_General.cpp | 6 +- .../Tempus_UnitTest_EDIRK_2Stage3rdOrder.cpp | 10 +- .../Tempus_UnitTest_EDIRK_2StageTheta.cpp | 14 +- .../Tempus_UnitTest_EDIRK_TrapezoidalRule.cpp | 10 +- .../Tempus_UnitTest_ERK_3Stage3rdOrder.cpp | 10 +- ...Tempus_UnitTest_ERK_3Stage3rdOrderHeun.cpp | 10 +- .../Tempus_UnitTest_ERK_3Stage3rdOrderTVD.cpp | 10 +- .../unit_test/Tempus_UnitTest_ERK_3_8Rule.cpp | 10 +- ...empus_UnitTest_ERK_4Stage3rdOrderRunge.cpp | 10 +- .../Tempus_UnitTest_ERK_4Stage4thOrder.cpp | 10 +- ...empus_UnitTest_ERK_5Stage3rdOrderKandG.cpp | 10 +- .../Tempus_UnitTest_ERK_BogackiShampine32.cpp | 10 +- .../Tempus_UnitTest_ERK_ForwardEuler.cpp | 10 +- .../unit_test/Tempus_UnitTest_ERK_General.cpp | 6 +- .../Tempus_UnitTest_ERK_Merson45.cpp | 10 +- .../Tempus_UnitTest_ERK_Midpoint.cpp | 10 +- .../Tempus_UnitTest_ERK_Trapezoidal.cpp | 10 +- .../Tempus_UnitTest_ForwardEuler.cpp | 8 +- .../unit_test/Tempus_UnitTest_HHTAlpha.cpp | 12 +- .../unit_test/Tempus_UnitTest_IMEX_RK.cpp | 49 ++- .../Tempus_UnitTest_IMEX_RK_Partition.cpp | 56 ++- .../unit_test/Tempus_UnitTest_Leapfrog.cpp | 12 +- .../Tempus_UnitTest_NewmarkExplicitAForm.cpp | 12 +- .../Tempus_UnitTest_NewmarkImplicitAForm.cpp | 12 +- .../Tempus_UnitTest_NewmarkImplicitDForm.cpp | 12 +- .../Tempus_UnitTest_OperatorSplit.cpp | 12 +- .../Tempus_UnitTest_SDIRK_21Pair.cpp | 10 +- .../Tempus_UnitTest_SDIRK_2Stage2ndOrder.cpp | 13 +- .../Tempus_UnitTest_SDIRK_2Stage3rdOrder.cpp | 17 +- .../Tempus_UnitTest_SDIRK_3Stage2ndOrder.cpp | 70 ++++ .../Tempus_UnitTest_SDIRK_3Stage4thOrder.cpp | 10 +- .../Tempus_UnitTest_SDIRK_5Stage4thOrder.cpp | 10 +- .../Tempus_UnitTest_SDIRK_5Stage5thOrder.cpp | 10 +- ...Tempus_UnitTest_SDIRK_ImplicitMidpoint.cpp | 10 +- .../unit_test/Tempus_UnitTest_SSPDIRK22.cpp | 70 ++++ .../unit_test/Tempus_UnitTest_SSPDIRK23.cpp | 70 ++++ .../unit_test/Tempus_UnitTest_SSPDIRK32.cpp | 70 ++++ .../unit_test/Tempus_UnitTest_SSPDIRK33.cpp | 70 ++++ .../unit_test/Tempus_UnitTest_Subcycling.cpp | 10 +- .../Tempus_UnitTest_TimeStepControl.cpp | 8 - .../unit_test/Tempus_UnitTest_Trapezoidal.cpp | 12 +- .../unit_test/Tempus_UnitTest_Utils.hpp | 342 +++++++----------- 70 files changed, 1265 insertions(+), 646 deletions(-) create mode 100644 packages/tempus/unit_test/Tempus_UnitTest_SDIRK_3Stage2ndOrder.cpp create mode 100644 packages/tempus/unit_test/Tempus_UnitTest_SSPDIRK22.cpp create mode 100644 packages/tempus/unit_test/Tempus_UnitTest_SSPDIRK23.cpp create mode 100644 packages/tempus/unit_test/Tempus_UnitTest_SSPDIRK32.cpp create mode 100644 packages/tempus/unit_test/Tempus_UnitTest_SSPDIRK33.cpp diff --git a/packages/tempus/src/Tempus_SolutionState_impl.hpp b/packages/tempus/src/Tempus_SolutionState_impl.hpp index 40a67bf0f9fb..bc5472a9940f 100644 --- a/packages/tempus/src/Tempus_SolutionState_impl.hpp +++ b/packages/tempus/src/Tempus_SolutionState_impl.hpp @@ -474,7 +474,6 @@ Teuchos::RCP > createSolutionStateX( const Teuchos::RCP >& xdot, const Teuchos::RCP >& xdotdot) { - std::cout << "Called non-const createSolutionStateX" << std::endl; Teuchos::RCP > metaData_nc = Teuchos::rcp(new SolutionStateMetaData()); @@ -496,7 +495,6 @@ Teuchos::RCP > createSolutionStateX( const Teuchos::RCP >& xdot, const Teuchos::RCP >& xdotdot) { - std::cout << "Called const createSolutionStateX" << std::endl; Teuchos::RCP > metaData = Teuchos::rcp(new SolutionStateMetaData()); diff --git a/packages/tempus/src/Tempus_StepperDIRK_decl.hpp b/packages/tempus/src/Tempus_StepperDIRK_decl.hpp index c7625b5d18dd..588d26638213 100644 --- a/packages/tempus/src/Tempus_StepperDIRK_decl.hpp +++ b/packages/tempus/src/Tempus_StepperDIRK_decl.hpp @@ -92,11 +92,11 @@ namespace Tempus { * \State $\dot{X}_i \leftarrow \bar{f}(\tilde{X},t_{n-1}+c_i\Delta t)$ * \EndIf * \Else \Comment{Implicit stage.} + * \State {\it appAction.execute(solutionHistory, stepper, BEFORE\_SOLVE)} * \If {``Zero initial guess.''} * \State $X \leftarrow 0$ * \Comment{Else use previous stage value as initial guess.} * \EndIf - * \State {\it appAction.execute(solutionHistory, stepper, BEFORE\_SOLVE)} * \State Solve $\mathcal{F}_i( * \dot{X}_i = \frac{X - \tilde{X}}{a_{ii} \Delta t}, * X, t_{n-1}+c_{i}\Delta t) = 0$ for $X$ diff --git a/packages/tempus/src/Tempus_StepperDIRK_impl.hpp b/packages/tempus/src/Tempus_StepperDIRK_impl.hpp index 235da21d2ca1..ea9fc9bbcfd8 100644 --- a/packages/tempus/src/Tempus_StepperDIRK_impl.hpp +++ b/packages/tempus/src/Tempus_StepperDIRK_impl.hpp @@ -12,7 +12,6 @@ #include "Tempus_config.hpp" #include "Tempus_StepperFactory.hpp" #include "Tempus_WrapperModelEvaluatorBasic.hpp" -#include "Tempus_StepperRKModifierDefault.hpp" #include "Teuchos_VerboseObjectParameterListHelpers.hpp" #include "Thyra_VectorStdOps.hpp" #include "NOX_Thyra.H" @@ -96,7 +95,7 @@ void StepperDIRK::setup( stepperObserver_ = Teuchos::rcp(new StepperRKObserverComposite()); this->setObserver(Teuchos::null); #endif - this->setAppAction(Teuchos::null); + this->setAppAction(stepperRKAppAction); this->setSolver(solver); if (appModel != Teuchos::null) { diff --git a/packages/tempus/src/Tempus_StepperExplicitRK_decl.hpp b/packages/tempus/src/Tempus_StepperExplicitRK_decl.hpp index 7ba0fe42fd11..58c5c832290d 100644 --- a/packages/tempus/src/Tempus_StepperExplicitRK_decl.hpp +++ b/packages/tempus/src/Tempus_StepperExplicitRK_decl.hpp @@ -57,7 +57,7 @@ namespace Tempus { * * \f{algorithm}{ * \renewcommand{\thealgorithm}{} - * \caption{Explcit RK with the application-action locations indicated.} + * \caption{Explicit RK with the application-action locations indicated.} * \begin{algorithmic}[1] * \State {\it appAction.execute(solutionHistory, stepper, BEGIN\_STEP)} * \State $X \leftarrow x_{n-1}$ \Comment Set initial guess to last timestep. diff --git a/packages/tempus/src/Tempus_StepperExplicitRK_impl.hpp b/packages/tempus/src/Tempus_StepperExplicitRK_impl.hpp index 3be4c7897c2d..74294b5d9660 100644 --- a/packages/tempus/src/Tempus_StepperExplicitRK_impl.hpp +++ b/packages/tempus/src/Tempus_StepperExplicitRK_impl.hpp @@ -10,7 +10,6 @@ #define Tempus_StepperExplicitRK_impl_hpp #include "Tempus_RKButcherTableau.hpp" -#include "Tempus_StepperRKModifierDefault.hpp" #include "Teuchos_VerboseObjectParameterListHelpers.hpp" #include "Thyra_VectorStdOps.hpp" diff --git a/packages/tempus/src/Tempus_StepperIMEX_RK_Partition_decl.hpp b/packages/tempus/src/Tempus_StepperIMEX_RK_Partition_decl.hpp index 4710690ea0b9..8a9b1c2e8c44 100644 --- a/packages/tempus/src/Tempus_StepperIMEX_RK_Partition_decl.hpp +++ b/packages/tempus/src/Tempus_StepperIMEX_RK_Partition_decl.hpp @@ -14,7 +14,9 @@ #include "Tempus_RKButcherTableau.hpp" #include "Tempus_StepperImplicit.hpp" #include "Tempus_WrapperModelEvaluatorPairPartIMEX_Basic.hpp" -#include "Tempus_StepperRKObserverComposite.hpp" +#ifndef TEMPUS_HIDE_DEPRECATED_CODE + #include "Tempus_StepperRKObserverComposite.hpp" +#endif namespace Tempus { @@ -214,25 +216,91 @@ namespace Tempus { * * Partitioned IMEX-RK Algorithm * The single-timestep algorithm for the partitioned IMEX-RK is - * - \f$Z_1 \leftarrow z_{n-1}\f$ (Recall \f$Z_i = \{Y_i,X_i\}^T\f$) - * - for \f$i = 1 \ldots s\f$ do - * - \f$Y_i = y_{n-1} -\Delta t \sum_{j=1}^{i-1} \hat{a}_{ij}\;f^y_j\f$ - * - \f$\tilde{X} \leftarrow x_{n-1} - \Delta t\,\sum_{j=1}^{i-1} \left[ - * \hat{a}_{ij}\, f^x_j + a_{ij}\, g^x_j \right] \f$ - * - if \f$a_{ii} = 0\f$ - * - \f$X_i \leftarrow \tilde{X}\f$ - * - \f$g^x_i \leftarrow g^x(X_i,Y_i,t_i)\f$ - * - else - * - Solve \f$\mathcal{G}^x( - * \tilde{\dot{X}} = \frac{X_i-\tilde{X}}{a_{ii} \Delta t}, - * X_i,Y_i,t_i) = 0\f$ - * for \f$X_i\f$ where \f$Y_i\f$ are known parameters - * - \f$g^x_i \leftarrow - \tilde{\dot{X}}\f$ - * - \f$f_i \leftarrow f(Z_i,\hat{t}_i)\f$ - * - \f$\dot{Z} \leftarrow - g(Z_i,t_i) - f(Z_i,t_i)\f$ [Optionally] - * - end for - * - \f$z_n = z_{n-1} - \Delta t\,\sum_{i=1}^{s}\hat{b}_i\, f_i\f$ - * - \f$x_n \mathrel{+{=}} - \Delta t\,\sum_{i=1}^{s} b_i\, g^x_i\f$ + * \f{algorithm}{ + * \renewcommand{\thealgorithm}{} + * \caption{IMEX RK with the application-action locations indicated.} + * \begin{algorithmic}[1] + * \State {\it appAction.execute(solutionHistory, stepper, BEGIN\_STEP)} + * \State $Z \leftarrow z_{n-1}$ (Recall $Z_i = \{Y_i,X_i\}^T$) + * \Comment Set initial guess to last timestep. + * \For {$i = 0 \ldots s-1$} + * \State $Y_i = y_{n-1} -\Delta t \sum_{j=1}^{i-1} \hat{a}_{ij}\;f^y_j$ + * \State $\tilde{X} \leftarrow x_{n-1} - \Delta t\,\sum_{j=1}^{i-1} \left[ + * \hat{a}_{ij}\, f^x_j + a_{ij}\, g^x_j \right]$ + * \State {\it appAction.execute(solutionHistory, stepper, BEGIN\_STAGE)} + * \State \Comment Implicit Tableau + * \If {$a_{ii} = 0$} + * \State $X_i \leftarrow \tilde{X}$ + * \If {$a_{k,i} = 0 \;\forall k = (i+1,\ldots, s-1)$, $b(i) = 0$, $b^\ast(i) = 0$} + * \State $g^x_i \leftarrow 0$ \Comment{Not needed for later calculations.} + * \Else + * \State $g^x_i \leftarrow g^x(X_i,Y_i,t_i)$ + * \EndIf + * \Else + * \State {\it appAction.execute(solutionHistory, stepper, BEFORE\_SOLVE)} + * \If {``Zero initial guess.''} + * \State $X \leftarrow 0$ + * \Comment{Else use previous stage value as initial guess.} + * \EndIf + * \State Solve $\mathcal{G}^x\left(\tilde{\dot{X}} + * = \frac{X-\tilde{X}}{a_{ii} \Delta t},X,Y,t_i\right) = 0$ + * for $X$ where $Y$ are known parameters + * \State {\it appAction.execute(solutionHistory, stepper, AFTER\_SOLVE)} + * \State $\tilde{\dot{X}} \leftarrow \frac{X - \tilde{X}}{a_{ii} \Delta t}$ + * \State $g_i \leftarrow - \tilde{\dot{X}}$ + * \EndIf + * \State \Comment Explicit Tableau + * \State {\it appAction.execute(solutionHistory, stepper, BEFORE\_EXPLICIT\_EVAL)} + * \State $f_i \leftarrow M(X,\hat{t}_i)^{-1}\, F(X,\hat{t}_i)$ + * \State $\dot{Z} \leftarrow - g(Z_i,t_i) - f(Z_i,t_i)$ [Optionally] + * \State {\it appAction.execute(solutionHistory, stepper, END\_STAGE)} + * \EndFor + * \State $z_n = z_{n-1} - \Delta t\,\sum_{i=1}^{s}\hat{b}_i\, f_i$ + * \State $x_n \mathrel{+{=}} - \Delta t\,\sum_{i=1}^{s} b_i\, g^x_i$ + * \State {\it appAction.execute(solutionHistory, stepper, END\_STEP)} + * \end{algorithmic} + * \f} + * + * The following table contains the pre-coded IMEX-RK tableaus. + * + * + *
Partitioned IMEX-RK Tableaus
Name Order Implicit Tableau Explicit Tableau + *
Partitioned IMEX RK 1st order 1st + * \f[ \begin{array}{c|cc} + * 0 & 0 & 0 \\ + * 1 & 0 & 1 \\ \hline + * & 0 & 1 + * \end{array} \f] + * \f[ \begin{array}{c|cc} + * 0 & 0 & 0 \\ + * 1 & 1 & 0 \\ \hline + * & 1 & 0 + * \end{array} \f] + *
Partitioned IMEX RK SSP2\n \f$\gamma = 1-1/\sqrt{2}\f$ 2nd + * \f[ \begin{array}{c|cc} + * \gamma & \gamma & 0 \\ + * 1-\gamma & 1-2\gamma & \gamma \\ \hline + * & 1/2 & 1/2 + * \end{array} \f] + * \f[ \begin{array}{c|cc} + * 0 & 0 & 0 \\ + * 1 & 1 & 0 \\ \hline + * & 1/2 & 1/2 + * \end{array} \f] + *
Partitioned IMEX RK ARS 233\n \f$\gamma = (3+\sqrt{3})/6\f$ 3rd + * \f[ \begin{array}{c|ccc} + * 0 & 0 & 0 & 0 \\ + * \gamma & 0 & \gamma & 0 \\ + * 1-\gamma & 0 & 1-2\gamma & \gamma \\ \hline + * & 0 & 1/2 & 1/2 + * \end{array} \f] + * \f[ \begin{array}{c|ccc} + * 0 & 0 & 0 & 0 \\ + * \gamma & \gamma & 0 & 0 \\ + * 1-\gamma & \gamma-1 & 2-2\gamma & 0 \\ \hline + * & 0 & 1/2 & 1/2 + * \end{array} \f] + *
* * The First-Step-As-Last (FSAL) principle is not valid for IMEX RK Partition. * The default is to set useFSAL=false, and useFSAL=true will result @@ -258,7 +326,8 @@ class StepperIMEX_RK_Partition : virtual public Tempus::StepperImplicit, */ StepperIMEX_RK_Partition(); - /// Constructor to specialize Stepper parameters. + /// Constructor to for all member data. +#ifndef TEMPUS_HIDE_DEPRECATED_CODE StepperIMEX_RK_Partition( const Teuchos::RCP >& appModel, const Teuchos::RCP >& obs, @@ -271,6 +340,19 @@ class StepperIMEX_RK_Partition : virtual public Tempus::StepperImplicit, Teuchos::RCP > explicitTableau, Teuchos::RCP > implicitTableau, Scalar order); +#endif + StepperIMEX_RK_Partition( + const Teuchos::RCP >& appModel, + const Teuchos::RCP >& solver, + bool useFSAL, + std::string ICConsistency, + bool ICConsistencyCheck, + bool zeroInitialGuess, + const Teuchos::RCP >& stepperRKAppAction, + std::string stepperType, + Teuchos::RCP > explicitTableau, + Teuchos::RCP > implicitTableau, + Scalar order); /// \name Basic stepper methods //@{ @@ -301,11 +383,13 @@ class StepperIMEX_RK_Partition : virtual public Tempus::StepperImplicit, const Teuchos::RCP >& explicitModel, const Teuchos::RCP >& implicitModel); +#ifndef TEMPUS_HIDE_DEPRECATED_CODE virtual void setObserver( Teuchos::RCP > obs = Teuchos::null); virtual Teuchos::RCP > getObserver() const { return this->stepperObserver_; } +#endif /// Initialize during construction and after changing input parameters. virtual void initialize(); @@ -383,7 +467,9 @@ class StepperIMEX_RK_Partition : virtual public Tempus::StepperImplicit, Teuchos::RCP > xTilde_; +#ifndef TEMPUS_HIDE_DEPRECATED_CODE Teuchos::RCP > stepperObserver_; +#endif }; diff --git a/packages/tempus/src/Tempus_StepperIMEX_RK_Partition_impl.hpp b/packages/tempus/src/Tempus_StepperIMEX_RK_Partition_impl.hpp index 155d7b86b88b..91abba4094b8 100644 --- a/packages/tempus/src/Tempus_StepperIMEX_RK_Partition_impl.hpp +++ b/packages/tempus/src/Tempus_StepperIMEX_RK_Partition_impl.hpp @@ -35,11 +35,15 @@ StepperIMEX_RK_Partition::StepperIMEX_RK_Partition() this->setStageNumber(-1); this->setTableaus("Partitioned IMEX RK SSP2"); +#ifndef TEMPUS_HIDE_DEPRECATED_CODE this->setObserver(); +#endif + this->setAppAction(Teuchos::null); this->setDefaultSolver(); } +#ifndef TEMPUS_HIDE_DEPRECATED_CODE template StepperIMEX_RK_Partition::StepperIMEX_RK_Partition( const Teuchos::RCP >& appModel, @@ -65,6 +69,44 @@ StepperIMEX_RK_Partition::StepperIMEX_RK_Partition( this->setExplicitTableau(explicitTableau); this->setImplicitTableau(implicitTableau); this->setObserver(obs); + this->setAppAction(Teuchos::null); + this->setSolver(solver); + + if (appModel != Teuchos::null) { + this->setModel(appModel); + this->initialize(); + } +} +#endif +template +StepperIMEX_RK_Partition::StepperIMEX_RK_Partition( + const Teuchos::RCP >& appModel, + const Teuchos::RCP >& solver, + bool useFSAL, + std::string ICConsistency, + bool ICConsistencyCheck, + bool zeroInitialGuess, + const Teuchos::RCP >& stepperRKAppAction, + std::string stepperType, + Teuchos::RCP > explicitTableau, + Teuchos::RCP > implicitTableau, + Scalar order) +{ + this->setStepperType( stepperType); + this->setUseFSAL( useFSAL); + this->setICConsistency( ICConsistency); + this->setICConsistencyCheck( ICConsistencyCheck); + this->setZeroInitialGuess( zeroInitialGuess); + this->setOrder( order); + + this->setStageNumber(-1); + + this->setExplicitTableau(explicitTableau); + this->setImplicitTableau(implicitTableau); +#ifndef TEMPUS_HIDE_DEPRECATED_CODE + this->setObserver(Teuchos::null); +#endif + this->setAppAction(stepperRKAppAction); this->setSolver(solver); if (appModel != Teuchos::null) { @@ -340,6 +382,7 @@ void StepperIMEX_RK_Partition::setModelPair( } +#ifndef TEMPUS_HIDE_DEPRECATED_CODE template void StepperIMEX_RK_Partition::setObserver( Teuchos::RCP > obs) @@ -368,6 +411,7 @@ void StepperIMEX_RK_Partition::setObserver( this->isInitialized_ = false; } +#endif template @@ -542,7 +586,13 @@ void StepperIMEX_RK_Partition::takeStep( "Try setting in \"Solution History\" \"Storage Type\" = \"Undo\"\n" " or \"Storage Type\" = \"Static\" and \"Storage Limit\" = \"2\"\n"); +#ifndef TEMPUS_HIDE_DEPRECATED_CODE this->stepperObserver_->observeBeginTakeStep(solutionHistory, *this); +#endif + RCP > thisStepper = Teuchos::rcpFromRef(*this); + this->stepperRKAppAction_->execute(solutionHistory, thisStepper, + StepperRKAppAction::ACTION_LOCATION::BEGIN_STEP); + RCP > currentState=solutionHistory->getCurrentState(); RCP > workingState=solutionHistory->getWorkingState(); const Scalar dt = workingState->getTimeStep(); @@ -573,7 +623,9 @@ void StepperIMEX_RK_Partition::takeStep( // Compute stage solutions for (int i = 0; i < numStages; ++i) { this->setStageNumber(i); +#ifndef TEMPUS_HIDE_DEPRECATED_CODE this->stepperObserver_->observeBeginStage(solutionHistory, *this); +#endif Thyra::assign(stageY.ptr(), *(wrapperModelPairIMEX->getExplicitOnlyVector(currentState->getX()))); @@ -592,6 +644,9 @@ void StepperIMEX_RK_Partition::takeStep( Thyra::Vp_StV(xTilde_.ptr(), -dt*A (i,j), *(stageGx_[j])); } + this->stepperRKAppAction_->execute(solutionHistory, thisStepper, + StepperRKAppAction::ACTION_LOCATION::BEGIN_STAGE); + Scalar ts = time + c(i)*dt; Scalar tHats = time + cHat(i)*dt; if (A(i,i) == Teuchos::ScalarTraits::zero()) { @@ -604,7 +659,9 @@ void StepperIMEX_RK_Partition::takeStep( assign(stageGx_[i].ptr(), Teuchos::ScalarTraits::zero()); } else { Thyra::assign(stageX.ptr(), *xTilde_); +#ifndef TEMPUS_HIDE_DEPRECATED_CODE this->stepperObserver_->observeBeforeImplicitExplicitly(solutionHistory, *this); +#endif evalImplicitModelExplicitly(stageX, stageY, ts, dt, i, stageGx_[i]); } } else { @@ -637,7 +694,11 @@ void StepperIMEX_RK_Partition::takeStep( wrapperModelPairIMEX->setForSolve(timeDer, inArgs, outArgs); +#ifndef TEMPUS_HIDE_DEPRECATED_CODE this->stepperObserver_->observeBeforeSolve(solutionHistory, *this); +#endif + this->stepperRKAppAction_->execute(solutionHistory, thisStepper, + StepperRKAppAction::ACTION_LOCATION::BEFORE_SOLVE); this->solver_->setModel(wrapperModelPairIMEX); sStatus = this->solveImplicitODE(stageX); @@ -645,15 +706,27 @@ void StepperIMEX_RK_Partition::takeStep( wrapperModelPairIMEX->setUseImplicitModel(false); +#ifndef TEMPUS_HIDE_DEPRECATED_CODE this->stepperObserver_->observeAfterSolve(solutionHistory, *this); +#endif + this->stepperRKAppAction_->execute(solutionHistory, thisStepper, + StepperRKAppAction::ACTION_LOCATION::AFTER_SOLVE); // Update contributions to stage values Thyra::V_StVpStV(stageGx_[i].ptr(), -alpha, *stageX, alpha, *xTilde_); } +#ifndef TEMPUS_HIDE_DEPRECATED_CODE this->stepperObserver_->observeBeforeExplicit(solutionHistory, *this); +#endif + this->stepperRKAppAction_->execute(solutionHistory, thisStepper, + StepperRKAppAction::ACTION_LOCATION::BEFORE_EXPLICIT_EVAL); evalExplicitModel(stageZ_, tHats, dt, i, stageF_[i]); +#ifndef TEMPUS_HIDE_DEPRECATED_CODE this->stepperObserver_->observeEndStage(solutionHistory, *this); +#endif + this->stepperRKAppAction_->execute(solutionHistory, thisStepper, + StepperRKAppAction::ACTION_LOCATION::END_STAGE); } // Sum for solution: y_n = y_n-1 - dt*Sum{ bHat(i)*fy(i) } @@ -672,7 +745,11 @@ void StepperIMEX_RK_Partition::takeStep( else workingState->setSolutionStatus(Status::FAILED); workingState->setOrder(this->getOrder()); workingState->computeNorms(currentState); +#ifndef TEMPUS_HIDE_DEPRECATED_CODE this->stepperObserver_->observeEndTakeStep(solutionHistory, *this); +#endif + this->stepperRKAppAction_->execute(solutionHistory, thisStepper, + StepperRKAppAction::ACTION_LOCATION::END_STEP); } // reset the stage number this->setStageNumber(-1); @@ -722,7 +799,10 @@ void StepperIMEX_RK_Partition::describe( numStages = stageGx_.size(); for (int i=0; i::isValidSetup(Teuchos::FancyOStream & out) out << "The solver is not set!\n"; } +#ifndef TEMPUS_HIDE_DEPRECATED_CODE if (stepperObserver_ == Teuchos::null) { isValidSetup = false; out << "The stepper observer is not set!\n"; } +#endif + if (this->stepperRKAppAction_ == Teuchos::null) { + isValidSetup = false; + out << "The AppAction is not set!\n"; + } if ( explicitTableau_ == Teuchos::null ) { isValidSetup = false; diff --git a/packages/tempus/src/Tempus_StepperIMEX_RK_decl.hpp b/packages/tempus/src/Tempus_StepperIMEX_RK_decl.hpp index 4ab168d4284d..2ac4c7c64200 100644 --- a/packages/tempus/src/Tempus_StepperIMEX_RK_decl.hpp +++ b/packages/tempus/src/Tempus_StepperIMEX_RK_decl.hpp @@ -14,7 +14,9 @@ #include "Tempus_RKButcherTableau.hpp" #include "Tempus_StepperImplicit.hpp" #include "Tempus_WrapperModelEvaluatorPairIMEX_Basic.hpp" -#include "Tempus_StepperRKObserverComposite.hpp" +#ifndef TEMPUS_HIDE_DEPRECATED_CODE + #include "Tempus_StepperRKObserverComposite.hpp" +#endif namespace Tempus { @@ -149,23 +151,48 @@ namespace Tempus { * IMEX-RK Algorithm * * The single-timestep algorithm for IMEX-RK is - * - \f$X_1 \leftarrow x_{n-1}\f$ - * - for \f$i = 1 \ldots s\f$ do - * - \f$\tilde{X} \leftarrow x_{n-1} - \Delta t\,\sum_{j=1}^{i-1} \left( - * \hat{a}_{ij}\, f(X_j,\hat{t}_j) + a_{ij}\, g(X_j,t_j) \right) \f$ - * - if \f$a_{ii} = 0\f$ - * - \f$X_i \leftarrow \tilde{X}\f$ - * - \f$g(X_i,t_i) \leftarrow M(X_i, t_i)^{-1}\, G(X_i, t_i)\f$ - * - else - * - Solve \f$\mathcal{G}\left(\tilde{\dot{X}} - * = \frac{X_i-\tilde{X}}{a_{ii} \Delta t},X_i,t_i\right) = 0\f$ - * for \f$X_i\f$ - * - \f$g(X_i,t_i) \leftarrow - \tilde{\dot{X}}\f$ - * - \f$f(X_i,\hat{t}_i) \leftarrow M(X_i,\hat{t}_i)^{-1}\, F(X_i,\hat{t}_i)\f$ - * - \f$\dot{X}_i(X_i,t_i) \leftarrow - g(X_i,t_i) - f(X_i,t_i)\f$ [Optionally] - * - end for - * - \f$x_n \leftarrow x_{n-1} - \Delta t\,\sum_{i=1}^{s}\hat{b}_i\,f(X_i,\hat{t}_i) - * - \Delta t\,\sum_{i=1}^{s} b_i\,g(X_i,t_i)\f$ + * + * \f{algorithm}{ + * \renewcommand{\thealgorithm}{} + * \caption{IMEX RK with the application-action locations indicated.} + * \begin{algorithmic}[1] + * \State {\it appAction.execute(solutionHistory, stepper, BEGIN\_STEP)} + * \State $X \leftarrow x_{n-1}$ \Comment Set initial guess to last timestep. + * \For {$i = 0 \ldots s-1$} + * \State $\tilde{X} \leftarrow x_{n-1} - \Delta t\,\sum_{j=1}^{i-1} \left( + * \hat{a}_{ij}\, f_j + a_{ij}\, g_j \right)$ + * \State {\it appAction.execute(solutionHistory, stepper, BEGIN\_STAGE)} + * \State \Comment Implicit Tableau + * \If {$a_{ii} = 0$} + * \State $X \leftarrow \tilde{X}$ + * \If {$a_{k,i} = 0 \;\forall k = (i+1,\ldots, s-1)$, $b(i) = 0$, $b^\ast(i) = 0$} + * \State $g_i \leftarrow 0$ \Comment{Not needed for later calculations.} + * \Else + * \State $g_i \leftarrow M(X, t_i)^{-1}\, G(X, t_i)$ + * \EndIf + * \Else + * \State {\it appAction.execute(solutionHistory, stepper, BEFORE\_SOLVE)} + * \If {``Zero initial guess.''} + * \State $X \leftarrow 0$ + * \Comment{Else use previous stage value as initial guess.} + * \EndIf + * \State Solve $\mathcal{G}\left(\tilde{\dot{X}} + * = \frac{X-\tilde{X}}{a_{ii} \Delta t},X,t_i\right) = 0$ for $X$ + * \State {\it appAction.execute(solutionHistory, stepper, AFTER\_SOLVE)} + * \State $\tilde{\dot{X}} \leftarrow \frac{X - \tilde{X}}{a_{ii} \Delta t}$ + * \State $g_i \leftarrow - \tilde{\dot{X}}$ + * \EndIf + * \State \Comment Explicit Tableau + * \State {\it appAction.execute(solutionHistory, stepper, BEFORE\_EXPLICIT\_EVAL)} + * \State $f_i \leftarrow M(X,\hat{t}_i)^{-1}\, F(X,\hat{t}_i)$ + * \State $\dot{X} \leftarrow - g_i - f_i$ [Optionally] + * \State {\it appAction.execute(solutionHistory, stepper, END\_STAGE)} + * \EndFor + * \State $x_n \leftarrow x_{n-1} - \Delta t\,\sum_{i=1}^{s}\hat{b}_i\,f_i + * - \Delta t\,\sum_{i=1}^{s} b_i \,g_i$ + * \State {\it appAction.execute(solutionHistory, stepper, END\_STEP)} + * \end{algorithmic} + * \f} * * The following table contains the pre-coded IMEX-RK tableaus. * @@ -182,7 +209,16 @@ namespace Tempus { * 1 & 1 & 0 \\ \hline * & 1 & 0 * \end{array} \f] - *
IMEX RK SSP2\n \f$\gamma = 1-1/\sqrt{2}\f$ 2nd + *
SSP1_111 1st + * \f[ \begin{array}{c|c} + * 1 & 1 \\ \hline + * & 1 + * \end{array} \f] + * \f[ \begin{array}{c|c} + * 0 & 0 \\ \hline + * & 1 + * \end{array} \f] + *
IMEX RK SSP2\n SSP2_222_L\n \f$\gamma = 1-1/\sqrt{2}\f$ 2nd * \f[ \begin{array}{c|cc} * \gamma & \gamma & 0 \\ * 1-\gamma & 1-2\gamma & \gamma \\ \hline @@ -193,7 +229,29 @@ namespace Tempus { * 1 & 1 & 0 \\ \hline * & 1/2 & 1/2 * \end{array} \f] - *
IMEX RK ARS 233\n \f$\gamma = (3+\sqrt{3})/6\f$ 3rd + *
SSP2_222\n SSP2_222_A\n \f$\gamma = 1/2\f$ 2nd + * \f[ \begin{array}{c|cc} + * \gamma & \gamma & 0 \\ + * 1-\gamma & 1-2\gamma & \gamma \\ \hline + * & 1/2 & 1/2 + * \end{array} \f] + * \f[ \begin{array}{c|cc} + * 0 & 0 & 0 \\ + * 1 & 1 & 0 \\ \hline + * & 1/2 & 1/2 + * \end{array} \f] + *
IMEX RK SSP3\n SSP3_332\n \f$\gamma = 1/ (2 + \sqrt{2})\f$ 3rd + * \f[ \begin{array}{c|ccc} + * 0 & 0 & & \\ + * 1 & 1 & 0 & \\ + * 1/2 & 1/4 & 1/4 & 0 \\ \hline + * & 1/6 & 1/6 & 4/6 \end{array} \f] + * \f[ \begin{array}{c|ccc} + * \gamma & \gamma & & \\ + * 1-\gamma & 1-2\gamma & \gamma & \\ + * 1-2 & 1/2 -\gamma & 0 & \gamma \\ \hline + * & 1/6 & 1/6 & 2/3 \end{array} \f] + *
IMEX RK ARS 233\n ARS 233\n \f$\gamma = (3+\sqrt{3})/6\f$ 3rd * \f[ \begin{array}{c|ccc} * 0 & 0 & 0 & 0 \\ * \gamma & 0 & \gamma & 0 \\ @@ -222,6 +280,7 @@ namespace Tempus { * Chuadhry, Hensinger, Fischer, Robinson, Rider, Niederhaus, Sanchez, * "Towards an IMEX Monolithic ALE Method with Integrated UQ for * Multiphysics Shock-hydro", SAND2016-11353, 2016, pp. 21-28. + * */ template class StepperIMEX_RK : virtual public Tempus::StepperImplicit, @@ -236,7 +295,8 @@ class StepperIMEX_RK : virtual public Tempus::StepperImplicit, */ StepperIMEX_RK(); - /// Constructor to specialize Stepper parameters. + /// Constructor for all member data. +#ifndef TEMPUS_HIDE_DEPRECATED_CODE StepperIMEX_RK( const Teuchos::RCP >& appModel, const Teuchos::RCP >& obs, @@ -249,6 +309,20 @@ class StepperIMEX_RK : virtual public Tempus::StepperImplicit, Teuchos::RCP > explicitTableau, Teuchos::RCP > implicitTableau, Scalar order); +#endif + StepperIMEX_RK( + const Teuchos::RCP >& appModel, + const Teuchos::RCP >& solver, + bool useFSAL, + std::string ICConsistency, + bool ICConsistencyCheck, + bool zeroInitialGuess, + const Teuchos::RCP >& stepperRKAppAction, + std::string stepperType, + Teuchos::RCP > explicitTableau, + Teuchos::RCP > implicitTableau, + Scalar order); + /// \name Basic stepper methods //@{ @@ -278,12 +352,13 @@ class StepperIMEX_RK : virtual public Tempus::StepperImplicit, const Teuchos::RCP >& explicitModel, const Teuchos::RCP >& implicitModel); +#ifndef TEMPUS_HIDE_DEPRECATED_CODE virtual void setObserver( Teuchos::RCP > obs = Teuchos::null); virtual Teuchos::RCP > getObserver() const { return this->stepperObserver_; } - +#endif /// Initialize during construction and after changing input parameters. virtual void initialize(); @@ -359,7 +434,9 @@ class StepperIMEX_RK : virtual public Tempus::StepperImplicit, Teuchos::RCP > xTilde_; +#ifndef TEMPUS_HIDE_DEPRECATED_CODE Teuchos::RCP > stepperObserver_; +#endif }; diff --git a/packages/tempus/src/Tempus_StepperIMEX_RK_impl.hpp b/packages/tempus/src/Tempus_StepperIMEX_RK_impl.hpp index 99ac346075e0..cd3a4d0c58ec 100644 --- a/packages/tempus/src/Tempus_StepperIMEX_RK_impl.hpp +++ b/packages/tempus/src/Tempus_StepperIMEX_RK_impl.hpp @@ -35,11 +35,15 @@ StepperIMEX_RK::StepperIMEX_RK() this->setStageNumber(-1); this->setTableaus("IMEX RK SSP2"); +#ifndef TEMPUS_HIDE_DEPRECATED_CODE this->setObserver(); +#endif + this->setAppAction(Teuchos::null); this->setDefaultSolver(); } +#ifndef TEMPUS_HIDE_DEPRECATED_CODE template StepperIMEX_RK::StepperIMEX_RK( const Teuchos::RCP >& appModel, @@ -66,6 +70,44 @@ StepperIMEX_RK::StepperIMEX_RK( this->setImplicitTableau(implicitTableau); this->setOrder(order); this->setObserver(obs); + this->setAppAction(Teuchos::null); + this->setSolver(solver); + + if (appModel != Teuchos::null) { + this->setModel(appModel); + this->initialize(); + } +} +#endif +template +StepperIMEX_RK::StepperIMEX_RK( + const Teuchos::RCP >& appModel, + const Teuchos::RCP >& solver, + bool useFSAL, + std::string ICConsistency, + bool ICConsistencyCheck, + bool zeroInitialGuess, + const Teuchos::RCP >& stepperRKAppAction, + std::string stepperType, + Teuchos::RCP > explicitTableau, + Teuchos::RCP > implicitTableau, + Scalar order) +{ + this->setStepperType( stepperType); + this->setUseFSAL( useFSAL); + this->setICConsistency( ICConsistency); + this->setICConsistencyCheck( ICConsistencyCheck); + this->setZeroInitialGuess( zeroInitialGuess); + + this->setStageNumber(-1); + + this->setExplicitTableau(explicitTableau); + this->setImplicitTableau(implicitTableau); + this->setOrder(order); +#ifndef TEMPUS_HIDE_DEPRECATED_CODE + this->setObserver(Teuchos::null); +#endif + this->setAppAction(stepperRKAppAction); this->setSolver(solver); if (appModel != Teuchos::null) { @@ -142,7 +184,7 @@ void StepperIMEX_RK::setTableaus(std::string stepperType, this->setStepperType("IMEX RK 1st order"); this->setOrder(1); - } else if ( stepperType == "SSP1_111" ) + } else if ( stepperType == "SSP1_111" ) { { // Explicit Tableau @@ -156,10 +198,10 @@ void StepperIMEX_RK::setTableaus(std::string stepperType, const Scalar zero = ST::zero(); // Fill A: - A(0,0) = zero; + A(0,0) = zero; // Fill b: - b(0) = one; + b(0) = one; // Fill c: c(0) = zero; @@ -298,11 +340,14 @@ void StepperIMEX_RK::setTableaus(std::string stepperType, TEUCHOS_TEST_FOR_EXCEPTION( true, std::logic_error, "Error - Not a valid StepperIMEX_RK type! Stepper Type = " << stepperType << "\n" - << " Current valid types are: " << "\n" - << " 'IMEX RK 1st order (SSP1_111)'" << "\n" - << " 'IMEX RK SSP2'" << "\n" - << " 'IMEX RK ARS 233'" << "\n" - << " 'General IMEX RK'" << "\n"); + << " Current valid types are: \n" + << " 'IMEX RK 1st order\n" + << " 'SSP1_111\n" + << " 'IMEX RK SSP2' ('SSP2_222_L')\n" + << " 'SSP2_222' ('SSP2_222_A')\n" + << " 'IMEX RK SSP3' ('SSP3_332')\n" + << " 'IMEX RK ARS 233' ('ARS 233')\n" + << " 'General IMEX RK'\n"); } TEUCHOS_TEST_FOR_EXCEPTION(explicitTableau_==Teuchos::null, @@ -429,6 +474,7 @@ void StepperIMEX_RK::setModelPair( } +#ifndef TEMPUS_HIDE_DEPRECATED_CODE template void StepperIMEX_RK::setObserver( Teuchos::RCP > obs) @@ -457,6 +503,7 @@ void StepperIMEX_RK::setObserver( this->isInitialized_ = false; } +#endif template @@ -619,7 +666,13 @@ void StepperIMEX_RK::takeStep( "Try setting in \"Solution History\" \"Storage Type\" = \"Undo\"\n" " or \"Storage Type\" = \"Static\" and \"Storage Limit\" = \"2\"\n"); +#ifndef TEMPUS_HIDE_DEPRECATED_CODE this->stepperObserver_->observeBeginTakeStep(solutionHistory, *this); +#endif + RCP > thisStepper = Teuchos::rcpFromRef(*this); + this->stepperRKAppAction_->execute(solutionHistory, thisStepper, + StepperRKAppAction::ACTION_LOCATION::BEGIN_STEP); + RCP > currentState=solutionHistory->getCurrentState(); RCP > workingState=solutionHistory->getWorkingState(); const Scalar dt = workingState->getTimeStep(); @@ -640,7 +693,9 @@ void StepperIMEX_RK::takeStep( // Compute stage solutions for (int i = 0; i < numStages; ++i) { this->setStageNumber(i); +#ifndef TEMPUS_HIDE_DEPRECATED_CODE this->stepperObserver_->observeBeginStage(solutionHistory, *this); +#endif Thyra::assign(xTilde_.ptr(), *(currentState->getX())); for (int j = 0; j < i; ++j) { if (AHat(i,j) != Teuchos::ScalarTraits::zero()) @@ -649,6 +704,9 @@ void StepperIMEX_RK::takeStep( Thyra::Vp_StV(xTilde_.ptr(), -dt*A (i,j), *(stageG_[j])); } + this->stepperRKAppAction_->execute(solutionHistory, thisStepper, + StepperRKAppAction::ACTION_LOCATION::BEGIN_STAGE); + Scalar ts = time + c(i)*dt; Scalar tHats = time + cHat(i)*dt; if (A(i,i) == Teuchos::ScalarTraits::zero()) { @@ -661,7 +719,9 @@ void StepperIMEX_RK::takeStep( assign(stageG_[i].ptr(), Teuchos::ScalarTraits::zero()); } else { Thyra::assign(this->stageX_.ptr(), *xTilde_); +#ifndef TEMPUS_HIDE_DEPRECATED_CODE this->stepperObserver_->observeBeforeImplicitExplicitly(solutionHistory, *this); +#endif evalImplicitModelExplicitly(this->stageX_, ts, dt, i, stageG_[i]); } } else { @@ -677,22 +737,38 @@ void StepperIMEX_RK::takeStep( auto p = Teuchos::rcp(new ImplicitODEParameters( timeDer, dt, alpha, beta, SOLVE_FOR_X, i)); +#ifndef TEMPUS_HIDE_DEPRECATED_CODE this->stepperObserver_->observeBeforeSolve(solutionHistory, *this); +#endif + this->stepperRKAppAction_->execute(solutionHistory, thisStepper, + StepperRKAppAction::ACTION_LOCATION::BEFORE_SOLVE); const Thyra::SolveStatus sStatus = this->solveImplicitODE(this->stageX_, stageG_[i], ts, p); if (sStatus.solveStatus != Thyra::SOLVE_STATUS_CONVERGED) pass = false; +#ifndef TEMPUS_HIDE_DEPRECATED_CODE this->stepperObserver_->observeAfterSolve(solutionHistory, *this); +#endif + this->stepperRKAppAction_->execute(solutionHistory, thisStepper, + StepperRKAppAction::ACTION_LOCATION::AFTER_SOLVE); // Update contributions to stage values Thyra::V_StVpStV(stageG_[i].ptr(), -alpha, *this->stageX_, alpha, *xTilde_); } +#ifndef TEMPUS_HIDE_DEPRECATED_CODE this->stepperObserver_->observeBeforeExplicit(solutionHistory, *this); +#endif + this->stepperRKAppAction_->execute(solutionHistory, thisStepper, + StepperRKAppAction::ACTION_LOCATION::BEFORE_EXPLICIT_EVAL); evalExplicitModel(this->stageX_, tHats, dt, i, stageF_[i]); +#ifndef TEMPUS_HIDE_DEPRECATED_CODE this->stepperObserver_->observeEndStage(solutionHistory, *this); +#endif + this->stepperRKAppAction_->execute(solutionHistory, thisStepper, + StepperRKAppAction::ACTION_LOCATION::END_STAGE); } // Sum for solution: x_n = x_n-1 - dt*Sum{ bHat(i)*f(i) + b(i)*g(i) } @@ -708,7 +784,11 @@ void StepperIMEX_RK::takeStep( else workingState->setSolutionStatus(Status::FAILED); workingState->setOrder(this->getOrder()); workingState->computeNorms(currentState); +#ifndef TEMPUS_HIDE_DEPRECATED_CODE this->stepperObserver_->observeEndTakeStep(solutionHistory, *this); +#endif + this->stepperRKAppAction_->execute(solutionHistory, thisStepper, + StepperRKAppAction::ACTION_LOCATION::END_STEP); } // reset the stage number this->setStageNumber(-1); @@ -758,7 +838,10 @@ void StepperIMEX_RK::describe( numStages = stageG_.size(); for (int i=0; i::isValidSetup(Teuchos::FancyOStream & out) const out << "The wrapper ModelEvaluator is not set!\n"; } +#ifndef TEMPUS_HIDE_DEPRECATED_CODE if (stepperObserver_ == Teuchos::null) { isValidSetup = false; out << "The stepper observer is not set!\n"; } +#endif + if (this->stepperRKAppAction_ == Teuchos::null) { + isValidSetup = false; + out << "The AppAction is not set!\n"; + } if ( explicitTableau_ == Teuchos::null ) { isValidSetup = false; diff --git a/packages/tempus/src/Tempus_StepperRKAppAction.hpp b/packages/tempus/src/Tempus_StepperRKAppAction.hpp index e40692466a41..7b4a4b954d81 100644 --- a/packages/tempus/src/Tempus_StepperRKAppAction.hpp +++ b/packages/tempus/src/Tempus_StepperRKAppAction.hpp @@ -21,63 +21,16 @@ template class StepperRKBase; /** \brief Application Action for StepperRKBase. * - * This class provides a means to apply various actions with the RK time step. - * The data available to this class is solution variables (through - * SolutionHistory), and stepper data (through the Stepper). It allows - * the application to just observe this data (i.e., use but not change the - * data) to change any of it (USER BEWARE!). + * This class provides a means to apply various actions with the + * RK time step. The data available to this class is solution + * variables (through SolutionHistory), and stepper data (through + * the Stepper). It allows the application to just observe this + * data (i.e., use but not change the data) to change any of it + * (USER BEWARE!). * - * Below is the IMEX RK algorithm and includes the locations where the - * application can take actions (in italicized). - * - * \f{algorithm}{ - * \renewcommand{\thealgorithm}{} - * \caption{IMEX RK with the application-action locations indicated.} - * \begin{algorithmic}[1] - * \State {\it appAction.execute(solutionHistory, stepper, BEGIN\_STEP)} - * \State $X \leftarrow x_{n-1}$ \Comment Set initial guess to last timestep. - * \For {$i = 0 \ldots s-1$} - * \If { $\hat{a}_{k,i} = 0 \;\forall k = (i+1,\ldots, s-1)$, $\hat{b}(i) = 0$, $\hat{b}^\ast(i) = 0$ and \newline \hspace*{0.37in} - * $a_{k,i} = 0 \;\forall k = (i+1,\ldots, s-1)$, $b(i) = 0$, $b^\ast(i) = 0$} - * \State $g_i \leftarrow 0$ \Comment{Not needed for later calculations.} - * \State $f_i \leftarrow 0$ \Comment{Not needed for later calculations.} - * \State {\bf continue} - * \EndIf - * \State $\tilde{X} \leftarrow x_{n-1} - \Delta t\,\sum_{j=1}^{i-1} \left( - * \hat{a}_{ij}\, f_j + a_{ij}\, g_j \right)$ - * \State {\it appAction.execute(solutionHistory, stepper, BEGIN\_STAGE)} - * \State \Comment Implicit Tableau - * \If {$a_{ii} = 0$} - * \State $X \leftarrow \tilde{X}$ - * \If {$i=0$ and ``Use FSAL''} \Comment{Save an evaluation.} - * \State $g_0 \leftarrow g_{s-1}$ - * \Comment{Use $g_{s-1}$ from $n-1$ time step.} - * \Else - * \State $g_i \leftarrow M(X, t_i)^{-1}\, G(X, t_i)$ - * \EndIf - * \Else - * \If {``Zero initial guess.''} - * \State $X \leftarrow 0$ - * \Comment{Else use previous stage value as initial guess.} - * \EndIf - * \State {\it appAction.execute(solutionHistory, stepper, BEFORE\_SOLVE)} - * \State Solve $\mathcal{G}\left(\tilde{\dot{X}} - * = \frac{X-\tilde{X}}{a_{ii} \Delta t},X,t_i\right) = 0$ for $X$ - * \State {\it appAction.execute(solutionHistory, stepper, AFTER\_SOLVE)} - * \State $\tilde{\dot{X}} \leftarrow \frac{X - \tilde{X}}{a_{ii} \Delta t}$ - * \State $g_i \leftarrow - \tilde{\dot{X}}$ - * \EndIf - * \State \Comment Explicit Tableau - * \State {\it appAction.execute(solutionHistory, stepper, BEFORE\_EXPLICIT\_EVAL)} - * \State $f_i \leftarrow M(X,\hat{t}_i)^{-1}\, F(X,\hat{t}_i)$ - * \State $\dot{X} \leftarrow - g_i - f_i$ [Optionally] - * \State {\it appAction.execute(solutionHistory, stepper, END\_STAGE)} - * \EndFor - * \State $x_n \leftarrow x_{n-1} - \Delta t\,\sum_{i=1}^{s}\hat{b}_i\,f_i - * - \Delta t\,\sum_{i=1}^{s} b_i \,g_i$ - * \State {\it appAction.execute(solutionHistory, stepper, END\_STEP)} - * \end{algorithmic} - * \f} + * The locations of the RK AppActions (ACITON_LOCATION) in takeStep + * are documented in each of the RK Algorithm sections: + * StepperExplicitRK, StepperDIRK and StepperIMEX_RK. */ template class StepperRKAppAction diff --git a/packages/tempus/src/Tempus_StepperRKButcherTableau.hpp b/packages/tempus/src/Tempus_StepperRKButcherTableau.hpp index cac42814e224..0bd63ec99c41 100644 --- a/packages/tempus/src/Tempus_StepperRKButcherTableau.hpp +++ b/packages/tempus/src/Tempus_StepperRKButcherTableau.hpp @@ -75,7 +75,6 @@ class StepperERK_ForwardEuler : bool ICConsistencyCheck, bool useEmbedded, const Teuchos::RCP >& stepperRKAppAction) - { this->setStepperType("RK Forward Euler"); this->setupTableau(); @@ -2045,6 +2044,8 @@ class StepperSDIRK_2Stage2ndOrder : this->setupTableau(); } + Scalar getGamma() { return gamma_; } + std::string getDescription() const { std::ostringstream Description; @@ -2375,6 +2376,9 @@ class StepperSDIRK_2Stage3rdOrder : this->isInitialized_ = false; this->setupTableau(); } + + std::string getGammaType() { return gammaType_; } + void setGamma(Scalar gamma) { if ( gammaType_ == "gamma" ) { @@ -2384,6 +2388,8 @@ class StepperSDIRK_2Stage3rdOrder : this->isInitialized_ = false; } + Scalar getGamma() { return gamma_; } + std::string getDescription() const { std::ostringstream Description; @@ -2696,6 +2702,8 @@ class StepperDIRK_1StageTheta : this->isInitialized_ = false; } + Scalar getTheta() { return theta_; } + std::string getDescription() const { std::ostringstream Description; @@ -2857,6 +2865,8 @@ class StepperEDIRK_2StageTheta : this->setupTableau(); } + Scalar getTheta() { return theta_; } + std::string getDescription() const { std::ostringstream Description; diff --git a/packages/tempus/test/BDF2/Tempus_BDF2Test.cpp b/packages/tempus/test/BDF2/Tempus_BDF2Test.cpp index 92fb84703c99..0c2756512987 100644 --- a/packages/tempus/test/BDF2/Tempus_BDF2Test.cpp +++ b/packages/tempus/test/BDF2/Tempus_BDF2Test.cpp @@ -34,14 +34,6 @@ #include #include -// Comment out any of the following tests to exclude from build/run. -#define TEST_PARAMETERLIST -#define TEST_CONSTRUCTING_FROM_DEFAULTS -#define TEST_SINCOS -#define TEST_SINCOS_ADAPT -#define TEST_CDR -#define TEST_VANDERPOL - namespace Tempus_Test { using Teuchos::RCP; @@ -56,7 +48,6 @@ using Tempus::SolutionHistory; using Tempus::SolutionState; -#ifdef TEST_PARAMETERLIST // ************************************************************ // ************************************************************ TEUCHOS_UNIT_TEST(BDF2, ParameterList) @@ -106,10 +97,8 @@ TEUCHOS_UNIT_TEST(BDF2, ParameterList) TEST_ASSERT(pass) } } -#endif // TEST_PARAMETERLIST -#ifdef TEST_CONSTRUCTING_FROM_DEFAULTS // ************************************************************ // ************************************************************ TEUCHOS_UNIT_TEST(BDF2, ConstructingFromDefaults) @@ -203,10 +192,8 @@ TEUCHOS_UNIT_TEST(BDF2, ConstructingFromDefaults) TEST_FLOATING_EQUALITY(get_ele(*(x), 0), 0.839732, 1.0e-4 ); TEST_FLOATING_EQUALITY(get_ele(*(x), 1), 0.542663, 1.0e-4 ); } -#endif // TEST_CONSTRUCTING_FROM_DEFAULTS -#ifdef TEST_SINCOS // ************************************************************ // ************************************************************ TEUCHOS_UNIT_TEST(BDF2, SinCos) @@ -328,10 +315,8 @@ TEUCHOS_UNIT_TEST(BDF2, SinCos) Teuchos::TimeMonitor::summarize(); } -#endif // TEST_SINCOS -#ifdef TEST_SINCOS_ADAPT // ************************************************************ // ************************************************************ TEUCHOS_UNIT_TEST(BDF2, SinCosAdapt) @@ -478,10 +463,8 @@ TEUCHOS_UNIT_TEST(BDF2, SinCosAdapt) Teuchos::TimeMonitor::summarize(); } -#endif // TEST_SINCOS_ADAPT -#ifdef TEST_CDR // ************************************************************ // ************************************************************ TEUCHOS_UNIT_TEST(BDF2, CDR) @@ -643,10 +626,8 @@ TEUCHOS_UNIT_TEST(BDF2, CDR) Teuchos::TimeMonitor::summarize(); } -#endif // TEST_CDR -#ifdef TEST_VANDERPOL // ************************************************************ // ************************************************************ TEUCHOS_UNIT_TEST(BDF2, VanDerPol) @@ -761,6 +742,5 @@ TEUCHOS_UNIT_TEST(BDF2, VanDerPol) Teuchos::TimeMonitor::summarize(); } -#endif // TEST_VANDERPOL } // namespace Tempus_Test diff --git a/packages/tempus/test/DIRK/Tempus_DIRKTest.cpp b/packages/tempus/test/DIRK/Tempus_DIRKTest.cpp index 33960e232b38..9e3af0bb855e 100644 --- a/packages/tempus/test/DIRK/Tempus_DIRKTest.cpp +++ b/packages/tempus/test/DIRK/Tempus_DIRKTest.cpp @@ -37,15 +37,7 @@ using Tempus::IntegratorBasic; using Tempus::SolutionHistory; using Tempus::SolutionState; -// Comment out any of the following tests to exclude from build/run. -#define TEST_PARAMETERLIST -#define TEST_CONSTRUCTING_FROM_DEFAULTS -#define TEST_SINCOS -#define TEST_VANDERPOL -#define TEST_EMBEDDED_DIRK - -#ifdef TEST_PARAMETERLIST // ************************************************************ // ************************************************************ TEUCHOS_UNIT_TEST(DIRK, ParameterList) @@ -181,10 +173,8 @@ TEUCHOS_UNIT_TEST(DIRK, ParameterList) } } } -#endif // TEST_PARAMETERLIST -#ifdef TEST_CONSTRUCTING_FROM_DEFAULTS // ************************************************************ // ************************************************************ TEUCHOS_UNIT_TEST(DIRK, ConstructingFromDefaults) @@ -281,10 +271,8 @@ TEUCHOS_UNIT_TEST(DIRK, ConstructingFromDefaults) TEST_FLOATING_EQUALITY(get_ele(*(x), 0), 0.841470, 1.0e-4 ); TEST_FLOATING_EQUALITY(get_ele(*(x), 1), 0.540304, 1.0e-4 ); } -#endif // TEST_CONSTRUCTING_FROM_DEFAULTS -#ifdef TEST_SINCOS // ************************************************************ // ************************************************************ TEUCHOS_UNIT_TEST(DIRK, SinCos) @@ -460,10 +448,8 @@ TEUCHOS_UNIT_TEST(DIRK, SinCos) } } -#endif // TEST_SINCOS -#ifdef TEST_VANDERPOL // ************************************************************ // ************************************************************ TEUCHOS_UNIT_TEST(DIRK, VanDerPol) @@ -558,10 +544,8 @@ TEUCHOS_UNIT_TEST(DIRK, VanDerPol) Teuchos::TimeMonitor::summarize(); } -#endif // TEST_VANDERPOL -#ifdef TEST_EMBEDDED_DIRK // ************************************************************ // ************************************************************ TEUCHOS_UNIT_TEST(DIRK, EmbeddedVanDerPol) @@ -663,7 +647,6 @@ TEUCHOS_UNIT_TEST(DIRK, EmbeddedVanDerPol) Teuchos::TimeMonitor::summarize(); } -#endif } // namespace Tempus_Test diff --git a/packages/tempus/test/ExplicitRK/Tempus_ExplicitRKTest.cpp b/packages/tempus/test/ExplicitRK/Tempus_ExplicitRKTest.cpp index aa0f69556440..0fc77e50c7ee 100644 --- a/packages/tempus/test/ExplicitRK/Tempus_ExplicitRKTest.cpp +++ b/packages/tempus/test/ExplicitRK/Tempus_ExplicitRKTest.cpp @@ -36,15 +36,7 @@ using Tempus::IntegratorBasic; using Tempus::SolutionHistory; using Tempus::SolutionState; -// Comment out any of the following tests to exclude from build/run. -#define TEST_PARAMETERLIST -#define TEST_CONSTRUCTING_FROM_DEFAULTS -#define TEST_SINCOS -#define TEST_EMBEDDED_VANDERPOL -#define TEST_STAGE_NUMBER - -#ifdef TEST_PARAMETERLIST // ************************************************************ // ************************************************************ TEUCHOS_UNIT_TEST(ExplicitRK, ParameterList) @@ -136,10 +128,8 @@ TEUCHOS_UNIT_TEST(ExplicitRK, ParameterList) } } } -#endif // TEST_PARAMETERLIST -#ifdef TEST_CONSTRUCTING_FROM_DEFAULTS // ************************************************************ // ************************************************************ TEUCHOS_UNIT_TEST(ExplicitRK, ConstructingFromDefaults) @@ -236,10 +226,8 @@ TEUCHOS_UNIT_TEST(ExplicitRK, ConstructingFromDefaults) TEST_FLOATING_EQUALITY(get_ele(*(x), 0), 0.841470, 1.0e-4 ); TEST_FLOATING_EQUALITY(get_ele(*(x), 1), 0.540303, 1.0e-4 ); } -#endif // TEST_CONSTRUCTING_FROM_DEFAULTS -#ifdef TEST_SINCOS // ************************************************************ // ************************************************************ TEUCHOS_UNIT_TEST(ExplicitRK, SinCos) @@ -419,10 +407,8 @@ TEUCHOS_UNIT_TEST(ExplicitRK, SinCos) } //Teuchos::TimeMonitor::summarize(); } -#endif // TEST_SINCOS -#ifdef TEST_EMBEDDED_VANDERPOL // ************************************************************ // ************************************************************ TEUCHOS_UNIT_TEST(ExplicitRK, EmbeddedVanDerPol) @@ -535,10 +521,8 @@ TEUCHOS_UNIT_TEST(ExplicitRK, EmbeddedVanDerPol) Teuchos::TimeMonitor::summarize(); } -#endif // TEST_EMBEDDED_VANDERPOL -#ifdef TEST_STAGE_NUMBER // ************************************************************ // ************************************************************ TEUCHOS_UNIT_TEST(ExplicitRK, stage_number) @@ -613,6 +597,6 @@ TEUCHOS_UNIT_TEST(ExplicitRK, stage_number) TEST_EQUALITY( stage_number, erk_stepper->getStageNumber()); } } -#endif // TEST_STAGE_NUMBER + } // namespace Tempus_Test diff --git a/packages/tempus/test/HHTAlpha/Tempus_HHTAlphaTest.cpp b/packages/tempus/test/HHTAlpha/Tempus_HHTAlphaTest.cpp index fc66eb8c82a0..5246c882837e 100644 --- a/packages/tempus/test/HHTAlpha/Tempus_HHTAlphaTest.cpp +++ b/packages/tempus/test/HHTAlpha/Tempus_HHTAlphaTest.cpp @@ -48,15 +48,7 @@ using Tempus::IntegratorBasic; using Tempus::SolutionHistory; using Tempus::SolutionState; -// Comment out any of the following tests to exclude from build/run. -#define TEST_BALL_PARABOLIC -#define TEST_CONSTRUCTING_FROM_DEFAULTS -#define TEST_SINCOS_SECONDORDER -#define TEST_SINCOS_FIRSTORDER -#define TEST_SINCOS_CD - -#ifdef TEST_BALL_PARABOLIC // ************************************************************ // ************************************************************ TEUCHOS_UNIT_TEST(HHTAlpha, BallParabolic) @@ -120,10 +112,8 @@ TEUCHOS_UNIT_TEST(HHTAlpha, BallParabolic) "\n Test failed! Max error = " << err << " > tolerance = " << tolerance << "\n!"); } -#endif // TEST_BALL_PARABOLIC -#ifdef TEST_CONSTRUCTING_FROM_DEFAULTS // ************************************************************ // ************************************************************ TEUCHOS_UNIT_TEST(HHTAlpha, ConstructingFromDefaults) @@ -214,10 +204,8 @@ TEUCHOS_UNIT_TEST(HHTAlpha, ConstructingFromDefaults) std::cout << " =========================" << std::endl; TEST_FLOATING_EQUALITY(get_ele(*(x), 0), 0.144918, 1.0e-4 ); } -#endif // TEST_CONSTRUCTING_FROM_DEFAULTS -#ifdef TEST_SINCOS_SECONDORDER // ************************************************************ TEUCHOS_UNIT_TEST(HHTAlpha, SinCos_SecondOrder) { @@ -360,10 +348,8 @@ TEUCHOS_UNIT_TEST(HHTAlpha, SinCos_SecondOrder) TEST_FLOATING_EQUALITY( xDotSlope, order, 0.01 ); TEST_FLOATING_EQUALITY( xDotErrorNorm[0], 0.104392, 1.0e-4 ); } -#endif // TEST_SINCOS_SECONDORDER -#ifdef TEST_SINCOS_FIRSTORDER // ************************************************************ // ************************************************************ TEUCHOS_UNIT_TEST(HHTAlpha, SinCos_FirstOrder) @@ -508,10 +494,8 @@ TEUCHOS_UNIT_TEST(HHTAlpha, SinCos_FirstOrder) TEST_FLOATING_EQUALITY( xDotErrorNorm[0], 0.393504, 1.0e-4 ); } -#endif // TEST_SINCOS_FIRSTORDER -#ifdef TEST_SINCOS_CD // ************************************************************ // ************************************************************ TEUCHOS_UNIT_TEST(HHTAlpha, SinCos_CD) @@ -655,6 +639,6 @@ TEUCHOS_UNIT_TEST(HHTAlpha, SinCos_CD) TEST_FLOATING_EQUALITY( xDotSlope, order, 0.01 ); TEST_FLOATING_EQUALITY( xDotErrorNorm[0], 0.0551522, 1.0e-4 ); } -#endif // TEST_SINCOS_CD + } diff --git a/packages/tempus/test/IMEX_RK/Tempus_IMEX_RKTest.cpp b/packages/tempus/test/IMEX_RK/Tempus_IMEX_RKTest.cpp index 313de6b88777..b0e63f0a95d9 100644 --- a/packages/tempus/test/IMEX_RK/Tempus_IMEX_RKTest.cpp +++ b/packages/tempus/test/IMEX_RK/Tempus_IMEX_RKTest.cpp @@ -36,12 +36,7 @@ using Tempus::IntegratorBasic; using Tempus::SolutionHistory; using Tempus::SolutionState; -// Comment out any of the following tests to exclude from build/run. -#define TEST_CONSTRUCTING_FROM_DEFAULTS -#define TEST_VANDERPOL - -#ifdef TEST_CONSTRUCTING_FROM_DEFAULTS // ************************************************************ // ************************************************************ TEUCHOS_UNIT_TEST(IMEX_RK, ConstructingFromDefaults) @@ -105,7 +100,6 @@ TEUCHOS_UNIT_TEST(IMEX_RK, ConstructingFromDefaults) integrator->setStepperWStepper(stepper); integrator->setTimeStepControl(timeStepControl); integrator->setSolutionHistory(solutionHistory); - //integrator->setObserver(...); integrator->initialize(); @@ -132,10 +126,8 @@ TEUCHOS_UNIT_TEST(IMEX_RK, ConstructingFromDefaults) TEST_FLOATING_EQUALITY(get_ele(*(x), 0), 1.810210, 1.0e-4 ); TEST_FLOATING_EQUALITY(get_ele(*(x), 1), -0.754602, 1.0e-4 ); } -#endif // TEST_CONSTRUCTING_FROM_DEFAULTS -#ifdef TEST_VANDERPOL // ************************************************************ // ************************************************************ TEUCHOS_UNIT_TEST(IMEX_RK, VanDerPol) @@ -283,7 +275,6 @@ TEUCHOS_UNIT_TEST(IMEX_RK, VanDerPol) } //Teuchos::TimeMonitor::summarize(); } -#endif // TEST_VANDERPOL } // namespace Tempus_Test diff --git a/packages/tempus/test/IMEX_RK_Partitioned/Tempus_IMEX_RK_PartitionedTest.cpp b/packages/tempus/test/IMEX_RK_Partitioned/Tempus_IMEX_RK_PartitionedTest.cpp index aa410040c918..ca45f46f9d89 100644 --- a/packages/tempus/test/IMEX_RK_Partitioned/Tempus_IMEX_RK_PartitionedTest.cpp +++ b/packages/tempus/test/IMEX_RK_Partitioned/Tempus_IMEX_RK_PartitionedTest.cpp @@ -37,12 +37,7 @@ using Tempus::IntegratorBasic; using Tempus::SolutionHistory; using Tempus::SolutionState; -// Comment out any of the following tests to exclude from build/run. -#define TEST_CONSTRUCTING_FROM_DEFAULTS -#define TEST_VANDERPOL - -#ifdef TEST_CONSTRUCTING_FROM_DEFAULTS // ************************************************************ // ************************************************************ TEUCHOS_UNIT_TEST(IMEX_RK_Partitioned, ConstructingFromDefaults) @@ -137,10 +132,8 @@ TEUCHOS_UNIT_TEST(IMEX_RK_Partitioned, ConstructingFromDefaults) TEST_FLOATING_EQUALITY(get_ele(*(x), 0), 1.810210, 1.0e-4 ); TEST_FLOATING_EQUALITY(get_ele(*(x), 1), -0.754602, 1.0e-4 ); } -#endif // TEST_CONSTRUCTING_FROM_DEFAULTS -#ifdef TEST_VANDERPOL // ************************************************************ // ************************************************************ TEUCHOS_UNIT_TEST(IMEX_RK_Partitioned, VanDerPol) @@ -280,7 +273,6 @@ TEUCHOS_UNIT_TEST(IMEX_RK_Partitioned, VanDerPol) } Teuchos::TimeMonitor::summarize(); } -#endif // TEST_VANDERPOL } // namespace Tempus_Test diff --git a/packages/tempus/test/Leapfrog/Tempus_LeapfrogTest.cpp b/packages/tempus/test/Leapfrog/Tempus_LeapfrogTest.cpp index fef6b9de7340..f93e4c04228c 100644 --- a/packages/tempus/test/Leapfrog/Tempus_LeapfrogTest.cpp +++ b/packages/tempus/test/Leapfrog/Tempus_LeapfrogTest.cpp @@ -45,12 +45,7 @@ using Tempus::SolutionHistory; using Tempus::SolutionState; -// Comment out any of the following tests to exclude from build/run. -#define TEST_CONSTRUCTING_FROM_DEFAULTS -#define TEST_SINCOS - -#ifdef TEST_CONSTRUCTING_FROM_DEFAULTS // ************************************************************ // ************************************************************ TEUCHOS_UNIT_TEST(Leapfrog, ConstructingFromDefaults) @@ -141,10 +136,8 @@ TEUCHOS_UNIT_TEST(Leapfrog, ConstructingFromDefaults) std::cout << " =========================" << std::endl; TEST_FLOATING_EQUALITY(get_ele(*(x), 0), 0.167158, 1.0e-4 ); } -#endif // TEST_CONSTRUCTING_FROM_DEFAULTS -#ifdef TEST_SINCOS // ************************************************************ // ************************************************************ TEUCHOS_UNIT_TEST(Leapfrog, SinCos) @@ -254,6 +247,6 @@ TEUCHOS_UNIT_TEST(Leapfrog, SinCos) Teuchos::TimeMonitor::summarize(); } -#endif // TEST_SINCOS + } diff --git a/packages/tempus/test/OperatorSplit/Tempus_OperatorSplitTest.cpp b/packages/tempus/test/OperatorSplit/Tempus_OperatorSplitTest.cpp index 3ee1ebe00bc8..364b314e9de4 100644 --- a/packages/tempus/test/OperatorSplit/Tempus_OperatorSplitTest.cpp +++ b/packages/tempus/test/OperatorSplit/Tempus_OperatorSplitTest.cpp @@ -38,12 +38,7 @@ using Tempus::IntegratorBasic; using Tempus::SolutionHistory; using Tempus::SolutionState; -// Comment out any of the following tests to exclude from build/run. -#define TEST_CONSTRUCTING_FROM_DEFAULTS -#define TEST_VANDERPOL - -#ifdef TEST_CONSTRUCTING_FROM_DEFAULTS // ************************************************************ // ************************************************************ TEUCHOS_UNIT_TEST(OperatorSplit, ConstructingFromDefaults) @@ -143,10 +138,8 @@ TEUCHOS_UNIT_TEST(OperatorSplit, ConstructingFromDefaults) TEST_FLOATING_EQUALITY(get_ele(*(x), 0), -2.223910, 1.0e-4); TEST_FLOATING_EQUALITY(get_ele(*(x), 1), 0.565441, 1.0e-4); } -#endif // TEST_CONSTRUCTING_FROM_DEFAULTS -#ifdef TEST_VANDERPOL // ************************************************************ // ************************************************************ TEUCHOS_UNIT_TEST(OperatorSplit, VanDerPol) @@ -237,6 +230,6 @@ TEUCHOS_UNIT_TEST(OperatorSplit, VanDerPol) Teuchos::TimeMonitor::summarize(); } -#endif // TEST_VANDERPOL + } // namespace Tempus_Test diff --git a/packages/tempus/test/Subcycling/Tempus_SubcyclingTest.cpp b/packages/tempus/test/Subcycling/Tempus_SubcyclingTest.cpp index 84e5534e6e0b..1e01885d1729 100644 --- a/packages/tempus/test/Subcycling/Tempus_SubcyclingTest.cpp +++ b/packages/tempus/test/Subcycling/Tempus_SubcyclingTest.cpp @@ -41,14 +41,6 @@ using Tempus::SolutionHistory; using Tempus::SolutionState; -// Comment out any of the following tests to exclude from build/run. -//#define TEST_PARAMETERLIST -#define TEST_CONSTRUCTING_FROM_DEFAULTS -#define TEST_SINCOS_ADAPT -#define TEST_VANDERPOL_OPERATOR_SPLIT - - -#ifdef TEST_PARAMETERLIST // ************************************************************ // ************************************************************ TEUCHOS_UNIT_TEST(Subcycling, ParameterList) @@ -103,10 +95,8 @@ TEUCHOS_UNIT_TEST(Subcycling, ParameterList) TEST_ASSERT(pass) } } -#endif // TEST_PARAMETERLIST -#ifdef TEST_CONSTRUCTING_FROM_DEFAULTS // ************************************************************ // ************************************************************ TEUCHOS_UNIT_TEST(Subcycling, ConstructingFromDefaults) @@ -204,10 +194,8 @@ TEUCHOS_UNIT_TEST(Subcycling, ConstructingFromDefaults) TEST_FLOATING_EQUALITY(get_ele(*(x), 0), 0.882508, 1.0e-4 ); TEST_FLOATING_EQUALITY(get_ele(*(x), 1), 0.570790, 1.0e-4 ); } -#endif // TEST_CONSTRUCTING_FROM_DEFAULTS -#ifdef TEST_SINCOS_ADAPT // ************************************************************ // ************************************************************ TEUCHOS_UNIT_TEST(Subcycling, SinCosAdapt) @@ -371,10 +359,8 @@ TEUCHOS_UNIT_TEST(Subcycling, SinCosAdapt) Teuchos::TimeMonitor::summarize(); } -#endif // TEST_SINCOS_ADAPT -#ifdef TEST_VANDERPOL_OPERATOR_SPLIT // ************************************************************ // ************************************************************ TEUCHOS_UNIT_TEST(Subcycling, VanDerPolOperatorSplit) @@ -538,7 +524,6 @@ TEUCHOS_UNIT_TEST(Subcycling, VanDerPolOperatorSplit) Teuchos::TimeMonitor::summarize(); } -#endif // TEST_VANDERPOL_OPERATOR_SPLIT } // namespace Tempus_Test diff --git a/packages/tempus/test/Trapezoidal/Tempus_TrapezoidalTest.cpp b/packages/tempus/test/Trapezoidal/Tempus_TrapezoidalTest.cpp index 9af3ec0971ea..9616d1fe1039 100644 --- a/packages/tempus/test/Trapezoidal/Tempus_TrapezoidalTest.cpp +++ b/packages/tempus/test/Trapezoidal/Tempus_TrapezoidalTest.cpp @@ -46,14 +46,7 @@ using Tempus::IntegratorBasic; using Tempus::SolutionHistory; using Tempus::SolutionState; -// Comment out any of the following tests to exclude from build/run. -#define TEST_PARAMETERLIST -#define TEST_CONSTRUCTING_FROM_DEFAULTS -#define TEST_SINCOS -#define TEST_VANDERPOL - -#ifdef TEST_PARAMETERLIST // ************************************************************ // ************************************************************ TEUCHOS_UNIT_TEST(Trapezoidal, ParameterList) @@ -104,10 +97,8 @@ TEUCHOS_UNIT_TEST(Trapezoidal, ParameterList) TEST_ASSERT(pass) } } -#endif // TEST_PARAMETERLIST -#ifdef TEST_CONSTRUCTING_FROM_DEFAULTS // ************************************************************ // ************************************************************ TEUCHOS_UNIT_TEST(Trapezoidal, ConstructingFromDefaults) @@ -216,10 +207,8 @@ TEUCHOS_UNIT_TEST(Trapezoidal, ConstructingFromDefaults) TEST_FLOATING_EQUALITY(get_ele(*(x), 0), 0.841021, 1.0e-4 ); TEST_FLOATING_EQUALITY(get_ele(*(x), 1), 0.541002, 1.0e-4 ); } -#endif // TEST_CONSTRUCTING_FROM_DEFAULTS -#ifdef TEST_SINCOS // ************************************************************ // ************************************************************ TEUCHOS_UNIT_TEST(Trapezoidal, SinCos) @@ -334,10 +323,8 @@ TEUCHOS_UNIT_TEST(Trapezoidal, SinCos) Teuchos::TimeMonitor::summarize(); } -#endif // TEST_SINCOS -#ifdef TEST_VANDERPOL // ************************************************************ // ************************************************************ TEUCHOS_UNIT_TEST(Trapezoidal, VanDerPol) @@ -418,7 +405,6 @@ TEUCHOS_UNIT_TEST(Trapezoidal, VanDerPol) Teuchos::TimeMonitor::summarize(); } -#endif // TEST_VANDERPOL } // namespace Tempus_Test diff --git a/packages/tempus/unit_test/CMakeLists.txt b/packages/tempus/unit_test/CMakeLists.txt index 0746b31e6bd8..c9422491810a 100644 --- a/packages/tempus/unit_test/CMakeLists.txt +++ b/packages/tempus/unit_test/CMakeLists.txt @@ -99,6 +99,13 @@ TRIBITS_ADD_EXECUTABLE_AND_TEST( NUM_MPI_PROCS 1 ) +TRIBITS_ADD_EXECUTABLE_AND_TEST( + UnitTest_SDIRK_3Stage2ndOrder + SOURCES Tempus_UnitTest_SDIRK_3Stage2ndOrder.cpp ${TEUCHOS_STD_UNIT_TEST_MAIN} + TESTONLYLIBS tempus_test_models + NUM_MPI_PROCS 1 + ) + TRIBITS_ADD_EXECUTABLE_AND_TEST( UnitTest_SDIRK_3Stage4thOrder SOURCES Tempus_UnitTest_SDIRK_3Stage4thOrder.cpp ${TEUCHOS_STD_UNIT_TEST_MAIN} @@ -127,6 +134,34 @@ TRIBITS_ADD_EXECUTABLE_AND_TEST( NUM_MPI_PROCS 1 ) +TRIBITS_ADD_EXECUTABLE_AND_TEST( + UnitTest_SSPDIRK22 + SOURCES Tempus_UnitTest_SSPDIRK22.cpp ${TEUCHOS_STD_UNIT_TEST_MAIN} + TESTONLYLIBS tempus_test_models + NUM_MPI_PROCS 1 + ) + +TRIBITS_ADD_EXECUTABLE_AND_TEST( + UnitTest_SSPDIRK23 + SOURCES Tempus_UnitTest_SSPDIRK23.cpp ${TEUCHOS_STD_UNIT_TEST_MAIN} + TESTONLYLIBS tempus_test_models + NUM_MPI_PROCS 1 + ) + +TRIBITS_ADD_EXECUTABLE_AND_TEST( + UnitTest_SSPDIRK32 + SOURCES Tempus_UnitTest_SSPDIRK32.cpp ${TEUCHOS_STD_UNIT_TEST_MAIN} + TESTONLYLIBS tempus_test_models + NUM_MPI_PROCS 1 + ) + +TRIBITS_ADD_EXECUTABLE_AND_TEST( + UnitTest_SSPDIRK33 + SOURCES Tempus_UnitTest_SSPDIRK33.cpp ${TEUCHOS_STD_UNIT_TEST_MAIN} + TESTONLYLIBS tempus_test_models + NUM_MPI_PROCS 1 + ) + TRIBITS_ADD_EXECUTABLE_AND_TEST( UnitTest_ERK_3_8Rule SOURCES Tempus_UnitTest_ERK_3_8Rule.cpp ${TEUCHOS_STD_UNIT_TEST_MAIN} diff --git a/packages/tempus/unit_test/Tempus_UnitTest_BDF2.cpp b/packages/tempus/unit_test/Tempus_UnitTest_BDF2.cpp index 4f769e22d764..fe90ed699ce8 100644 --- a/packages/tempus/unit_test/Tempus_UnitTest_BDF2.cpp +++ b/packages/tempus/unit_test/Tempus_UnitTest_BDF2.cpp @@ -36,14 +36,11 @@ using Teuchos::getParametersFromXmlFile; using Tempus::StepperFactory; // Comment out any of the following tests to exclude from build/run. -#define CONSTRUCTION -#define STEPPERFACTORY_CONSTRUCTION -#ifdef CONSTRUCTION // ************************************************************ // ************************************************************ -TEUCHOS_UNIT_TEST(BDF2, Construction) +TEUCHOS_UNIT_TEST(BDF2, Default_Construction) { auto model = rcp(new Tempus_Test::SinCosModel()); @@ -85,11 +82,11 @@ TEUCHOS_UNIT_TEST(BDF2, Construction) ICConsistency, ICConsistencyCheck, zeroInitialGuess)); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + // Test stepper properties. + TEUCHOS_ASSERT(stepper->getOrder() == 2); } -#endif // CONSTRUCTION -#ifdef STEPPERFACTORY_CONSTRUCTION // ************************************************************ // ************************************************************ TEUCHOS_UNIT_TEST(BDF2, StepperFactory_Construction) @@ -97,7 +94,6 @@ TEUCHOS_UNIT_TEST(BDF2, StepperFactory_Construction) auto model = rcp(new Tempus_Test::SinCosModel()); testFactoryConstruction("BDF2", model); } -#endif // STEPPERFACTORY_CONSTRUCTION } // namespace Tempus_Test diff --git a/packages/tempus/unit_test/Tempus_UnitTest_BackwardEuler.cpp b/packages/tempus/unit_test/Tempus_UnitTest_BackwardEuler.cpp index a2533f4a1002..e72a7bd43f51 100644 --- a/packages/tempus/unit_test/Tempus_UnitTest_BackwardEuler.cpp +++ b/packages/tempus/unit_test/Tempus_UnitTest_BackwardEuler.cpp @@ -43,7 +43,7 @@ using Tempus::StepperFactory; // ************************************************************ // ************************************************************ -TEUCHOS_UNIT_TEST(BackwardEuler, Construction) +TEUCHOS_UNIT_TEST(BackwardEuler, Default_Construction) { auto model = rcp(new Tempus_Test::SinCosModel()); @@ -96,6 +96,9 @@ TEUCHOS_UNIT_TEST(BackwardEuler, Construction) model, solver, predictorStepper, useFSAL, ICConsistency, ICConsistencyCheck, zeroInitialGuess, modifier)); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + + // Test stepper properties. + TEUCHOS_ASSERT(stepper->getOrder() == 1); } diff --git a/packages/tempus/unit_test/Tempus_UnitTest_DIRK_1Stage1stOrderRadauIA.cpp b/packages/tempus/unit_test/Tempus_UnitTest_DIRK_1Stage1stOrderRadauIA.cpp index 7585bbcd52fe..27ce6d4cd2b8 100644 --- a/packages/tempus/unit_test/Tempus_UnitTest_DIRK_1Stage1stOrderRadauIA.cpp +++ b/packages/tempus/unit_test/Tempus_UnitTest_DIRK_1Stage1stOrderRadauIA.cpp @@ -40,7 +40,11 @@ using Tempus::StepperFactory; // ************************************************************ TEUCHOS_UNIT_TEST(DIRK_1Stage1stOrderRadauIA, Default_Construction) { - testDIRKAccessorsFullConstruction("RK Implicit 1 Stage 1st order Radau IA"); + auto stepper = rcp(new Tempus::StepperDIRK_1Stage1stOrderRadauIA()); + testDIRKAccessorsFullConstruction(stepper); + + // Test stepper properties. + TEUCHOS_ASSERT(stepper->getOrder() == 1); } @@ -57,7 +61,9 @@ TEUCHOS_UNIT_TEST(DIRK_1Stage1stOrderRadauIA, StepperFactory_Construction) // ************************************************************ TEUCHOS_UNIT_TEST(DIRK_1Stage1stOrderRadauIA, AppAction) { - testRKAppAction("RK Implicit 1 Stage 1st order Radau IA", out, success); + auto stepper = rcp(new Tempus::StepperDIRK_1Stage1stOrderRadauIA()); + auto model = rcp(new Tempus_Test::SinCosModel()); + testRKAppAction(stepper, model, out, success); } diff --git a/packages/tempus/unit_test/Tempus_UnitTest_DIRK_1StageTheta.cpp b/packages/tempus/unit_test/Tempus_UnitTest_DIRK_1StageTheta.cpp index 109801cc3f82..fcd14a2b2466 100644 --- a/packages/tempus/unit_test/Tempus_UnitTest_DIRK_1StageTheta.cpp +++ b/packages/tempus/unit_test/Tempus_UnitTest_DIRK_1StageTheta.cpp @@ -40,7 +40,15 @@ using Tempus::StepperFactory; // ************************************************************ TEUCHOS_UNIT_TEST(DIRK_1StageTheta, Default_Construction) { - testDIRKAccessorsFullConstruction("DIRK 1 Stage Theta Method"); + auto stepper = rcp(new Tempus::StepperDIRK_1StageTheta()); + testDIRKAccessorsFullConstruction(stepper); + + // Test stepper properties. + TEUCHOS_ASSERT(stepper->getOrder() == 2); + double theta = 0.5; + TEUCHOS_ASSERT(stepper->getTheta() == theta); + stepper->setTheta(theta); stepper->initialize(); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + } @@ -57,7 +65,9 @@ TEUCHOS_UNIT_TEST(DIRK_1StageTheta, StepperFactory_Construction) // ************************************************************ TEUCHOS_UNIT_TEST(DIRK_1StageTheta, AppAction) { - testRKAppAction("DIRK 1 Stage Theta Method", out, success); + auto stepper = rcp(new Tempus::StepperDIRK_1StageTheta()); + auto model = rcp(new Tempus_Test::SinCosModel()); + testRKAppAction(stepper, model, out, success); } diff --git a/packages/tempus/unit_test/Tempus_UnitTest_DIRK_2Stage2ndOrderLobattoIIIB.cpp b/packages/tempus/unit_test/Tempus_UnitTest_DIRK_2Stage2ndOrderLobattoIIIB.cpp index afec1c9424ed..e681c8ebadb8 100644 --- a/packages/tempus/unit_test/Tempus_UnitTest_DIRK_2Stage2ndOrderLobattoIIIB.cpp +++ b/packages/tempus/unit_test/Tempus_UnitTest_DIRK_2Stage2ndOrderLobattoIIIB.cpp @@ -40,7 +40,11 @@ using Tempus::StepperFactory; // ************************************************************ TEUCHOS_UNIT_TEST(DIRK_2Stage2ndOrderLobattoIIIB, Default_Construction) { - testDIRKAccessorsFullConstruction("RK Implicit 2 Stage 2nd order Lobatto IIIB"); + auto stepper=rcp(new Tempus::StepperDIRK_2Stage2ndOrderLobattoIIIB()); + testDIRKAccessorsFullConstruction(stepper); + + // Test stepper properties. + TEUCHOS_ASSERT(stepper->getOrder() == 2); } @@ -57,7 +61,9 @@ TEUCHOS_UNIT_TEST(DIRK_2Stage2ndOrderLobattoIIIB, StepperFactory_Construction) // ************************************************************ TEUCHOS_UNIT_TEST(DIRK_2Stage2ndOrderLobattoIIIB, AppAction) { - testRKAppAction("RK Implicit 2 Stage 2nd order Lobatto IIIB", out, success); + auto stepper = rcp(new Tempus::StepperDIRK_2Stage2ndOrderLobattoIIIB()); + auto model = rcp(new Tempus_Test::SinCosModel()); + testRKAppAction(stepper, model, out, success); } diff --git a/packages/tempus/unit_test/Tempus_UnitTest_DIRK_BackwardEuler.cpp b/packages/tempus/unit_test/Tempus_UnitTest_DIRK_BackwardEuler.cpp index 051109e43ee9..64f3bd21a85b 100644 --- a/packages/tempus/unit_test/Tempus_UnitTest_DIRK_BackwardEuler.cpp +++ b/packages/tempus/unit_test/Tempus_UnitTest_DIRK_BackwardEuler.cpp @@ -40,7 +40,11 @@ using Tempus::StepperFactory; // ************************************************************ TEUCHOS_UNIT_TEST(DIRK_BackwardEuler, Default_Construction) { - testDIRKAccessorsFullConstruction("RK Backward Euler"); + auto stepper = rcp(new Tempus::StepperDIRK_BackwardEuler()); + testDIRKAccessorsFullConstruction(stepper); + + // Test stepper properties. + TEUCHOS_ASSERT(stepper->getOrder() == 1); } @@ -57,7 +61,9 @@ TEUCHOS_UNIT_TEST(DIRK_BackwardEuler, StepperFactory_Construction) // ************************************************************ TEUCHOS_UNIT_TEST(DIRK_BackwardEuler, AppAction) { - testRKAppAction("RK Backward Euler", out, success); + auto stepper = rcp(new Tempus::StepperDIRK_BackwardEuler()); + auto model = rcp(new Tempus_Test::SinCosModel()); + testRKAppAction(stepper, model, out, success); } diff --git a/packages/tempus/unit_test/Tempus_UnitTest_DIRK_General.cpp b/packages/tempus/unit_test/Tempus_UnitTest_DIRK_General.cpp index 39800063500d..efd6b6d4629c 100644 --- a/packages/tempus/unit_test/Tempus_UnitTest_DIRK_General.cpp +++ b/packages/tempus/unit_test/Tempus_UnitTest_DIRK_General.cpp @@ -111,6 +111,8 @@ TEUCHOS_UNIT_TEST(DIRK_General, Default_Construction) A, b, c, order, order, order, bstar)); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + // Test stepper properties. + TEUCHOS_ASSERT(stepper->getOrder() == 2); } @@ -127,7 +129,9 @@ TEUCHOS_UNIT_TEST(DIRK_General, StepperFactory_Construction) // ************************************************************ TEUCHOS_UNIT_TEST(DIRK_General, AppAction) { - testRKAppAction("General DIRK", out, success); + auto stepper = rcp(new Tempus::StepperDIRK_General()); + auto model = rcp(new Tempus_Test::SinCosModel()); + testRKAppAction(stepper, model, out, success); } diff --git a/packages/tempus/unit_test/Tempus_UnitTest_EDIRK_2Stage3rdOrder.cpp b/packages/tempus/unit_test/Tempus_UnitTest_EDIRK_2Stage3rdOrder.cpp index bb755680e6bf..5379aa9127f8 100644 --- a/packages/tempus/unit_test/Tempus_UnitTest_EDIRK_2Stage3rdOrder.cpp +++ b/packages/tempus/unit_test/Tempus_UnitTest_EDIRK_2Stage3rdOrder.cpp @@ -40,7 +40,11 @@ using Tempus::StepperFactory; // ************************************************************ TEUCHOS_UNIT_TEST(EDIRK_2Stage3rdOrder, Default_Construction) { - testDIRKAccessorsFullConstruction("EDIRK 2 Stage 3rd order"); + auto stepper = rcp(new Tempus::StepperEDIRK_2Stage3rdOrder()); + testDIRKAccessorsFullConstruction(stepper); + + // Test stepper properties. + TEUCHOS_ASSERT(stepper->getOrder() == 3); } @@ -57,7 +61,9 @@ TEUCHOS_UNIT_TEST(EDIRK_2Stage3rdOrder, StepperFactory_Construction) // ************************************************************ TEUCHOS_UNIT_TEST(EDIRK_2Stage3rdOrder, AppAction) { - testRKAppAction("EDIRK 2 Stage 3rd order", out, success); + auto stepper = rcp(new Tempus::StepperEDIRK_2Stage3rdOrder()); + auto model = rcp(new Tempus_Test::SinCosModel()); + testRKAppAction(stepper, model, out, success); } diff --git a/packages/tempus/unit_test/Tempus_UnitTest_EDIRK_2StageTheta.cpp b/packages/tempus/unit_test/Tempus_UnitTest_EDIRK_2StageTheta.cpp index 168ca815b780..3568810cb754 100644 --- a/packages/tempus/unit_test/Tempus_UnitTest_EDIRK_2StageTheta.cpp +++ b/packages/tempus/unit_test/Tempus_UnitTest_EDIRK_2StageTheta.cpp @@ -40,7 +40,15 @@ using Tempus::StepperFactory; // ************************************************************ TEUCHOS_UNIT_TEST(EDIRK_2StageTheta, Default_Construction) { - testDIRKAccessorsFullConstruction("EDIRK 2 Stage Theta Method"); + auto stepper = rcp(new Tempus::StepperEDIRK_2StageTheta()); + testDIRKAccessorsFullConstruction(stepper); + + // Test stepper properties. + TEUCHOS_ASSERT(stepper->getOrder() == 2); + double theta = 0.5; + TEUCHOS_ASSERT(stepper->getTheta() == theta); + stepper->setTheta(theta); stepper->initialize(); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + } @@ -57,7 +65,9 @@ TEUCHOS_UNIT_TEST(EDIRK_2StageTheta, StepperFactory_Construction) // ************************************************************ TEUCHOS_UNIT_TEST(EDIRK_2StageTheta, AppAction) { - testRKAppAction("EDIRK 2 Stage Theta Method", out, success); + auto stepper = rcp(new Tempus::StepperEDIRK_2StageTheta()); + auto model = rcp(new Tempus_Test::SinCosModel()); + testRKAppAction(stepper, model, out, success); } diff --git a/packages/tempus/unit_test/Tempus_UnitTest_EDIRK_TrapezoidalRule.cpp b/packages/tempus/unit_test/Tempus_UnitTest_EDIRK_TrapezoidalRule.cpp index 94468c2c139b..8969d118ee32 100644 --- a/packages/tempus/unit_test/Tempus_UnitTest_EDIRK_TrapezoidalRule.cpp +++ b/packages/tempus/unit_test/Tempus_UnitTest_EDIRK_TrapezoidalRule.cpp @@ -40,7 +40,11 @@ using Tempus::StepperFactory; // ************************************************************ TEUCHOS_UNIT_TEST(EDIRK_TrapezoidalRule, Default_Construction) { - testDIRKAccessorsFullConstruction("RK Trapezoidal Rule"); + auto stepper = rcp(new Tempus::StepperEDIRK_TrapezoidalRule()); + testDIRKAccessorsFullConstruction(stepper); + + // Test stepper properties. + TEUCHOS_ASSERT(stepper->getOrder() == 2); } @@ -57,7 +61,9 @@ TEUCHOS_UNIT_TEST(EDIRK_TrapezoidalRule, StepperFactory_Construction) // ************************************************************ TEUCHOS_UNIT_TEST(EDIRK_TrapezoidalRule, AppAction) { - testRKAppAction("RK Trapezoidal Rule", out, success); + auto stepper = rcp(new Tempus::StepperEDIRK_TrapezoidalRule()); + auto model = rcp(new Tempus_Test::SinCosModel()); + testRKAppAction(stepper, model, out, success); } diff --git a/packages/tempus/unit_test/Tempus_UnitTest_ERK_3Stage3rdOrder.cpp b/packages/tempus/unit_test/Tempus_UnitTest_ERK_3Stage3rdOrder.cpp index 43007dbbc50d..6e47c34243ce 100644 --- a/packages/tempus/unit_test/Tempus_UnitTest_ERK_3Stage3rdOrder.cpp +++ b/packages/tempus/unit_test/Tempus_UnitTest_ERK_3Stage3rdOrder.cpp @@ -25,7 +25,11 @@ using Teuchos::rcp_dynamic_cast; // ************************************************************ TEUCHOS_UNIT_TEST(ERK_3Stage3rdOrder, Default_Construction) { - testExplicitRKAccessorsFullConstruction("RK Explicit 3 Stage 3rd order"); + auto stepper = rcp(new Tempus::StepperERK_3Stage3rdOrder()); + testExplicitRKAccessorsFullConstruction(stepper); + + // Test stepper properties. + TEUCHOS_ASSERT(stepper->getOrder() == 3); } @@ -42,7 +46,9 @@ TEUCHOS_UNIT_TEST(ERK_3Stage3rdOrder, StepperFactory_Construction) // ************************************************************ TEUCHOS_UNIT_TEST(ERK_3Stage3rdOrder, AppAction) { - testRKAppAction("RK Explicit 3 Stage 3rd order", out, success); + auto stepper = rcp(new Tempus::StepperERK_3Stage3rdOrder()); + auto model = rcp(new Tempus_Test::SinCosModel()); + testRKAppAction(stepper, model, out, success); } diff --git a/packages/tempus/unit_test/Tempus_UnitTest_ERK_3Stage3rdOrderHeun.cpp b/packages/tempus/unit_test/Tempus_UnitTest_ERK_3Stage3rdOrderHeun.cpp index 0ee72dd45551..e1bdd5ff2d0c 100644 --- a/packages/tempus/unit_test/Tempus_UnitTest_ERK_3Stage3rdOrderHeun.cpp +++ b/packages/tempus/unit_test/Tempus_UnitTest_ERK_3Stage3rdOrderHeun.cpp @@ -24,7 +24,11 @@ using Teuchos::rcp_dynamic_cast; // ************************************************************ TEUCHOS_UNIT_TEST(ERK_3Stage3rdOrderHeun, Default_Construction) { - testExplicitRKAccessorsFullConstruction("RK Explicit 3 Stage 3rd order by Heun"); + auto stepper = rcp(new Tempus::StepperERK_3Stage3rdOrderHeun()); + testExplicitRKAccessorsFullConstruction(stepper); + + // Test stepper properties. + TEUCHOS_ASSERT(stepper->getOrder() == 3); } @@ -41,7 +45,9 @@ TEUCHOS_UNIT_TEST(ERK_3Stage3rdOrderHeun, StepperFactory_Construction) // ************************************************************ TEUCHOS_UNIT_TEST(ERK_3Stage3rdOrderHeun, AppAction) { - testRKAppAction("RK Explicit 3 Stage 3rd order by Heun", out, success); + auto stepper = rcp(new Tempus::StepperERK_3Stage3rdOrderHeun()); + auto model = rcp(new Tempus_Test::SinCosModel()); + testRKAppAction(stepper, model, out, success); } diff --git a/packages/tempus/unit_test/Tempus_UnitTest_ERK_3Stage3rdOrderTVD.cpp b/packages/tempus/unit_test/Tempus_UnitTest_ERK_3Stage3rdOrderTVD.cpp index 5bdd5b0cfac9..ae0b47dc848a 100644 --- a/packages/tempus/unit_test/Tempus_UnitTest_ERK_3Stage3rdOrderTVD.cpp +++ b/packages/tempus/unit_test/Tempus_UnitTest_ERK_3Stage3rdOrderTVD.cpp @@ -24,7 +24,11 @@ using Teuchos::rcp_dynamic_cast; // ************************************************************ TEUCHOS_UNIT_TEST(ERK_3Stage3rdOrderTVD, Default_Construction) { - testExplicitRKAccessorsFullConstruction("RK Explicit 3 Stage 3rd order TVD"); + auto stepper = rcp(new Tempus::StepperERK_3Stage3rdOrderTVD()); + testExplicitRKAccessorsFullConstruction(stepper); + + // Test stepper properties. + TEUCHOS_ASSERT(stepper->getOrder() == 3); } @@ -41,7 +45,9 @@ TEUCHOS_UNIT_TEST(ERK_3Stage3rdOrderTVD, StepperFactory_Construction) // ************************************************************ TEUCHOS_UNIT_TEST(ERK_3Stage3rdOrderTVD, AppAction) { - testRKAppAction("RK Explicit 3 Stage 3rd order TVD", out, success); + auto stepper = rcp(new Tempus::StepperERK_3Stage3rdOrderTVD()); + auto model = rcp(new Tempus_Test::SinCosModel()); + testRKAppAction(stepper, model, out, success); } diff --git a/packages/tempus/unit_test/Tempus_UnitTest_ERK_3_8Rule.cpp b/packages/tempus/unit_test/Tempus_UnitTest_ERK_3_8Rule.cpp index 9ad56701f666..3390b7552a1d 100644 --- a/packages/tempus/unit_test/Tempus_UnitTest_ERK_3_8Rule.cpp +++ b/packages/tempus/unit_test/Tempus_UnitTest_ERK_3_8Rule.cpp @@ -24,7 +24,11 @@ using Teuchos::rcp_dynamic_cast; // ************************************************************ TEUCHOS_UNIT_TEST(ERK_3_8Rule, Default_Construction) { - testExplicitRKAccessorsFullConstruction("RK Explicit 3/8 Rule"); + auto stepper = rcp(new Tempus::StepperERK_3_8Rule()); + testExplicitRKAccessorsFullConstruction(stepper); + + // Test stepper properties. + TEUCHOS_ASSERT(stepper->getOrder() == 4); } @@ -41,7 +45,9 @@ TEUCHOS_UNIT_TEST(ERK_3_8Rule, StepperFactory_Construction) // ************************************************************ TEUCHOS_UNIT_TEST(ERK_3_8Rule, AppAction) { - testRKAppAction("RK Explicit 3/8 Rule", out, success); + auto stepper = rcp(new Tempus::StepperERK_3_8Rule()); + auto model = rcp(new Tempus_Test::SinCosModel()); + testRKAppAction(stepper, model, out, success); } diff --git a/packages/tempus/unit_test/Tempus_UnitTest_ERK_4Stage3rdOrderRunge.cpp b/packages/tempus/unit_test/Tempus_UnitTest_ERK_4Stage3rdOrderRunge.cpp index 8c4a3706cae2..947b8a152216 100644 --- a/packages/tempus/unit_test/Tempus_UnitTest_ERK_4Stage3rdOrderRunge.cpp +++ b/packages/tempus/unit_test/Tempus_UnitTest_ERK_4Stage3rdOrderRunge.cpp @@ -24,7 +24,11 @@ using Teuchos::rcp_dynamic_cast; // ************************************************************ TEUCHOS_UNIT_TEST(ERK_4Stage3rdOrderRunge, Default_Construction) { - testExplicitRKAccessorsFullConstruction("RK Explicit 4 Stage 3rd order by Runge"); + auto stepper = rcp(new Tempus::StepperERK_4Stage3rdOrderRunge()); + testExplicitRKAccessorsFullConstruction(stepper); + + // Test stepper properties. + TEUCHOS_ASSERT(stepper->getOrder() == 3); } @@ -41,7 +45,9 @@ TEUCHOS_UNIT_TEST(ERK_4Stage3rdOrderRunge, StepperFactory_Construction) // ************************************************************ TEUCHOS_UNIT_TEST(ERK_4Stage3rdOrderRunge, AppAction) { - testRKAppAction("RK Explicit 4 Stage 3rd order by Runge", out, success); + auto stepper = rcp(new Tempus::StepperERK_4Stage3rdOrderRunge()); + auto model = rcp(new Tempus_Test::SinCosModel()); + testRKAppAction(stepper, model, out, success); } diff --git a/packages/tempus/unit_test/Tempus_UnitTest_ERK_4Stage4thOrder.cpp b/packages/tempus/unit_test/Tempus_UnitTest_ERK_4Stage4thOrder.cpp index 00d770a7ed8e..0649b1bd5511 100644 --- a/packages/tempus/unit_test/Tempus_UnitTest_ERK_4Stage4thOrder.cpp +++ b/packages/tempus/unit_test/Tempus_UnitTest_ERK_4Stage4thOrder.cpp @@ -24,7 +24,11 @@ using Teuchos::rcp_dynamic_cast; // ************************************************************ TEUCHOS_UNIT_TEST(ERK_4Stage4thOrder, Default_Construction) { - testExplicitRKAccessorsFullConstruction("RK Explicit 4 Stage"); + auto stepper = rcp(new Tempus::StepperERK_4Stage4thOrder()); + testExplicitRKAccessorsFullConstruction(stepper); + + // Test stepper properties. + TEUCHOS_ASSERT(stepper->getOrder() == 4); } @@ -41,7 +45,9 @@ TEUCHOS_UNIT_TEST(ERK_4Stage4thOrder, StepperFactory_Construction) // ************************************************************ TEUCHOS_UNIT_TEST(ERK_4Stage4thOrder, AppAction) { - testRKAppAction("RK Explicit 4 Stage", out, success); + auto stepper = rcp(new Tempus::StepperERK_4Stage4thOrder()); + auto model = rcp(new Tempus_Test::SinCosModel()); + testRKAppAction(stepper, model, out, success); } diff --git a/packages/tempus/unit_test/Tempus_UnitTest_ERK_5Stage3rdOrderKandG.cpp b/packages/tempus/unit_test/Tempus_UnitTest_ERK_5Stage3rdOrderKandG.cpp index 1805f543e6ba..52bc0d45a7bb 100644 --- a/packages/tempus/unit_test/Tempus_UnitTest_ERK_5Stage3rdOrderKandG.cpp +++ b/packages/tempus/unit_test/Tempus_UnitTest_ERK_5Stage3rdOrderKandG.cpp @@ -24,7 +24,11 @@ using Teuchos::rcp_dynamic_cast; // ************************************************************ TEUCHOS_UNIT_TEST(ERK_5Stage3rdOrderKandG, Default_Construction) { - testExplicitRKAccessorsFullConstruction("RK Explicit 5 Stage 3rd order by Kinnmark and Gray"); + auto stepper = rcp(new Tempus::StepperERK_5Stage3rdOrderKandG()); + testExplicitRKAccessorsFullConstruction(stepper); + + // Test stepper properties. + TEUCHOS_ASSERT(stepper->getOrder() == 3); } @@ -41,7 +45,9 @@ TEUCHOS_UNIT_TEST(ERK_5Stage3rdOrderKandG, StepperFactory_Construction) // ************************************************************ TEUCHOS_UNIT_TEST(ERK_5Stage3rdOrderKandG, AppAction) { - testRKAppAction("RK Explicit 5 Stage 3rd order by Kinnmark and Gray", out, success); + auto stepper = rcp(new Tempus::StepperERK_5Stage3rdOrderKandG()); + auto model = rcp(new Tempus_Test::SinCosModel()); + testRKAppAction(stepper, model, out, success); } diff --git a/packages/tempus/unit_test/Tempus_UnitTest_ERK_BogackiShampine32.cpp b/packages/tempus/unit_test/Tempus_UnitTest_ERK_BogackiShampine32.cpp index 2237ca2281f9..57e61f3a23dd 100644 --- a/packages/tempus/unit_test/Tempus_UnitTest_ERK_BogackiShampine32.cpp +++ b/packages/tempus/unit_test/Tempus_UnitTest_ERK_BogackiShampine32.cpp @@ -24,7 +24,11 @@ using Teuchos::rcp_dynamic_cast; // ************************************************************ TEUCHOS_UNIT_TEST(ERK_BogackiShampine32, Default_Construction) { - testExplicitRKAccessorsFullConstruction("Bogacki-Shampine 3(2) Pair"); + auto stepper = rcp(new Tempus::StepperERK_BogackiShampine32()); + testExplicitRKAccessorsFullConstruction(stepper); + + // Test stepper properties. + TEUCHOS_ASSERT(stepper->getOrder() == 3); } @@ -41,7 +45,9 @@ TEUCHOS_UNIT_TEST(ERK_BogackiShampine32, StepperFactory_Construction) // ************************************************************ TEUCHOS_UNIT_TEST(ERK_BogackiShampine32, AppAction) { - testRKAppAction("Bogacki-Shampine 3(2) Pair", out, success); + auto stepper = rcp(new Tempus::StepperERK_BogackiShampine32()); + auto model = rcp(new Tempus_Test::SinCosModel()); + testRKAppAction(stepper, model, out, success); } diff --git a/packages/tempus/unit_test/Tempus_UnitTest_ERK_ForwardEuler.cpp b/packages/tempus/unit_test/Tempus_UnitTest_ERK_ForwardEuler.cpp index ad6d1e54e0d4..d9495b6c5c3e 100644 --- a/packages/tempus/unit_test/Tempus_UnitTest_ERK_ForwardEuler.cpp +++ b/packages/tempus/unit_test/Tempus_UnitTest_ERK_ForwardEuler.cpp @@ -24,7 +24,11 @@ using Teuchos::rcp_dynamic_cast; // ************************************************************ TEUCHOS_UNIT_TEST(ERK_ForwardEuler, Default_Construction) { - testExplicitRKAccessorsFullConstruction("RK Forward Euler"); + auto stepper = rcp(new Tempus::StepperERK_ForwardEuler()); + testExplicitRKAccessorsFullConstruction(stepper); + + // Test stepper properties. + TEUCHOS_ASSERT(stepper->getOrder() == 1); } @@ -41,7 +45,9 @@ TEUCHOS_UNIT_TEST(ERK_ForwardEuler, StepperFactory_Construction) // ************************************************************ TEUCHOS_UNIT_TEST(ERK_ForwardEuler, AppAction) { - testRKAppAction("RK Forward Euler", out, success); + auto stepper = rcp(new Tempus::StepperERK_ForwardEuler()); + auto model = rcp(new Tempus_Test::SinCosModel()); + testRKAppAction(stepper, model, out, success); } diff --git a/packages/tempus/unit_test/Tempus_UnitTest_ERK_General.cpp b/packages/tempus/unit_test/Tempus_UnitTest_ERK_General.cpp index a8708fb48650..5b295ede2c36 100644 --- a/packages/tempus/unit_test/Tempus_UnitTest_ERK_General.cpp +++ b/packages/tempus/unit_test/Tempus_UnitTest_ERK_General.cpp @@ -88,6 +88,8 @@ TEUCHOS_UNIT_TEST(ERK_General, Default_Construction) A, b, c, order, order, order, bstar, modifier)); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + // Test stepper properties. + TEUCHOS_ASSERT(stepper->getOrder() == 4); } @@ -104,7 +106,9 @@ TEUCHOS_UNIT_TEST(ERK_General, StepperFactory_Construction) // ************************************************************ TEUCHOS_UNIT_TEST(ERK_General, AppAction) { - testRKAppAction("General ERK", out, success); + auto stepper = rcp(new Tempus::StepperERK_General()); + auto model = rcp(new Tempus_Test::SinCosModel()); + testRKAppAction(stepper, model, out, success); } diff --git a/packages/tempus/unit_test/Tempus_UnitTest_ERK_Merson45.cpp b/packages/tempus/unit_test/Tempus_UnitTest_ERK_Merson45.cpp index 959ba8cd907c..1a44e5a52b0d 100644 --- a/packages/tempus/unit_test/Tempus_UnitTest_ERK_Merson45.cpp +++ b/packages/tempus/unit_test/Tempus_UnitTest_ERK_Merson45.cpp @@ -24,7 +24,11 @@ using Teuchos::rcp_dynamic_cast; // ************************************************************ TEUCHOS_UNIT_TEST(ERK_Merson45, Default_Construction) { - testExplicitRKAccessorsFullConstruction("Merson 4(5) Pair"); + auto stepper = rcp(new Tempus::StepperERK_Merson45()); + testExplicitRKAccessorsFullConstruction(stepper); + + // Test stepper properties. + TEUCHOS_ASSERT(stepper->getOrder() == 4); } @@ -41,7 +45,9 @@ TEUCHOS_UNIT_TEST(ERK_Merson45, StepperFactory_Construction) // ************************************************************ TEUCHOS_UNIT_TEST(ERK_Merson45, AppAction) { - testRKAppAction("Merson 4(5) Pair", out, success); + auto stepper = rcp(new Tempus::StepperERK_Merson45()); + auto model = rcp(new Tempus_Test::SinCosModel()); + testRKAppAction(stepper, model, out, success); } diff --git a/packages/tempus/unit_test/Tempus_UnitTest_ERK_Midpoint.cpp b/packages/tempus/unit_test/Tempus_UnitTest_ERK_Midpoint.cpp index 8d2bdd2c3072..fe8d289c4f8d 100644 --- a/packages/tempus/unit_test/Tempus_UnitTest_ERK_Midpoint.cpp +++ b/packages/tempus/unit_test/Tempus_UnitTest_ERK_Midpoint.cpp @@ -24,7 +24,11 @@ using Teuchos::rcp_dynamic_cast; // ************************************************************ TEUCHOS_UNIT_TEST(ERK_Midpoint, Default_Construction) { - testExplicitRKAccessorsFullConstruction("RK Explicit Midpoint"); + auto stepper = rcp(new Tempus::StepperERK_Midpoint()); + testExplicitRKAccessorsFullConstruction(stepper); + + // Test stepper properties. + TEUCHOS_ASSERT(stepper->getOrder() == 2); } @@ -41,7 +45,9 @@ TEUCHOS_UNIT_TEST(ERK_Midpoint, StepperFactory_Construction) // ************************************************************ TEUCHOS_UNIT_TEST(ERK_Midpoint, AppAction) { - testRKAppAction("RK Explicit Midpoint", out, success); + auto stepper = rcp(new Tempus::StepperERK_Midpoint()); + auto model = rcp(new Tempus_Test::SinCosModel()); + testRKAppAction(stepper, model, out, success); } diff --git a/packages/tempus/unit_test/Tempus_UnitTest_ERK_Trapezoidal.cpp b/packages/tempus/unit_test/Tempus_UnitTest_ERK_Trapezoidal.cpp index 1f8c1b34d795..493aadd0e644 100644 --- a/packages/tempus/unit_test/Tempus_UnitTest_ERK_Trapezoidal.cpp +++ b/packages/tempus/unit_test/Tempus_UnitTest_ERK_Trapezoidal.cpp @@ -24,7 +24,11 @@ using Teuchos::rcp_dynamic_cast; // ************************************************************ TEUCHOS_UNIT_TEST(ERK_Trapezoidal, Default_Construction) { - testExplicitRKAccessorsFullConstruction("RK Explicit Trapezoidal"); + auto stepper = rcp(new Tempus::StepperERK_Trapezoidal()); + testExplicitRKAccessorsFullConstruction(stepper); + + // Test stepper properties. + TEUCHOS_ASSERT(stepper->getOrder() == 2); } @@ -41,7 +45,9 @@ TEUCHOS_UNIT_TEST(ERK_Trapezoidal, StepperFactory_Construction) // ************************************************************ TEUCHOS_UNIT_TEST(ERK_Trapezoidal, AppAction) { - testRKAppAction("RK Explicit Trapezoidal", out, success); + auto stepper = rcp(new Tempus::StepperERK_Trapezoidal()); + auto model = rcp(new Tempus_Test::SinCosModel()); + testRKAppAction(stepper, model, out, success); } diff --git a/packages/tempus/unit_test/Tempus_UnitTest_ForwardEuler.cpp b/packages/tempus/unit_test/Tempus_UnitTest_ForwardEuler.cpp index e8a0d1465f40..1c49596a1bc0 100644 --- a/packages/tempus/unit_test/Tempus_UnitTest_ForwardEuler.cpp +++ b/packages/tempus/unit_test/Tempus_UnitTest_ForwardEuler.cpp @@ -43,11 +43,8 @@ using Tempus::StepperFactory; using Tempus::StepperExplicitRK; // Comment out any of the following tests to exclude from build/run. -#define CONSTRUCTION -#define STEPPERFACTORY_CONSTRUCTION -#ifdef CONSTRUCTION // ************************************************************ // ************************************************************ TEUCHOS_UNIT_TEST(ForwardEuler, Default_Construction) @@ -85,11 +82,11 @@ TEUCHOS_UNIT_TEST(ForwardEuler, Default_Construction) model, useFSAL, ICConsistency, ICConsistencyCheck,modifier)); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + // Test stepper properties. + TEUCHOS_ASSERT(stepper->getOrder() == 1); } -#endif // CONSTRUCTION -#ifdef STEPPERFACTORY_CONSTRUCTION // ************************************************************ // ************************************************************ TEUCHOS_UNIT_TEST(ForwardEuler, StepperFactory_Construction) @@ -97,7 +94,6 @@ TEUCHOS_UNIT_TEST(ForwardEuler, StepperFactory_Construction) auto model = rcp(new Tempus_Test::SinCosModel()); testFactoryConstruction("Forward Euler", model); } -#endif // STEPPERFACTORY_CONSTRUCTION // ************************************************************ diff --git a/packages/tempus/unit_test/Tempus_UnitTest_HHTAlpha.cpp b/packages/tempus/unit_test/Tempus_UnitTest_HHTAlpha.cpp index 4611bf10c11e..612ab1adceea 100644 --- a/packages/tempus/unit_test/Tempus_UnitTest_HHTAlpha.cpp +++ b/packages/tempus/unit_test/Tempus_UnitTest_HHTAlpha.cpp @@ -36,15 +36,10 @@ using Teuchos::getParametersFromXmlFile; using Tempus::StepperFactory; -// Comment out any of the following tests to exclude from build/run. -#define CONSTRUCTION -#define STEPPERFACTORY_CONSTRUCTION - -#ifdef CONSTRUCTION // ************************************************************ // ************************************************************ -TEUCHOS_UNIT_TEST(HHTAlpha, Construction) +TEUCHOS_UNIT_TEST(HHTAlpha, Default_Construction) { auto model = rcp(new Tempus_Test::HarmonicOscillatorModel()); @@ -91,11 +86,11 @@ TEUCHOS_UNIT_TEST(HHTAlpha, Construction) schemeName, beta, gamma, alpha_f, alpha_m)); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + // Test stepper properties. + TEUCHOS_ASSERT(stepper->getOrder() == 2); } -#endif // CONSTRUCTION -#ifdef STEPPERFACTORY_CONSTRUCTION // ************************************************************ // ************************************************************ TEUCHOS_UNIT_TEST(HHTAlpha, StepperFactory_Construction) @@ -103,7 +98,6 @@ TEUCHOS_UNIT_TEST(HHTAlpha, StepperFactory_Construction) auto model = rcp(new Tempus_Test::HarmonicOscillatorModel()); testFactoryConstruction("HHT-Alpha", model); } -#endif // STEPPERFACTORY_CONSTRUCTION } // namespace Tempus_Test diff --git a/packages/tempus/unit_test/Tempus_UnitTest_IMEX_RK.cpp b/packages/tempus/unit_test/Tempus_UnitTest_IMEX_RK.cpp index 794e921afccc..7405b3b60c7c 100644 --- a/packages/tempus/unit_test/Tempus_UnitTest_IMEX_RK.cpp +++ b/packages/tempus/unit_test/Tempus_UnitTest_IMEX_RK.cpp @@ -37,14 +37,7 @@ using Teuchos::getParametersFromXmlFile; using Tempus::StepperFactory; using Tempus::StepperExplicitRK; -// Comment out any of the following tests to exclude from build/run. -#define CONSTRUCTION -#define STEPPERFACTORY_CONSTRUCTION -#define STEPPERFACTORY_CONSTRUCTION_GENERAL_WO_PARAMETERLIST -#define STEPPERFACTORY_CONSTRUCTION_GENERAL_WO_PARAMETERLIST_MODEL - -#ifdef CONSTRUCTION // ************************************************************ // ************************************************************ TEUCHOS_UNIT_TEST(IMEX_RK, Default_Construction) @@ -62,7 +55,7 @@ TEUCHOS_UNIT_TEST(IMEX_RK, Default_Construction) TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); // Default values for construction. - auto obs = rcp(new Tempus::StepperRKObserverComposite()); + auto modifier = rcp(new Tempus::StepperRKModifierDefault()); auto solver = rcp(new Thyra::NOXNonlinearSolver()); solver->setParameterList(Tempus::defaultSolverParameters()); @@ -79,7 +72,11 @@ TEUCHOS_UNIT_TEST(IMEX_RK, Default_Construction) // Test the set functions. +#ifndef TEMPUS_HIDE_DEPRECATED_CODE + auto obs = rcp(new Tempus::StepperRKObserverComposite()); stepper->setObserver(obs); stepper->initialize(); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); +#endif + stepper->setAppAction(modifier); stepper->initialize(); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); stepper->setSolver(solver); stepper->initialize(); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); stepper->setUseFSAL(useFSAL); stepper->initialize(); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); stepper->setICConsistency(ICConsistency); stepper->initialize(); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); @@ -93,17 +90,23 @@ TEUCHOS_UNIT_TEST(IMEX_RK, Default_Construction) // Full argument list construction. +#ifndef TEMPUS_HIDE_DEPRECATED_CODE + stepper = rcp(new Tempus::StepperIMEX_RK( + model, obs, solver, useFSAL, ICConsistency, ICConsistencyCheck, + zeroInitialGuess, stepperType, explicitTableau, implicitTableau, order)); + TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); +#endif stepper = rcp(new Tempus::StepperIMEX_RK( - model, obs, solver, useFSAL, - ICConsistency, ICConsistencyCheck, zeroInitialGuess, - stepperType, explicitTableau, implicitTableau, order)); + model, solver, useFSAL, ICConsistency, ICConsistencyCheck, + zeroInitialGuess, modifier, stepperType, explicitTableau, + implicitTableau, order)); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + // Test stepper properties. + TEUCHOS_ASSERT(stepper->getOrder() == 2); } -#endif // CONSTRUCTION -#ifdef STEPPERFACTORY_CONSTRUCTION // ************************************************************ // ************************************************************ TEUCHOS_UNIT_TEST(IMEX_RK, StepperFactory_Construction) @@ -116,10 +119,8 @@ TEUCHOS_UNIT_TEST(IMEX_RK, StepperFactory_Construction) testFactoryConstruction("IMEX RK SSP2", model); } -#endif // STEPPERFACTORY_CONSTRUCTION -#ifdef STEPPERFACTORY_CONSTRUCTION_GENERAL_WO_PARAMETERLIST // ************************************************************ // ************************************************************ TEUCHOS_UNIT_TEST(IMEX_RK, StepperFactory_Construction_General_wo_Parameterlist) @@ -135,10 +136,8 @@ TEUCHOS_UNIT_TEST(IMEX_RK, StepperFactory_Construction_General_wo_Parameterlist) auto stepper = sf->createStepper("General IMEX RK", model); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); } -#endif // STEPPERFACTORY_CONSTRUCTION_GENERAL_WO_PARAMETERLIST -#ifdef STEPPERFACTORY_CONSTRUCTION_GENERAL_WO_PARAMETERLIST_MODEL // ************************************************************ // ************************************************************ TEUCHOS_UNIT_TEST(IMEX_RK, StepperFactory_Construction_General_wo_Parameterlist_Model) @@ -156,7 +155,21 @@ TEUCHOS_UNIT_TEST(IMEX_RK, StepperFactory_Construction_General_wo_Parameterlist_ stepper->initialize(); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); } -#endif // STEPPERFACTORY_CONSTRUCTION_GENERAL_WO_PARAMETERLIST_MODEL + + +// ************************************************************ +// ************************************************************ +TEUCHOS_UNIT_TEST(IMEX_RK, AppAction) +{ + auto stepper = rcp(new Tempus::StepperIMEX_RK()); + // Setup the IMEX Pair ModelEvaluator + auto explicitModel = rcp(new Tempus_Test::VanDerPol_IMEX_ExplicitModel()); + auto implicitModel = rcp(new Tempus_Test::VanDerPol_IMEX_ImplicitModel()); + auto model = rcp(new Tempus::WrapperModelEvaluatorPairIMEX_Basic( + explicitModel, implicitModel)); + + testRKAppAction(stepper, model, out, success); +} } // namespace Tempus_Test diff --git a/packages/tempus/unit_test/Tempus_UnitTest_IMEX_RK_Partition.cpp b/packages/tempus/unit_test/Tempus_UnitTest_IMEX_RK_Partition.cpp index f7061bfc7ab2..0dedde7bbf5a 100644 --- a/packages/tempus/unit_test/Tempus_UnitTest_IMEX_RK_Partition.cpp +++ b/packages/tempus/unit_test/Tempus_UnitTest_IMEX_RK_Partition.cpp @@ -37,14 +37,7 @@ using Teuchos::getParametersFromXmlFile; using Tempus::StepperFactory; using Tempus::StepperExplicitRK; -// Comment out any of the following tests to exclude from build/run. -#define CONSTRUCTION -#define STEPPERFACTORY_CONSTRUCTION -#define STEPPERFACTORY_CONSTRUCTION_GENERAL_WO_PARAMETERLIST -#define STEPPERFACTORY_CONSTRUCTION_GENERAL_WO_PARAMETERLIST_MODEL - -#ifdef CONSTRUCTION // ************************************************************ // ************************************************************ TEUCHOS_UNIT_TEST(IMEX_RK_Partition, Default_Construction) @@ -69,7 +62,7 @@ TEUCHOS_UNIT_TEST(IMEX_RK_Partition, Default_Construction) TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); // Default values for construction. - auto obs = rcp(new Tempus::StepperRKObserverComposite()); + auto modifier = rcp(new Tempus::StepperRKModifierDefault()); auto solver = rcp(new Thyra::NOXNonlinearSolver()); solver->setParameterList(Tempus::defaultSolverParameters()); @@ -86,7 +79,11 @@ TEUCHOS_UNIT_TEST(IMEX_RK_Partition, Default_Construction) // Test the set functions. +#ifndef TEMPUS_HIDE_DEPRECATED_CODE + auto obs = rcp(new Tempus::StepperRKObserverComposite()); stepper->setObserver(obs); stepper->initialize(); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); +#endif + stepper->setAppAction(modifier); stepper->initialize(); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); stepper->setSolver(solver); stepper->initialize(); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); stepper->setUseFSAL(useFSAL); stepper->initialize(); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); stepper->setICConsistency(ICConsistency); stepper->initialize(); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); @@ -100,17 +97,25 @@ TEUCHOS_UNIT_TEST(IMEX_RK_Partition, Default_Construction) // Full argument list construction. +#ifndef TEMPUS_HIDE_DEPRECATED_CODE stepper = rcp(new Tempus::StepperIMEX_RK_Partition( model, obs, solver, useFSAL, ICConsistency, ICConsistencyCheck, zeroInitialGuess, stepperType, explicitTableau, implicitTableau, order)); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); +#endif + stepper = rcp(new Tempus::StepperIMEX_RK_Partition( + model, solver, useFSAL, ICConsistency, ICConsistencyCheck, + zeroInitialGuess, modifier, stepperType, explicitTableau, + implicitTableau, order)); + TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + // Test stepper properties. + std::cout << "ordero = " << stepper->getOrder() << std::endl; + TEUCHOS_ASSERT(stepper->getOrder() == 2); } -#endif // CONSTRUCTION -#ifdef STEPPERFACTORY_CONSTRUCTION // ************************************************************ // ************************************************************ TEUCHOS_UNIT_TEST(IMEX_RK_Partition, StepperFactory_Construction) @@ -129,13 +134,11 @@ TEUCHOS_UNIT_TEST(IMEX_RK_Partition, StepperFactory_Construction) testFactoryConstruction("Partitioned IMEX RK SSP2", model); } -#endif // STEPPERFACTORY_CONSTRUCTION -#ifdef STEPPERFACTORY_CONSTRUCTION_GENERAL_WO_PARAMETERLIST // ************************************************************ // ************************************************************ -TEUCHOS_UNIT_TEST(IMEX_RK, StepperFactory_Construction_General_wo_Parameterlist) +TEUCHOS_UNIT_TEST(IMEX_RK_Partition, StepperFactory_Construction_General_wo_Parameterlist) { // Setup the explicit VanDerPol ModelEvaluator const bool useProductVector = true; @@ -154,13 +157,11 @@ TEUCHOS_UNIT_TEST(IMEX_RK, StepperFactory_Construction_General_wo_Parameterlist) auto stepper = sf->createStepper("General Partitioned IMEX RK", model); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); } -#endif // STEPPERFACTORY_CONSTRUCTION_GENERAL_WO_PARAMETERLIST -#ifdef STEPPERFACTORY_CONSTRUCTION_GENERAL_WO_PARAMETERLIST_MODEL // ************************************************************ // ************************************************************ -TEUCHOS_UNIT_TEST(IMEX_RK, StepperFactory_Construction_General_wo_Parameterlist_Model) +TEUCHOS_UNIT_TEST(IMEX_RK_Partition, StepperFactory_Construction_General_wo_Parameterlist_Model) { // Setup the explicit VanDerPol ModelEvaluator const bool useProductVector = true; @@ -181,7 +182,28 @@ TEUCHOS_UNIT_TEST(IMEX_RK, StepperFactory_Construction_General_wo_Parameterlist_ stepper->initialize(); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); } -#endif // STEPPERFACTORY_CONSTRUCTION_GENERAL_WO_PARAMETERLIST_MODEL + + +// ************************************************************ +// ************************************************************ +TEUCHOS_UNIT_TEST(IMEX_RK_Partition, AppAction) +{ + auto stepper = rcp(new Tempus::StepperIMEX_RK_Partition()); + + // Setup the explicit VanDerPol ModelEvaluator + const bool useProductVector = true; + auto explicitModel = rcp(new Tempus_Test::VanDerPol_IMEX_ExplicitModel(Teuchos::null, useProductVector)); + auto implicitModel = rcp(new Tempus_Test::VanDerPol_IMEXPart_ImplicitModel()); + + // Setup the IMEX Pair ModelEvaluator + const int numExplicitBlocks = 1; + const int parameterIndex = 4; + auto model = rcp(new Tempus::WrapperModelEvaluatorPairPartIMEX_Basic( + explicitModel, implicitModel, + numExplicitBlocks, parameterIndex)); + + testRKAppAction(stepper, model, out, success); +} } // namespace Tempus_Test diff --git a/packages/tempus/unit_test/Tempus_UnitTest_Leapfrog.cpp b/packages/tempus/unit_test/Tempus_UnitTest_Leapfrog.cpp index 7834c0a41674..49317389f743 100644 --- a/packages/tempus/unit_test/Tempus_UnitTest_Leapfrog.cpp +++ b/packages/tempus/unit_test/Tempus_UnitTest_Leapfrog.cpp @@ -36,15 +36,10 @@ using Teuchos::getParametersFromXmlFile; using Tempus::StepperFactory; -// Comment out any of the following tests to exclude from build/run. -#define CONSTRUCTION -#define STEPPERFACTORY_CONSTRUCTION - -#ifdef CONSTRUCTION // ************************************************************ // ************************************************************ -TEUCHOS_UNIT_TEST(Leapfrog, Construction) +TEUCHOS_UNIT_TEST(Leapfrog, Default_Construction) { auto model = rcp(new Tempus_Test::HarmonicOscillatorModel()); @@ -75,11 +70,11 @@ TEUCHOS_UNIT_TEST(Leapfrog, Construction) model, obs, useFSAL, ICConsistency, ICConsistencyCheck)); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + // Test stepper properties. + TEUCHOS_ASSERT(stepper->getOrder() == 2); } -#endif // CONSTRUCTION -#ifdef STEPPERFACTORY_CONSTRUCTION // ************************************************************ // ************************************************************ TEUCHOS_UNIT_TEST(Leapfrog, StepperFactory_Construction) @@ -87,7 +82,6 @@ TEUCHOS_UNIT_TEST(Leapfrog, StepperFactory_Construction) auto model = rcp(new Tempus_Test::HarmonicOscillatorModel()); testFactoryConstruction("Leapfrog", model); } -#endif // STEPPERFACTORY_CONSTRUCTION } // namespace Tempus_Test diff --git a/packages/tempus/unit_test/Tempus_UnitTest_NewmarkExplicitAForm.cpp b/packages/tempus/unit_test/Tempus_UnitTest_NewmarkExplicitAForm.cpp index ebe76dcd59a6..5bdc2cac5680 100644 --- a/packages/tempus/unit_test/Tempus_UnitTest_NewmarkExplicitAForm.cpp +++ b/packages/tempus/unit_test/Tempus_UnitTest_NewmarkExplicitAForm.cpp @@ -36,15 +36,10 @@ using Teuchos::getParametersFromXmlFile; using Tempus::StepperFactory; -// Comment out any of the following tests to exclude from build/run. -#define CONSTRUCTION -#define STEPPERFACTORY_CONSTRUCTION - -#ifdef CONSTRUCTION // ************************************************************ // ************************************************************ -TEUCHOS_UNIT_TEST(NewmarkExplicitAForm, Construction) +TEUCHOS_UNIT_TEST(NewmarkExplicitAForm, Default_Construction) { auto model = rcp(new Tempus_Test::HarmonicOscillatorModel()); @@ -75,11 +70,11 @@ TEUCHOS_UNIT_TEST(NewmarkExplicitAForm, Construction) model, Teuchos::null, useFSAL, ICConsistency, ICConsistencyCheck, gamma)); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + // Test stepper properties. + TEUCHOS_ASSERT(stepper->getOrder() == 2); } -#endif // CONSTRUCTION -#ifdef STEPPERFACTORY_CONSTRUCTION // ************************************************************ // ************************************************************ TEUCHOS_UNIT_TEST(NewmarkExplicitAForm, StepperFactory_Construction) @@ -87,7 +82,6 @@ TEUCHOS_UNIT_TEST(NewmarkExplicitAForm, StepperFactory_Construction) auto model = rcp(new Tempus_Test::HarmonicOscillatorModel()); testFactoryConstruction("Newmark Explicit a-Form", model); } -#endif // STEPPERFACTORY_CONSTRUCTION } // namespace Tempus_Test diff --git a/packages/tempus/unit_test/Tempus_UnitTest_NewmarkImplicitAForm.cpp b/packages/tempus/unit_test/Tempus_UnitTest_NewmarkImplicitAForm.cpp index 8a857d78a1d8..9de83aa2505d 100644 --- a/packages/tempus/unit_test/Tempus_UnitTest_NewmarkImplicitAForm.cpp +++ b/packages/tempus/unit_test/Tempus_UnitTest_NewmarkImplicitAForm.cpp @@ -36,15 +36,10 @@ using Teuchos::getParametersFromXmlFile; using Tempus::StepperFactory; -// Comment out any of the following tests to exclude from build/run. -#define CONSTRUCTION -#define STEPPERFACTORY_CONSTRUCTION - -#ifdef CONSTRUCTION // ************************************************************ // ************************************************************ -TEUCHOS_UNIT_TEST(NewmarkImplicitAForm, Construction) +TEUCHOS_UNIT_TEST(NewmarkImplicitAForm, Default_Construction) { auto model = rcp(new Tempus_Test::HarmonicOscillatorModel()); @@ -87,11 +82,11 @@ TEUCHOS_UNIT_TEST(NewmarkImplicitAForm, Construction) schemeName, beta, gamma)); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + // Test stepper properties. + TEUCHOS_ASSERT(stepper->getOrder() == 2); } -#endif // CONSTRUCTION -#ifdef STEPPERFACTORY_CONSTRUCTION // ************************************************************ // ************************************************************ TEUCHOS_UNIT_TEST(NewmarkImplicitAForm, StepperFactory_Construction) @@ -99,7 +94,6 @@ TEUCHOS_UNIT_TEST(NewmarkImplicitAForm, StepperFactory_Construction) auto model = rcp(new Tempus_Test::HarmonicOscillatorModel()); testFactoryConstruction("Newmark Implicit a-Form", model); } -#endif // STEPPERFACTORY_CONSTRUCTION } // namespace Tempus_Test diff --git a/packages/tempus/unit_test/Tempus_UnitTest_NewmarkImplicitDForm.cpp b/packages/tempus/unit_test/Tempus_UnitTest_NewmarkImplicitDForm.cpp index c5eb5e3f5d00..505d1ef05200 100644 --- a/packages/tempus/unit_test/Tempus_UnitTest_NewmarkImplicitDForm.cpp +++ b/packages/tempus/unit_test/Tempus_UnitTest_NewmarkImplicitDForm.cpp @@ -36,15 +36,10 @@ using Teuchos::getParametersFromXmlFile; using Tempus::StepperFactory; -// Comment out any of the following tests to exclude from build/run. -#define CONSTRUCTION -#define STEPPERFACTORY_CONSTRUCTION - -#ifdef CONSTRUCTION // ************************************************************ // ************************************************************ -TEUCHOS_UNIT_TEST(NewmarkImplicitDForm, Construction) +TEUCHOS_UNIT_TEST(NewmarkImplicitDForm, Default_Construction) { auto model = rcp(new Tempus_Test::HarmonicOscillatorModel()); @@ -87,11 +82,11 @@ TEUCHOS_UNIT_TEST(NewmarkImplicitDForm, Construction) schemeName, beta, gamma)); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + // Test stepper properties. + TEUCHOS_ASSERT(stepper->getOrder() == 2); } -#endif // CONSTRUCTION -#ifdef STEPPERFACTORY_CONSTRUCTION // ************************************************************ // ************************************************************ TEUCHOS_UNIT_TEST(NewmarkImplicitDForm, StepperFactory_Construction) @@ -99,7 +94,6 @@ TEUCHOS_UNIT_TEST(NewmarkImplicitDForm, StepperFactory_Construction) auto model = rcp(new Tempus_Test::HarmonicOscillatorModel()); testFactoryConstruction("Newmark Implicit d-Form", model); } -#endif // STEPPERFACTORY_CONSTRUCTION } // namespace Tempus_Test diff --git a/packages/tempus/unit_test/Tempus_UnitTest_OperatorSplit.cpp b/packages/tempus/unit_test/Tempus_UnitTest_OperatorSplit.cpp index 951ceb9853b5..a2217e72278e 100644 --- a/packages/tempus/unit_test/Tempus_UnitTest_OperatorSplit.cpp +++ b/packages/tempus/unit_test/Tempus_UnitTest_OperatorSplit.cpp @@ -37,12 +37,7 @@ using Teuchos::getParametersFromXmlFile; using Tempus::StepperFactory; using Tempus::StepperExplicitRK; -// Comment out any of the following tests to exclude from build/run. -#define CONSTRUCTION -#define STEPPERFACTORY_CONSTRUCTION - -#ifdef CONSTRUCTION // ************************************************************ // ************************************************************ TEUCHOS_UNIT_TEST(OperatorSplit, Default_Construction) @@ -68,7 +63,7 @@ TEUCHOS_UNIT_TEST(OperatorSplit, Default_Construction) bool useFSAL = stepper->getUseFSALDefault(); std::string ICConsistency = stepper->getICConsistencyDefault(); bool ICConsistencyCheck = stepper->getICConsistencyCheckDefault(); - int order = 2; + int order = 1; // Test the set functions. stepper->setObserver(obs); stepper->initialize(); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); @@ -94,11 +89,11 @@ TEUCHOS_UNIT_TEST(OperatorSplit, Default_Construction) order, order, order)); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + // Test stepper properties. + TEUCHOS_ASSERT(stepper->getOrder() == 1); } -#endif // CONSTRUCTION -#ifdef STEPPERFACTORY_CONSTRUCTION // ************************************************************ // ************************************************************ TEUCHOS_UNIT_TEST(OperatorSplit, StepperFactory_Construction) @@ -124,7 +119,6 @@ TEUCHOS_UNIT_TEST(OperatorSplit, StepperFactory_Construction) TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); } -#endif // STEPPERFACTORY_CONSTRUCTION } // namespace Tempus_Test diff --git a/packages/tempus/unit_test/Tempus_UnitTest_SDIRK_21Pair.cpp b/packages/tempus/unit_test/Tempus_UnitTest_SDIRK_21Pair.cpp index 2c5025e73e11..f162ffca46a5 100644 --- a/packages/tempus/unit_test/Tempus_UnitTest_SDIRK_21Pair.cpp +++ b/packages/tempus/unit_test/Tempus_UnitTest_SDIRK_21Pair.cpp @@ -40,7 +40,11 @@ using Tempus::StepperFactory; // ************************************************************ TEUCHOS_UNIT_TEST(SDIRK_21Pair, Default_Construction) { - testDIRKAccessorsFullConstruction("SDIRK 2(1) Pair"); + auto stepper = rcp(new Tempus::StepperSDIRK_21Pair()); + testDIRKAccessorsFullConstruction(stepper); + + // Test stepper properties. + TEUCHOS_ASSERT(stepper->getOrder() == 2); } @@ -57,7 +61,9 @@ TEUCHOS_UNIT_TEST(SDIRK_21Pair, StepperFactory_Construction) // ************************************************************ TEUCHOS_UNIT_TEST(SDIRK_21Pair, AppAction) { - testRKAppAction("SDIRK 2(1) Pair", out, success); + auto stepper = rcp(new Tempus::StepperSDIRK_21Pair()); + auto model = rcp(new Tempus_Test::SinCosModel()); + testRKAppAction(stepper, model, out, success); } diff --git a/packages/tempus/unit_test/Tempus_UnitTest_SDIRK_2Stage2ndOrder.cpp b/packages/tempus/unit_test/Tempus_UnitTest_SDIRK_2Stage2ndOrder.cpp index 5941b1233312..000b5c688048 100644 --- a/packages/tempus/unit_test/Tempus_UnitTest_SDIRK_2Stage2ndOrder.cpp +++ b/packages/tempus/unit_test/Tempus_UnitTest_SDIRK_2Stage2ndOrder.cpp @@ -40,7 +40,14 @@ using Tempus::StepperFactory; // ************************************************************ TEUCHOS_UNIT_TEST(SDIRK_2Stage2ndOrder, Default_Construction) { - testDIRKAccessorsFullConstruction("SDIRK 2 Stage 2nd order"); + auto stepper = rcp(new Tempus::StepperSDIRK_2Stage2ndOrder()); + testDIRKAccessorsFullConstruction(stepper); + + // Test stepper properties. + TEUCHOS_ASSERT(stepper->getOrder() == 2); + TEUCHOS_ASSERT(stepper->getGamma() == 0.2928932188134524); + stepper->setGamma(0.5); stepper->initialize(); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + } @@ -57,7 +64,9 @@ TEUCHOS_UNIT_TEST(SDIRK_2Stage2ndOrder, StepperFactory_Construction) // ************************************************************ TEUCHOS_UNIT_TEST(SDIRK_2Stage2ndOrder, AppAction) { - testRKAppAction("SDIRK 2 Stage 2nd order", out, success); + auto stepper = rcp(new Tempus::StepperSDIRK_2Stage2ndOrder()); + auto model = rcp(new Tempus_Test::SinCosModel()); + testRKAppAction(stepper, model, out, success); } diff --git a/packages/tempus/unit_test/Tempus_UnitTest_SDIRK_2Stage3rdOrder.cpp b/packages/tempus/unit_test/Tempus_UnitTest_SDIRK_2Stage3rdOrder.cpp index a64618a1e4e6..fc0d3c7401a6 100644 --- a/packages/tempus/unit_test/Tempus_UnitTest_SDIRK_2Stage3rdOrder.cpp +++ b/packages/tempus/unit_test/Tempus_UnitTest_SDIRK_2Stage3rdOrder.cpp @@ -40,7 +40,18 @@ using Tempus::StepperFactory; // ************************************************************ TEUCHOS_UNIT_TEST(SDIRK_2Stage3rdOrder, Default_Construction) { - testDIRKAccessorsFullConstruction("SDIRK 2 Stage 3rd order"); + auto stepper = rcp(new Tempus::StepperSDIRK_2Stage3rdOrder()); + testDIRKAccessorsFullConstruction(stepper); + + // Test stepper properties. + TEUCHOS_ASSERT(stepper->getOrder() == 3); + std::string gammaType = "3rd Order A-stable"; + TEUCHOS_ASSERT(stepper->getGammaType() == gammaType); + double gamma = 0.7886751345948128; + TEUCHOS_ASSERT(stepper->getGamma() == gamma); + stepper->setGammaType(gammaType); stepper->initialize(); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + stepper->setGamma(gamma); stepper->initialize(); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + } @@ -57,7 +68,9 @@ TEUCHOS_UNIT_TEST(SDIRK_2Stage3rdOrder, StepperFactory_Construction) // ************************************************************ TEUCHOS_UNIT_TEST(SDIRK_2Stage3rdOrder, AppAction) { - testRKAppAction("SDIRK 2 Stage 3rd order", out, success); + auto stepper = rcp(new Tempus::StepperSDIRK_2Stage3rdOrder()); + auto model = rcp(new Tempus_Test::SinCosModel()); + testRKAppAction(stepper, model, out, success); } diff --git a/packages/tempus/unit_test/Tempus_UnitTest_SDIRK_3Stage2ndOrder.cpp b/packages/tempus/unit_test/Tempus_UnitTest_SDIRK_3Stage2ndOrder.cpp new file mode 100644 index 000000000000..ece0b6df6247 --- /dev/null +++ b/packages/tempus/unit_test/Tempus_UnitTest_SDIRK_3Stage2ndOrder.cpp @@ -0,0 +1,70 @@ +// @HEADER +// **************************************************************************** +// Tempus: Copyright (2017) Sandia Corporation +// +// Distributed under BSD 3-clause license (See accompanying file Copyright.txt) +// **************************************************************************** +// @HEADER + +#include "Teuchos_UnitTestHarness.hpp" +#include "Teuchos_XMLParameterListHelpers.hpp" +#include "Teuchos_TimeMonitor.hpp" +#include "Teuchos_DefaultComm.hpp" + +#include "Thyra_VectorStdOps.hpp" + +#include "Tempus_StepperFactory.hpp" +#include "Tempus_UnitTest_Utils.hpp" + +#include "../TestModels/SinCosModel.hpp" +#include "../TestModels/VanDerPolModel.hpp" +#include "../TestUtils/Tempus_ConvergenceTestUtils.hpp" + +#include +#include + +namespace Tempus_Unit_Test { + +using Teuchos::RCP; +using Teuchos::rcp; +using Teuchos::rcp_const_cast; +using Teuchos::rcp_dynamic_cast; +using Teuchos::ParameterList; +using Teuchos::sublist; +using Teuchos::getParametersFromXmlFile; + +using Tempus::StepperFactory; + + +// ************************************************************ +// ************************************************************ +TEUCHOS_UNIT_TEST(SDIRK_3Stage2ndOrder, Default_Construction) +{ + auto stepper = rcp(new Tempus::StepperSDIRK_3Stage2ndOrder()); + testDIRKAccessorsFullConstruction(stepper); + + // Test stepper properties. + TEUCHOS_ASSERT(stepper->getOrder() == 2); +} + + +// ************************************************************ +// ************************************************************ +TEUCHOS_UNIT_TEST(SDIRK_3Stage2ndOrder, StepperFactory_Construction) +{ + auto model = rcp(new Tempus_Test::SinCosModel()); + testFactoryConstruction("SDIRK 3 Stage 2nd order", model); +} + + +// ************************************************************ +// ************************************************************ +TEUCHOS_UNIT_TEST(SDIRK_3Stage2ndOrder, AppAction) +{ + auto stepper = rcp(new Tempus::StepperSDIRK_3Stage2ndOrder()); + auto model = rcp(new Tempus_Test::SinCosModel()); + testRKAppAction(stepper, model, out, success); +} + + +} // namespace Tempus_Test diff --git a/packages/tempus/unit_test/Tempus_UnitTest_SDIRK_3Stage4thOrder.cpp b/packages/tempus/unit_test/Tempus_UnitTest_SDIRK_3Stage4thOrder.cpp index caacbdd97c3c..538055aadcf7 100644 --- a/packages/tempus/unit_test/Tempus_UnitTest_SDIRK_3Stage4thOrder.cpp +++ b/packages/tempus/unit_test/Tempus_UnitTest_SDIRK_3Stage4thOrder.cpp @@ -40,7 +40,11 @@ using Tempus::StepperFactory; // ************************************************************ TEUCHOS_UNIT_TEST(SDIRK_3Stage4thOrder, Default_Construction) { - testDIRKAccessorsFullConstruction("SDIRK 3 Stage 4th order"); + auto stepper = rcp(new Tempus::StepperSDIRK_3Stage4thOrder()); + testDIRKAccessorsFullConstruction(stepper); + + // Test stepper properties. + TEUCHOS_ASSERT(stepper->getOrder() == 4); } @@ -57,7 +61,9 @@ TEUCHOS_UNIT_TEST(SDIRK_3Stage4thOrder, StepperFactory_Construction) // ************************************************************ TEUCHOS_UNIT_TEST(SDIRK_3Stage4thOrder, AppAction) { - testRKAppAction("SDIRK 3 Stage 4th order", out, success); + auto stepper = rcp(new Tempus::StepperSDIRK_3Stage4thOrder()); + auto model = rcp(new Tempus_Test::SinCosModel()); + testRKAppAction(stepper, model, out, success); } diff --git a/packages/tempus/unit_test/Tempus_UnitTest_SDIRK_5Stage4thOrder.cpp b/packages/tempus/unit_test/Tempus_UnitTest_SDIRK_5Stage4thOrder.cpp index 2650ae75138a..81271861d832 100644 --- a/packages/tempus/unit_test/Tempus_UnitTest_SDIRK_5Stage4thOrder.cpp +++ b/packages/tempus/unit_test/Tempus_UnitTest_SDIRK_5Stage4thOrder.cpp @@ -40,7 +40,11 @@ using Tempus::StepperFactory; // ************************************************************ TEUCHOS_UNIT_TEST(SDIRK_5Stage4thOrder, Default_Construction) { - testDIRKAccessorsFullConstruction("SDIRK 5 Stage 4th order"); + auto stepper = rcp(new Tempus::StepperSDIRK_5Stage4thOrder()); + testDIRKAccessorsFullConstruction(stepper); + + // Test stepper properties. + TEUCHOS_ASSERT(stepper->getOrder() == 4); } @@ -57,7 +61,9 @@ TEUCHOS_UNIT_TEST(SDIRK_5Stage4thOrder, StepperFactory_Construction) // ************************************************************ TEUCHOS_UNIT_TEST(SDIRK_5Stage4thOrder, AppAction) { - testRKAppAction("SDIRK 5 Stage 4th order", out, success); + auto stepper = rcp(new Tempus::StepperSDIRK_5Stage4thOrder()); + auto model = rcp(new Tempus_Test::SinCosModel()); + testRKAppAction(stepper, model, out, success); } diff --git a/packages/tempus/unit_test/Tempus_UnitTest_SDIRK_5Stage5thOrder.cpp b/packages/tempus/unit_test/Tempus_UnitTest_SDIRK_5Stage5thOrder.cpp index 189608730355..f9191df20cc4 100644 --- a/packages/tempus/unit_test/Tempus_UnitTest_SDIRK_5Stage5thOrder.cpp +++ b/packages/tempus/unit_test/Tempus_UnitTest_SDIRK_5Stage5thOrder.cpp @@ -40,7 +40,11 @@ using Tempus::StepperFactory; // ************************************************************ TEUCHOS_UNIT_TEST(SDIRK_5Stage5thOrder, Default_Construction) { - testDIRKAccessorsFullConstruction("SDIRK 5 Stage 5th order"); + auto stepper = rcp(new Tempus::StepperSDIRK_5Stage5thOrder()); + testDIRKAccessorsFullConstruction(stepper); + + // Test stepper properties. + TEUCHOS_ASSERT(stepper->getOrder() == 5); } @@ -69,7 +73,9 @@ TEUCHOS_UNIT_TEST(SDIRK_5Stage5thOrder, StageNumber) // ************************************************************ TEUCHOS_UNIT_TEST(SDIRK_5Stage5thOrder, AppAction) { - testRKAppAction("SDIRK 5 Stage 5th order", out, success); + auto stepper = rcp(new Tempus::StepperSDIRK_5Stage5thOrder()); + auto model = rcp(new Tempus_Test::SinCosModel()); + testRKAppAction(stepper, model, out, success); } diff --git a/packages/tempus/unit_test/Tempus_UnitTest_SDIRK_ImplicitMidpoint.cpp b/packages/tempus/unit_test/Tempus_UnitTest_SDIRK_ImplicitMidpoint.cpp index 304ed7766e85..7b49bf6eea50 100644 --- a/packages/tempus/unit_test/Tempus_UnitTest_SDIRK_ImplicitMidpoint.cpp +++ b/packages/tempus/unit_test/Tempus_UnitTest_SDIRK_ImplicitMidpoint.cpp @@ -40,7 +40,11 @@ using Tempus::StepperFactory; // ************************************************************ TEUCHOS_UNIT_TEST(SDIRK_ImplicitMidpoint, Default_Construction) { - testDIRKAccessorsFullConstruction("RK Implicit Midpoint"); + auto stepper = rcp(new Tempus::StepperSDIRK_ImplicitMidpoint()); + testDIRKAccessorsFullConstruction(stepper); + + // Test stepper properties. + TEUCHOS_ASSERT(stepper->getOrder() == 2); } @@ -57,7 +61,9 @@ TEUCHOS_UNIT_TEST(SDIRK_ImplicitMidpoint, StepperFactory_Construction) // ************************************************************ TEUCHOS_UNIT_TEST(SDIRK_ImplicitMidpoint, AppAction) { - testRKAppAction("RK Implicit Midpoint", out, success); + auto stepper = rcp(new Tempus::StepperSDIRK_ImplicitMidpoint()); + auto model = rcp(new Tempus_Test::SinCosModel()); + testRKAppAction(stepper, model, out, success); } diff --git a/packages/tempus/unit_test/Tempus_UnitTest_SSPDIRK22.cpp b/packages/tempus/unit_test/Tempus_UnitTest_SSPDIRK22.cpp new file mode 100644 index 000000000000..44edbbeb120d --- /dev/null +++ b/packages/tempus/unit_test/Tempus_UnitTest_SSPDIRK22.cpp @@ -0,0 +1,70 @@ +// @HEADER +// **************************************************************************** +// Tempus: Copyright (2017) Sandia Corporation +// +// Distributed under BSD 3-clause license (See accompanying file Copyright.txt) +// **************************************************************************** +// @HEADER + +#include "Teuchos_UnitTestHarness.hpp" +#include "Teuchos_XMLParameterListHelpers.hpp" +#include "Teuchos_TimeMonitor.hpp" +#include "Teuchos_DefaultComm.hpp" + +#include "Thyra_VectorStdOps.hpp" + +#include "Tempus_StepperFactory.hpp" +#include "Tempus_UnitTest_Utils.hpp" + +#include "../TestModels/SinCosModel.hpp" +#include "../TestModels/VanDerPolModel.hpp" +#include "../TestUtils/Tempus_ConvergenceTestUtils.hpp" + +#include +#include + +namespace Tempus_Unit_Test { + +using Teuchos::RCP; +using Teuchos::rcp; +using Teuchos::rcp_const_cast; +using Teuchos::rcp_dynamic_cast; +using Teuchos::ParameterList; +using Teuchos::sublist; +using Teuchos::getParametersFromXmlFile; + +using Tempus::StepperFactory; + + +// ************************************************************ +// ************************************************************ +TEUCHOS_UNIT_TEST(SSPDIRK22, Default_Construction) +{ + auto stepper = rcp(new Tempus::StepperSDIRK_SSPDIRK22()); + testDIRKAccessorsFullConstruction(stepper); + + // Test stepper properties. + TEUCHOS_ASSERT(stepper->getOrder() == 2); +} + + +// ************************************************************ +// ************************************************************ +TEUCHOS_UNIT_TEST(SSPDIRK22, StepperFactory_Construction) +{ + auto model = rcp(new Tempus_Test::SinCosModel()); + testFactoryConstruction("SSPDIRK22", model); +} + + +// ************************************************************ +// ************************************************************ +TEUCHOS_UNIT_TEST(SSPDIRK22, AppAction) +{ + auto stepper = rcp(new Tempus::StepperSDIRK_SSPDIRK22()); + auto model = rcp(new Tempus_Test::SinCosModel()); + testRKAppAction(stepper, model, out, success); +} + + +} // namespace Tempus_Test diff --git a/packages/tempus/unit_test/Tempus_UnitTest_SSPDIRK23.cpp b/packages/tempus/unit_test/Tempus_UnitTest_SSPDIRK23.cpp new file mode 100644 index 000000000000..9767f88fcf78 --- /dev/null +++ b/packages/tempus/unit_test/Tempus_UnitTest_SSPDIRK23.cpp @@ -0,0 +1,70 @@ +// @HEADER +// **************************************************************************** +// Tempus: Copyright (2017) Sandia Corporation +// +// Distributed under BSD 3-clause license (See accompanying file Copyright.txt) +// **************************************************************************** +// @HEADER + +#include "Teuchos_UnitTestHarness.hpp" +#include "Teuchos_XMLParameterListHelpers.hpp" +#include "Teuchos_TimeMonitor.hpp" +#include "Teuchos_DefaultComm.hpp" + +#include "Thyra_VectorStdOps.hpp" + +#include "Tempus_StepperFactory.hpp" +#include "Tempus_UnitTest_Utils.hpp" + +#include "../TestModels/SinCosModel.hpp" +#include "../TestModels/VanDerPolModel.hpp" +#include "../TestUtils/Tempus_ConvergenceTestUtils.hpp" + +#include +#include + +namespace Tempus_Unit_Test { + +using Teuchos::RCP; +using Teuchos::rcp; +using Teuchos::rcp_const_cast; +using Teuchos::rcp_dynamic_cast; +using Teuchos::ParameterList; +using Teuchos::sublist; +using Teuchos::getParametersFromXmlFile; + +using Tempus::StepperFactory; + + +// ************************************************************ +// ************************************************************ +TEUCHOS_UNIT_TEST(SSPDIRK23, Default_Construction) +{ + auto stepper = rcp(new Tempus::StepperSDIRK_SSPDIRK23()); + testDIRKAccessorsFullConstruction(stepper); + + // Test stepper properties. + TEUCHOS_ASSERT(stepper->getOrder() == 3); +} + + +// ************************************************************ +// ************************************************************ +TEUCHOS_UNIT_TEST(SSPDIRK23, StepperFactory_Construction) +{ + auto model = rcp(new Tempus_Test::SinCosModel()); + testFactoryConstruction("SSPDIRK23", model); +} + + +// ************************************************************ +// ************************************************************ +TEUCHOS_UNIT_TEST(SSPDIRK23, AppAction) +{ + auto stepper = rcp(new Tempus::StepperSDIRK_SSPDIRK23()); + auto model = rcp(new Tempus_Test::SinCosModel()); + testRKAppAction(stepper, model, out, success); +} + + +} // namespace Tempus_Test diff --git a/packages/tempus/unit_test/Tempus_UnitTest_SSPDIRK32.cpp b/packages/tempus/unit_test/Tempus_UnitTest_SSPDIRK32.cpp new file mode 100644 index 000000000000..599be58e0574 --- /dev/null +++ b/packages/tempus/unit_test/Tempus_UnitTest_SSPDIRK32.cpp @@ -0,0 +1,70 @@ +// @HEADER +// **************************************************************************** +// Tempus: Copyright (2017) Sandia Corporation +// +// Distributed under BSD 3-clause license (See accompanying file Copyright.txt) +// **************************************************************************** +// @HEADER + +#include "Teuchos_UnitTestHarness.hpp" +#include "Teuchos_XMLParameterListHelpers.hpp" +#include "Teuchos_TimeMonitor.hpp" +#include "Teuchos_DefaultComm.hpp" + +#include "Thyra_VectorStdOps.hpp" + +#include "Tempus_StepperFactory.hpp" +#include "Tempus_UnitTest_Utils.hpp" + +#include "../TestModels/SinCosModel.hpp" +#include "../TestModels/VanDerPolModel.hpp" +#include "../TestUtils/Tempus_ConvergenceTestUtils.hpp" + +#include +#include + +namespace Tempus_Unit_Test { + +using Teuchos::RCP; +using Teuchos::rcp; +using Teuchos::rcp_const_cast; +using Teuchos::rcp_dynamic_cast; +using Teuchos::ParameterList; +using Teuchos::sublist; +using Teuchos::getParametersFromXmlFile; + +using Tempus::StepperFactory; + + +// ************************************************************ +// ************************************************************ +TEUCHOS_UNIT_TEST(SSPDIRK32, Default_Construction) +{ + auto stepper = rcp(new Tempus::StepperSDIRK_SSPDIRK32()); + testDIRKAccessorsFullConstruction(stepper); + + // Test stepper properties. + TEUCHOS_ASSERT(stepper->getOrder() == 2); +} + + +// ************************************************************ +// ************************************************************ +TEUCHOS_UNIT_TEST(SSPDIRK32, StepperFactory_Construction) +{ + auto model = rcp(new Tempus_Test::SinCosModel()); + testFactoryConstruction("SSPDIRK32", model); +} + + +// ************************************************************ +// ************************************************************ +TEUCHOS_UNIT_TEST(SSPDIRK32, AppAction) +{ + auto stepper = rcp(new Tempus::StepperSDIRK_SSPDIRK32()); + auto model = rcp(new Tempus_Test::SinCosModel()); + testRKAppAction(stepper, model, out, success); +} + + +} // namespace Tempus_Test diff --git a/packages/tempus/unit_test/Tempus_UnitTest_SSPDIRK33.cpp b/packages/tempus/unit_test/Tempus_UnitTest_SSPDIRK33.cpp new file mode 100644 index 000000000000..3c2b155f40f4 --- /dev/null +++ b/packages/tempus/unit_test/Tempus_UnitTest_SSPDIRK33.cpp @@ -0,0 +1,70 @@ +// @HEADER +// **************************************************************************** +// Tempus: Copyright (2017) Sandia Corporation +// +// Distributed under BSD 3-clause license (See accompanying file Copyright.txt) +// **************************************************************************** +// @HEADER + +#include "Teuchos_UnitTestHarness.hpp" +#include "Teuchos_XMLParameterListHelpers.hpp" +#include "Teuchos_TimeMonitor.hpp" +#include "Teuchos_DefaultComm.hpp" + +#include "Thyra_VectorStdOps.hpp" + +#include "Tempus_StepperFactory.hpp" +#include "Tempus_UnitTest_Utils.hpp" + +#include "../TestModels/SinCosModel.hpp" +#include "../TestModels/VanDerPolModel.hpp" +#include "../TestUtils/Tempus_ConvergenceTestUtils.hpp" + +#include +#include + +namespace Tempus_Unit_Test { + +using Teuchos::RCP; +using Teuchos::rcp; +using Teuchos::rcp_const_cast; +using Teuchos::rcp_dynamic_cast; +using Teuchos::ParameterList; +using Teuchos::sublist; +using Teuchos::getParametersFromXmlFile; + +using Tempus::StepperFactory; + + +// ************************************************************ +// ************************************************************ +TEUCHOS_UNIT_TEST(SSPDIRK33, Default_Construction) +{ + auto stepper = rcp(new Tempus::StepperSDIRK_SSPDIRK33()); + testDIRKAccessorsFullConstruction(stepper); + + // Test stepper properties. + TEUCHOS_ASSERT(stepper->getOrder() == 3); +} + + +// ************************************************************ +// ************************************************************ +TEUCHOS_UNIT_TEST(SSPDIRK33, StepperFactory_Construction) +{ + auto model = rcp(new Tempus_Test::SinCosModel()); + testFactoryConstruction("SSPDIRK33", model); +} + + +// ************************************************************ +// ************************************************************ +TEUCHOS_UNIT_TEST(SSPDIRK33, AppAction) +{ + auto stepper = rcp(new Tempus::StepperSDIRK_SSPDIRK33()); + auto model = rcp(new Tempus_Test::SinCosModel()); + testRKAppAction(stepper, model, out, success); +} + + +} // namespace Tempus_Test diff --git a/packages/tempus/unit_test/Tempus_UnitTest_Subcycling.cpp b/packages/tempus/unit_test/Tempus_UnitTest_Subcycling.cpp index edf725641150..c918b1e50dc7 100644 --- a/packages/tempus/unit_test/Tempus_UnitTest_Subcycling.cpp +++ b/packages/tempus/unit_test/Tempus_UnitTest_Subcycling.cpp @@ -35,12 +35,7 @@ using Teuchos::getParametersFromXmlFile; using Tempus::StepperFactory; using Tempus::StepperExplicitRK; -// Comment out any of the following tests to exclude from build/run. -#define CONSTRUCTION -#define MAXTIMESTEPDOESNOTCHANGEDURING_TAKESTEP - -#ifdef CONSTRUCTION // ************************************************************ // ************************************************************ TEUCHOS_UNIT_TEST(Subcycling, Default_Construction) @@ -82,11 +77,11 @@ TEUCHOS_UNIT_TEST(Subcycling, Default_Construction) model, obs, scIntegrator, useFSAL, ICConsistency, ICConsistencyCheck)); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + // Test stepper properties. + TEUCHOS_ASSERT(stepper->getOrder() == 1); } -#endif // CONSTRUCTION -#ifdef MAXTIMESTEPDOESNOTCHANGEDURING_TAKESTEP // ************************************************************ // ************************************************************ TEUCHOS_UNIT_TEST(Subcycling, MaxTimeStepDoesNotChangeDuring_takeStep) @@ -116,7 +111,6 @@ TEUCHOS_UNIT_TEST(Subcycling, MaxTimeStepDoesNotChangeDuring_takeStep) TEST_FLOATING_EQUALITY(maxTimeStep_Set, maxTimeStep_After, 1.0e-14 ); } -#endif // MAXTIMESTEPDOESNOTCHANGEDURING_TAKESTEP } // namespace Tempus_Test diff --git a/packages/tempus/unit_test/Tempus_UnitTest_TimeStepControl.cpp b/packages/tempus/unit_test/Tempus_UnitTest_TimeStepControl.cpp index 8c8e56a3e0bb..d8da5860b06a 100644 --- a/packages/tempus/unit_test/Tempus_UnitTest_TimeStepControl.cpp +++ b/packages/tempus/unit_test/Tempus_UnitTest_TimeStepControl.cpp @@ -30,12 +30,7 @@ using Teuchos::ParameterList; using Teuchos::sublist; using Teuchos::getParametersFromXmlFile; -// Comment out any of the following tests to exclude from build/run. -#define SETOUTPUTTIMES -#define SETANDGETOUTPUTINDICESANDINTERVALS - -#ifdef SETOUTPUTTIMES // ************************************************************ // ************************************************************ TEUCHOS_UNIT_TEST(TimeStepControl, setOutputTimes) @@ -109,10 +104,8 @@ TEUCHOS_UNIT_TEST(TimeStepControl, setOutputTimes) //tscPL = tsc->getParameterList(); //std::cout << "tscPL = \n" << *tscPL << std::endl; } -#endif // SETOUTPUTTIMES -#ifdef SETANDGETOUTPUTINDICESANDINTERVALS // ************************************************************ // ************************************************************ TEUCHOS_UNIT_TEST(TimeStepControl, getOutputIndicesandIntervals){ @@ -128,7 +121,6 @@ TEUCHOS_UNIT_TEST(TimeStepControl, getOutputIndicesandIntervals){ TEST_COMPARE(getOutputTimeInterval, ==, setOutputTimeInterval); TEST_COMPARE(getOutputTimeIndex, ==, setOutputTimeIndex); } -#endif // SETANDGETOUTPUTINDICESANDINTERVALS } // namespace Tempus_Test diff --git a/packages/tempus/unit_test/Tempus_UnitTest_Trapezoidal.cpp b/packages/tempus/unit_test/Tempus_UnitTest_Trapezoidal.cpp index 9ce3a3ed166a..675102793872 100644 --- a/packages/tempus/unit_test/Tempus_UnitTest_Trapezoidal.cpp +++ b/packages/tempus/unit_test/Tempus_UnitTest_Trapezoidal.cpp @@ -35,15 +35,10 @@ using Teuchos::getParametersFromXmlFile; using Tempus::StepperFactory; -// Comment out any of the following tests to exclude from build/run. -#define CONSTRUCTION -#define STEPPERFACTORY_CONSTRUCTION - -#ifdef CONSTRUCTION // ************************************************************ // ************************************************************ -TEUCHOS_UNIT_TEST(Trapezoidal, Construction) +TEUCHOS_UNIT_TEST(Trapezoidal, Default_Construction) { auto model = rcp(new Tempus_Test::SinCosModel()); @@ -79,11 +74,11 @@ TEUCHOS_UNIT_TEST(Trapezoidal, Construction) ICConsistency, ICConsistencyCheck, zeroInitialGuess)); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + // Test stepper properties. + TEUCHOS_ASSERT(stepper->getOrder() == 2); } -#endif // CONSTRUCTION -#ifdef STEPPERFACTORY_CONSTRUCTION // ************************************************************ // ************************************************************ TEUCHOS_UNIT_TEST(Trapezoidal, StepperFactory_Construction) @@ -91,7 +86,6 @@ TEUCHOS_UNIT_TEST(Trapezoidal, StepperFactory_Construction) auto model = rcp(new Tempus_Test::SinCosModel()); testFactoryConstruction("Trapezoidal Method", model); } -#endif // STEPPERFACTORY_CONSTRUCTION } // namespace Tempus_Test diff --git a/packages/tempus/unit_test/Tempus_UnitTest_Utils.hpp b/packages/tempus/unit_test/Tempus_UnitTest_Utils.hpp index 06412a394f5d..80a5e301ba2c 100644 --- a/packages/tempus/unit_test/Tempus_UnitTest_Utils.hpp +++ b/packages/tempus/unit_test/Tempus_UnitTest_Utils.hpp @@ -61,25 +61,9 @@ void testFactoryConstruction(std::string stepperType, /** \brief Unit test utility for ExplicitRK Stepper construction and accessors. */ -void testExplicitRKAccessorsFullConstruction(std::string stepperType) +void testExplicitRKAccessorsFullConstruction( + const RCP >& stepper) { - // Default construction. - RCP > stepper; - if (stepperType == "RK Explicit 3 Stage 3rd order") stepper = rcp(new Tempus::StepperERK_3Stage3rdOrder()); - else if (stepperType == "RK Explicit 3 Stage 3rd order by Heun") stepper = rcp(new Tempus::StepperERK_3Stage3rdOrderHeun()); - else if (stepperType == "RK Explicit 3 Stage 3rd order TVD") stepper = rcp(new Tempus::StepperERK_3Stage3rdOrderTVD()); - else if (stepperType == "RK Explicit 3/8 Rule") stepper = rcp(new Tempus::StepperERK_3_8Rule()); - else if (stepperType == "RK Explicit 4 Stage 3rd order by Runge") stepper = rcp(new Tempus::StepperERK_4Stage3rdOrderRunge()); - else if (stepperType == "RK Explicit 4 Stage") stepper = rcp(new Tempus::StepperERK_4Stage4thOrder()); - else if (stepperType == "RK Explicit 5 Stage 3rd order by Kinnmark and Gray") stepper = rcp(new Tempus::StepperERK_5Stage3rdOrderKandG()); - else if (stepperType == "Bogacki-Shampine 3(2) Pair") stepper = rcp(new Tempus::StepperERK_BogackiShampine32()); - else if (stepperType == "RK Forward Euler") stepper = rcp(new Tempus::StepperERK_ForwardEuler()); - else if (stepperType == "Merson 4(5) Pair") stepper = rcp(new Tempus::StepperERK_Merson45()); - else if (stepperType == "RK Explicit Midpoint") stepper = rcp(new Tempus::StepperERK_Midpoint()); - else if (stepperType == "RK Explicit Trapezoidal") stepper = rcp(new Tempus::StepperERK_Trapezoidal()); - else TEUCHOS_TEST_FOR_EXCEPTION(true, std::logic_error, "Error - unknown stepperType = "+stepperType); - - auto model = rcp(new Tempus_Test::SinCosModel()); stepper->setModel(model); stepper->initialize(); @@ -105,115 +89,116 @@ void testExplicitRKAccessorsFullConstruction(std::string stepperType) stepper->setUseEmbedded(useEmbedded); stepper->initialize(); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + std::string stepperType = stepper->getStepperType(); // Full argument list construction. if (stepperType == "RK Explicit 3 Stage 3rd order") { #ifndef TEMPUS_HIDE_DEPRECATED_CODE - stepper = rcp(new Tempus::StepperERK_3Stage3rdOrder( + { auto s = rcp(new Tempus::StepperERK_3Stage3rdOrder( model, obs, useFSAL, ICConsistency, ICConsistencyCheck, useEmbedded)); - TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + TEUCHOS_TEST_FOR_EXCEPT(!s->isInitialized()); } #endif - stepper = rcp(new Tempus::StepperERK_3Stage3rdOrder( + auto s = rcp(new Tempus::StepperERK_3Stage3rdOrder( model, useFSAL, ICConsistency, ICConsistencyCheck, useEmbedded, modifier)); - TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + TEUCHOS_TEST_FOR_EXCEPT(!s->isInitialized()); } else if (stepperType == "RK Explicit 3 Stage 3rd order by Heun") { #ifndef TEMPUS_HIDE_DEPRECATED_CODE - stepper = rcp(new Tempus::StepperERK_3Stage3rdOrderHeun( + { auto s = rcp(new Tempus::StepperERK_3Stage3rdOrderHeun( model, obs, useFSAL, ICConsistency, ICConsistencyCheck, useEmbedded)); - TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + TEUCHOS_TEST_FOR_EXCEPT(!s->isInitialized()); } #endif - stepper = rcp(new Tempus::StepperERK_3Stage3rdOrderHeun( + auto s = rcp(new Tempus::StepperERK_3Stage3rdOrderHeun( model, useFSAL, ICConsistency, ICConsistencyCheck, useEmbedded, modifier)); - TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + TEUCHOS_TEST_FOR_EXCEPT(!s->isInitialized()); } else if (stepperType == "RK Explicit 3 Stage 3rd order TVD") { #ifndef TEMPUS_HIDE_DEPRECATED_CODE - stepper = rcp(new Tempus::StepperERK_3Stage3rdOrderTVD( + { auto s = rcp(new Tempus::StepperERK_3Stage3rdOrderTVD( model, obs, useFSAL, ICConsistency, ICConsistencyCheck, useEmbedded)); - TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + TEUCHOS_TEST_FOR_EXCEPT(!s->isInitialized()); } #endif - stepper = rcp(new Tempus::StepperERK_3Stage3rdOrderTVD( + auto s = rcp(new Tempus::StepperERK_3Stage3rdOrderTVD( model, useFSAL, ICConsistency, ICConsistencyCheck, useEmbedded, modifier)); - TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + TEUCHOS_TEST_FOR_EXCEPT(!s->isInitialized()); } else if (stepperType == "RK Explicit 3/8 Rule") { #ifndef TEMPUS_HIDE_DEPRECATED_CODE - stepper = rcp(new Tempus::StepperERK_3_8Rule( + { auto s = rcp(new Tempus::StepperERK_3_8Rule( model, obs, useFSAL, ICConsistency, ICConsistencyCheck, useEmbedded)); - TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + TEUCHOS_TEST_FOR_EXCEPT(!s->isInitialized()); } #endif - stepper = rcp(new Tempus::StepperERK_3_8Rule( + auto s = rcp(new Tempus::StepperERK_3_8Rule( model, useFSAL, ICConsistency, ICConsistencyCheck, useEmbedded, modifier)); - TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + TEUCHOS_TEST_FOR_EXCEPT(!s->isInitialized()); } else if (stepperType == "RK Explicit 4 Stage 3rd order by Runge") { #ifndef TEMPUS_HIDE_DEPRECATED_CODE - stepper = rcp(new Tempus::StepperERK_4Stage3rdOrderRunge( + { auto s = rcp(new Tempus::StepperERK_4Stage3rdOrderRunge( model, obs, useFSAL, ICConsistency, ICConsistencyCheck, useEmbedded)); - TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + TEUCHOS_TEST_FOR_EXCEPT(!s->isInitialized()); } #endif - stepper = rcp(new Tempus::StepperERK_4Stage3rdOrderRunge( + auto s = rcp(new Tempus::StepperERK_4Stage3rdOrderRunge( model, useFSAL, ICConsistency, ICConsistencyCheck, useEmbedded, modifier)); - TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + TEUCHOS_TEST_FOR_EXCEPT(!s->isInitialized()); } else if (stepperType == "RK Explicit 4 Stage") { #ifndef TEMPUS_HIDE_DEPRECATED_CODE - stepper = rcp(new Tempus::StepperERK_4Stage4thOrder( + { auto s = rcp(new Tempus::StepperERK_4Stage4thOrder( model, obs, useFSAL, ICConsistency, ICConsistencyCheck, useEmbedded)); - TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + TEUCHOS_TEST_FOR_EXCEPT(!s->isInitialized()); } #endif - stepper = rcp(new Tempus::StepperERK_4Stage4thOrder( + auto s = rcp(new Tempus::StepperERK_4Stage4thOrder( model, useFSAL, ICConsistency, ICConsistencyCheck, useEmbedded, modifier)); - TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + TEUCHOS_TEST_FOR_EXCEPT(!s->isInitialized()); } else if (stepperType == "RK Explicit 5 Stage 3rd order by Kinnmark and Gray") { #ifndef TEMPUS_HIDE_DEPRECATED_CODE - stepper = rcp(new Tempus::StepperERK_5Stage3rdOrderKandG( + { auto s = rcp(new Tempus::StepperERK_5Stage3rdOrderKandG( model, obs, useFSAL, ICConsistency, ICConsistencyCheck, useEmbedded)); - TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + TEUCHOS_TEST_FOR_EXCEPT(!s->isInitialized()); } #endif - stepper = rcp(new Tempus::StepperERK_5Stage3rdOrderKandG( + auto s = rcp(new Tempus::StepperERK_5Stage3rdOrderKandG( model, useFSAL, ICConsistency, ICConsistencyCheck, useEmbedded, modifier)); - TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + TEUCHOS_TEST_FOR_EXCEPT(!s->isInitialized()); } else if (stepperType == "Bogacki-Shampine 3(2) Pair") { #ifndef TEMPUS_HIDE_DEPRECATED_CODE - stepper = rcp(new Tempus::StepperERK_BogackiShampine32( + { auto s = rcp(new Tempus::StepperERK_BogackiShampine32( model, obs, useFSAL, ICConsistency, ICConsistencyCheck, useEmbedded)); - TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + TEUCHOS_TEST_FOR_EXCEPT(!s->isInitialized()); } #endif - stepper = rcp(new Tempus::StepperERK_BogackiShampine32( + auto s = rcp(new Tempus::StepperERK_BogackiShampine32( model, useFSAL, ICConsistency, ICConsistencyCheck, useEmbedded, modifier)); - TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + TEUCHOS_TEST_FOR_EXCEPT(!s->isInitialized()); } else if (stepperType == "RK Forward Euler") { #ifndef TEMPUS_HIDE_DEPRECATED_CODE - stepper = rcp(new Tempus::StepperERK_ForwardEuler( + { auto s = rcp(new Tempus::StepperERK_ForwardEuler( model, obs, useFSAL, ICConsistency, ICConsistencyCheck, useEmbedded)); - TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + TEUCHOS_TEST_FOR_EXCEPT(!s->isInitialized()); } #endif - stepper = rcp(new Tempus::StepperERK_ForwardEuler( + auto s = rcp(new Tempus::StepperERK_ForwardEuler( model, useFSAL, ICConsistency, ICConsistencyCheck, useEmbedded, modifier)); - TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + TEUCHOS_TEST_FOR_EXCEPT(!s->isInitialized()); } else if (stepperType == "Merson 4(5) Pair") { #ifndef TEMPUS_HIDE_DEPRECATED_CODE - stepper = rcp(new Tempus::StepperERK_Merson45( + { auto s = rcp(new Tempus::StepperERK_Merson45( model, obs, useFSAL, ICConsistency, ICConsistencyCheck, useEmbedded)); - TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + TEUCHOS_TEST_FOR_EXCEPT(!s->isInitialized()); } #endif - stepper = rcp(new Tempus::StepperERK_Merson45( + auto s = rcp(new Tempus::StepperERK_Merson45( model, useFSAL, ICConsistency, ICConsistencyCheck, useEmbedded, modifier)); - TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + TEUCHOS_TEST_FOR_EXCEPT(!s->isInitialized()); } else if (stepperType == "RK Explicit Midpoint") { #ifndef TEMPUS_HIDE_DEPRECATED_CODE - stepper = rcp(new Tempus::StepperERK_Midpoint( + { auto s = rcp(new Tempus::StepperERK_Midpoint( model, obs, useFSAL, ICConsistency, ICConsistencyCheck, useEmbedded)); - TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + TEUCHOS_TEST_FOR_EXCEPT(!s->isInitialized()); } #endif - stepper = rcp(new Tempus::StepperERK_Midpoint( + auto s = rcp(new Tempus::StepperERK_Midpoint( model, useFSAL, ICConsistency, ICConsistencyCheck, useEmbedded, modifier)); - TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + TEUCHOS_TEST_FOR_EXCEPT(!s->isInitialized()); } else if (stepperType == "RK Explicit Trapezoidal") { #ifndef TEMPUS_HIDE_DEPRECATED_CODE - stepper = rcp(new Tempus::StepperERK_Trapezoidal( + { auto s = rcp(new Tempus::StepperERK_Trapezoidal( model, obs, useFSAL, ICConsistency, ICConsistencyCheck, useEmbedded)); - TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + TEUCHOS_TEST_FOR_EXCEPT(!s->isInitialized()); } #endif - stepper = rcp(new Tempus::StepperERK_Trapezoidal( + auto s = rcp(new Tempus::StepperERK_Trapezoidal( model, useFSAL, ICConsistency, ICConsistencyCheck, useEmbedded, modifier)); - TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + TEUCHOS_TEST_FOR_EXCEPT(!s->isInitialized()); } else TEUCHOS_TEST_FOR_EXCEPTION(true, std::logic_error, "Error - unknown stepperType = "+stepperType); } @@ -221,32 +206,9 @@ void testExplicitRKAccessorsFullConstruction(std::string stepperType) /** \brief Unit test utility for ExplicitRK Stepper construction and accessors. */ -void testDIRKAccessorsFullConstruction(std::string stepperType) +void testDIRKAccessorsFullConstruction( + const RCP >& stepper) { - // Default construction. - RCP > stepper; - if (stepperType == "RK Backward Euler") stepper = rcp(new Tempus::StepperDIRK_BackwardEuler()); - else if (stepperType == "SDIRK 2 Stage 2nd order") stepper = rcp(new Tempus::StepperSDIRK_2Stage2ndOrder()); - else if (stepperType == "SDIRK 3 Stage 2nd order") stepper = rcp(new Tempus::StepperSDIRK_3Stage2ndOrder()); - else if (stepperType == "SDIRK 2 Stage 3rd order") stepper = rcp(new Tempus::StepperSDIRK_2Stage3rdOrder()); - else if (stepperType == "EDIRK 2 Stage 3rd order") stepper = rcp(new Tempus::StepperEDIRK_2Stage3rdOrder()); - else if (stepperType == "DIRK 1 Stage Theta Method") stepper = rcp(new Tempus::StepperDIRK_1StageTheta()); - else if (stepperType == "EDIRK 2 Stage Theta Method") stepper = rcp(new Tempus::StepperEDIRK_2StageTheta()); - else if (stepperType == "RK Trapezoidal Rule") stepper = rcp(new Tempus::StepperEDIRK_TrapezoidalRule()); - else if (stepperType == "RK Implicit Midpoint") stepper = rcp(new Tempus::StepperSDIRK_ImplicitMidpoint()); - else if (stepperType == "SSPDIRK22") stepper = rcp(new Tempus::StepperSDIRK_SSPDIRK22()); - else if (stepperType == "SSPDIRK32") stepper = rcp(new Tempus::StepperSDIRK_SSPDIRK32()); - else if (stepperType == "SSPDIRK23") stepper = rcp(new Tempus::StepperSDIRK_SSPDIRK23()); - else if (stepperType == "SSPDIRK33") stepper = rcp(new Tempus::StepperSDIRK_SSPDIRK33()); - else if (stepperType == "RK Implicit 1 Stage 1st order Radau IA") stepper = rcp(new Tempus::StepperDIRK_1Stage1stOrderRadauIA()); - else if (stepperType == "RK Implicit 2 Stage 2nd order Lobatto IIIB") stepper = rcp(new Tempus::StepperDIRK_2Stage2ndOrderLobattoIIIB()); - else if (stepperType == "SDIRK 5 Stage 4th order") stepper = rcp(new Tempus::StepperSDIRK_5Stage4thOrder()); - else if (stepperType == "SDIRK 3 Stage 4th order") stepper = rcp(new Tempus::StepperSDIRK_3Stage4thOrder()); - else if (stepperType == "SDIRK 5 Stage 5th order") stepper = rcp(new Tempus::StepperSDIRK_5Stage5thOrder()); - else if (stepperType == "SDIRK 2(1) Pair") stepper = rcp(new Tempus::StepperSDIRK_21Pair()); - else TEUCHOS_TEST_FOR_EXCEPTION(true, std::logic_error, "Error - unknown stepperType = "+stepperType); - - auto model = rcp(new Tempus_Test::SinCosModel()); stepper->setModel(model); stepper->initialize(); @@ -277,96 +239,85 @@ void testDIRKAccessorsFullConstruction(std::string stepperType) stepper->setZeroInitialGuess(zeroInitialGuess); stepper->initialize(); TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + std::string stepperType = stepper->getStepperType(); // Full argument list construction. if (stepperType == "RK Backward Euler") { #ifndef TEMPUS_HIDE_DEPRECATED_CODE - stepper = rcp(new Tempus::StepperDIRK_BackwardEuler( + { auto s = rcp(new Tempus::StepperDIRK_BackwardEuler( model, obs, solver, useFSAL, ICConsistency, ICConsistencyCheck, useEmbedded, zeroInitialGuess)); - TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + TEUCHOS_TEST_FOR_EXCEPT(!s->isInitialized()); } #endif - stepper = rcp(new Tempus::StepperDIRK_BackwardEuler( + auto s = rcp(new Tempus::StepperDIRK_BackwardEuler( model, solver, useFSAL, ICConsistency, ICConsistencyCheck, useEmbedded, zeroInitialGuess, modifier)); - TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + TEUCHOS_TEST_FOR_EXCEPT(!s->isInitialized()); } else if (stepperType == "SDIRK 2 Stage 2nd order") { double gamma = 0.2928932188134524; #ifndef TEMPUS_HIDE_DEPRECATED_CODE - stepper = rcp(new Tempus::StepperSDIRK_2Stage2ndOrder( + { auto s = rcp(new Tempus::StepperSDIRK_2Stage2ndOrder( model, obs, solver, useFSAL, ICConsistency, ICConsistencyCheck, useEmbedded, zeroInitialGuess, gamma)); - TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + TEUCHOS_TEST_FOR_EXCEPT(!s->isInitialized()); } #endif auto s = rcp(new Tempus::StepperSDIRK_2Stage2ndOrder( model, solver, useFSAL, ICConsistency, ICConsistencyCheck, useEmbedded, zeroInitialGuess, modifier, gamma)); TEUCHOS_TEST_FOR_EXCEPT(!s->isInitialized()); - s->setGamma(gamma); - s->initialize(); - TEUCHOS_TEST_FOR_EXCEPT(!s->isInitialized()); } else if (stepperType == "SDIRK 3 Stage 2nd order") { #ifndef TEMPUS_HIDE_DEPRECATED_CODE - stepper = rcp(new Tempus::StepperSDIRK_3Stage2ndOrder( + { auto s = rcp(new Tempus::StepperSDIRK_3Stage2ndOrder( model, obs, solver, useFSAL, ICConsistency, ICConsistencyCheck, useEmbedded, zeroInitialGuess)); - TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + TEUCHOS_TEST_FOR_EXCEPT(!s->isInitialized()); } #endif - stepper = rcp(new Tempus::StepperSDIRK_3Stage2ndOrder( + auto s = rcp(new Tempus::StepperSDIRK_3Stage2ndOrder( model, solver, useFSAL, ICConsistency, ICConsistencyCheck, useEmbedded, zeroInitialGuess, modifier)); - TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + TEUCHOS_TEST_FOR_EXCEPT(!s->isInitialized()); } else if (stepperType == "SDIRK 2 Stage 3rd order") { std::string gammaType = "3rd Order A-stable"; double gamma = 0.7886751345948128; #ifndef TEMPUS_HIDE_DEPRECATED_CODE - stepper = rcp(new Tempus::StepperSDIRK_2Stage3rdOrder( + { auto s = rcp(new Tempus::StepperSDIRK_2Stage3rdOrder( model, obs, solver, useFSAL, ICConsistency, ICConsistencyCheck, useEmbedded, zeroInitialGuess, gammaType, gamma)); - TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + TEUCHOS_TEST_FOR_EXCEPT(!s->isInitialized()); } #endif auto s = rcp(new Tempus::StepperSDIRK_2Stage3rdOrder( model, solver, useFSAL, ICConsistency, ICConsistencyCheck, useEmbedded, zeroInitialGuess, modifier, gammaType, gamma)); TEUCHOS_TEST_FOR_EXCEPT(!s->isInitialized()); - s->setGammaType(gammaType); - s->initialize(); - TEUCHOS_TEST_FOR_EXCEPT(!s->isInitialized()); - s->setGamma(gamma); - s->initialize(); - TEUCHOS_TEST_FOR_EXCEPT(!s->isInitialized()); } else if (stepperType == "EDIRK 2 Stage 3rd order") { #ifndef TEMPUS_HIDE_DEPRECATED_CODE - stepper = rcp(new Tempus::StepperEDIRK_2Stage3rdOrder( + { auto s = rcp(new Tempus::StepperEDIRK_2Stage3rdOrder( model, obs, solver, useFSAL, ICConsistency, ICConsistencyCheck, useEmbedded, zeroInitialGuess)); - TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + TEUCHOS_TEST_FOR_EXCEPT(!s->isInitialized()); } #endif - stepper = rcp(new Tempus::StepperEDIRK_2Stage3rdOrder( + auto s = rcp(new Tempus::StepperEDIRK_2Stage3rdOrder( model, solver, useFSAL, ICConsistency, ICConsistencyCheck, useEmbedded, zeroInitialGuess, modifier)); - TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + TEUCHOS_TEST_FOR_EXCEPT(!s->isInitialized()); } else if (stepperType == "DIRK 1 Stage Theta Method") { double theta = 0.5; #ifndef TEMPUS_HIDE_DEPRECATED_CODE - stepper = rcp(new Tempus::StepperDIRK_1StageTheta( + { auto s = rcp(new Tempus::StepperDIRK_1StageTheta( model, obs, solver, useFSAL, ICConsistency, ICConsistencyCheck, useEmbedded, zeroInitialGuess), theta); - TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + TEUCHOS_TEST_FOR_EXCEPT(!s->isInitialized()); } #endif auto s = rcp(new Tempus::StepperDIRK_1StageTheta( model, solver, useFSAL, ICConsistency, ICConsistencyCheck, useEmbedded, zeroInitialGuess, modifier, theta)); TEUCHOS_TEST_FOR_EXCEPT(!s->isInitialized()); - s->setTheta(theta); - s->initialize(); - TEUCHOS_TEST_FOR_EXCEPT(!s->isInitialized()); } else if (stepperType == "EDIRK 2 Stage Theta Method") { double theta = 0.5; #ifndef TEMPUS_HIDE_DEPRECATED_CODE - stepper = rcp(new Tempus::StepperEDIRK_2StageTheta( + { auto s = rcp(new Tempus::StepperEDIRK_2StageTheta( model, obs, solver, useFSAL, ICConsistency, ICConsistencyCheck, useEmbedded, zeroInitialGuess, theta)); - TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + TEUCHOS_TEST_FOR_EXCEPT(!s->isInitialized()); } #endif auto s = rcp(new Tempus::StepperEDIRK_2StageTheta( model, solver, useFSAL, ICConsistency, ICConsistencyCheck, @@ -377,136 +328,136 @@ void testDIRKAccessorsFullConstruction(std::string stepperType) TEUCHOS_TEST_FOR_EXCEPT(!s->isInitialized()); } else if (stepperType == "RK Trapezoidal Rule") { #ifndef TEMPUS_HIDE_DEPRECATED_CODE - stepper = rcp(new Tempus::StepperEDIRK_TrapezoidalRule( + { auto s = rcp(new Tempus::StepperEDIRK_TrapezoidalRule( model, obs, solver, useFSAL, ICConsistency, ICConsistencyCheck, useEmbedded, zeroInitialGuess)); - TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + TEUCHOS_TEST_FOR_EXCEPT(!s->isInitialized()); } #endif - stepper = rcp(new Tempus::StepperEDIRK_TrapezoidalRule( + auto s = rcp(new Tempus::StepperEDIRK_TrapezoidalRule( model, solver, useFSAL, ICConsistency, ICConsistencyCheck, useEmbedded, zeroInitialGuess, modifier)); - TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + TEUCHOS_TEST_FOR_EXCEPT(!s->isInitialized()); } else if (stepperType == "RK Implicit Midpoint") { #ifndef TEMPUS_HIDE_DEPRECATED_CODE - stepper = rcp(new Tempus::StepperSDIRK_ImplicitMidpoint( + { auto s = rcp(new Tempus::StepperSDIRK_ImplicitMidpoint( model, obs, solver, useFSAL, ICConsistency, ICConsistencyCheck, useEmbedded, zeroInitialGuess)); - TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + TEUCHOS_TEST_FOR_EXCEPT(!s->isInitialized()); } #endif - stepper = rcp(new Tempus::StepperSDIRK_ImplicitMidpoint( + auto s = rcp(new Tempus::StepperSDIRK_ImplicitMidpoint( model, solver, useFSAL, ICConsistency, ICConsistencyCheck, useEmbedded, zeroInitialGuess, modifier)); - TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + TEUCHOS_TEST_FOR_EXCEPT(!s->isInitialized()); } else if (stepperType == "SSPDIRK22") { #ifndef TEMPUS_HIDE_DEPRECATED_CODE - stepper = rcp(new Tempus::StepperSDIRK_SSPDIRK22( + { auto s = rcp(new Tempus::StepperSDIRK_SSPDIRK22( model, obs, solver, useFSAL, ICConsistency, ICConsistencyCheck, useEmbedded, zeroInitialGuess)); - TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + TEUCHOS_TEST_FOR_EXCEPT(!s->isInitialized()); } #endif - stepper = rcp(new Tempus::StepperSDIRK_SSPDIRK22( + auto s = rcp(new Tempus::StepperSDIRK_SSPDIRK22( model, solver, useFSAL, ICConsistency, ICConsistencyCheck, useEmbedded, zeroInitialGuess, modifier)); - TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + TEUCHOS_TEST_FOR_EXCEPT(!s->isInitialized()); } else if (stepperType == "SSPDIRK32") { #ifndef TEMPUS_HIDE_DEPRECATED_CODE - stepper = rcp(new Tempus::StepperSDIRK_SSPDIRK32( + { auto s = rcp(new Tempus::StepperSDIRK_SSPDIRK32( model, obs, solver, useFSAL, ICConsistency, ICConsistencyCheck, useEmbedded, zeroInitialGuess)); - TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + TEUCHOS_TEST_FOR_EXCEPT(!s->isInitialized()); } #endif - stepper = rcp(new Tempus::StepperSDIRK_SSPDIRK32( + auto s = rcp(new Tempus::StepperSDIRK_SSPDIRK32( model, solver, useFSAL, ICConsistency, ICConsistencyCheck, useEmbedded, zeroInitialGuess, modifier)); - TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + TEUCHOS_TEST_FOR_EXCEPT(!s->isInitialized()); } else if (stepperType == "SSPDIRK23") { #ifndef TEMPUS_HIDE_DEPRECATED_CODE - stepper = rcp(new Tempus::StepperSDIRK_SSPDIRK23( + { auto s = rcp(new Tempus::StepperSDIRK_SSPDIRK23( model, obs, solver, useFSAL, ICConsistency, ICConsistencyCheck, useEmbedded, zeroInitialGuess)); - TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + TEUCHOS_TEST_FOR_EXCEPT(!s->isInitialized()); } #endif - stepper = rcp(new Tempus::StepperSDIRK_SSPDIRK23( + auto s = rcp(new Tempus::StepperSDIRK_SSPDIRK23( model, solver, useFSAL, ICConsistency, ICConsistencyCheck, useEmbedded, zeroInitialGuess, modifier)); - TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + TEUCHOS_TEST_FOR_EXCEPT(!s->isInitialized()); } else if (stepperType == "SSPDIRK33") { #ifndef TEMPUS_HIDE_DEPRECATED_CODE - stepper = rcp(new Tempus::StepperSDIRK_SSPDIRK33( + { auto s = rcp(new Tempus::StepperSDIRK_SSPDIRK33( model, obs, solver, useFSAL, ICConsistency, ICConsistencyCheck, useEmbedded, zeroInitialGuess)); - TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + TEUCHOS_TEST_FOR_EXCEPT(!s->isInitialized()); } #endif - stepper = rcp(new Tempus::StepperSDIRK_SSPDIRK33( + auto s = rcp(new Tempus::StepperSDIRK_SSPDIRK33( model, solver, useFSAL, ICConsistency, ICConsistencyCheck, useEmbedded, zeroInitialGuess, modifier)); - TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + TEUCHOS_TEST_FOR_EXCEPT(!s->isInitialized()); } else if (stepperType == "RK Implicit 1 Stage 1st order Radau IA") { #ifndef TEMPUS_HIDE_DEPRECATED_CODE - stepper = rcp(new Tempus::StepperDIRK_1Stage1stOrderRadauIA( + { auto s = rcp(new Tempus::StepperDIRK_1Stage1stOrderRadauIA( model, obs, solver, useFSAL, ICConsistency, ICConsistencyCheck, useEmbedded, zeroInitialGuess)); - TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + TEUCHOS_TEST_FOR_EXCEPT(!s->isInitialized()); } #endif - stepper = rcp(new Tempus::StepperDIRK_1Stage1stOrderRadauIA( + auto s = rcp(new Tempus::StepperDIRK_1Stage1stOrderRadauIA( model, solver, useFSAL, ICConsistency, ICConsistencyCheck, useEmbedded, zeroInitialGuess, modifier)); - TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + TEUCHOS_TEST_FOR_EXCEPT(!s->isInitialized()); } else if (stepperType == "RK Implicit 2 Stage 2nd order Lobatto IIIB") { #ifndef TEMPUS_HIDE_DEPRECATED_CODE - stepper = rcp(new Tempus::StepperDIRK_2Stage2ndOrderLobattoIIIB( + { auto s = rcp(new Tempus::StepperDIRK_2Stage2ndOrderLobattoIIIB( model, obs, solver, useFSAL, ICConsistency, ICConsistencyCheck, useEmbedded, zeroInitialGuess)); - TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + TEUCHOS_TEST_FOR_EXCEPT(!s->isInitialized()); } #endif - stepper = rcp(new Tempus::StepperDIRK_2Stage2ndOrderLobattoIIIB( + auto s = rcp(new Tempus::StepperDIRK_2Stage2ndOrderLobattoIIIB( model, solver, useFSAL, ICConsistency, ICConsistencyCheck, useEmbedded, zeroInitialGuess, modifier)); - TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + TEUCHOS_TEST_FOR_EXCEPT(!s->isInitialized()); } else if (stepperType == "SDIRK 5 Stage 4th order") { #ifndef TEMPUS_HIDE_DEPRECATED_CODE - stepper = rcp(new Tempus::StepperSDIRK_5Stage4thOrder( + { auto s = rcp(new Tempus::StepperSDIRK_5Stage4thOrder( model, obs, solver, useFSAL, ICConsistency, ICConsistencyCheck, useEmbedded, zeroInitialGuess)); - TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + TEUCHOS_TEST_FOR_EXCEPT(!s->isInitialized()); } #endif - stepper = rcp(new Tempus::StepperSDIRK_5Stage4thOrder( + auto s = rcp(new Tempus::StepperSDIRK_5Stage4thOrder( model, solver, useFSAL, ICConsistency, ICConsistencyCheck, useEmbedded, zeroInitialGuess, modifier)); - TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + TEUCHOS_TEST_FOR_EXCEPT(!s->isInitialized()); } else if (stepperType == "SDIRK 3 Stage 4th order") { #ifndef TEMPUS_HIDE_DEPRECATED_CODE - stepper = rcp(new Tempus::StepperSDIRK_3Stage4thOrder( + { auto s = rcp(new Tempus::StepperSDIRK_3Stage4thOrder( model, obs, solver, useFSAL, ICConsistency, ICConsistencyCheck, useEmbedded, zeroInitialGuess)); - TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + TEUCHOS_TEST_FOR_EXCEPT(!s->isInitialized()); } #endif - stepper = rcp(new Tempus::StepperSDIRK_3Stage4thOrder( + auto s = rcp(new Tempus::StepperSDIRK_3Stage4thOrder( model, solver, useFSAL, ICConsistency, ICConsistencyCheck, useEmbedded, zeroInitialGuess, modifier)); - TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + TEUCHOS_TEST_FOR_EXCEPT(!s->isInitialized()); } else if (stepperType == "SDIRK 5 Stage 5th order") { #ifndef TEMPUS_HIDE_DEPRECATED_CODE - stepper = rcp(new Tempus::StepperSDIRK_5Stage5thOrder( + { auto s = rcp(new Tempus::StepperSDIRK_5Stage5thOrder( model, obs, solver, useFSAL, ICConsistency, ICConsistencyCheck, useEmbedded, zeroInitialGuess)); - TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + TEUCHOS_TEST_FOR_EXCEPT(!s->isInitialized()); } #endif - stepper = rcp(new Tempus::StepperSDIRK_5Stage5thOrder( + auto s = rcp(new Tempus::StepperSDIRK_5Stage5thOrder( model, solver, useFSAL, ICConsistency, ICConsistencyCheck, useEmbedded, zeroInitialGuess, modifier)); - TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + TEUCHOS_TEST_FOR_EXCEPT(!s->isInitialized()); } else if (stepperType == "SDIRK 2(1) Pair") { #ifndef TEMPUS_HIDE_DEPRECATED_CODE - stepper = rcp(new Tempus::StepperSDIRK_21Pair( + { auto s = rcp(new Tempus::StepperSDIRK_21Pair( model, obs, solver, useFSAL, ICConsistency, ICConsistencyCheck, useEmbedded, zeroInitialGuess)); - TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + TEUCHOS_TEST_FOR_EXCEPT(!s->isInitialized()); } #endif - stepper = rcp(new Tempus::StepperSDIRK_21Pair( + auto s = rcp(new Tempus::StepperSDIRK_21Pair( model, solver, useFSAL, ICConsistency, ICConsistencyCheck, useEmbedded, zeroInitialGuess, modifier)); - TEUCHOS_TEST_FOR_EXCEPT(!stepper->isInitialized()); + TEUCHOS_TEST_FOR_EXCEPT(!s->isInitialized()); } else TEUCHOS_TEST_FOR_EXCEPTION(true, std::logic_error, "Error - unknown stepperType = "+stepperType); } @@ -796,52 +747,15 @@ class StepperRKModifierXTest /** \brief Unit test utility for Stepper RK AppAction. */ -void testRKAppAction(std::string stepperType, - Teuchos::FancyOStream &out, bool &success) +void testRKAppAction( + const Teuchos::RCP >& stepper, + const Teuchos::RCP >& model, + Teuchos::FancyOStream &out, bool &success) { - // Default construction. - RCP > stepper; - if (stepperType == "RK Explicit 3 Stage 3rd order") stepper = rcp(new Tempus::StepperERK_3Stage3rdOrder()); - else if (stepperType == "RK Explicit 3 Stage 3rd order by Heun") stepper = rcp(new Tempus::StepperERK_3Stage3rdOrderHeun()); - else if (stepperType == "RK Explicit 3 Stage 3rd order TVD") stepper = rcp(new Tempus::StepperERK_3Stage3rdOrderTVD()); - else if (stepperType == "RK Explicit 3/8 Rule") stepper = rcp(new Tempus::StepperERK_3_8Rule()); - else if (stepperType == "RK Explicit 4 Stage 3rd order by Runge") stepper = rcp(new Tempus::StepperERK_4Stage3rdOrderRunge()); - else if (stepperType == "RK Explicit 4 Stage") stepper = rcp(new Tempus::StepperERK_4Stage4thOrder()); - else if (stepperType == "RK Explicit 5 Stage 3rd order by Kinnmark and Gray") stepper = rcp(new Tempus::StepperERK_5Stage3rdOrderKandG()); - else if (stepperType == "Bogacki-Shampine 3(2) Pair") stepper = rcp(new Tempus::StepperERK_BogackiShampine32()); - else if (stepperType == "RK Forward Euler") stepper = rcp(new Tempus::StepperERK_ForwardEuler()); - else if (stepperType == "General ERK") stepper = rcp(new Tempus::StepperERK_General()); - else if (stepperType == "Merson 4(5) Pair") stepper = rcp(new Tempus::StepperERK_Merson45()); - else if (stepperType == "RK Explicit Midpoint") stepper = rcp(new Tempus::StepperERK_Midpoint()); - else if (stepperType == "RK Explicit Trapezoidal") stepper = rcp(new Tempus::StepperERK_Trapezoidal()); - else if (stepperType == "RK Backward Euler") stepper = rcp(new Tempus::StepperDIRK_BackwardEuler()); - else if (stepperType == "SDIRK 2 Stage 2nd order") stepper = rcp(new Tempus::StepperSDIRK_2Stage2ndOrder()); - else if (stepperType == "SDIRK 3 Stage 2nd order") stepper = rcp(new Tempus::StepperSDIRK_3Stage2ndOrder()); - else if (stepperType == "SDIRK 2 Stage 3rd order") stepper = rcp(new Tempus::StepperSDIRK_2Stage3rdOrder()); - else if (stepperType == "EDIRK 2 Stage 3rd order") stepper = rcp(new Tempus::StepperEDIRK_2Stage3rdOrder()); - else if (stepperType == "DIRK 1 Stage Theta Method") stepper = rcp(new Tempus::StepperDIRK_1StageTheta()); - else if (stepperType == "EDIRK 2 Stage Theta Method") stepper = rcp(new Tempus::StepperEDIRK_2StageTheta()); - else if (stepperType == "RK Trapezoidal Rule") stepper = rcp(new Tempus::StepperEDIRK_TrapezoidalRule()); - else if (stepperType == "RK Implicit Midpoint") stepper = rcp(new Tempus::StepperSDIRK_ImplicitMidpoint()); - else if (stepperType == "SSPDIRK22") stepper = rcp(new Tempus::StepperSDIRK_SSPDIRK22()); - else if (stepperType == "SSPDIRK32") stepper = rcp(new Tempus::StepperSDIRK_SSPDIRK32()); - else if (stepperType == "SSPDIRK23") stepper = rcp(new Tempus::StepperSDIRK_SSPDIRK23()); - else if (stepperType == "SSPDIRK33") stepper = rcp(new Tempus::StepperSDIRK_SSPDIRK33()); - else if (stepperType == "RK Implicit 1 Stage 1st order Radau IA") stepper = rcp(new Tempus::StepperDIRK_1Stage1stOrderRadauIA()); - else if (stepperType == "RK Implicit 2 Stage 2nd order Lobatto IIIB") stepper = rcp(new Tempus::StepperDIRK_2Stage2ndOrderLobattoIIIB()); - else if (stepperType == "SDIRK 5 Stage 4th order") stepper = rcp(new Tempus::StepperSDIRK_5Stage4thOrder()); - else if (stepperType == "SDIRK 3 Stage 4th order") stepper = rcp(new Tempus::StepperSDIRK_3Stage4thOrder()); - else if (stepperType == "SDIRK 5 Stage 5th order") stepper = rcp(new Tempus::StepperSDIRK_5Stage5thOrder()); - else if (stepperType == "SDIRK 2(1) Pair") stepper = rcp(new Tempus::StepperSDIRK_21Pair()); - else if (stepperType == "General DIRK") stepper = rcp(new Tempus::StepperDIRK_General()); - else TEUCHOS_TEST_FOR_EXCEPTION(true, std::logic_error, "Error - unknown stepperType = "+stepperType); - auto testTypeOrig = stepper->getStepperType(); // Test Modifier. { - Teuchos::RCP > model = - rcp(new Tempus_Test::SinCosModel()); stepper->setModel(model); auto modifier = rcp(new StepperRKModifierTest()); stepper->setAppAction(modifier); @@ -881,8 +795,6 @@ void testRKAppAction(std::string stepperType, // Test Observer. { - Teuchos::RCP > model = - rcp(new Tempus_Test::SinCosModel()); stepper->setModel(model); auto observer = rcp(new StepperRKObserverTest()); stepper->setAppAction(observer); @@ -923,8 +835,6 @@ void testRKAppAction(std::string stepperType, // Test ModifierX. { - Teuchos::RCP > model = - rcp(new Tempus_Test::SinCosModel()); stepper->setModel(model); auto modifierX = rcp(new StepperRKModifierXTest()); stepper->setAppAction(modifierX); From fb623fb3ef7d353b14b9ed277b3a345411322a2a Mon Sep 17 00:00:00 2001 From: "Roscoe A. Bartlett" Date: Tue, 21 Apr 2020 13:55:28 -0400 Subject: [PATCH 17/17] ATDM: van1-tx2: Address problem of 'van1-tx2' matching KOKKOS_ARCH=TX2 (#4063, CDOFA-27) After the "upgrade" of the ATDM Trilinos parsing system to parse out the KOKKOS_ARCH in either upper or lower case, now the 'tx2' in 'van1-tx2' matches the KOKKOS_ARCH 'TX2' (lower case 'tx2'). This broke the running of atdm/van1-tx2/environment.sh. This broke the nightly ATDM Trilinos 'van1-tx2' builds and installs of Trilinos from 'stria' today, testing day 2020-04-21. I updated the error message to show the KOKKOS_ARCH and then I updated the logic to accept the KOKKOS_ARCH of 'TX2'. That is a bit of a hack but it gets us around this problem (and is harmless on this system). --- cmake/std/atdm/van1-tx2/environment.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmake/std/atdm/van1-tx2/environment.sh b/cmake/std/atdm/van1-tx2/environment.sh index 3225ca4cecea..19ff493f28e1 100755 --- a/cmake/std/atdm/van1-tx2/environment.sh +++ b/cmake/std/atdm/van1-tx2/environment.sh @@ -12,13 +12,14 @@ echo "Using ARM ATSE compiler stack $ATDM_CONFIG_COMPILER to build $ATDM_CONFIG_ # if [[ "$ATDM_CONFIG_KOKKOS_ARCH" == "DEFAULT" ]] \ + || [[ "$ATDM_CONFIG_KOKKOS_ARCH" == "TX2" ]] \ || [[ "$ATDM_CONFIG_KOKKOS_ARCH" == "" ]] \ ; then export ATDM_CONFIG_KOKKOS_ARCH=ARMv8-TX2 else echo echo "***" - echo "*** ERROR: Only one arch is supported this system! Remove any arch keywords from build name '${ATDM_CONFIG_BUILD_NAME}'" + echo "*** ERROR: KOKKOS_ARCH='${ATDM_CONFIG_KOKKOS_ARCH}' was parsed from the the buildname '${ATDM_CONFIG_BUILD_NAME}'. Only one KOKKOS_ARCH is supported for this system. Please remove that KOKKOS_ARCH keyword from the buildname!" echo "***" return fi