diff --git a/CMakeLists.txt b/CMakeLists.txt index 3055abf22..049d196d7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,10 +2,10 @@ # CMake script for the PRISMS-PF applications: ## -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12) +CMAKE_MINIMUM_REQUIRED(VERSION 3.1.0) # Find deal.II installation -FIND_PACKAGE(deal.II 8.3.0 REQUIRED +FIND_PACKAGE(deal.II 9.2.0 REQUIRED HINTS ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR}) DEAL_II_INITIALIZE_CACHED_VARIABLES() @@ -33,17 +33,11 @@ INCLUDE_DIRECTORIES(include) FILE(GLOB headers include/*.h) FILE(GLOB matrixfree_sources src/matrixfree/*.cc) - FILE(GLOB userinputparameters_sources src/userInputParameters/*.cc) - FILE(GLOB solverparameters_sources src/SolverParameters/*.cc) - FILE(GLOB equationdependencyparser_sources src/EquationDependencyParser/*.cc) - FILE(GLOB floodfiller_sources src/FloodFiller/*.cc) - FILE(GLOB orderparameterremapper_sources src/OrderParameterRemapper/*.cc) - FILE(GLOB simplifiedgrainrepresentation_sources src/SimplifiedGrainRepresentation/*.cc) @@ -52,11 +46,8 @@ SET(CMAKE_BUILD_TYPE Release) # Append extra flags for the GNU compiler to suppress some warnings if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") - #set(DEAL_II_CXX_FLAGS_DEBUG "${DEAL_II_CXX_FLAGS_DEBUG} -Wno-maybe-uninitialized -Wno-unused-parameter -Wno-extra") - #set(DEAL_II_CXX_FLAGS_RELEASE "${DEAL_II_CXX_FLAGS_RELEASE} -Wno-maybe-uninitialized -Wno-unused-parameter -Wno-extra") - set(DEAL_II_CXX_FLAGS_DEBUG "${DEAL_II_CXX_FLAGS_DEBUG} -Wno-maybe-uninitialized -Wno-deprecated-declarations -Wno-comment -Wno-unused-parameter -Wno-unused-variable -Wno-unused-but-set-variable") - set(DEAL_II_CXX_FLAGS_RELEASE "${DEAL_II_CXX_FLAGS_RELEASE} -Wno-maybe-uninitialized -Wno-deprecated-declarations -Wno-comment -Wno-unused-parameter -Wno-unused-variable -Wno-unused-but-set-variable") - #set(CMAKE_CXX_FLAGS "-Wno-maybe-uninitialized -Wno-deprecated-declarations -Wno-comment -Wno-unused-parameter -Wno-unused-variable -Wno-unused-but-set-variable") + set(DEAL_II_CXX_FLAGS_DEBUG "${DEAL_II_CXX_FLAGS_DEBUG} -Wno-maybe-uninitialized -Wno-deprecated-declarations -Wno-comment -Wno-unused-parameter -Wno-unused-variable -Wno-unused-but-set-variable") + set(DEAL_II_CXX_FLAGS_RELEASE "${DEAL_II_CXX_FLAGS_RELEASE} -Wno-maybe-uninitialized -Wno-deprecated-declarations -Wno-comment -Wno-unused-parameter -Wno-unused-variable -Wno-unused-but-set-variable") endif() ADD_LIBRARY(${PROJECT_NAME} ${matrixfree_sources} ${userinputparameters_sources} ${solverparameters_sources} ${equationdependencyparser_sources} ${floodfiller_sources} ${orderparameterremapper_sources} ${simplifiedgrainrepresentation_sources} src/utilities/sortIndexEntryPairList.cc src/variableAttributeLoader/variableAttributeLoader.cc src/utilities/vectorBCFunction.cc src/inputFileReader/inputFileReader.cc src/parallelNucleationList/parallelNucleationList.cc src/variableContainer/variableContainer.cc) @@ -67,11 +58,8 @@ SET(CMAKE_BUILD_TYPE Debug) # Append extra flags for the GNU compiler to suppress some warnings if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") - #set(DEAL_II_CXX_FLAGS_DEBUG "${DEAL_II_CXX_FLAGS_DEBUG} -Wno-maybe-uninitialized -Wno-unused-parameter -Wno-extra") - #set(DEAL_II_CXX_FLAGS_RELEASE "${DEAL_II_CXX_FLAGS_RELEASE} -Wno-maybe-uninitialized -Wno-unused-parameter -Wno-extra") - set(DEAL_II_CXX_FLAGS_DEBUG "${DEAL_II_CXX_FLAGS_DEBUG} -Wno-maybe-uninitialized -Wno-deprecated-declarations -Wno-comment -Wno-unused-parameter -Wno-unused-variable -Wno-unused-but-set-variable") - set(DEAL_II_CXX_FLAGS_RELEASE "${DEAL_II_CXX_FLAGS_RELEASE} -Wno-maybe-uninitialized -Wno-deprecated-declarations -Wno-comment -Wno-unused-parameter -Wno-unused-variable -Wno-unused-but-set-variable") - #set(CMAKE_CXX_FLAGS "-Wno-maybe-uninitialized -Wno-deprecated-declarations -Wno-comment -Wno-unused-parameter -Wno-unused-variable -Wno-unused-but-set-variable") + set(DEAL_II_CXX_FLAGS_DEBUG "${DEAL_II_CXX_FLAGS_DEBUG} -Wno-maybe-uninitialized -Wno-deprecated-declarations -Wno-comment -Wno-unused-parameter -Wno-unused-variable -Wno-unused-but-set-variable") + set(DEAL_II_CXX_FLAGS_RELEASE "${DEAL_II_CXX_FLAGS_RELEASE} -Wno-maybe-uninitialized -Wno-deprecated-declarations -Wno-comment -Wno-unused-parameter -Wno-unused-variable -Wno-unused-but-set-variable") endif() ADD_LIBRARY(${PROJECT_NAME} ${matrixfree_sources} ${userinputparameters_sources} ${solverparameters_sources} ${equationdependencyparser_sources} ${floodfiller_sources} ${orderparameterremapper_sources} ${simplifiedgrainrepresentation_sources} src/utilities/sortIndexEntryPairList.cc src/variableAttributeLoader/variableAttributeLoader.cc src/utilities/vectorBCFunction.cc src/inputFileReader/inputFileReader.cc src/parallelNucleationList/parallelNucleationList.cc src/variableContainer/variableContainer.cc) diff --git a/applications/CHAC_anisotropy/CMakeLists.txt b/applications/CHAC_anisotropy/CMakeLists.txt index 39b8e6bd3..f3773585b 100644 --- a/applications/CHAC_anisotropy/CMakeLists.txt +++ b/applications/CHAC_anisotropy/CMakeLists.txt @@ -2,7 +2,7 @@ # CMake script for the PRISMS-PF applications: ## -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12) +CMAKE_MINIMUM_REQUIRED(VERSION 3.1.0) # Find deal.II installation FIND_PACKAGE(deal.II 9.2.0 REQUIRED diff --git a/applications/CHAC_anisotropyRegularized/CMakeLists.txt b/applications/CHAC_anisotropyRegularized/CMakeLists.txt index 39b8e6bd3..f3773585b 100644 --- a/applications/CHAC_anisotropyRegularized/CMakeLists.txt +++ b/applications/CHAC_anisotropyRegularized/CMakeLists.txt @@ -2,7 +2,7 @@ # CMake script for the PRISMS-PF applications: ## -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12) +CMAKE_MINIMUM_REQUIRED(VERSION 3.1.0) # Find deal.II installation FIND_PACKAGE(deal.II 9.2.0 REQUIRED diff --git a/applications/CHAC_performance_test/CMakeLists.txt b/applications/CHAC_performance_test/CMakeLists.txt index 39b8e6bd3..f3773585b 100644 --- a/applications/CHAC_performance_test/CMakeLists.txt +++ b/applications/CHAC_performance_test/CMakeLists.txt @@ -2,7 +2,7 @@ # CMake script for the PRISMS-PF applications: ## -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12) +CMAKE_MINIMUM_REQUIRED(VERSION 3.1.0) # Find deal.II installation FIND_PACKAGE(deal.II 9.2.0 REQUIRED diff --git a/applications/CHiMaD_benchmark1a/CMakeLists.txt b/applications/CHiMaD_benchmark1a/CMakeLists.txt index 39b8e6bd3..f3773585b 100644 --- a/applications/CHiMaD_benchmark1a/CMakeLists.txt +++ b/applications/CHiMaD_benchmark1a/CMakeLists.txt @@ -2,7 +2,7 @@ # CMake script for the PRISMS-PF applications: ## -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12) +CMAKE_MINIMUM_REQUIRED(VERSION 3.1.0) # Find deal.II installation FIND_PACKAGE(deal.II 9.2.0 REQUIRED diff --git a/applications/CHiMaD_benchmark2a/CMakeLists.txt b/applications/CHiMaD_benchmark2a/CMakeLists.txt index 39b8e6bd3..f3773585b 100644 --- a/applications/CHiMaD_benchmark2a/CMakeLists.txt +++ b/applications/CHiMaD_benchmark2a/CMakeLists.txt @@ -2,7 +2,7 @@ # CMake script for the PRISMS-PF applications: ## -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12) +CMAKE_MINIMUM_REQUIRED(VERSION 3.1.0) # Find deal.II installation FIND_PACKAGE(deal.II 9.2.0 REQUIRED diff --git a/applications/CHiMaD_benchmark3/CMakeLists.txt b/applications/CHiMaD_benchmark3/CMakeLists.txt index 39b8e6bd3..f3773585b 100644 --- a/applications/CHiMaD_benchmark3/CMakeLists.txt +++ b/applications/CHiMaD_benchmark3/CMakeLists.txt @@ -2,7 +2,7 @@ # CMake script for the PRISMS-PF applications: ## -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12) +CMAKE_MINIMUM_REQUIRED(VERSION 3.1.0) # Find deal.II installation FIND_PACKAGE(deal.II 9.2.0 REQUIRED diff --git a/applications/CHiMaD_benchmark6a/CMakeLists.txt b/applications/CHiMaD_benchmark6a/CMakeLists.txt index 39b8e6bd3..f3773585b 100644 --- a/applications/CHiMaD_benchmark6a/CMakeLists.txt +++ b/applications/CHiMaD_benchmark6a/CMakeLists.txt @@ -2,7 +2,7 @@ # CMake script for the PRISMS-PF applications: ## -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12) +CMAKE_MINIMUM_REQUIRED(VERSION 3.1.0) # Find deal.II installation FIND_PACKAGE(deal.II 9.2.0 REQUIRED diff --git a/applications/CHiMaD_benchmark6b/CMakeLists.txt b/applications/CHiMaD_benchmark6b/CMakeLists.txt index 39b8e6bd3..f3773585b 100644 --- a/applications/CHiMaD_benchmark6b/CMakeLists.txt +++ b/applications/CHiMaD_benchmark6b/CMakeLists.txt @@ -2,7 +2,7 @@ # CMake script for the PRISMS-PF applications: ## -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12) +CMAKE_MINIMUM_REQUIRED(VERSION 3.1.0) # Find deal.II installation FIND_PACKAGE(deal.II 9.2.0 REQUIRED diff --git a/applications/CHiMaD_benchmark7/CMakeLists.txt b/applications/CHiMaD_benchmark7/CMakeLists.txt index 39b8e6bd3..f3773585b 100644 --- a/applications/CHiMaD_benchmark7/CMakeLists.txt +++ b/applications/CHiMaD_benchmark7/CMakeLists.txt @@ -2,7 +2,7 @@ # CMake script for the PRISMS-PF applications: ## -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12) +CMAKE_MINIMUM_REQUIRED(VERSION 3.1.0) # Find deal.II installation FIND_PACKAGE(deal.II 9.2.0 REQUIRED diff --git a/applications/MgNd_precipitate_single_Bppp/CMakeLists.txt b/applications/MgNd_precipitate_single_Bppp/CMakeLists.txt index 39b8e6bd3..f3773585b 100644 --- a/applications/MgNd_precipitate_single_Bppp/CMakeLists.txt +++ b/applications/MgNd_precipitate_single_Bppp/CMakeLists.txt @@ -2,7 +2,7 @@ # CMake script for the PRISMS-PF applications: ## -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12) +CMAKE_MINIMUM_REQUIRED(VERSION 3.1.0) # Find deal.II installation FIND_PACKAGE(deal.II 9.2.0 REQUIRED diff --git a/applications/allenCahn/CMakeLists.txt b/applications/allenCahn/CMakeLists.txt index 39b8e6bd3..f3773585b 100644 --- a/applications/allenCahn/CMakeLists.txt +++ b/applications/allenCahn/CMakeLists.txt @@ -2,7 +2,7 @@ # CMake script for the PRISMS-PF applications: ## -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12) +CMAKE_MINIMUM_REQUIRED(VERSION 3.1.0) # Find deal.II installation FIND_PACKAGE(deal.II 9.2.0 REQUIRED diff --git a/applications/allenCahn/equations.cc b/applications/allenCahn/equations.cc index 8959e7473..8cca69e2b 100644 --- a/applications/allenCahn/equations.cc +++ b/applications/allenCahn/equations.cc @@ -41,8 +41,9 @@ variableAttributeLoader::loadVariableAttributes() template void customPDE::explicitEquationRHS( - variableContainer> &variable_list, - dealii::Point> q_point_loc) const + [[maybe_unused]] variableContainer> + &variable_list, + [[maybe_unused]] dealii::Point> q_point_loc) const { // --- Getting the values and derivatives of the model variables --- @@ -78,8 +79,9 @@ customPDE::explicitEquationRHS( template void customPDE::nonExplicitEquationRHS( - variableContainer> &variable_list, - dealii::Point> q_point_loc) const + [[maybe_unused]] variableContainer> + &variable_list, + [[maybe_unused]] dealii::Point> q_point_loc) const {} // ============================================================================================= @@ -100,6 +102,7 @@ customPDE::nonExplicitEquationRHS( template void customPDE::equationLHS( - variableContainer> &variable_list, - dealii::Point> q_point_loc) const + [[maybe_unused]] variableContainer> + &variable_list, + [[maybe_unused]] dealii::Point> q_point_loc) const {} diff --git a/applications/allenCahn/postprocess.cc b/applications/allenCahn/postprocess.cc index a35864785..db9e65cc1 100644 --- a/applications/allenCahn/postprocess.cc +++ b/applications/allenCahn/postprocess.cc @@ -45,9 +45,12 @@ variableAttributeLoader::loadPostProcessorVariableAttributes() template void customPDE::postProcessedFields( - const variableContainer> &variable_list, - variableContainer> &pp_variable_list, - const dealii::Point> q_point_loc) const + [[maybe_unused]] const variableContainer> + &variable_list, + [[maybe_unused]] variableContainer> + &pp_variable_list, + [[maybe_unused]] const dealii::Point> q_point_loc) + const { // --- Getting the values and derivatives of the model variables --- diff --git a/applications/allenCahn_conserved/CMakeLists.txt b/applications/allenCahn_conserved/CMakeLists.txt index 39b8e6bd3..f3773585b 100644 --- a/applications/allenCahn_conserved/CMakeLists.txt +++ b/applications/allenCahn_conserved/CMakeLists.txt @@ -2,7 +2,7 @@ # CMake script for the PRISMS-PF applications: ## -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12) +CMAKE_MINIMUM_REQUIRED(VERSION 3.1.0) # Find deal.II installation FIND_PACKAGE(deal.II 9.2.0 REQUIRED diff --git a/applications/alloySolidification/CMakeLists.txt b/applications/alloySolidification/CMakeLists.txt index 39b8e6bd3..f3773585b 100644 --- a/applications/alloySolidification/CMakeLists.txt +++ b/applications/alloySolidification/CMakeLists.txt @@ -2,7 +2,7 @@ # CMake script for the PRISMS-PF applications: ## -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12) +CMAKE_MINIMUM_REQUIRED(VERSION 3.1.0) # Find deal.II installation FIND_PACKAGE(deal.II 9.2.0 REQUIRED diff --git a/applications/alloySolidification_uniform/CMakeLists.txt b/applications/alloySolidification_uniform/CMakeLists.txt index 39b8e6bd3..f3773585b 100644 --- a/applications/alloySolidification_uniform/CMakeLists.txt +++ b/applications/alloySolidification_uniform/CMakeLists.txt @@ -2,7 +2,7 @@ # CMake script for the PRISMS-PF applications: ## -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12) +CMAKE_MINIMUM_REQUIRED(VERSION 3.1.0) # Find deal.II installation FIND_PACKAGE(deal.II 9.2.0 REQUIRED diff --git a/applications/anisotropyFacet/CMakeLists.txt b/applications/anisotropyFacet/CMakeLists.txt index 39b8e6bd3..f3773585b 100644 --- a/applications/anisotropyFacet/CMakeLists.txt +++ b/applications/anisotropyFacet/CMakeLists.txt @@ -2,7 +2,7 @@ # CMake script for the PRISMS-PF applications: ## -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12) +CMAKE_MINIMUM_REQUIRED(VERSION 3.1.0) # Find deal.II installation FIND_PACKAGE(deal.II 9.2.0 REQUIRED diff --git a/applications/cahnHilliard/CMakeLists.txt b/applications/cahnHilliard/CMakeLists.txt index 39b8e6bd3..f3773585b 100644 --- a/applications/cahnHilliard/CMakeLists.txt +++ b/applications/cahnHilliard/CMakeLists.txt @@ -2,7 +2,7 @@ # CMake script for the PRISMS-PF applications: ## -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12) +CMAKE_MINIMUM_REQUIRED(VERSION 3.1.0) # Find deal.II installation FIND_PACKAGE(deal.II 9.2.0 REQUIRED diff --git a/applications/corrosion/CMakeLists.txt b/applications/corrosion/CMakeLists.txt index 39b8e6bd3..f3773585b 100644 --- a/applications/corrosion/CMakeLists.txt +++ b/applications/corrosion/CMakeLists.txt @@ -2,7 +2,7 @@ # CMake script for the PRISMS-PF applications: ## -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12) +CMAKE_MINIMUM_REQUIRED(VERSION 3.1.0) # Find deal.II installation FIND_PACKAGE(deal.II 9.2.0 REQUIRED diff --git a/applications/corrosion_microgalvanic/CMakeLists.txt b/applications/corrosion_microgalvanic/CMakeLists.txt index 39b8e6bd3..f3773585b 100644 --- a/applications/corrosion_microgalvanic/CMakeLists.txt +++ b/applications/corrosion_microgalvanic/CMakeLists.txt @@ -2,7 +2,7 @@ # CMake script for the PRISMS-PF applications: ## -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12) +CMAKE_MINIMUM_REQUIRED(VERSION 3.1.0) # Find deal.II installation FIND_PACKAGE(deal.II 9.2.0 REQUIRED diff --git a/applications/coupledCahnHilliardAllenCahn/CMakeLists.txt b/applications/coupledCahnHilliardAllenCahn/CMakeLists.txt index 39b8e6bd3..f3773585b 100644 --- a/applications/coupledCahnHilliardAllenCahn/CMakeLists.txt +++ b/applications/coupledCahnHilliardAllenCahn/CMakeLists.txt @@ -2,7 +2,7 @@ # CMake script for the PRISMS-PF applications: ## -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12) +CMAKE_MINIMUM_REQUIRED(VERSION 3.1.0) # Find deal.II installation FIND_PACKAGE(deal.II 9.2.0 REQUIRED diff --git a/applications/dendriticSolidification/CMakeLists.txt b/applications/dendriticSolidification/CMakeLists.txt index 39b8e6bd3..f3773585b 100644 --- a/applications/dendriticSolidification/CMakeLists.txt +++ b/applications/dendriticSolidification/CMakeLists.txt @@ -2,7 +2,7 @@ # CMake script for the PRISMS-PF applications: ## -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12) +CMAKE_MINIMUM_REQUIRED(VERSION 3.1.0) # Find deal.II installation FIND_PACKAGE(deal.II 9.2.0 REQUIRED diff --git a/applications/eshelbyInclusion/CMakeLists.txt b/applications/eshelbyInclusion/CMakeLists.txt index 39b8e6bd3..f3773585b 100644 --- a/applications/eshelbyInclusion/CMakeLists.txt +++ b/applications/eshelbyInclusion/CMakeLists.txt @@ -2,7 +2,7 @@ # CMake script for the PRISMS-PF applications: ## -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12) +CMAKE_MINIMUM_REQUIRED(VERSION 3.1.0) # Find deal.II installation FIND_PACKAGE(deal.II 9.2.0 REQUIRED diff --git a/applications/fickianDiffusion/CMakeLists.txt b/applications/fickianDiffusion/CMakeLists.txt index 39b8e6bd3..f3773585b 100644 --- a/applications/fickianDiffusion/CMakeLists.txt +++ b/applications/fickianDiffusion/CMakeLists.txt @@ -2,7 +2,7 @@ # CMake script for the PRISMS-PF applications: ## -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12) +CMAKE_MINIMUM_REQUIRED(VERSION 3.1.0) # Find deal.II installation FIND_PACKAGE(deal.II 9.2.0 REQUIRED diff --git a/applications/grainGrowth/CMakeLists.txt b/applications/grainGrowth/CMakeLists.txt index 39b8e6bd3..f3773585b 100644 --- a/applications/grainGrowth/CMakeLists.txt +++ b/applications/grainGrowth/CMakeLists.txt @@ -2,7 +2,7 @@ # CMake script for the PRISMS-PF applications: ## -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12) +CMAKE_MINIMUM_REQUIRED(VERSION 3.1.0) # Find deal.II installation FIND_PACKAGE(deal.II 9.2.0 REQUIRED diff --git a/applications/grainGrowth/equations.cc b/applications/grainGrowth/equations.cc index 0049614c6..e3fdea53d 100644 --- a/applications/grainGrowth/equations.cc +++ b/applications/grainGrowth/equations.cc @@ -48,8 +48,9 @@ variableAttributeLoader::loadVariableAttributes() template void customPDE::explicitEquationRHS( - variableContainer> &variable_list, - dealii::Point> q_point_loc) const + [[maybe_unused]] variableContainer> + &variable_list, + [[maybe_unused]] dealii::Point> q_point_loc) const { // --- Getting the values and derivatives of the model variables --- @@ -111,8 +112,9 @@ customPDE::explicitEquationRHS( template void customPDE::nonExplicitEquationRHS( - variableContainer> &variable_list, - dealii::Point> q_point_loc) const + [[maybe_unused]] variableContainer> + &variable_list, + [[maybe_unused]] dealii::Point> q_point_loc) const {} // ============================================================================================= @@ -133,6 +135,7 @@ customPDE::nonExplicitEquationRHS( template void customPDE::equationLHS( - variableContainer> &variable_list, - dealii::Point> q_point_loc) const + [[maybe_unused]] variableContainer> + &variable_list, + [[maybe_unused]] dealii::Point> q_point_loc) const {} diff --git a/applications/grainGrowth/postprocess.cc b/applications/grainGrowth/postprocess.cc index f0ee32c00..c9f177de4 100644 --- a/applications/grainGrowth/postprocess.cc +++ b/applications/grainGrowth/postprocess.cc @@ -45,9 +45,12 @@ variableAttributeLoader::loadPostProcessorVariableAttributes() template void customPDE::postProcessedFields( - const variableContainer> &variable_list, - variableContainer> &pp_variable_list, - const dealii::Point> q_point_loc) const + [[maybe_unused]] const variableContainer> + &variable_list, + [[maybe_unused]] variableContainer> + &pp_variable_list, + [[maybe_unused]] const dealii::Point> q_point_loc) + const { // --- Getting the values and derivatives of the model variables --- diff --git a/applications/grainGrowth_dream3d/CMakeLists.txt b/applications/grainGrowth_dream3d/CMakeLists.txt index 39b8e6bd3..f3773585b 100644 --- a/applications/grainGrowth_dream3d/CMakeLists.txt +++ b/applications/grainGrowth_dream3d/CMakeLists.txt @@ -2,7 +2,7 @@ # CMake script for the PRISMS-PF applications: ## -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12) +CMAKE_MINIMUM_REQUIRED(VERSION 3.1.0) # Find deal.II installation FIND_PACKAGE(deal.II 9.2.0 REQUIRED diff --git a/applications/mechanics/CMakeLists.txt b/applications/mechanics/CMakeLists.txt index 39b8e6bd3..f3773585b 100644 --- a/applications/mechanics/CMakeLists.txt +++ b/applications/mechanics/CMakeLists.txt @@ -2,7 +2,7 @@ # CMake script for the PRISMS-PF applications: ## -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12) +CMAKE_MINIMUM_REQUIRED(VERSION 3.1.0) # Find deal.II installation FIND_PACKAGE(deal.II 9.2.0 REQUIRED diff --git a/applications/nucleationModel/CMakeLists.txt b/applications/nucleationModel/CMakeLists.txt index 39b8e6bd3..f3773585b 100644 --- a/applications/nucleationModel/CMakeLists.txt +++ b/applications/nucleationModel/CMakeLists.txt @@ -2,7 +2,7 @@ # CMake script for the PRISMS-PF applications: ## -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12) +CMAKE_MINIMUM_REQUIRED(VERSION 3.1.0) # Find deal.II installation FIND_PACKAGE(deal.II 9.2.0 REQUIRED diff --git a/applications/nucleationModel_preferential/CMakeLists.txt b/applications/nucleationModel_preferential/CMakeLists.txt index 39b8e6bd3..f3773585b 100644 --- a/applications/nucleationModel_preferential/CMakeLists.txt +++ b/applications/nucleationModel_preferential/CMakeLists.txt @@ -2,7 +2,7 @@ # CMake script for the PRISMS-PF applications: ## -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12) +CMAKE_MINIMUM_REQUIRED(VERSION 3.1.0) # Find deal.II installation FIND_PACKAGE(deal.II 9.2.0 REQUIRED diff --git a/applications/precipitateEvolution/CMakeLists.txt b/applications/precipitateEvolution/CMakeLists.txt index 39b8e6bd3..f3773585b 100644 --- a/applications/precipitateEvolution/CMakeLists.txt +++ b/applications/precipitateEvolution/CMakeLists.txt @@ -2,7 +2,7 @@ # CMake script for the PRISMS-PF applications: ## -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12) +CMAKE_MINIMUM_REQUIRED(VERSION 3.1.0) # Find deal.II installation FIND_PACKAGE(deal.II 9.2.0 REQUIRED diff --git a/applications/precipitateEvolution/equations.cc b/applications/precipitateEvolution/equations.cc index 4fb3bab7d..f532d6075 100644 --- a/applications/precipitateEvolution/equations.cc +++ b/applications/precipitateEvolution/equations.cc @@ -77,8 +77,9 @@ variableAttributeLoader::loadVariableAttributes() template void customPDE::explicitEquationRHS( - variableContainer> &variable_list, - dealii::Point> q_point_loc) const + [[maybe_unused]] variableContainer> + &variable_list, + [[maybe_unused]] dealii::Point> q_point_loc) const { // --- Getting the values and derivatives of the model variables --- @@ -373,8 +374,9 @@ customPDE::explicitEquationRHS( template void customPDE::nonExplicitEquationRHS( - variableContainer> &variable_list, - dealii::Point> q_point_loc) const + [[maybe_unused]] variableContainer> + &variable_list, + [[maybe_unused]] dealii::Point> q_point_loc) const { // --- Getting the values and derivatives of the model variables --- @@ -491,8 +493,9 @@ customPDE::nonExplicitEquationRHS( template void customPDE::equationLHS( - variableContainer> &variable_list, - dealii::Point> q_point_loc) const + [[maybe_unused]] variableContainer> + &variable_list, + [[maybe_unused]] dealii::Point> q_point_loc) const { // --- Getting the values and derivatives of the model variables --- diff --git a/applications/precipitateEvolution_pfunction/CMakeLists.txt b/applications/precipitateEvolution_pfunction/CMakeLists.txt index 39b8e6bd3..f3773585b 100644 --- a/applications/precipitateEvolution_pfunction/CMakeLists.txt +++ b/applications/precipitateEvolution_pfunction/CMakeLists.txt @@ -2,7 +2,7 @@ # CMake script for the PRISMS-PF applications: ## -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12) +CMAKE_MINIMUM_REQUIRED(VERSION 3.1.0) # Find deal.II installation FIND_PACKAGE(deal.II 9.2.0 REQUIRED diff --git a/applications/spinodalDecomposition/CMakeLists.txt b/applications/spinodalDecomposition/CMakeLists.txt index 39b8e6bd3..f3773585b 100644 --- a/applications/spinodalDecomposition/CMakeLists.txt +++ b/applications/spinodalDecomposition/CMakeLists.txt @@ -2,7 +2,7 @@ # CMake script for the PRISMS-PF applications: ## -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12) +CMAKE_MINIMUM_REQUIRED(VERSION 3.1.0) # Find deal.II installation FIND_PACKAGE(deal.II 9.2.0 REQUIRED diff --git a/applications/steadyStateAllenCahn/CMakeLists.txt b/applications/steadyStateAllenCahn/CMakeLists.txt index 39b8e6bd3..f3773585b 100644 --- a/applications/steadyStateAllenCahn/CMakeLists.txt +++ b/applications/steadyStateAllenCahn/CMakeLists.txt @@ -2,7 +2,7 @@ # CMake script for the PRISMS-PF applications: ## -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12) +CMAKE_MINIMUM_REQUIRED(VERSION 3.1.0) # Find deal.II installation FIND_PACKAGE(deal.II 9.2.0 REQUIRED diff --git a/tests/deprecated_tests/analytic_tests/diffusionAnalyticComparison/CMakeLists.txt b/tests/deprecated_tests/analytic_tests/diffusionAnalyticComparison/CMakeLists.txt deleted file mode 100644 index 0444f179d..000000000 --- a/tests/deprecated_tests/analytic_tests/diffusionAnalyticComparison/CMakeLists.txt +++ /dev/null @@ -1,32 +0,0 @@ -## -# CMake script for the phaseField applications: -## - - -# Set the name of the project and target: -SET(TARGET "main") - -# Declare all source files the target consists of: -SET(TARGET_SRC - ${TARGET}.cc - # You can specify additional files here! - ) - -# Usually, you will not need to modify anything beyond this point... - -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8) - -FIND_PACKAGE(deal.II 8.0 QUIET - HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} - ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" - "*** Could not locate deal.II. ***\n\n" - "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" - "or set an environment variable \"DEAL_II_DIR\" that contains this path." - ) -ENDIF() - -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() diff --git a/tests/deprecated_tests/analytic_tests/diffusionAnalyticComparison/ICs_and_BCs.h b/tests/deprecated_tests/analytic_tests/diffusionAnalyticComparison/ICs_and_BCs.h deleted file mode 100644 index 3875f926a..000000000 --- a/tests/deprecated_tests/analytic_tests/diffusionAnalyticComparison/ICs_and_BCs.h +++ /dev/null @@ -1,96 +0,0 @@ -// initial condition -template -class InitialCondition : public Function -{ -public: - unsigned int index; - Vector values; - - InitialCondition(const unsigned int _index) - : Function(1) - , index(_index) - { - std::srand(Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) + 1); - } - - double - value(const Point &p, const unsigned int component = 0) const - { - double scalar_IC; - // ===================================================================== - // ENTER THE INITIAL CONDITIONS HERE FOR SCALAR FIELDS - // ===================================================================== - // Enter the function describing conditions for the fields at point "p". - // Use "if" statements to set the initial condition for each variable - // according to its variable index. - - scalar_IC = 1.0; - - // ===================================================================== - return scalar_IC; - } -}; - -// initial condition -template -class InitialConditionVec : public Function -{ -public: - unsigned int index; - - // Vector values; - InitialConditionVec(const unsigned int _index) - : Function(dim) - , index(_index) - { - std::srand(Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) + 1); - } - - void - vector_value(const Point &p, Vector &vector_IC) const - { - // ===================================================================== - // ENTER THE INITIAL CONDITIONS HERE FOR VECTOR FIELDS - // ===================================================================== - // Enter the function describing conditions for the fields at point "p". - // Use "if" statements to set the initial condition for each variable - // according to its variable index. - - // ===================================================================== - } -}; - -// Sets the BCs for the problem variables -// "inputBCs" should be called for each component of each variable and should be -// in numerical order Four input arguments set the same BC on the entire -// boundary Two plus two times the number of dimensions inputs sets separate BCs -// on each face of the domain Inputs to "inputBCs": First input: variable number -// Second input: component number -// Third input: BC type (options are "ZERO_DERIVATIVE" and "DIRICHLET") -// Fourth input: BC value (ignored unless the BC type is "DIRICHLET") -// Odd inputs after the third: BC type -// Even inputs after the third: BC value -// Face numbering: starts at zero with the minimum of the first direction, one -// for the maximum of the first direction -// two for the minimum of the second direction, etc. -template -void -generalizedProblem::setBCs() -{ - // ===================================================================== - // ENTER THE BOUNDARY CONDITIONS HERE - // ===================================================================== - - inputBCs(0, - 0, - "DIRICHLET", - 0.0, - "ZERO_DERVIVATIVE", - 0.0, - "ZERO_DERVIVATIVE", - 0, - "ZERO_DERVIVATIVE", - 0); - - // ===================================================================== -} diff --git a/tests/deprecated_tests/analytic_tests/diffusionAnalyticComparison/main.cc b/tests/deprecated_tests/analytic_tests/diffusionAnalyticComparison/main.cc deleted file mode 100644 index 82ace544a..000000000 --- a/tests/deprecated_tests/analytic_tests/diffusionAnalyticComparison/main.cc +++ /dev/null @@ -1,53 +0,0 @@ -// Coupled Cahn-Hilliard, Allen-Cahn and Mechanics problem -// general headers -#include "../../../include/dealIIheaders.h" - -// Coupled Cahn-Hilliard+Allen-Cahn+Mechanics problem headers -#include "ICs_and_BCs.h" -#include "parameters.h" -#include "residuals.h" - -#include "../../../src/models/coupled/generalized_model.h" -#include "../../../src/models/coupled/generalized_model_functions.h" - -// main -int -main(int argc, char **argv) -{ - Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, - argv, - numbers::invalid_unsigned_int); - try - { - deallog.depth_console(0); - generalizedProblem problem; - - problem.setBCs(); - problem.buildFields(); - problem.init(); - problem.solve(); - } - catch (std::exception &exc) - { - std::cerr << std::endl - << std::endl - << "----------------------------------------------------" << std::endl; - std::cerr << "Exception on processing: " << std::endl - << exc.what() << std::endl - << "Aborting!" << std::endl - << "----------------------------------------------------" << std::endl; - return 1; - } - catch (...) - { - std::cerr << std::endl - << std::endl - << "----------------------------------------------------" << std::endl; - std::cerr << "Unknown exception!" << std::endl - << "Aborting!" << std::endl - << "----------------------------------------------------" << std::endl; - return 1; - } - - return 0; -} diff --git a/tests/deprecated_tests/analytic_tests/diffusionAnalyticComparison/parameters.h b/tests/deprecated_tests/analytic_tests/diffusionAnalyticComparison/parameters.h deleted file mode 100644 index 38f5ad1f2..000000000 --- a/tests/deprecated_tests/analytic_tests/diffusionAnalyticComparison/parameters.h +++ /dev/null @@ -1,36 +0,0 @@ -// Parameter list for the Fickian diffusion problem - -// Define problem dimensions -#define problemDIM 2 -#define spanX 10.0 -#define spanY 1.0 -#define spanZ 10.0 - -// Define mesh parameters -#define subdivisionsX 500 -#define subdivisionsY 1 -#define subdivisionsZ 1 -#define refineFactor 0 -#define finiteElementDegree 1 - -// define number of fields in the problem -// c -#define numFields 1 - -// define time step parameters -#define timeStep 1.0e-4 -#define timeFinal 100.0 -#define timeIncrements 10000 - -// define results output parameters -#define writeOutput true - -// Type of spacing between outputs ("EQUAL_SPACING", "LOG_SPACING", or -// "N_PER_DECADE") -#define outputCondition "EQUAL_SPACING" - -// Number of times the program outputs the fields (total number for -// "EQUAL_SPACING" and "LOG_SPACING", number per decade for "N_PER_DECADE") -#define numOutputs 10 - -#define calcEnergy false diff --git a/tests/deprecated_tests/analytic_tests/diffusionAnalyticComparison/residuals.h b/tests/deprecated_tests/analytic_tests/diffusionAnalyticComparison/residuals.h deleted file mode 100644 index 751cba19d..000000000 --- a/tests/deprecated_tests/analytic_tests/diffusionAnalyticComparison/residuals.h +++ /dev/null @@ -1,74 +0,0 @@ -// Definition of the variables in the model -#define num_var 1 -#define variable_name \ - { \ - "c" \ - } -#define variable_type \ - { \ - "SCALAR" \ - } -#define variable_eq_type \ - { \ - "PARABOLIC" \ - } -#define need_val \ - { \ - true \ - } -#define need_grad \ - { \ - true \ - } -#define need_hess \ - { \ - false \ - } -#define need_val_residual \ - { \ - true \ - } -#define need_grad_residual \ - { \ - true \ - } - -// define Fickian diffusion parameters -#define DcV 1.0 - -// define required residuals -#define rcV (c) -#define rcxV (constV(-DcV * timeStep) * cx) - -// --------------------------------------------- - -template -void -generalizedProblem::residualRHS( - const std::vector> &modelVariablesList, - std::vector> &modelResidualsList, - dealii::Point> q_point_loc) const -{ - // c - scalarvalueType c = modelVariablesList[0].scalarValue; - scalargradType cx = modelVariablesList[0].scalarGrad; - - modelResidualsList[0].scalarValueResidual = rcV; - modelResidualsList[0].scalarGradResidual = rcxV; -} - -template -void -generalizedProblem::residualLHS( - const std::vector> &modelVarList, - modelResidual &modelRes, - dealii::Point> q_point_loc) const -{} - -template -void -generalizedProblem::energyDensity( - const std::vector> &modelVarList, - const dealii::VectorizedArray &JxW_value, - dealii::Point> q_point_loc) -{} diff --git a/tests/deprecated_tests/analytic_tests/diffusionAnalyticResult/CMakeLists.txt b/tests/deprecated_tests/analytic_tests/diffusionAnalyticResult/CMakeLists.txt deleted file mode 100644 index 0444f179d..000000000 --- a/tests/deprecated_tests/analytic_tests/diffusionAnalyticResult/CMakeLists.txt +++ /dev/null @@ -1,32 +0,0 @@ -## -# CMake script for the phaseField applications: -## - - -# Set the name of the project and target: -SET(TARGET "main") - -# Declare all source files the target consists of: -SET(TARGET_SRC - ${TARGET}.cc - # You can specify additional files here! - ) - -# Usually, you will not need to modify anything beyond this point... - -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8) - -FIND_PACKAGE(deal.II 8.0 QUIET - HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} - ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" - "*** Could not locate deal.II. ***\n\n" - "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" - "or set an environment variable \"DEAL_II_DIR\" that contains this path." - ) -ENDIF() - -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() diff --git a/tests/deprecated_tests/analytic_tests/diffusionAnalyticResult/ICs_and_BCs.h b/tests/deprecated_tests/analytic_tests/diffusionAnalyticResult/ICs_and_BCs.h deleted file mode 100644 index 2cc7a4ec0..000000000 --- a/tests/deprecated_tests/analytic_tests/diffusionAnalyticResult/ICs_and_BCs.h +++ /dev/null @@ -1,97 +0,0 @@ -// initial condition -template -class InitialCondition : public Function -{ -public: - unsigned int index; - Vector values; - - InitialCondition(const unsigned int _index) - : Function(1) - , index(_index) - { - std::srand(Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) + 1); - } - - double - value(const Point &p, const unsigned int component = 0) const - { - double scalar_IC; - // ===================================================================== - // ENTER THE INITIAL CONDITIONS HERE FOR SCALAR FIELDS - // ===================================================================== - // Enter the function describing conditions for the fields at point "p". - // Use "if" statements to set the initial condition for each variable - // according to its variable index. - - double desired_time = 1.0; - scalar_IC = std::erf(p[0] / std::sqrt(4.0 * DcV * desired_time)); - - // ===================================================================== - return scalar_IC; - } -}; - -// initial condition -template -class InitialConditionVec : public Function -{ -public: - unsigned int index; - - // Vector values; - InitialConditionVec(const unsigned int _index) - : Function(dim) - , index(_index) - { - std::srand(Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) + 1); - } - - void - vector_value(const Point &p, Vector &vector_IC) const - { - // ===================================================================== - // ENTER THE INITIAL CONDITIONS HERE FOR VECTOR FIELDS - // ===================================================================== - // Enter the function describing conditions for the fields at point "p". - // Use "if" statements to set the initial condition for each variable - // according to its variable index. - - // ===================================================================== - } -}; - -// Sets the BCs for the problem variables -// "inputBCs" should be called for each component of each variable and should be -// in numerical order Four input arguments set the same BC on the entire -// boundary Two plus two times the number of dimensions inputs sets separate BCs -// on each face of the domain Inputs to "inputBCs": First input: variable number -// Second input: component number -// Third input: BC type (options are "ZERO_DERIVATIVE" and "DIRICHLET") -// Fourth input: BC value (ignored unless the BC type is "DIRICHLET") -// Odd inputs after the third: BC type -// Even inputs after the third: BC value -// Face numbering: starts at zero with the minimum of the first direction, one -// for the maximum of the first direction -// two for the minimum of the second direction, etc. -template -void -generalizedProblem::setBCs() -{ - // ===================================================================== - // ENTER THE BOUNDARY CONDITIONS HERE - // ===================================================================== - - inputBCs(0, - 0, - "ZERO_DERVIVATIVE", - 0.0, - "ZERO_DERVIVATIVE", - 0.0, - "ZERO_DERVIVATIVE", - 0, - "ZERO_DERVIVATIVE", - 0); - - // ===================================================================== -} diff --git a/tests/deprecated_tests/analytic_tests/diffusionAnalyticResult/main.cc b/tests/deprecated_tests/analytic_tests/diffusionAnalyticResult/main.cc deleted file mode 100644 index 82ace544a..000000000 --- a/tests/deprecated_tests/analytic_tests/diffusionAnalyticResult/main.cc +++ /dev/null @@ -1,53 +0,0 @@ -// Coupled Cahn-Hilliard, Allen-Cahn and Mechanics problem -// general headers -#include "../../../include/dealIIheaders.h" - -// Coupled Cahn-Hilliard+Allen-Cahn+Mechanics problem headers -#include "ICs_and_BCs.h" -#include "parameters.h" -#include "residuals.h" - -#include "../../../src/models/coupled/generalized_model.h" -#include "../../../src/models/coupled/generalized_model_functions.h" - -// main -int -main(int argc, char **argv) -{ - Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, - argv, - numbers::invalid_unsigned_int); - try - { - deallog.depth_console(0); - generalizedProblem problem; - - problem.setBCs(); - problem.buildFields(); - problem.init(); - problem.solve(); - } - catch (std::exception &exc) - { - std::cerr << std::endl - << std::endl - << "----------------------------------------------------" << std::endl; - std::cerr << "Exception on processing: " << std::endl - << exc.what() << std::endl - << "Aborting!" << std::endl - << "----------------------------------------------------" << std::endl; - return 1; - } - catch (...) - { - std::cerr << std::endl - << std::endl - << "----------------------------------------------------" << std::endl; - std::cerr << "Unknown exception!" << std::endl - << "Aborting!" << std::endl - << "----------------------------------------------------" << std::endl; - return 1; - } - - return 0; -} diff --git a/tests/deprecated_tests/analytic_tests/diffusionAnalyticResult/parameters.h b/tests/deprecated_tests/analytic_tests/diffusionAnalyticResult/parameters.h deleted file mode 100644 index 0806e7762..000000000 --- a/tests/deprecated_tests/analytic_tests/diffusionAnalyticResult/parameters.h +++ /dev/null @@ -1,36 +0,0 @@ -// Parameter list for the Fickian diffusion problem - -// Define problem dimensions -#define problemDIM 2 -#define spanX 10.0 -#define spanY 1.0 -#define spanZ 10.0 - -// Define mesh parameters -#define subdivisionsX 500 -#define subdivisionsY 1 -#define subdivisionsZ 1 -#define refineFactor 0 -#define finiteElementDegree 1 - -// define number of fields in the problem -// c -#define numFields 1 - -// define time step parameters -#define timeStep 1.0e-3 -#define timeFinal 10.0 -#define timeIncrements 0 - -// define results output parameters -#define writeOutput true - -// Type of spacing between outputs ("EQUAL_SPACING", "LOG_SPACING", or -// "N_PER_DECADE") -#define outputCondition "EQUAL_SPACING" - -// Number of times the program outputs the fields (total number for -// "EQUAL_SPACING" and "LOG_SPACING", number per decade for "N_PER_DECADE") -#define numOutputs 1 - -#define calcEnergy false diff --git a/tests/deprecated_tests/analytic_tests/diffusionAnalyticResult/residuals.h b/tests/deprecated_tests/analytic_tests/diffusionAnalyticResult/residuals.h deleted file mode 100644 index 751cba19d..000000000 --- a/tests/deprecated_tests/analytic_tests/diffusionAnalyticResult/residuals.h +++ /dev/null @@ -1,74 +0,0 @@ -// Definition of the variables in the model -#define num_var 1 -#define variable_name \ - { \ - "c" \ - } -#define variable_type \ - { \ - "SCALAR" \ - } -#define variable_eq_type \ - { \ - "PARABOLIC" \ - } -#define need_val \ - { \ - true \ - } -#define need_grad \ - { \ - true \ - } -#define need_hess \ - { \ - false \ - } -#define need_val_residual \ - { \ - true \ - } -#define need_grad_residual \ - { \ - true \ - } - -// define Fickian diffusion parameters -#define DcV 1.0 - -// define required residuals -#define rcV (c) -#define rcxV (constV(-DcV * timeStep) * cx) - -// --------------------------------------------- - -template -void -generalizedProblem::residualRHS( - const std::vector> &modelVariablesList, - std::vector> &modelResidualsList, - dealii::Point> q_point_loc) const -{ - // c - scalarvalueType c = modelVariablesList[0].scalarValue; - scalargradType cx = modelVariablesList[0].scalarGrad; - - modelResidualsList[0].scalarValueResidual = rcV; - modelResidualsList[0].scalarGradResidual = rcxV; -} - -template -void -generalizedProblem::residualLHS( - const std::vector> &modelVarList, - modelResidual &modelRes, - dealii::Point> q_point_loc) const -{} - -template -void -generalizedProblem::energyDensity( - const std::vector> &modelVarList, - const dealii::VectorizedArray &JxW_value, - dealii::Point> q_point_loc) -{} diff --git a/tests/deprecated_tests/analytic_tests/diffusionAnalyticResult/visitlog.py b/tests/deprecated_tests/analytic_tests/diffusionAnalyticResult/visitlog.py deleted file mode 100644 index 2b2be23bf..000000000 --- a/tests/deprecated_tests/analytic_tests/diffusionAnalyticResult/visitlog.py +++ /dev/null @@ -1,5 +0,0 @@ -# Visit 2.7.0 log file -ScriptVersion = "2.7.0" -if ScriptVersion != Version(): - print "This script is for VisIt %s. It may not work with version %s" % (ScriptVersion, Version()) -ShowAllWindows() diff --git a/tests/deprecated_tests/analytic_tests/diffusion_difference.txt b/tests/deprecated_tests/analytic_tests/diffusion_difference.txt deleted file mode 100644 index e721bfdbc..000000000 --- a/tests/deprecated_tests/analytic_tests/diffusion_difference.txt +++ /dev/null @@ -1 +0,0 @@ -1.23977661133e-05 \ No newline at end of file diff --git a/tests/deprecated_tests/analytic_tests/diffusion_test_result.txt b/tests/deprecated_tests/analytic_tests/diffusion_test_result.txt deleted file mode 100644 index bad9d23c4..000000000 --- a/tests/deprecated_tests/analytic_tests/diffusion_test_result.txt +++ /dev/null @@ -1,2 +0,0 @@ -Maximum difference between the calculated and analytic result: -1.23977661133e-05 diff --git a/tests/deprecated_tests/analytic_tests/eshelbyAnalyticComparison/CMakeLists.txt b/tests/deprecated_tests/analytic_tests/eshelbyAnalyticComparison/CMakeLists.txt deleted file mode 100644 index 0444f179d..000000000 --- a/tests/deprecated_tests/analytic_tests/eshelbyAnalyticComparison/CMakeLists.txt +++ /dev/null @@ -1,32 +0,0 @@ -## -# CMake script for the phaseField applications: -## - - -# Set the name of the project and target: -SET(TARGET "main") - -# Declare all source files the target consists of: -SET(TARGET_SRC - ${TARGET}.cc - # You can specify additional files here! - ) - -# Usually, you will not need to modify anything beyond this point... - -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8) - -FIND_PACKAGE(deal.II 8.0 QUIET - HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} - ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" - "*** Could not locate deal.II. ***\n\n" - "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" - "or set an environment variable \"DEAL_II_DIR\" that contains this path." - ) -ENDIF() - -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() diff --git a/tests/deprecated_tests/analytic_tests/eshelbyAnalyticComparison/ICs_and_BCs.h b/tests/deprecated_tests/analytic_tests/eshelbyAnalyticComparison/ICs_and_BCs.h deleted file mode 100644 index a51fcb10d..000000000 --- a/tests/deprecated_tests/analytic_tests/eshelbyAnalyticComparison/ICs_and_BCs.h +++ /dev/null @@ -1,130 +0,0 @@ -// initial condition -template -class InitialCondition : public Function -{ -public: - unsigned int index; - Vector values; - - InitialCondition(const unsigned int _index) - : Function(1) - , index(_index) - { - std::srand(Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) + 1); - } - - double - value(const Point &p, const unsigned int component = 0) const - { - double scalar_IC = 0; - // ===================================================================== - // ENTER THE INITIAL CONDITIONS HERE FOR SCALAR FIELDS - // ===================================================================== - // Enter the function describing conditions for the fields at point "p". - // Use "if" statements to set the initial condition for each variable - // according to its variable index. - - // ===================================================================== - return scalar_IC; - } -}; - -// initial condition -template -class InitialConditionVec : public Function -{ -public: - unsigned int index; - - // Vector values; - InitialConditionVec(const unsigned int _index) - : Function(dim) - , index(_index) - { - std::srand(Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) + 1); - } - - void - vector_value(const Point &p, Vector &vector_IC) const - { - // ===================================================================== - // ENTER THE INITIAL CONDITIONS HERE FOR VECTOR FIELDS - // ===================================================================== - // Enter the function describing conditions for the fields at point "p". - // Use "if" statements to set the initial condition for each variable - // according to its variable index. - - vector_IC(0) = 0.0; - vector_IC(1) = 0.0; - vector_IC(2) = 0.0; - - // ===================================================================== - } -}; - -// Sets the BCs for the problem variables -// "inputBCs" should be called for each component of each variable and should be -// in numerical order Four input arguments set the same BC on the entire -// boundary Two plus two times the number of dimensions inputs sets separate BCs -// on each face of the domain Inputs to "inputBCs": First input: variable number -// Second input: component number -// Third input: BC type (options are "ZERO_DERIVATIVE" and "DIRICHLET") -// Fourth input: BC value (ignored unless the BC type is "DIRICHLET") -// Odd inputs after the third: BC type -// Even inputs after the third: BC value -// Face numbering: starts at zero with the minimum of the first direction, one -// for the maximum of the first direction -// two for the minimum of the second direction, etc. -template -void -generalizedProblem::setBCs() -{ - // ===================================================================== - // ENTER THE BOUNDARY CONDITIONS HERE - // ===================================================================== - - inputBCs(0, - 0, - "DIRICHLET", - 0.0, - "DIRICHLET", - 0.0, - "ZERO_DERIVATIVE", - 0.0, - "DIRICHLET", - 0.0, - "ZERO_DERIVATIVE", - 0.0, - "DIRICHLET", - 0.0); - inputBCs(0, - 1, - "ZERO_DERIVATIVE", - 0.0, - "DIRICHLET", - 0.0, - "DIRICHLET", - 0.0, - "DIRICHLET", - 0.0, - "ZERO_DERIVATIVE", - 0.0, - "DIRICHLET", - 0.0); - inputBCs(0, - 2, - "ZERO_DERIVATIVE", - 0.0, - "DIRICHLET", - 0.0, - "ZERO_DERIVATIVE", - 0.0, - "DIRICHLET", - 0.0, - "DIRICHLET", - 0.0, - "DIRICHLET", - 0.0); - - // ===================================================================== -} diff --git a/tests/deprecated_tests/analytic_tests/eshelbyAnalyticComparison/main.cc b/tests/deprecated_tests/analytic_tests/eshelbyAnalyticComparison/main.cc deleted file mode 100644 index 82ace544a..000000000 --- a/tests/deprecated_tests/analytic_tests/eshelbyAnalyticComparison/main.cc +++ /dev/null @@ -1,53 +0,0 @@ -// Coupled Cahn-Hilliard, Allen-Cahn and Mechanics problem -// general headers -#include "../../../include/dealIIheaders.h" - -// Coupled Cahn-Hilliard+Allen-Cahn+Mechanics problem headers -#include "ICs_and_BCs.h" -#include "parameters.h" -#include "residuals.h" - -#include "../../../src/models/coupled/generalized_model.h" -#include "../../../src/models/coupled/generalized_model_functions.h" - -// main -int -main(int argc, char **argv) -{ - Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, - argv, - numbers::invalid_unsigned_int); - try - { - deallog.depth_console(0); - generalizedProblem problem; - - problem.setBCs(); - problem.buildFields(); - problem.init(); - problem.solve(); - } - catch (std::exception &exc) - { - std::cerr << std::endl - << std::endl - << "----------------------------------------------------" << std::endl; - std::cerr << "Exception on processing: " << std::endl - << exc.what() << std::endl - << "Aborting!" << std::endl - << "----------------------------------------------------" << std::endl; - return 1; - } - catch (...) - { - std::cerr << std::endl - << std::endl - << "----------------------------------------------------" << std::endl; - std::cerr << "Unknown exception!" << std::endl - << "Aborting!" << std::endl - << "----------------------------------------------------" << std::endl; - return 1; - } - - return 0; -} diff --git a/tests/deprecated_tests/analytic_tests/eshelbyAnalyticComparison/parameters.h b/tests/deprecated_tests/analytic_tests/eshelbyAnalyticComparison/parameters.h deleted file mode 100644 index 4853fb087..000000000 --- a/tests/deprecated_tests/analytic_tests/eshelbyAnalyticComparison/parameters.h +++ /dev/null @@ -1,33 +0,0 @@ -// Parameter list for the Beta Prime precipitate evolution problem -//(Coupled Allen Cahn, Cahn Hilliard and Mechanics formulation) -// The free energy expressions in this file are from the reference: -// H. Liu et al, "A simulation study of the shape of beta prime precipitates in -// Mg–Y and Mg–Gd alloys", Acta Materialia, Volume 61, Issue 2, January 2013, -// Pages 453-466. http://dx.doi.org/10.1016/j.actamat.2012.09.044 - -// Define problem dimensions -#define problemDIM 3 -#define spanX 100.0 -#define spanY 100.0 -#define spanZ 100.0 - -// Define mesh parameters -#define subdivisionsX 1 -#define subdivisionsY 1 -#define subdivisionsZ 1 -#define refineFactor 6 -#define finiteElementDegree 1 - -// define number of fields in the problem -#define numFields 3 - -// Define solver paramters -#define solverType SolverCG -#define absTol false -#define solverTolerance 1.0e-10 -#define maxSolverIterations 1000 - -// Define results output parameters -#define writeOutput true - -#define calcEnergy false diff --git a/tests/deprecated_tests/analytic_tests/eshelbyAnalyticComparison/residuals.h b/tests/deprecated_tests/analytic_tests/eshelbyAnalyticComparison/residuals.h deleted file mode 100644 index 16779b9cc..000000000 --- a/tests/deprecated_tests/analytic_tests/eshelbyAnalyticComparison/residuals.h +++ /dev/null @@ -1,241 +0,0 @@ -// Define required residuals -// Definition of the variables in the model -#define num_var 1 -#define variable_name \ - { \ - "u" \ - } -#define variable_type \ - { \ - "VECTOR" \ - } -#define variable_eq_type \ - { \ - "ELLIPTIC" \ - } -#define need_val \ - { \ - false \ - } -#define need_grad \ - { \ - true \ - } -#define need_hess \ - { \ - false \ - } -#define need_val_residual \ - { \ - false \ - } -#define need_grad_residual \ - { \ - true \ - } - -#define need_val_LHS \ - { \ - false \ - } -#define need_grad_LHS \ - { \ - true \ - } -#define need_hess_LHS \ - { \ - false \ - } -#define need_val_residual_LHS \ - { \ - false \ - } -#define need_grad_residual_LHS \ - { \ - true \ - } - -// Define Mechanical properties -// Mechanical symmetry of the material and stiffness parameters -#define MaterialModels \ - { \ - "ISOTROPIC" \ - } -#define MaterialConstants \ - { \ - { \ - 22.5, 0.3 \ - } \ - } - -// --------------------------------------------- - -template -void -generalizedProblem::residualRHS( - const std::vector> &modelVariablesList, - std::vector> &modelResidualsList, - dealii::Point> q_point_loc) const -{ - // u - vectorgradType ux = modelVariablesList[0].vectorGrad; - vectorgradType Rux; - - dealii::VectorizedArray sfts[dim][dim]; - - dealii::VectorizedArray dist, a; - - a = constV(10.0); - - dist = std::sqrt((q_point_loc[0] - constV(0.0)) * (q_point_loc[0] - constV(0.0)) + - (q_point_loc[1] - constV(0.0)) * (q_point_loc[1] - constV(0.0)) + - (q_point_loc[2] - constV(0.0)) * (q_point_loc[2] - constV(0.0))); - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - if (i == j) - { - sfts[i][j] = - 0.01 * (0.5 + 0.5 * (constV(1.0) - std::exp(-20.0 * (dist - a))) / - (constV(1.0) + std::exp(-20.0 * (dist - a)))); - } - else - { - sfts[i][j] = 0.0; - } - } - } - - // compute strain tensor - dealii::VectorizedArray E[dim][dim], S[dim][dim]; - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - E[i][j] = constV(0.5) * (ux[i][j] + ux[j][i]) - sfts[i][j]; - } - } - - // compute stress tensor - computeStress(CIJ_list[0], E, S); - - // compute residual - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - Rux[i][j] = -S[i][j]; - } - } - - modelResidualsList[0].vectorGradResidual = Rux; -} - -template -void -generalizedProblem::residualLHS( - const std::vector> &modelVarList, - modelResidual &modelRes, - dealii::Point> q_point_loc) const -{ - // u - vectorgradType ux = modelVarList[0].vectorGrad; - vectorgradType Rux; - - // compute strain tensor - dealii::VectorizedArray E[dim][dim], S[dim][dim]; - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - E[i][j] = constV(0.5) * (ux[i][j] + ux[j][i]); - } - } - - // compute stress tensor - computeStress(CIJ_list[0], E, S); - - // compute residual - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - Rux[i][j] = S[i][j]; - } - } - - modelRes.vectorGradResidual = Rux; -} - -template -void -generalizedProblem::energyDensity( - const std::vector> &modelVarList, - const dealii::VectorizedArray &JxW_value, - dealii::Point> q_point_loc) -{ - // u - vectorgradType ux = modelVarList[0].vectorGrad; - - dealii::VectorizedArray sfts[dim][dim]; - - dealii::VectorizedArray dist; - - dist = std::sqrt((q_point_loc[0] - constV(0.0)) * (q_point_loc[0] - constV(0.0)) + - (q_point_loc[1] - constV(0.0)) * (q_point_loc[1] - constV(0.0)) + - (q_point_loc[2] - constV(0.0)) * (q_point_loc[2] - constV(0.0))); - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - if (i == j) - { - sfts[i][j] = - 0.01 * - (0.5 + 0.5 * (constV(1.0) - std::exp(-20.0 * (dist - constV(10.0)))) / - (constV(1.0) + std::exp(-20.0 * (dist - constV(10.0))))); - } - else - { - sfts[i][j] = 0.0; - } - } - } - - // compute strain tensor - dealii::VectorizedArray E[dim][dim], S[dim][dim]; - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - E[i][j] = constV(0.5) * (ux[i][j] + ux[j][i]) - sfts[i][j]; - } - } - - // compute stress tensor - computeStress(CIJ_list[0], E, S); - - scalarvalueType f_el = constV(0.0); - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - f_el += constV(0.5) * S[i][j] * E[i][j]; - } - } - - assembler_lock.acquire(); - for (unsigned i = 0; i < f_el.size(); i++) - { - // For some reason, some of the values in this loop - if (f_el[i] > 1.0e-10) - { - this->energy += f_el[i] * JxW_value[i]; - } - } - assembler_lock.release(); -} diff --git a/tests/deprecated_tests/analytic_tests/eshelbyAnalyticResult/CMakeLists.txt b/tests/deprecated_tests/analytic_tests/eshelbyAnalyticResult/CMakeLists.txt deleted file mode 100644 index 0444f179d..000000000 --- a/tests/deprecated_tests/analytic_tests/eshelbyAnalyticResult/CMakeLists.txt +++ /dev/null @@ -1,32 +0,0 @@ -## -# CMake script for the phaseField applications: -## - - -# Set the name of the project and target: -SET(TARGET "main") - -# Declare all source files the target consists of: -SET(TARGET_SRC - ${TARGET}.cc - # You can specify additional files here! - ) - -# Usually, you will not need to modify anything beyond this point... - -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8) - -FIND_PACKAGE(deal.II 8.0 QUIET - HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} - ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" - "*** Could not locate deal.II. ***\n\n" - "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" - "or set an environment variable \"DEAL_II_DIR\" that contains this path." - ) -ENDIF() - -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() diff --git a/tests/deprecated_tests/analytic_tests/eshelbyAnalyticResult/ICs_and_BCs.h b/tests/deprecated_tests/analytic_tests/eshelbyAnalyticResult/ICs_and_BCs.h deleted file mode 100644 index f002c1ca7..000000000 --- a/tests/deprecated_tests/analytic_tests/eshelbyAnalyticResult/ICs_and_BCs.h +++ /dev/null @@ -1,206 +0,0 @@ -// initial condition -template -class InitialCondition : public Function -{ -public: - unsigned int index; - Vector values; - - InitialCondition(const unsigned int _index) - : Function(1) - , index(_index) - { - std::srand(Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) + 1); - } - - double - value(const Point &p, const unsigned int component = 0) const - { - double scalar_IC = 0; - // ===================================================================== - // ENTER THE INITIAL CONDITIONS HERE FOR SCALAR FIELDS - // ===================================================================== - // Enter the function describing conditions for the fields at point "p". - // Use "if" statements to set the initial condition for each variable - // according to its variable index. - - // ===================================================================== - return scalar_IC; - } -}; - -// initial condition -template -class InitialConditionVec : public Function -{ -public: - unsigned int index; - - // Vector values; - InitialConditionVec(const unsigned int _index) - : Function(dim) - , index(_index) - { - std::srand(Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) + 1); - } - - void - vector_value(const Point &p, Vector &vector_IC) const - { - // ===================================================================== - // ENTER THE INITIAL CONDITIONS HERE FOR VECTOR FIELDS - // ===================================================================== - // Enter the function describing conditions for the fields at point "p". - // Use "if" statements to set the initial condition for each variable - // according to its variable index. - - double mater_consts[1][2] = MaterialConstants; - double E = mater_consts[0][0]; - double nu = mater_consts[0][1]; - double e0[dim][dim] = { - {0.01, 0, 0 }, - {0, 0.01, 0 }, - {0, 0, 0.01} - }; - - double a = 10.0; - - Point p_shifted; - p_shifted[0] = p[0]; - p_shifted[1] = p[1]; - p_shifted[2] = p[2]; - - double r = p_shifted.distance(Point(0, 0, 0)); - Tensor<2, dim, double> pT; - Tensor<3, dim, double> S; - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - pT[i][j] = E / (1.0 + nu) * (e0[i][j]); - if (i == j) - { - pT[i][j] = - pT[i][j] + E / (1.0 + nu) * - (nu / (1.0 - 2.0 * nu) * (e0[0][0] + e0[1][1] + e0[2][2])); - } - } - } - - if (r > a) - { - for (unsigned int i = 0; i < dim; i++) - { - double front_coeff = (1 + nu) * a * a * a / (2.0 * (1.0 - nu) * E); - - double term1 = 0; - for (unsigned int k = 0; k < dim; k++) - { - term1 = - term1 + (3.0 * a * a - 5.0 * r * r) / (15.0 * r * r * r * r * r) * - (2.0 * pT[i][k] * p_shifted[k] + pT[k][k] * p_shifted[i]); - } - - double term2 = 0; - for (unsigned int j = 0; j < dim; j++) - { - for (unsigned int k = 0; k < dim; k++) - { - term2 = term2 + (r * r - a * a) / (r * r * r * r * r * r * r) * - pT[j][k] * p_shifted[j] * p_shifted[i] * - p_shifted[k]; - } - } - - double term3 = 0; - for (unsigned int k = 0; k < dim; k++) - { - term3 = - term3 + 4.0 * (1 - nu) / (3.0 * r * r * r) * pT[i][k] * p_shifted[k]; - } - - vector_IC(i) = front_coeff * (term1 + term2 + term3); - } - } - else - { - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - for (unsigned int k = 0; k < dim; k++) - { - for (unsigned int l = 0; l < dim; l++) - { - if ((i == j) & (i == k) & (i == l)) - { - S[j][k][l] = (7.0 - 5.0 * nu) / (15.0 * (1.0 - nu)); - } - else if ((i == j) & (k == l)) - { - S[j][k][l] = (5.0 * nu - 1.0) / (15.0 * (1.0 - nu)); - } - else if ((i == k) & (j == l)) - { - S[j][k][l] = (4 - 5 * nu) / (15 * (1 - nu)); - } - else if ((i == l) & (j == k)) - { - S[j][k][l] = (4 - 5 * nu) / (15 * (1 - nu)); - } - else - { - S[j][k][l] = 0.0; - } - } - } - } - - vector_IC(i) = 0.0; - - for (unsigned int j = 0; j < dim; j++) - { - for (unsigned int k = 0; k < dim; k++) - { - for (unsigned int l = 0; l < dim; l++) - { - vector_IC(i) = - vector_IC(i) + S[j][k][l] * e0[k][l] * p_shifted[j]; - } - } - } - } - } - - // ===================================================================== - } -}; - -// Sets the BCs for the problem variables -// "inputBCs" should be called for each component of each variable and should be -// in numerical order Four input arguments set the same BC on the entire -// boundary Two plus two times the number of dimensions inputs sets separate BCs -// on each face of the domain Inputs to "inputBCs": First input: variable number -// Second input: component number -// Third input: BC type (options are "ZERO_DERIVATIVE" and "DIRICHLET") -// Fourth input: BC value (ignored unless the BC type is "DIRICHLET") -// Odd inputs after the third: BC type -// Even inputs after the third: BC value -// Face numbering: starts at zero with the minimum of the first direction, one -// for the maximum of the first direction -// two for the minimum of the second direction, etc. -template -void -generalizedProblem::setBCs() -{ - // ===================================================================== - // ENTER THE BOUNDARY CONDITIONS HERE - // ===================================================================== - - inputBCs(4, 0, "ZERO_DERIVATIVE", 0.0); - inputBCs(4, 1, "ZERO_DERIVATIVE", 0.0); - inputBCs(4, 2, "ZERO_DERIVATIVE", 0.0); - - // ===================================================================== -} diff --git a/tests/deprecated_tests/analytic_tests/eshelbyAnalyticResult/main.cc b/tests/deprecated_tests/analytic_tests/eshelbyAnalyticResult/main.cc deleted file mode 100644 index 82ace544a..000000000 --- a/tests/deprecated_tests/analytic_tests/eshelbyAnalyticResult/main.cc +++ /dev/null @@ -1,53 +0,0 @@ -// Coupled Cahn-Hilliard, Allen-Cahn and Mechanics problem -// general headers -#include "../../../include/dealIIheaders.h" - -// Coupled Cahn-Hilliard+Allen-Cahn+Mechanics problem headers -#include "ICs_and_BCs.h" -#include "parameters.h" -#include "residuals.h" - -#include "../../../src/models/coupled/generalized_model.h" -#include "../../../src/models/coupled/generalized_model_functions.h" - -// main -int -main(int argc, char **argv) -{ - Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, - argv, - numbers::invalid_unsigned_int); - try - { - deallog.depth_console(0); - generalizedProblem problem; - - problem.setBCs(); - problem.buildFields(); - problem.init(); - problem.solve(); - } - catch (std::exception &exc) - { - std::cerr << std::endl - << std::endl - << "----------------------------------------------------" << std::endl; - std::cerr << "Exception on processing: " << std::endl - << exc.what() << std::endl - << "Aborting!" << std::endl - << "----------------------------------------------------" << std::endl; - return 1; - } - catch (...) - { - std::cerr << std::endl - << std::endl - << "----------------------------------------------------" << std::endl; - std::cerr << "Unknown exception!" << std::endl - << "Aborting!" << std::endl - << "----------------------------------------------------" << std::endl; - return 1; - } - - return 0; -} diff --git a/tests/deprecated_tests/analytic_tests/eshelbyAnalyticResult/parameters.h b/tests/deprecated_tests/analytic_tests/eshelbyAnalyticResult/parameters.h deleted file mode 100644 index d7362b130..000000000 --- a/tests/deprecated_tests/analytic_tests/eshelbyAnalyticResult/parameters.h +++ /dev/null @@ -1,38 +0,0 @@ -// Parameter list for the Beta Prime precipitate evolution problem -//(Coupled Allen Cahn, Cahn Hilliard and Mechanics formulation) -// The free energy expressions in this file are from the reference: -// H. Liu et al, "A simulation study of the shape of beta prime precipitates in -// Mg–Y and Mg–Gd alloys", Acta Materialia, Volume 61, Issue 2, January 2013, -// Pages 453-466. http://dx.doi.org/10.1016/j.actamat.2012.09.044 - -// Define problem dimensions -#define problemDIM 3 -#define spanX 100.0 -#define spanY 100.0 -#define spanZ 100.0 - -// Define mesh parameters -#define subdivisionsX 1 -#define subdivisionsY 1 -#define subdivisionsZ 1 -#define refineFactor 6 -#define finiteElementDegree 1 - -// define number of fields in the problem -#define numFields 3 - -// Define solver paramters -#define solverType SolverCG -#define relSolverTolerance 1.0e-10 -#define maxSolverIterations 1000 - -// define time step parameters -#define timeStep 1.0e-3 -#define timeFinal 10.0 -#define timeIncrements 0 - -// Define results output parameters -#define writeOutput true -#define skipOutputSteps 10 - -#define calcEnergy false diff --git a/tests/deprecated_tests/analytic_tests/eshelbyAnalyticResult/residuals.h b/tests/deprecated_tests/analytic_tests/eshelbyAnalyticResult/residuals.h deleted file mode 100644 index 9962388c7..000000000 --- a/tests/deprecated_tests/analytic_tests/eshelbyAnalyticResult/residuals.h +++ /dev/null @@ -1,221 +0,0 @@ -// Define required residuals -// Definition of the variables in the model -#define num_var 1 -#define variable_name \ - { \ - "u" \ - } -#define variable_type \ - { \ - "VECTOR" \ - } -#define variable_eq_type \ - { \ - "PARABOLIC" \ - } -#define need_val \ - { \ - false \ - } -#define need_grad \ - { \ - true \ - } -#define need_hess \ - { \ - false \ - } -#define need_val_residual \ - { \ - false \ - } -#define need_grad_residual \ - { \ - true \ - } - -// Define Mechanical properties -// Mechanical symmetry of the material and stiffness parameters -#define MaterialModels \ - { \ - "ISOTROPIC" \ - } -#define MaterialConstants \ - { \ - { \ - 22.5, 0.3 \ - } \ - } - -// --------------------------------------------- - -template -void -generalizedProblem::residualRHS( - const std::vector> &modelVariablesList, - std::vector> &modelResidualsList, - dealii::Point> q_point_loc) const -{ - // u - vectorgradType ux = modelVariablesList[0].vectorGrad; - vectorgradType Rux; - - dealii::VectorizedArray sfts[dim][dim]; - - dealii::VectorizedArray dist; - - dist = std::sqrt( - (q_point_loc[0] - constV(spanX / 2.0)) * (q_point_loc[0] - constV(spanX / 2.0)) + - (q_point_loc[1] - constV(spanY / 2.0)) * (q_point_loc[1] - constV(spanY / 2.0)) + - (q_point_loc[2] - constV(spanY / 2.0)) * (q_point_loc[2] - constV(spanY / 2.0))); - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - if (i == j) - { - sfts[i][j] = - 0.01 * - (0.5 + 0.5 * (constV(1.0) - std::exp(-20.0 * (dist - constV(5.0)))) / - (constV(1.0) + std::exp(-20.0 * (dist - constV(5.0))))); - } - else - { - sfts[i][j] = 0.0; - } - } - } - - // compute strain tensor - dealii::VectorizedArray E[dim][dim], S[dim][dim]; - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - E[i][j] = constV(0.5) * (ux[i][j] + ux[j][i]) - sfts[i][j]; - } - } - - // compute stress tensor - computeStress(CIJ_list[0], E, S); - - // compute residual - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - Rux[i][j] = -S[i][j]; - } - } - - modelResidualsList[0].vectorGradResidual = Rux; -} - -template -void -generalizedProblem::residualLHS( - const std::vector> &modelVarList, - modelResidual &modelRes, - dealii::Point> q_point_loc) const -{ - // u - vectorgradType ux = modelVarList[0].vectorGrad; - vectorgradType Rux; - - // compute strain tensor - dealii::VectorizedArray E[dim][dim], S[dim][dim]; - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - E[i][j] = constV(0.5) * (ux[i][j] + ux[j][i]); - } - } - - // compute stress tensor - computeStress(CIJ_list[0], E, S); - - // compute residual - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - Rux[i][j] = S[i][j]; - } - } - - modelRes.vectorGradResidual = Rux; -} - -template -void -generalizedProblem::energyDensity( - const std::vector> &modelVarList, - const dealii::VectorizedArray &JxW_value, - dealii::Point> q_point_loc) -{ - // u - vectorgradType ux = modelVarList[0].vectorGrad; - - dealii::VectorizedArray sfts[dim][dim]; - - dealii::VectorizedArray dist; - - dist = std::sqrt( - (q_point_loc[0] - constV(spanX / 2.0)) * (q_point_loc[0] - constV(spanX / 2.0)) + - (q_point_loc[1] - constV(spanY / 2.0)) * (q_point_loc[1] - constV(spanY / 2.0)) + - (q_point_loc[2] - constV(spanY / 2.0)) * (q_point_loc[2] - constV(spanY / 2.0))); - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - if (i == j) - { - sfts[i][j] = - 0.01 * - (0.5 + 0.5 * (constV(1.0) - std::exp(-20.0 * (dist - constV(10.0)))) / - (constV(1.0) + std::exp(-20.0 * (dist - constV(10.0))))); - } - else - { - sfts[i][j] = 0.0; - } - } - } - - // compute strain tensor - dealii::VectorizedArray E[dim][dim], S[dim][dim]; - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - E[i][j] = constV(0.5) * (ux[i][j] + ux[j][i]) - sfts[i][j]; - } - } - - // compute stress tensor - computeStress(CIJ_list[0], E, S); - - scalarvalueType f_el = constV(0.0); - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - f_el += constV(0.5) * S[i][j] * E[i][j]; - } - } - - assembler_lock.acquire(); - for (unsigned i = 0; i < f_el.size(); i++) - { - // For some reason, some of the values in this loop - if (f_el[i] > 1.0e-10) - { - this->energy += f_el[i] * JxW_value[i]; - } - } - assembler_lock.release(); -} diff --git a/tests/deprecated_tests/analytic_tests/eshelby_difference.txt b/tests/deprecated_tests/analytic_tests/eshelby_difference.txt deleted file mode 100644 index 51874705a..000000000 --- a/tests/deprecated_tests/analytic_tests/eshelby_difference.txt +++ /dev/null @@ -1 +0,0 @@ -0.00426410918517 \ No newline at end of file diff --git a/tests/deprecated_tests/analytic_tests/eshelby_test_result.txt b/tests/deprecated_tests/analytic_tests/eshelby_test_result.txt deleted file mode 100644 index 80b3def4d..000000000 --- a/tests/deprecated_tests/analytic_tests/eshelby_test_result.txt +++ /dev/null @@ -1,2 +0,0 @@ -Maximum difference between the calculated and analytic result: -0.00426410918517 diff --git a/tests/deprecated_tests/analytic_tests/getDiff_diffusion.py b/tests/deprecated_tests/analytic_tests/getDiff_diffusion.py deleted file mode 100644 index cc3d1d810..000000000 --- a/tests/deprecated_tests/analytic_tests/getDiff_diffusion.py +++ /dev/null @@ -1,61 +0,0 @@ -import sys - -variable_1 = 'c' -variable_2 = 'c' - -output_num_1 = "10000" -output_num_2 = "0" - -use_mesh_1 = True -apply_3slice = False -apply_box_crop = False - -directory_1 = "diffusionAnalyticComparison/solution-"+output_num_1+".pvtu" -directory_2 = "diffusionAnalyticResult/solution-"+output_num_2+".pvtu" - -if use_mesh_1 == True: - OpenDatabase(directory_1) - DefineScalarExpression("diff","("+variable_1+"-pos_cmfe(<"+directory_2+":"+variable_2+">, mesh,0))") -else: - OpenDatabase(directory_2) - DefineScalarExpression("diff","("+variable_2+"-pos_cmfe(<"+directory_1+":"+variable_1+">, mesh,0))") - -#AddPlot("Contour","diff") -AddPlot("Pseudocolor","diff") - -PseudocolorAtts = PseudocolorAttributes() -PseudocolorAtts.limitsMode = PseudocolorAtts.CurrentPlot -SetPlotOptions(PseudocolorAtts) - -if apply_box_crop == True: - AddOperator("Box", 1) - BoxAtts = BoxAttributes() - BoxAtts.amount = BoxAtts.Some # Some, All - BoxAtts.minx = 2.0 - BoxAtts.maxx = 30.0 - BoxAtts.miny = 2.0 - BoxAtts.maxy = 30.0 - BoxAtts.minz = 2.0 - BoxAtts.maxz = 30.0 - BoxAtts.inverse = 0 - SetOperatorOptions(BoxAtts, 1) - -if apply_3slice == True: - AddOperator("ThreeSlice") - slice_atts = ThreeSliceAttributes() - slice_atts.x = 16 - slice_atts.y = 16 - slice_atts.z = 16 - SetOperatorOptions(slice_atts) - -DrawPlots() - -Query("MinMax", use_actual_data=1) -min_max_val = GetQueryOutputValue() -error = max(abs(min_max_val[0]),abs(min_max_val[1])) - -text_file = open("diffusion_difference.txt","w") -text_file.write(str(error)) -text_file.close() - -sys.exit() diff --git a/tests/deprecated_tests/analytic_tests/getDiff_eshelby.py b/tests/deprecated_tests/analytic_tests/getDiff_eshelby.py deleted file mode 100644 index 4460cbd66..000000000 --- a/tests/deprecated_tests/analytic_tests/getDiff_eshelby.py +++ /dev/null @@ -1,61 +0,0 @@ -import sys - -variable_1 = 'u_magnitude' -variable_2 = 'u_magnitude' - -output_num_1 = "0" -output_num_2 = "0" - -use_mesh_1 = True -apply_3slice = False -apply_box_crop = False - -directory_1 = "eshelbyAnalyticComparison/solution-"+output_num_1+".pvtu" -directory_2 = "eshelbyAnalyticResult/solution-"+output_num_2+".pvtu" - -if use_mesh_1 == True: - OpenDatabase(directory_1) - DefineScalarExpression("diff","("+variable_1+"-pos_cmfe(<"+directory_2+":"+variable_2+">, mesh,0))") -else: - OpenDatabase(directory_2) - DefineScalarExpression("diff","("+variable_2+"-pos_cmfe(<"+directory_1+":"+variable_1+">, mesh,0))") - -#AddPlot("Contour","diff") -AddPlot("Pseudocolor","diff") - -PseudocolorAtts = PseudocolorAttributes() -PseudocolorAtts.limitsMode = PseudocolorAtts.CurrentPlot -SetPlotOptions(PseudocolorAtts) - -if apply_box_crop == True: - AddOperator("Box", 1) - BoxAtts = BoxAttributes() - BoxAtts.amount = BoxAtts.Some # Some, All - BoxAtts.minx = 2.0 - BoxAtts.maxx = 30.0 - BoxAtts.miny = 2.0 - BoxAtts.maxy = 30.0 - BoxAtts.minz = 2.0 - BoxAtts.maxz = 30.0 - BoxAtts.inverse = 0 - SetOperatorOptions(BoxAtts, 1) - -if apply_3slice == True: - AddOperator("ThreeSlice") - slice_atts = ThreeSliceAttributes() - slice_atts.x = 16 - slice_atts.y = 16 - slice_atts.z = 16 - SetOperatorOptions(slice_atts) - -DrawPlots() - -Query("MinMax", use_actual_data=1) -min_max_val = GetQueryOutputValue() -error = max(abs(min_max_val[0]),abs(min_max_val[1])) - -text_file = open("eshelby_difference.txt","w") -text_file.write(str(error)) -text_file.close() - -sys.exit() diff --git a/tests/deprecated_tests/analytic_tests/run_analytic_diffusion_test.py b/tests/deprecated_tests/analytic_tests/run_analytic_diffusion_test.py deleted file mode 100644 index 12b548281..000000000 --- a/tests/deprecated_tests/analytic_tests/run_analytic_diffusion_test.py +++ /dev/null @@ -1,58 +0,0 @@ -import subprocess -import shutil -import glob -import math -import os.path -import os - -# ---------------------------------------------------------------------------------------- - -# If files exist from previous tests, delete them -if os.path.exists("simulation_result_diffusion") == True: - shutil.rmtree("simulation_result_diffusion") -if os.path.exists("analytical_result_diffusion") == True: - shutil.rmtree("analytical_result_diffusion") - -# Run the 1D diffusion simulation - -os.chdir("diffusionAnalyticComparison") -subprocess.call(["rm", "CMakeCache.txt"]) -subprocess.call(["cmake", "."]) -subprocess.call(["make", "debug"]) -subprocess.call(["./main"]) - -# Get the analytic result -os.chdir("../diffusionAnalyticResult") -subprocess.call(["rm", "CMakeCache.txt"]) -subprocess.call(["cmake", "."]) -subprocess.call(["make", "debug"]) -subprocess.call(["./main"]) - -# Find the error -os.chdir("..") -subprocess.call(["visit", "-cli","-s","getDiff_diffusion.py"]) - -f = open('diffusion_difference.txt','r') -diff = float(f.read()) -f.close() - -# Output the difference -print "Maximum difference between the calculated and analytic result: \n" -print str(diff), "\n" - -text_file = open("diffusion_test_result.txt","w") -text_file.write("Maximum difference between the calculated and analytic result: \n") -text_file.write(str(diff) + "\n") -text_file.close() - -# Move the files -subprocess.call(["mkdir","simulation_result_diffusion"]) -os.chdir("diffusionAnalyticComparison") -subprocess.call(["cp *vtu ../simulation_result_diffusion/"],shell=True) - -os.chdir("..") -subprocess.call(["mkdir","analytical_result_diffusion"]) -os.chdir("diffusionAnalyticResult") -subprocess.call(["cp *vtu ../analytical_result_diffusion/"],shell=True) -os.chdir("..") - diff --git a/tests/deprecated_tests/analytic_tests/run_analytic_eshelby_test.py b/tests/deprecated_tests/analytic_tests/run_analytic_eshelby_test.py deleted file mode 100644 index a8492b4c2..000000000 --- a/tests/deprecated_tests/analytic_tests/run_analytic_eshelby_test.py +++ /dev/null @@ -1,57 +0,0 @@ -import subprocess -import shutil -import glob -import math -import os.path -import os - -# ---------------------------------------------------------------------------------------- - -# If files exist from previous tests, delete them -if os.path.exists("simulation_result_eshelby") == True: - shutil.rmtree("simulation_result_eshelby") -if os.path.exists("analytical_result_eshelby") == True: - shutil.rmtree("analytical_result_eshelby") - -# Run the 1D diffusion simulation -os.chdir("eshelbyAnalyticComparison") -subprocess.call(["rm", "CMakeCache.txt"]) -subprocess.call(["cmake", "."]) -subprocess.call(["make", "release"]) -subprocess.call(["./main"]) - -# Get the analytic result -os.chdir("../eshelbyAnalyticResult") -subprocess.call(["rm", "CMakeCache.txt"]) -subprocess.call(["cmake", "."]) -subprocess.call(["make", "release"]) -subprocess.call(["./main"]) - -# Find the error for runs 1-3 (as compared to run 4) -os.chdir("..") -subprocess.call(["visit", "-cli","-s","getDiff_eshelby.py"]) - - -f = open('eshelby_difference.txt','r') -diff = float(f.read()) -f.close() - -# Output the difference -print "Maximum difference between the calculated and analytic result: \n" -print str(diff), "\n" - -text_file = open("eshelby_test_result.txt","w") -text_file.write("Maximum difference between the calculated and analytic result: \n") -text_file.write(str(diff) + "\n") -text_file.close() - -# Move the files -subprocess.call(["mkdir","simulation_result_eshelby"]) -os.chdir("eshelbyAnalyticComparison") -subprocess.call(["cp *vtu ../simulation_result_eshelby/"],shell=True) - -os.chdir("..") -subprocess.call(["mkdir","analytical_result_eshelby"]) -os.chdir("eshelbyAnalyticResult") -subprocess.call(["cp *vtu ../analytical_result_eshelby/"],shell=True) -os.chdir("..") diff --git a/tests/deprecated_tests/analytic_tests/visitlog.py b/tests/deprecated_tests/analytic_tests/visitlog.py deleted file mode 100644 index 04801a787..000000000 --- a/tests/deprecated_tests/analytic_tests/visitlog.py +++ /dev/null @@ -1,57 +0,0 @@ -# Visit 2.7.3 log file -ScriptVersion = "2.7.3" -if ScriptVersion != Version(): - print "This script is for VisIt %s. It may not work with version %s" % (ScriptVersion, Version()) -ShowAllWindows() -OpenDatabase("diffusionAnalyticComparison/solution-10000.pvtu", 0) -# The UpdateDBPluginInfo RPC is not supported in the VisIt module so it will not be logged. -DefineScalarExpression("diff", "(c-pos_cmfe(, mesh,0))") -AddPlot("Pseudocolor", "diff", 1, 1) -PseudocolorAtts = PseudocolorAttributes() -PseudocolorAtts.scaling = PseudocolorAtts.Linear # Linear, Log, Skew -PseudocolorAtts.skewFactor = 1 -PseudocolorAtts.limitsMode = PseudocolorAtts.CurrentPlot # OriginalData, CurrentPlot -PseudocolorAtts.minFlag = 0 -PseudocolorAtts.min = 0 -PseudocolorAtts.maxFlag = 0 -PseudocolorAtts.max = 1 -PseudocolorAtts.centering = PseudocolorAtts.Natural # Natural, Nodal, Zonal -PseudocolorAtts.colorTableName = "hot" -PseudocolorAtts.invertColorTable = 0 -PseudocolorAtts.opacityType = PseudocolorAtts.FullyOpaque # ColorTable, FullyOpaque, Constant, Ramp, VariableRange -PseudocolorAtts.opacityVariable = "" -PseudocolorAtts.opacity = 1 -PseudocolorAtts.opacityVarMin = 0 -PseudocolorAtts.opacityVarMax = 1 -PseudocolorAtts.opacityVarMinFlag = 0 -PseudocolorAtts.opacityVarMaxFlag = 0 -PseudocolorAtts.pointSize = 0.05 -PseudocolorAtts.pointType = PseudocolorAtts.Point # Box, Axis, Icosahedron, Octahedron, Tetrahedron, SphereGeometry, Point, Sphere -PseudocolorAtts.pointSizeVarEnabled = 0 -PseudocolorAtts.pointSizeVar = "default" -PseudocolorAtts.pointSizePixels = 2 -PseudocolorAtts.lineType = PseudocolorAtts.Line # Line, Tube, Ribbon -PseudocolorAtts.lineStyle = PseudocolorAtts.SOLID # SOLID, DASH, DOT, DOTDASH -PseudocolorAtts.lineWidth = 0 -PseudocolorAtts.tubeDisplayDensity = 10 -PseudocolorAtts.tubeRadiusSizeType = PseudocolorAtts.FractionOfBBox # Absolute, FractionOfBBox -PseudocolorAtts.tubeRadiusAbsolute = 0.125 -PseudocolorAtts.tubeRadiusBBox = 0.005 -PseudocolorAtts.varyTubeRadius = 0 -PseudocolorAtts.varyTubeRadiusVariable = "" -PseudocolorAtts.varyTubeRadiusFactor = 10 -PseudocolorAtts.endPointType = PseudocolorAtts.None # None, Tails, Heads, Both -PseudocolorAtts.endPointStyle = PseudocolorAtts.Spheres # Spheres, Cones -PseudocolorAtts.endPointRadiusSizeType = PseudocolorAtts.FractionOfBBox # Absolute, FractionOfBBox -PseudocolorAtts.endPointRadiusAbsolute = 1 -PseudocolorAtts.endPointRadiusBBox = 0.005 -PseudocolorAtts.endPointRatio = 2 -PseudocolorAtts.renderSurfaces = 1 -PseudocolorAtts.renderWireframe = 0 -PseudocolorAtts.renderPoints = 0 -PseudocolorAtts.smoothingLevel = 0 -PseudocolorAtts.legendFlag = 1 -PseudocolorAtts.lightingFlag = 1 -SetPlotOptions(PseudocolorAtts) -DrawPlots() -Query("MinMax", use_actual_data=1) diff --git a/tests/deprecated_tests/finite_difference_comparison/AC_speed_comparison/CMakeLists.txt b/tests/deprecated_tests/finite_difference_comparison/AC_speed_comparison/CMakeLists.txt deleted file mode 100644 index 0444f179d..000000000 --- a/tests/deprecated_tests/finite_difference_comparison/AC_speed_comparison/CMakeLists.txt +++ /dev/null @@ -1,32 +0,0 @@ -## -# CMake script for the phaseField applications: -## - - -# Set the name of the project and target: -SET(TARGET "main") - -# Declare all source files the target consists of: -SET(TARGET_SRC - ${TARGET}.cc - # You can specify additional files here! - ) - -# Usually, you will not need to modify anything beyond this point... - -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8) - -FIND_PACKAGE(deal.II 8.0 QUIET - HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} - ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" - "*** Could not locate deal.II. ***\n\n" - "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" - "or set an environment variable \"DEAL_II_DIR\" that contains this path." - ) -ENDIF() - -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() diff --git a/tests/deprecated_tests/finite_difference_comparison/AC_speed_comparison/ICs_and_BCs.h b/tests/deprecated_tests/finite_difference_comparison/AC_speed_comparison/ICs_and_BCs.h deleted file mode 100644 index eda6e1ed6..000000000 --- a/tests/deprecated_tests/finite_difference_comparison/AC_speed_comparison/ICs_and_BCs.h +++ /dev/null @@ -1,120 +0,0 @@ -// initial condition -template -class InitialCondition : public Function -{ -public: - unsigned int index; - Vector values; - - InitialCondition(const unsigned int _index) - : Function(1) - , index(_index) - { - std::srand(Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) + 1); - } - - double - value(const Point &p, const unsigned int component = 0) const - { - double scalar_IC; - // ===================================================================== - // ENTER THE INITIAL CONDITIONS HERE FOR SCALAR FIELDS - // ===================================================================== - // Enter the function describing conditions for the fields at point "p". - // Use "if" statements to set the initial condition for each variable - // according to its variable index. - - // set result equal to the structural order paramter initial condition - double dx = spanX / ((double) subdivisionsX) / std::pow(2.0, refineFactor); - double dy = spanY / ((double) subdivisionsY) / std::pow(2.0, refineFactor); - double dz = spanZ / ((double) subdivisionsZ) / std::pow(2.0, refineFactor); - double r = 0.0; - - double initial_radius = 40.0; - double initial_interface_coeff = 2.0; - -#if problemDIM == 1 - r = p.operator()(0); - return 0.5 * (1.0 - std::tanh((r - spanX / 16.0) / (0.1 * dx))); -#elif problemDIM == 2 - - r = sqrt((p.operator()(0)) * (p.operator()(0)) / x_denom + - (p.operator()(1)) * (p.operator()(1)) / y_denom); - return 0.5 * (1.0 - std::tanh((r - initial_radius) / (initial_interface_coeff))); -// return 0.5*(1.0-std::tanh((r-spanX/16.0)/(3*dx))); -#elif problemDIM == 3 - - // r=p.distance(Point(spanX/2.0,spanY/2.0,spanZ/2.0)); - // return 0.5*(1.0-std::tanh((r-spanX/8.0)/(3*dx))); - - r = sqrt((p.operator()(0) - spanX / 2.0) * (p.operator()(0) - spanX / 2.0) + - (p.operator()(1) - spanY / 2.0) * (p.operator()(1) - spanY / 2.0) * 4.0 + - (p.operator()(2) - spanZ / 2.0) * (p.operator()(2) - spanZ / 2.0)); - return 0.5 * (1.0 - std::tanh((r - initial_radius) / (initial_interface_coeff))); - -// planar interface -// r=sqrt((p.operator()(2)-spanZ/2.0)*(p.operator()(2)-spanZ/2.0)); -// return 0.5*(1.0-std::tanh((r)/(initial_interface_coeff))); -// return 0.5*(1.0-std::tanh((r-initial_radius)/(initial_interface_coeff))); -#endif - return 0.0; - - // ===================================================================== - return scalar_IC; - } -}; - -// initial condition -template -class InitialConditionVec : public Function -{ -public: - unsigned int index; - - // Vector values; - InitialConditionVec(const unsigned int _index) - : Function(dim) - , index(_index) - { - std::srand(Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) + 1); - } - - void - vector_value(const Point &p, Vector &vector_IC) const - { - // ===================================================================== - // ENTER THE INITIAL CONDITIONS HERE FOR VECTOR FIELDS - // ===================================================================== - // Enter the function describing conditions for the fields at point "p". - // Use "if" statements to set the initial condition for each variable - // according to its variable index. - - // ===================================================================== - } -}; - -// Sets the BCs for the problem variables -// "inputBCs" should be called for each component of each variable and should be -// in numerical order Four input arguments set the same BC on the entire -// boundary Two plus two times the number of dimensions inputs sets separate BCs -// on each face of the domain Inputs to "inputBCs": First input: variable number -// Second input: component number -// Third input: BC type (options are "ZERO_DERIVATIVE" and "DIRICHLET") -// Fourth input: BC value (ignored unless the BC type is "DIRICHLET") -// Odd inputs after the third: BC type -// Even inputs after the third: BC value -// Face numbering: starts at zero with the minimum of the first direction, one -// for the maximum of the first direction -// two for the minimum of the second direction, etc. -template -void -generalizedProblem::setBCs() -{ - // ===================================================================== - // ENTER THE BOUNDARY CONDITIONS HERE - // ===================================================================== - - inputBCs(0, 0, "ZERO_DERIVATIVE", 0); - - // ===================================================================== -} diff --git a/tests/deprecated_tests/finite_difference_comparison/AC_speed_comparison/finite_difference_AC/AC_finite_difference.f90 b/tests/deprecated_tests/finite_difference_comparison/AC_speed_comparison/finite_difference_AC/AC_finite_difference.f90 deleted file mode 100644 index 586db993f..000000000 --- a/tests/deprecated_tests/finite_difference_comparison/AC_speed_comparison/finite_difference_AC/AC_finite_difference.f90 +++ /dev/null @@ -1,900 +0,0 @@ -MODULE parameters -IMPLICIT NONE -SAVE - - CHARACTER(LEN=3), PARAMETER :: run_num = '001' - CHARACTER(LEN=0), PARAMETER :: output_path = '' - - !! Grid size - - - REAL(KIND=8), PARAMETER :: domain_size_x = 100.0d0 !! nm - REAL(KIND=8), PARAMETER :: domain_size_y = 100.0d0 !! nm - REAL(KIND=8), PARAMETER :: domain_size_z = 100.0d0 !! nm - - INTEGER, PARAMETER :: xg = 128/2 !128 !224 !128 !184 !127 !181 !241 !181 !121 - INTEGER, PARAMETER :: yg = 128/2 !128 !224 !128 !256 !128 !184 !127 !181 !241 !181 !121 - INTEGER, PARAMETER :: zg = 128/2 !92 !92 !163 !91 !195 !195 !121 !91 !61 - - INTEGER, PARAMETER :: bb = 1 - - REAL(KIND=8), PARAMETER :: dz = domain_size_z/DBLE(zg) !! Grid spacing (nm) - REAL(KIND=8), PARAMETER :: dx = domain_size_x/DBLE(xg) !! Grid spacing (nm) - REAL(KIND=8), PARAMETER :: dy = domain_size_y/DBLE(yg) !! Grid spacing (nm) - - !! The number of subdomains in each direction for MPI - INTEGER, PARAMETER :: num_subdomain_x = 4 !8 !8 !8 !8 !8 !4 !8 !6 - INTEGER, PARAMETER :: num_subdomain_y = 2 !4 !4 !4 !4 !4 !1 !1 - INTEGER, PARAMETER :: num_subdomain_z = 2 !4 !2 !2 !3 !6 !4 - - !! Particle initialization - REAL(KIND=8), PARAMETER :: particle_x = domain_size_x/2.0d0 !75.0d0 !! nm - REAL(KIND=8), PARAMETER :: particle_y = domain_size_y/2.0d0 !75.0d0 !! nm - REAL(KIND=8), PARAMETER :: particle_z = domain_size_z/2.0d0 !! nm - REAL(KIND=8), PARAMETER :: rad = 40.0d0 !! nm - - - !! Phase field constants - - REAL(KIND=8), PARAMETER :: A_alpha = 24.7939d0 - REAL(KIND=8), PARAMETER :: B_alpha = -1.6752d0 - REAL(KIND=8), PARAMETER :: C_alpha = 1.9453d-6 - REAL(KIND=8), PARAMETER :: A_beta = 37.9316d0 - REAL(KIND=8), PARAMETER :: B_beta = -10.7373d0 - REAL(KIND=8), PARAMETER :: C_beta = 0.5401d0 - - REAL(KIND=8), PARAMETER :: L = 1.0d0 - REAL(KIND=8), PARAMETER :: kappa = 4.0d0 - - REAL(KIND=8), PARAMETER :: delta = 2.0d0 !0.215d0 - - REAL(KIND=8), PARAMETER :: pi = ACOS(-1.0d0) - - INTEGER, PARAMETER :: max_iter = 30000 - REAL(KIND=8), PARAMETER :: dt = 1.0d-3 !! seconds - - !! Tags for MPI communication - INTEGER, PARAMETER :: c1Tag=91,c2Tag=92,c3Tag=93,c4Tag=94, pTag=95 - INTEGER, PARAMETER :: r1Tag=101,l1Tag=102,f1Tag=103,b1Tag=104,t1Tag=105,d1Tag=106 - INTEGER, PARAMETER :: r2Tag=111,l2Tag=112,f2Tag=113,b2Tag=114,t2Tag=115,d2Tag=116 - INTEGER, PARAMETER :: Sr1Req=81,Sl1Req=82,Sf1Req=83,Sb1Req=84,St1Req=85,Sd1Req=86 - INTEGER, PARAMETER :: Rr1Req=71,Rl1Req=72,Rf1Req=73,Rb1Req=74,Rt1Req=75,Rd1Req=76 - INTEGER, PARAMETER :: Sr2Req=61,Sl2Req=62,Sf2Req=63,Sb2Req=64,St2Req=65,Sd2Req=66 - INTEGER, PARAMETER :: Rr2Req=51,Rl2Req=52,Rf2Req=53,Rb2Req=54,Rt2Req=55,Rd2Req=56 - -END MODULE parameters - -!! CHAC_finite_difference: This program solves the coupled Cahn-Hilliard-Allen-Cahn system -!! of equations. It was developed for comparison to the PRISMS-PF finite element code to -!! ensure that its performance was competitive with finite difference. -!! -!! Author: Stephen DeWitt (stvdwtt@umich.edu) -!! Date Started: 1/6/2016 -!! -!! ============================================================================= - -PROGRAM CHAC_finite_difference -USE parameters -IMPLICIT NONE - -INCLUDE 'mpif.h' -INTEGER :: len -CHARACTER(MPI_MAX_PROCESSOR_NAME) :: hostname - -INTEGER errcode -INTEGER rank, nsize -INTEGER :: dims(1:3),coord(1:3),left,right,front,back,top,bot,ndims,cartcomm -LOGICAL :: reorder,periodic(1:3) -INTEGER L1, L2, L3, S1, S2, S3, Id1, Id2, Id3, Rm1, Rm2, Rm3 - -CALL outputDomainInfo() - -!! Starting the MPI section of the code - -CALL MPI_INIT (errcode) - -CALL MPI_COMM_RANK (MPI_COMM_WORLD, rank, errcode) -CALL MPI_COMM_SIZE (MPI_COMM_WORLD, nsize, errcode) -CALL MPI_GET_PROCESSOR_NAME(hostname, len, errcode) - -IF (rank .eq. 0) PRINT *, 'number of partitions', num_subdomain_x*num_subdomain_y*num_subdomain_z - -!! Start off by partitioning the domain - -!! Number of dimensions (for the MPI Cartesian communicator) -ndims = 3 - -!! Set the number of partitions in each direction -dims(1) = num_subdomain_x -dims(2) = num_subdomain_y -dims(3) = num_subdomain_z - -periodic(1) = .TRUE. -periodic(2) = .TRUE. -periodic(3) = .FALSE. -reorder = .true. - -!! Create the Cartesian communicator -call MPI_CART_CREATE(MPI_COMM_WORLD,ndims,dims,periodic,reorder,cartcomm,errcode) -!PRINT *, 'rank', rank, 'cartcomm', cartcomm - -!! Calculate the non-ghost-zone length of each partition (L#) and the remaining grid points (Rm#) -L1 = floor(xg/real(num_subdomain_x)) -Rm1 = mod(xg,num_subdomain_x) - -L2 = floor(yg/real(num_subdomain_y)) -Rm2 = mod(yg,num_subdomain_y) - -L3 = floor(zg/real(num_subdomain_z)) -Rm3 = mod(zg,num_subdomain_z) - -!! Get coordinates of each partition using MPI_CART_COORDS -call MPI_CART_COORDS(cartcomm,rank,ndims,coord,errcode) - -!! The index of the partition in all three directions -Id3 = coord(3) -Id2 = coord(2) -Id1 = coord(1) - -!! Defines the 6 neighbor partitions -call MPI_CART_SHIFT(cartcomm,0,1,left,right,errcode) !+/- x shifts are left/right -call MPI_CART_SHIFT(cartcomm,1,1,front,back,errcode) !+/- y shifts are front/back -call MPI_CART_SHIFT(cartcomm,2,1,bot,top,errcode) !+/- z shifts are top/bottom - -!! Find the starting point for each partition with respect to the global array location (S#), also find the length of each partition (L#) -if(Id1 == 0)then ! starting point of domain is set to 1, end point is n1 - S1 = 1-bb - L1=L1+2*bb -elseif(Id1 == num_subdomain_x-1)then - S1 = Id1*L1+1-bb - L1 = L1+2*bb+Rm1 -else - S1 = Id1*L1+1-bb - L1= L1+2*bb -endif -if(Id2 == 0)then ! starting point of domain is set to 1, end point is n1 - S2 = 1-bb - L2= L2+2*bb -elseif(Id2 == num_subdomain_y-1)then - S2 = Id2*L2+1-bb - L2 = L2+2*bb+Rm2 -else - S2 = Id2*L2+1-bb - L2 = L2+2*bb -endif -if(Id3 == 0)then ! starting point of domain is set to 1, end point is n1 - S3 = 1-bb - L3= L3+2*bb -elseif(Id3 == num_subdomain_z-1)then - S3 = Id3*L3+1-bb - L3 = L3+2*bb+Rm3 -else - S3 = Id3*L3+1-bb - L3= L3+2*bb -endif - -CALL main_subroutine(Id1,Id2,Id3,S1,S2,S3,L1,L2,L3,left,right,front,back,top,bot,cartcomm) - -CALL MPI_FINALIZE(errcode) - - -END PROGRAM - -!! =================================================================================== -!! Main subroutine where most of the calculations are done -!! =================================================================================== - -SUBROUTINE main_subroutine(Id1,Id2,Id3,S1,S2,S3,L1,L2,L3,left,right,front,back,top,bot,cartcomm) -USE parameters -IMPLICIT NONE - -INCLUDE 'mpif.h' -INTEGER :: L1, L2, L3, S1, S2, S3, Id1, Id2, Id3, Is1, Is2, Is3, Ie1, Ie2, Ie3, k, iter -INTEGER :: left,right,front,back,top,bot, cartcomm -REAL(KIND=8), DIMENSION(S1:S1+L1-1,S2:S2+L2-1,S3:S3+L3-1) :: eta, x, y, z -REAL(KIND=8) :: time_elapsed, dist_particle -INTEGER :: i,j, out_num, output_crit -INTEGER :: errcode -CHARACTER(len=3) :: counter - -out_num = 0 - -time_elapsed = 0.0d0 - -!! Real grid points inside the subdomain (without ghost cells) -Is1 = S1 + bb -Ie1 = S1 + L1 - 1 - bb -Is2 = S2 + bb -Ie2 = S2 + L2 - 1 - bb -Is3 = S3 + bb -Ie3 = S3 + L3 - 1 - bb - -!! Initialize the fields - -DO k = Is3-1,Ie3+1 -DO j = Is2-1,Ie2+1 -DO i = Is1-1,Ie1+1 - - x(i,j,k) = dx * DBLE(i) -dx/2.0d0 - y(i,j,k) = dy * DBLE(j) -dy/2.0d0 - z(i,j,k) = dz * DBLE(k) -dz/2.0d0 - - !! Distance functions for spherical particles - !dist_particle = SQRT(DBLE((particle_1_x-x(i,j,k))**2)+DBLE((particle_1_y-y(i,j,k))**2)+DBLE((particle_1_z-z(i,j,k))**2)) - - !! Distance functions for ellipsoidal particles (squished in y direction) - dist_particle = SQRT(DBLE((particle_x-x(i,j,k))**2) + DBLE(((particle_y-y(i,j,k))*2.0d0)**2) & - + DBLE( (particle_z-z(i,j,k))**2) ) - - !! Flat interface - !dist_particle = SQRT((particle_z-z(i,j,k))**2) - - !! 3D Sphere - eta(i,j,k) = 0.5d0*(1.0d0 - ( TANH( (dist_particle - rad)/delta ))) - -END DO -END DO -END DO - -!! Apply boundary conditions - -call commuBC(Id1,Id2,Id3,L1,L2,L3,S1,S2,S3,eta,left,right,front,back,top,bot,cartcomm) -CALL external_BCs_Zero_Derivative(eta,.TRUE.,1,Id1,Id2,Id3,L1-2,L2-2,L3-2) -CALL external_BCs_Zero_Derivative(eta,.FALSE.,1,Id1,Id2,Id3,L1-2,L2-2,L3-2) -CALL external_BCs_Zero_Derivative(eta,.TRUE.,2,Id1,Id2,Id3,L1-2,L2-2,L3-2) -CALL external_BCs_Zero_Derivative(eta,.FALSE.,2,Id1,Id2,Id3,L1-2,L2-2,L3-2) -CALL external_BCs_Zero_Derivative(eta,.TRUE.,3,Id1,Id2,Id3,L1-2,L2-2,L3-2) -CALL external_BCs_Zero_Derivative(eta,.FALSE.,3,Id1,Id2,Id3,L1-2,L2-2,L3-2) - -!! Initial Outputs -IF (Id1+Id2+Id3.eq. 0) PRINT *, 'Time step: ', dt -CALL writeLotsFiles(eta,'eta_r',out_num,Is1,Ie1,Is2,Ie2,Is3,Ie3, Id1,Id2,Id3) -CALL writeLotsFiles(x,'xgrid',out_num,Is1,Ie1,Is2,Ie2,Is3,Ie3, Id1,Id2,Id3) -CALL writeLotsFiles(y,'ygrid',out_num,Is1,Ie1,Is2,Ie2,Is3,Ie3, Id1,Id2,Id3) -CALL writeLotsFiles(z,'zgrid',out_num,Is1,Ie1,Is2,Ie2,Is3,Ie3, Id1,Id2,Id3) - - -out_num = out_num + 1 - - -!! ------------------------------------------------------------------------- -!! Iterate through time -!! ------------------------------------------------------------------------- - -DO iter = 1,max_iter - - CALL allenCahn_solver_explicit(eta,S1,S2,S3,L1,L2,L3,Is1,Ie1,Is2,Ie2,Is3,Ie3,Id1,Id2,Id3, & - left,right,front,back,top,bot,cartcomm) - - IF (ANY(ISNAN(eta))) THEN - PRINT *, 'Error: Element in eta is NAN' - STOP - END IF - - time_elapsed = time_elapsed + dt - - !! ------------------------------------------------------------------------- - !! Output files - IF (max_iter <= 10) THEN - output_crit = 0 - ELSE - output_crit = MOD(iter,max_iter) - END IF - - IF (output_crit == 0) THEN - IF (Id1 .eq. 0 .and. Id2 .eq. 0 .and. Id3 .eq. 0) PRINT *, 'Output number ', out_num, ' complete' - - CALL writeLotsFiles(eta,'eta_r',out_num,Is1,Ie1,Is2,Ie2,Is3,Ie3, Id1,Id2,Id3) - - out_num = out_num + 1 - - END IF - -END DO - -IF (Id1+Id2+Id3.eq. 0) PRINT *, 'Total time elapsed: ', max_iter*dt - -END SUBROUTINE - -!! =================================================================================== -!! Explicit Allen-Cahn Solver -!! =================================================================================== - -SUBROUTINE allenCahn_solver_explicit(eta,S1,S2,S3,L1,L2,L3,Is1,Ie1,Is2,Ie2,Is3,Ie3,Id1,Id2,Id3, & - left,right,front,back,top,bot,cartcomm) -USE parameters -IMPLICIT NONE - -INCLUDE 'mpif.h' -INTEGER :: L1, L2, L3, S1, S2, S3, Id1, Id2, Id3, Is1, Is2, Is3, Ie1, Ie2, Ie3 -INTEGER :: left,right,front,back,top,bot, cartcomm -REAL(KIND=8), DIMENSION(S1:S1+L1-1,S2:S2+L2-1,S3:S3+L3-1) :: c, eta, mu, dfdeta, landau_term -REAL(KIND=8), DIMENSION(S1+1:S1+L1-2,S2+1:S2+L2-2,S3+1:S3+L3-2) :: kappa_Lap_eta - -dfdeta = 4.0d0*eta*(eta-1.0d0)*(eta-0.5) - -kappa_Lap_eta(Is1:Ie1,Is2:Ie2,Is3:Ie3) = kappa*( (eta(Is1+1:Ie1+1,Is2:Ie2,Is3:Ie3) - 2.0d0*eta(Is1:Ie1,Is2:Ie2,Is3:Ie3) & - + eta(Is1-1:Ie1-1,Is2:Ie2,Is3:Ie3))/dx**2 & - + (eta(Is1:Ie1,Is2+1:Ie2+1,Is3:Ie3) - 2.0d0*eta(Is1:Ie1,Is2:Ie2,Is3:Ie3) & - + eta(Is1:Ie1,Is2-1:Ie2-1,Is3:Ie3))/dy**2 & - + (eta(Is1:Ie1,Is2:Ie2,Is3+1:Ie3+1) - 2.0d0*eta(Is1:Ie1,Is2:Ie2,Is3:Ie3) & - + eta(Is1:Ie1,Is2:Ie2,Is3-1:Ie3-1))/dz**2 ) - -eta(Is1:Ie1,Is2:Ie2,Is3:Ie3) = eta(Is1:Ie1,Is2:Ie2,Is3:Ie3) & - - dt * L * ( dfdeta(Is1:Ie1,Is2:Ie2,Is3:Ie3) - kappa_Lap_eta) - -call commuBC(Id1,Id2,Id3,L1,L2,L3,S1,S2,S3,eta,left,right,front,back,top,bot,cartcomm) -CALL external_BCs_Zero_Derivative(eta,.TRUE.,1,Id1,Id2,Id3,L1-2,L2-2,L3-2) -CALL external_BCs_Zero_Derivative(eta,.FALSE.,1,Id1,Id2,Id3,L1-2,L2-2,L3-2) -CALL external_BCs_Zero_Derivative(eta,.TRUE.,2,Id1,Id2,Id3,L1-2,L2-2,L3-2) -CALL external_BCs_Zero_Derivative(eta,.FALSE.,2,Id1,Id2,Id3,L1-2,L2-2,L3-2) -CALL external_BCs_Zero_Derivative(eta,.TRUE.,3,Id1,Id2,Id3,L1-2,L2-2,L3-2) -CALL external_BCs_Zero_Derivative(eta,.FALSE.,3,Id1,Id2,Id3,L1-2,L2-2,L3-2) - - -END SUBROUTINE allenCahn_solver_explicit - - -!! =================================================================================== - -SUBROUTINE applyBCs(Id1,Id2,Id3,L1,L2,L3,S1,S2,S3,phi1,U_BC_top,left,right,front,back,top,bot,cartcomm,direction) -use parameters -implicit none -INCLUDE 'mpif.h' - -INTEGER S1, S2, S3, Id1, Id2, Id3,L1,L2,L3 -INTEGER :: left,right,front,back,top,bot,cartcomm !ranks of processors to shift to and cartcomm -INTEGER :: i,j,k, direction -INTEGER :: errcode -REAL(KIND=8) :: phi1(S1:S1+L1-1,S2:S2+L2-1,S3:S3+L3-1), U_BC_top -INTEGER,DIMENSION(MPI_STATUS_SIZE) :: nstatus - -REAL(KIND=8), DIMENSION(1:L2,1:L3) :: Buffer_x1, Buffer_x2, Buffer_x3, Buffer_x4 -REAL(KIND=8), DIMENSION(1:L1,1:L3) :: Buffer_y1, Buffer_y2, Buffer_y3, Buffer_y4 -REAL(KIND=8), DIMENSION(1:L1,1:L2) :: Buffer_z1, Buffer_z2, Buffer_z3, Buffer_z4 -INTEGER,DIMENSION(12) :: req - -!! Communication in n1 direction - -IF ( direction .EQ. 0 .OR. direction .EQ. 1 ) THEN - - ! x-direction - Buffer_x3 = phi1(S1+L1-1-bb,S2:S2+L2-1,S3:S3+L3-1) - Buffer_x2 = phi1(S1+bb,S2:S2+L2-1,S3:S3+L3-1) - - CALL MPI_iSEND(Buffer_x3,L2*L3,MPI_DOUBLE_PRECISION,right,r1Tag,cartcomm,req(1),errcode) - CALL MPI_iRECV(Buffer_x4,L2*L3,MPI_DOUBLE_PRECISION,right,l1Tag,cartcomm,req(2),errcode) - CALL MPI_iSEND(Buffer_x2,L2*L3,MPI_DOUBLE_PRECISION,left ,l1Tag,cartcomm,req(4),errcode) - CALL MPI_iRECV(Buffer_x1,L2*L3,MPI_DOUBLE_PRECISION,left ,r1Tag,cartcomm,req(3),errcode) - call MPI_waitall(4,req(1:4),MPI_STATUS_IGNORE,errcode) - - phi1(S1,S2:S2+L2-1,S3:S3+L3-1) = Buffer_x1 - phi1(S1+L1-1,S2:S2+L2-1,S3:S3+L3-1) = Buffer_x4 - -ENDIF - -!! Communication in n2 direction - -IF ( direction .EQ. 0 .OR. direction .EQ. 2 ) THEN - ! y-direction - Buffer_y3 = phi1(S1:S1+L1-1,S2+L2-1-bb,S3:S3+L3-1) - Buffer_y2 = phi1(S1:S1+L1-1,S2+bb,S3:S3+L3-1) - CALL MPI_iSEND(Buffer_y3,L1*L3,MPI_DOUBLE_PRECISION,back ,b1Tag,cartcomm,req(5),errcode) - CALL MPI_iRECV(Buffer_y4,L1*L3,MPI_DOUBLE_PRECISION,back ,f1Tag,cartcomm,req(6),errcode) - CALL MPI_iSEND(Buffer_y2,L1*L3,MPI_DOUBLE_PRECISION,front,f1Tag,cartcomm,req(8),errcode) - CALL MPI_iRECV(Buffer_y1,L1*L3,MPI_DOUBLE_PRECISION,front,b1Tag,cartcomm,req(7),errcode) - call MPI_waitall(4,req(5:8),MPI_STATUS_IGNORE,errcode) - phi1(S1:S1+L1-1,S2,S3:S3+L3-1) = Buffer_y1 - phi1(S1:S1+L1-1,S2+L2-1,S3:S3+L3-1) = Buffer_y4 - -ENDIF - -!! Communication in n3 direction - -IF ( direction .EQ. 0 .OR. direction .EQ. 3 ) THEN - ! z-direction - Buffer_z3=phi1(S1:S1+L1-1,S2:S2+L2-1,S3+L3-1-bb) - Buffer_z2=phi1(S1:S1+L1-1,S2:S2+L2-1,S3+bb) - IF ( Id3 .NE. num_subdomain_z-1 ) THEN - CALL MPI_iSEND(Buffer_z3,L1*L2,MPI_DOUBLE_PRECISION,top,t1Tag,cartcomm,req(9),errcode) - CALL MPI_iRECV(Buffer_z4,L1*L2,MPI_DOUBLE_PRECISION,top,b1Tag,cartcomm,req(10),errcode) - ELSE - !CALL external_BCs_Dirichlet(phi1,U_BC_top,.TRUE.,3,Id1,Id2,Id3,L1-2,L2-2,L3-2) - Buffer_z4 = U_BC_top - ENDIF - - IF ( Id3 .NE. 0 ) THEN - CALL MPI_iSEND(Buffer_z2,L1*L2,MPI_DOUBLE_PRECISION,bot,b1Tag,cartcomm,req(12),errcode) - CALL MPI_iRECV(Buffer_z1,L1*L2,MPI_DOUBLE_PRECISION,bot,t1Tag,cartcomm,req(11),errcode) - ELSE - !CALL external_BCs_Zero_Derivative(phi1,.FALSE.,3,Id1,Id2,Id3,L1-2,L2-2,L3-2) - Buffer_z1 = phi1(S1:S1+L1-1,S2:S2+L2-1,S3+bb) - ENDIF - - IF ( Id3 .NE. num_subdomain_z-1 ) call MPI_waitall(2,req(9:10),MPI_STATUS_IGNORE,errcode) - IF ( Id3 .NE. 0 ) call MPI_waitall(2,req(11:12),MPI_STATUS_IGNORE,errcode) - phi1(S1:S1+L1-1,S2:S2+L2-1,S3)=Buffer_z1 - phi1(S1:S1+L1-1,S2:S2+L2-1,S3+L3-1)=Buffer_z4 - -ENDIF - -!! External BCs in the z-direction -!CALL external_BCs_Dirichlet(phi1,U_BC_top,.TRUE.,3,Id1,Id2,Id3,L1-2,L2-2,L3-2) -!CALL external_BCs_Zero_Derivative(phi1,.FALSE.,3,Id1,Id2,Id3,L1-2,L2-2,L3-2) - -RETURN -END SUBROUTINE applyBCs - -!! =================================================================================== -!! External BC calculation subroutines -!! =================================================================================== - -SUBROUTINE external_BCs_Dirichlet(array,BC_value,is_top,dimension_num,Id1,Id2,Id3,px,py,pz) -USE parameters -IMPLICIT NONE - -INTEGER :: px, py, pz -REAL(KIND=8), DIMENSION(0:px+1,0:py+1,0:pz+1) :: array -REAL(KIND=8) :: BC_value -INTEGER :: dimension_num,Id1,Id2,Id3 -LOGICAL :: is_top - -SELECT CASE (dimension_num) - -CASE (1) - IF (is_top .eqv. .TRUE.) THEN - IF (Id1 .eq. num_subdomain_x-1) THEN - array(px+1,0:py+1,0:pz+1) = BC_value - END IF - ELSE - IF (Id1 .eq. 0) THEN - array(0,0:py+1,0:pz+1) = BC_value - END IF - END IF - -CASE (2) - IF (is_top .eqv. .TRUE.) THEN - IF (Id2 .eq. num_subdomain_y-1) THEN - array(0:px+1,py+1,0:pz+1) = BC_value - END IF - ELSE - IF (Id2 .eq. 0) THEN - array(0:px+1,0,0:pz+1) = BC_value - END IF - END IF - -CASE (3) - IF (is_top .eqv. .TRUE.) THEN - IF (Id3 .eq. num_subdomain_z-1) THEN - array(0:px+1,0:py+1,pz+1) = BC_value - END IF - ELSE - IF (Id3 .eq. 0) THEN - array(0:px+1,0:py+1,0) = BC_value - END IF - END IF - -END SELECT - -!PRINT *, 'in BC subroutine', array(40, 10, pz+1), array(40, 10, 0), top_val, bottom_val - -END SUBROUTINE external_BCs_Dirichlet - -!! =================================================================================== - -SUBROUTINE external_BCs_Zero_Derivative(array,is_top,dimension_num,Id1,Id2,Id3,px,py,pz) -USE parameters -IMPLICIT NONE - -INTEGER :: px, py, pz -REAL(KIND=8), DIMENSION(0:px+1,0:py+1,0:pz+1) :: array -REAL(KIND=8) :: BC_value -INTEGER :: dimension_num,Id1,Id2,Id3 -LOGICAL :: is_top - -SELECT CASE (dimension_num) - -CASE (1) - IF (is_top .eqv. .TRUE.) THEN - IF (Id1 .eq. num_subdomain_x-1) THEN - array(px+1,0:py+1,0:pz+1) = array(px,0:py+1,0:pz+1) - END IF - ELSE - IF (Id1 .eq. 0) THEN - array(0,0:py+1,0:pz+1) = array(1,0:py+1,0:pz+1) - END IF - END IF - -CASE (2) - IF (is_top .eqv. .TRUE.) THEN - IF (Id2 .eq. num_subdomain_y-1) THEN - array(0:px+1,py+1,0:pz+1) = array(0:px+1,py,0:pz+1) - END IF - ELSE - IF (Id2 .eq. 0) THEN - array(0:px+1,0,0:pz+1) = array(0:px+1,1,0:pz+1) - END IF - END IF - -CASE (3) - IF (is_top .eqv. .TRUE.) THEN - IF (Id3 .eq. num_subdomain_z-1) THEN - array(0:px+1,0:py+1,pz+1) = array(0:px+1,0:py+1,pz) - END IF - ELSE - IF (Id3 .eq. 0) THEN - array(0:px+1,0:py+1,0) = array(0:px+1,0:py+1,1) - END IF - END IF - -END SELECT - -!PRINT *, 'in BC subroutine', array(40, 10, pz+1), array(40, 10, 0), top_val, bottom_val - -END SUBROUTINE external_BCs_Zero_Derivative - -!! =================================================================================== - -SUBROUTINE external_BCs_Neumann(array,derivative,is_top,dimension_num,Id1,Id2,Id3,px,py,pz) -USE parameters -IMPLICIT NONE - -INTEGER :: px, py, pz -REAL(KIND=8), DIMENSION(0:px+1,0:py+1,0:pz+1) :: array -REAL(KIND=8) :: derivative -INTEGER :: dimension_num,Id1,Id2,Id3 -LOGICAL :: is_top - -SELECT CASE (dimension_num) - -CASE (1) - IF (is_top .eqv. .TRUE.) THEN - IF (Id1 .eq. num_subdomain_x-1) THEN - array(px+1,0:py+1,0:pz+1) = array(px,0:py+1,0:pz+1) + derivative - END IF - ELSE - IF (Id1 .eq. 0) THEN - array(0,0:py+1,0:pz+1) = array(1,0:py+1,0:pz+1) - derivative - END IF - END IF - -CASE (2) - IF (is_top .eqv. .TRUE.) THEN - IF (Id2 .eq. num_subdomain_y-1) THEN - array(0:px+1,py+1,0:pz+1) = array(0:px+1,py,0:pz+1) + derivative - END IF - ELSE - IF (Id2 .eq. 0) THEN - array(0:px+1,0,0:pz+1) = array(0:px+1,1,0:pz+1) - derivative - END IF - END IF - -CASE (3) - IF (is_top .eqv. .TRUE.) THEN - IF (Id3 .eq. num_subdomain_z-1) THEN - array(0:px+1,0:py+1,pz+1) = array(0:px+1,0:py+1,pz) + derivative - END IF - ELSE - IF (Id3 .eq. 0) THEN - array(0:px+1,0:py+1,0) = array(0:px+1,0:py+1,1) - derivative - END IF - END IF - -END SELECT - -END SUBROUTINE external_BCs_Neumann - -!! =================================================================================== - -SUBROUTINE external_BCs_Periodic(array,dimension_num,Id1,Id2,Id3,px,py,pz,left,right,front,back,top,bot,cartcomm) -USE parameters -IMPLICIT NONE -INCLUDE 'mpif.h' - -INTEGER :: px, py, pz -REAL(KIND=8), DIMENSION(0:px+1,0:py+1,0:pz+1) :: array -INTEGER :: dimension_num,Id1,Id2,Id3 -INTEGER :: left,right,front,back,top,bot,cartcomm -INTEGER :: errcode -INTEGER,DIMENSION(MPI_STATUS_SIZE) :: nstatus - -SELECT CASE (dimension_num) - -CASE (1) - IF ( num_subdomain_x .eq. 1) THEN - array(0,0:py+1,0:pz+1) = array(px,0:py+1,0:pz+1) - array(px+1,0:py+1,0:pz+1) = array(1,0:py+1,0:pz+1) - ELSE - IF (Id1 .eq. num_subdomain_x-1) & - call MPI_SEND(array(px,0:py+1,0:pz+1),(py+2)*(pz+2),MPI_DOUBLE_PRECISION,right,r1Tag+100,cartcomm,errcode) - - IF (Id1 .eq. 0) & - call MPI_RECV(array(0,0:py+1,0:pz+1),(py+2)*(pz+2),MPI_DOUBLE_PRECISION,left,r1Tag+100,cartcomm,nstatus,errcode) - - IF (Id1 .eq. 0) & - call MPI_SEND(array(1,0:py+1,0:pz+1),(py+2)*(pz+2),MPI_DOUBLE_PRECISION,left,l1Tag+100,cartcomm,errcode) - - IF (Id1 .eq. num_subdomain_x-1) & - call MPI_RECV(array(px+1,0:py+1,0:pz+1),(py+2)*(pz+2),MPI_DOUBLE_PRECISION,right,l1Tag+100,cartcomm,nstatus,errcode) - END IF - -CASE (2) - IF ( num_subdomain_y .eq. 1) THEN - array(0:px+1,0,0:pz+1) = array(0:px+1,py,0:pz+1) - array(0:px+1,py+1,0:pz+1) = array(0:px+1,1,0:pz+1) - ELSE - IF (Id2 .eq. num_subdomain_y-1) THEN - call MPI_SEND(array(0:px+1,py,0:pz+1),(px+2)*(pz+2),MPI_DOUBLE_PRECISION,back,f1Tag+100,cartcomm,errcode) - END IF - - IF (Id2 .eq. 0) THEN - call MPI_RECV(array(0:px+1,0,0:pz+1),(px+2)*(pz+2),MPI_DOUBLE_PRECISION,front,f1Tag+100,cartcomm,nstatus,errcode) - END IF - - IF (Id2 .eq. 0) & - call MPI_SEND(array(0:px+1,1,0:pz+1),(px+2)*(pz+2),MPI_DOUBLE_PRECISION,front,b1Tag+100,cartcomm,errcode) - - IF (Id2 .eq. num_subdomain_y-1) & - call MPI_RECV(array(0:px+1,py+1,0:pz+1),(px+2)*(pz+2),MPI_DOUBLE_PRECISION,back,b1Tag+100,cartcomm,nstatus,errcode) - END IF -CASE (3) - IF ( num_subdomain_z .eq. 1) THEN - array(0:px+1,0:py+1,0) = array(0:px+1,0:py+1,pz) - array(0:px+1,0:py+1,pz+1) = array(0:px+1,0:py+1,1) - ELSE - IF (Id3 .eq. num_subdomain_z-1) & - call MPI_SEND(array(0:px+1,0:py+1,pz),(px+2)*(py+2),MPI_DOUBLE_PRECISION,top,t1Tag+100,cartcomm,errcode) - - IF (Id3 .eq. 0) & - call MPI_RECV(array(0:px+1,0:py+1,0),(px+2)*(py+2),MPI_DOUBLE_PRECISION,bot,t1Tag+100,cartcomm,nstatus,errcode) - - IF (Id3 .eq. 0) & - call MPI_SEND(array(0:px+1,0:py+1,1),(px+2)*(py+2),MPI_DOUBLE_PRECISION,bot,d1Tag+100,cartcomm,errcode) - - IF (Id3 .eq. num_subdomain_z-1) & - call MPI_RECV(array(0:px+1,0:py+1,pz+1),(px+2)*(py+2),MPI_DOUBLE_PRECISION,top,d1Tag+100,cartcomm,nstatus,errcode) - END IF - -END SELECT - -END SUBROUTINE external_BCs_Periodic - -!!=================================================================================== -!! Internal BC Communication Subroutine -!!=================================================================================== - -SUBROUTINE commuBC(Id1,Id2,Id3,L1,L2,L3,S1,S2,S3,phi1,left,right,front,back,top,bot,cartcomm) -use parameters -implicit none -INCLUDE 'mpif.h' - -INTEGER S1, S2, S3, Id1, Id2, Id3,L1,L2,L3 -INTEGER :: left,right,front,back,top,bot,cartcomm !ranks of processors to shift to and cartcomm -INTEGER :: i,j,k -INTEGER :: errcode -REAL(KIND=8) :: phi1(S1:S1+L1-1,S2:S2+L2-1,S3:S3+L3-1) -INTEGER,DIMENSION(MPI_STATUS_SIZE) :: nstatus - -! Interior boundary condition -! communication in n1 direction - -If(Id1 .NE. num_subdomain_x-1) call MPI_SEND(phi1(S1+L1-1-bb,S2:S2+L2-1,S3:S3+L3-1), & - bb*L2*L3,MPI_DOUBLE_PRECISION,right,r1Tag,cartcomm,errcode) !Send real grid - -If(Id1 .NE. 0) call MPI_RECV(phi1(S1,S2:S2+L2-1,S3:S3+L3-1), & - bb*L2*L3,MPI_DOUBLE_PRECISION,left,r1Tag,cartcomm,nstatus,errcode) !receive by ghost grid - -If(Id1 .NE. 0) call MPI_SEND(phi1(S1+bb,S2:S2+L2-1,S3:S3+L3-1), & - bb*L2*L3,MPI_DOUBLE_PRECISION,left,l1Tag,cartcomm,errcode) - -If(Id1 .NE. num_subdomain_x-1) call MPI_RECV(phi1(S1+L1-1,S2:S2+L2-1,S3:S3+L3-1), & - bb*L2*L3,MPI_DOUBLE_PRECISION,right,l1Tag,cartcomm,nstatus,errcode) - -! communication in n2 direction - -If(Id2 .NE. num_subdomain_y-1) call MPI_SEND(phi1(S1:S1+L1-1,S2+L2-1-bb,S3:S3+L3-1), & - L1*bb*L3,MPI_DOUBLE_PRECISION,back,f1Tag,cartcomm,errcode) - -If(Id2 .NE. 0) call MPI_RECV(phi1(S1:S1+L1-1,S2,S3:S3+L3-1), & - L1*bb*L3,MPI_DOUBLE_PRECISION,front,f1Tag,cartcomm,nstatus,errcode) - -If(Id2 .NE. 0) call MPI_SEND(phi1(S1:S1+L1-1,S2+bb,S3:S3+L3-1), & - L1*bb*L3,MPI_DOUBLE_PRECISION,front,b1Tag,cartcomm,errcode) - -If(Id2 .NE. num_subdomain_y-1) call MPI_RECV(phi1(S1:S1+L1-1,S2+L2-1,S3:S3+L3-1), & - L1*bb*L3,MPI_DOUBLE_PRECISION,back,b1Tag,cartcomm,nstatus,errcode) - -! communication in n3 direction - - -If(Id3 .NE. num_subdomain_z-1) call MPI_SEND(phi1(S1:S1+L1-1,S2:S2+L2-1,S3+L3-1-bb), & - L1*L2*bb,MPI_DOUBLE_PRECISION,top,t1Tag,cartcomm,errcode) - -If(Id3 .NE. 0) call MPI_RECV(phi1(S1:S1+L1-1,S2:S2+L2-1,S3), & - L1*L2*bb,MPI_DOUBLE_PRECISION,bot,t1Tag,cartcomm,nstatus,errcode) - -If(Id3 .NE. 0) call MPI_SEND(phi1(S1:S1+L1-1,S2:S2+L2-1,S3+bb), & - L1*L2*bb,MPI_DOUBLE_PRECISION,bot,d1Tag,cartcomm,errcode) - -If(Id3 .NE. num_subdomain_z-1) call MPI_RECV(phi1(S1:S1+L1-1,S2:S2+L2-1,S3+L3-1), & - L1*L2*bb,MPI_DOUBLE_PRECISION,top,d1Tag,cartcomm,nstatus,errcode) - -RETURN -END SUBROUTINE - -!! =================================================================================== -!! Input subroutine -!! =================================================================================== - -!SUBROUTINE loadLotsFiles(arrIn,name_string,Is1,Ie1,Is2,Ie2,Is3,Ie3, Id1,Id2,Id3) -!! Purpose: -!! Write arrIn to an individual file for each core. -!! File has Id1,Id2,Id3 in filename as _XXYYZZ.frt -! -!USE parameters -!IMPLICIT NONE -! -!! Declare variables:--------------------------------------------------------+ -!INTEGER, INTENT(in) :: Is1,Ie1,Is2,Ie2,Is3,Ie3, Id1,Id2,Id3 -!REAL(KIND=8), DIMENSION(Is1-bb:Ie1+bb,Is2-bb:Ie2+bb,Is3-bb:Ie3+bb) :: arrIn ! Array to load -!CHARACTER(LEN=29) :: filename ! Filename of input or output -!CHARACTER(LEN=5) :: tstring, name_string -!CHARACTER(LEN=2) :: Id1string, Id2string, Id3string -!CHARACTER(LEN=3) :: counter -!INTEGER :: status -!INTEGER :: tpStep, i, outFreq -!!---------------------------------------------------------------------------+ -! -!WRITE(counter,'(I3)') 100+load_from_output -! -!write(Id1string,'(i2.2)')Id1 -!write(Id2string,'(i2.2)')Id2 -!write(Id3string,'(i2.2)')Id3 -! -!filename=name_string//load_from_run//'_'//counter(2:3)//'_'//Id1string//Id2string//Id3string//'.frt' -!!PRINT *,'Filename:', filename -!OPEN (FILE=output_path//filename, UNIT=300, STATUS='UNKNOWN', FORM='UNFORMATTED') -!READ (300) arrIn(Is1:Ie1,Is2:Ie2,Is3:Ie3) -!CLOSE (300) -! -!RETURN -! -!END SUBROUTINE loadLotsFiles - - -!! =================================================================================== -!! Output subroutine -!! =================================================================================== - -SUBROUTINE writeLotsFiles(arrIn,name_string,step,Is1,Ie1,Is2,Ie2,Is3,Ie3,Id1,Id2,Id3) -! Purpose: -! Write arrIn to an individual file for each core. -! File has Id1,Id2,Id3 in filename as _XXYYZZ.frt - -USE parameters -IMPLICIT NONE - -! Declare variables:--------------------------------------------------------+ -INTEGER, INTENT(in) :: Is1,Ie1,Is2,Ie2,Is3,Ie3, Id1,Id2,Id3 -REAL(KIND=8), DIMENSION(Is1-bb:Ie1+bb,Is2-bb:Ie2+bb,Is3-bb:Ie3+bb), INTENT(IN) :: arrIn ! Array to write -CHARACTER(LEN=29) :: filename ! Filename of input or output -CHARACTER(LEN=5) :: tstring, name_string -CHARACTER(LEN=2) :: Id1string, Id2string, Id3string -CHARACTER(LEN=3) :: counter -INTEGER, INTENT(in) :: step -INTEGER :: tpStep, i, outFreq -!---------------------------------------------------------------------------+ - -WRITE(counter,'(I3)') 100+step - -write(Id1string,'(i2.2)')Id1 -write(Id2string,'(i2.2)')Id2 -write(Id3string,'(i2.2)')Id3 - -filename=name_string//run_num//'_'//counter(2:3)//'_'//Id1string//Id2string//Id3string//'.frt' -OPEN (FILE=output_path//filename, UNIT=300, STATUS='UNKNOWN', FORM='UNFORMATTED') -WRITE (300) arrIn(Is1:Ie1,Is2:Ie2,Is3:Ie3) -CLOSE (300) - -RETURN - -END SUBROUTINE writeLotsFiles - -!! =================================================================================== - -SUBROUTINE writeLotsFiles2(arrIn,name_string,step,Is1,Ie1,Is2,Ie2,Is3,Ie3,Id1,Id2,Id3) -! Purpose: -! Write arrIn to an individual file for each core. -! File has Id1,Id2,Id3 in filename as _XXYYZZ.frt - -USE parameters -IMPLICIT NONE - -! Declare variables:--------------------------------------------------------+ -INTEGER, INTENT(in) :: Is1,Ie1,Is2,Ie2,Is3,Ie3, Id1,Id2,Id3 -REAL(KIND=8), DIMENSION(Is1:Ie1,Is2:Ie2,Is3:Ie3), INTENT(IN) :: arrIn ! Array to write -CHARACTER(LEN=29) :: filename ! Filename of input or output -CHARACTER(LEN=5) :: tstring, name_string -CHARACTER(LEN=2) :: Id1string, Id2string, Id3string -CHARACTER(LEN=3) :: counter -INTEGER, INTENT(in) :: step -INTEGER :: tpStep, i, outFreq -!---------------------------------------------------------------------------+ - -WRITE(counter,'(I3)') 100+step - -write(Id1string,'(i2.2)')Id1 -write(Id2string,'(i2.2)')Id2 -write(Id3string,'(i2.2)')Id3 - -filename=name_string//run_num//'_'//counter(2:3)//'_'//Id1string//Id2string//Id3string//'.frt' -OPEN (FILE=output_path//filename, UNIT=300, STATUS='UNKNOWN', FORM='UNFORMATTED') -WRITE (300) arrIn(Is1:Ie1,Is2:Ie2,Is3:Ie3) -CLOSE (300) - -RETURN - -END SUBROUTINE writeLotsFiles2 - -!! ================================================================================================= - -SUBROUTINE outputVector(vector,outName,length) -USE parameters -IMPLICIT NONE -INTEGER :: length, outNum -REAL(KIND=8),DIMENSION(1:length) :: vector -CHARACTER(LEN=8) :: outName -CHARACTER(LEN=12) :: filename - -!! This subroutine outputs arrays of length "length" to file. - -WRITE(filename, '(A8,A4)') outName,'.dat' -OPEN(UNIT=300,FILE=output_path//filename,FORM='FORMATTED',ACTION='WRITE') -WRITE(300,'(E25.12)') vector -CLOSE(300) - -END SUBROUTINE outputVector - -!! ================================================================================================= - -!SUBROUTINE loadVector(vector,outName,length) -!USE parameters -!IMPLICIT NONE -!INTEGER :: length, outNum -!REAL(KIND=8),DIMENSION(1:length) :: vector -!CHARACTER(LEN=8) :: outName -!CHARACTER(LEN=12) :: filename -! -!!! This subroutine outputs arrays of length "length" to file. -! -!WRITE(filename, '(A8,A4)') outName,'.dat' -!OPEN(UNIT=300,FILE=output_path//filename,FORM='FORMATTED',ACTION='READ') -!READ(300,'(E25.12)') vector -!CLOSE(300) -! -!END SUBROUTINE loadVector - -!! ================================================================================================= - -SUBROUTINE outputDomainInfo() -USE parameters -IMPLICIT NONE - -CHARACTER(LEN=3) :: counter -CHARACTER(LEN=18) :: filename - -!! This subroutine outputs the dimensions of the domain and the number of subdomains - -WRITE(filename, '(A11,A3,A4)') 'domain_info',run_num,'.frt' -OPEN(UNIT=20,FILE=output_path//filename,ACTION='WRITE') -WRITE(20,*) xg -WRITE(20,*) yg -WRITE(20,*) zg -WRITE(20,*) num_subdomain_x -WRITE(20,*) num_subdomain_y -WRITE(20,*) num_subdomain_z -CLOSE(20) - -END SUBROUTINE - - diff --git a/tests/deprecated_tests/finite_difference_comparison/AC_speed_comparison/finite_difference_AC/parameters.mod b/tests/deprecated_tests/finite_difference_comparison/AC_speed_comparison/finite_difference_AC/parameters.mod deleted file mode 100644 index eee0a152c..000000000 Binary files a/tests/deprecated_tests/finite_difference_comparison/AC_speed_comparison/finite_difference_AC/parameters.mod and /dev/null differ diff --git a/tests/deprecated_tests/finite_difference_comparison/AC_speed_comparison/main.cc b/tests/deprecated_tests/finite_difference_comparison/AC_speed_comparison/main.cc deleted file mode 100644 index 82ace544a..000000000 --- a/tests/deprecated_tests/finite_difference_comparison/AC_speed_comparison/main.cc +++ /dev/null @@ -1,53 +0,0 @@ -// Coupled Cahn-Hilliard, Allen-Cahn and Mechanics problem -// general headers -#include "../../../include/dealIIheaders.h" - -// Coupled Cahn-Hilliard+Allen-Cahn+Mechanics problem headers -#include "ICs_and_BCs.h" -#include "parameters.h" -#include "residuals.h" - -#include "../../../src/models/coupled/generalized_model.h" -#include "../../../src/models/coupled/generalized_model_functions.h" - -// main -int -main(int argc, char **argv) -{ - Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, - argv, - numbers::invalid_unsigned_int); - try - { - deallog.depth_console(0); - generalizedProblem problem; - - problem.setBCs(); - problem.buildFields(); - problem.init(); - problem.solve(); - } - catch (std::exception &exc) - { - std::cerr << std::endl - << std::endl - << "----------------------------------------------------" << std::endl; - std::cerr << "Exception on processing: " << std::endl - << exc.what() << std::endl - << "Aborting!" << std::endl - << "----------------------------------------------------" << std::endl; - return 1; - } - catch (...) - { - std::cerr << std::endl - << std::endl - << "----------------------------------------------------" << std::endl; - std::cerr << "Unknown exception!" << std::endl - << "Aborting!" << std::endl - << "----------------------------------------------------" << std::endl; - return 1; - } - - return 0; -} diff --git a/tests/deprecated_tests/finite_difference_comparison/AC_speed_comparison/parameters.h b/tests/deprecated_tests/finite_difference_comparison/AC_speed_comparison/parameters.h deleted file mode 100644 index d6c4c7fed..000000000 --- a/tests/deprecated_tests/finite_difference_comparison/AC_speed_comparison/parameters.h +++ /dev/null @@ -1,41 +0,0 @@ -// Parameter list for the Beta Prime precipitate evolution problem -//(Coupled Allen Cahn, Cahn Hilliard and Mechanics formulation) -// The free energy expressions in this file are from the reference: -// H. Liu et al, "A simulation study of the shape of beta prime precipitates in -// Mg–Y and Mg–Gd alloys", Acta Materialia, Volume 61, Issue 2, January 2013, -// Pages 453-466. http://dx.doi.org/10.1016/j.actamat.2012.09.044 - -// Define problem dimensions -#define problemDIM 3 -#define spanX 100.0 -#define spanY 100.0 -#define spanZ 100.0 - -// Define mesh parameters -#define subdivisionsX 1 -#define subdivisionsY 1 -#define subdivisionsZ 1 -#define refineFactor 7 -#define finiteElementDegree 1 - -// define number of fields in the problem -// n -#define numFields 1 - -// define time step parameters -#define timeStep 1.0e-3 -#define timeFinal 20.0 -#define timeIncrements 30000 - -// define results output parameters -#define writeOutput true - -// Type of spacing between outputs ("EQUAL_SPACING", "LOG_SPACING", or -// "N_PER_DECADE") -#define outputCondition "EQUAL_SPACING" - -// Number of times the program outputs the fields (total number for -// "EQUAL_SPACING" and "LOG_SPACING", number per decade for "N_PER_DECADE") -#define numOutputs 1 - -#define calcEnergy false diff --git a/tests/deprecated_tests/finite_difference_comparison/AC_speed_comparison/residuals.h b/tests/deprecated_tests/finite_difference_comparison/AC_speed_comparison/residuals.h deleted file mode 100644 index 3932a8592..000000000 --- a/tests/deprecated_tests/finite_difference_comparison/AC_speed_comparison/residuals.h +++ /dev/null @@ -1,112 +0,0 @@ -// Definition of the variables in the model -#define num_var 1 -#define variable_name \ - { \ - "n" \ - } -#define variable_type \ - { \ - "SCALAR" \ - } -#define variable_eq_type \ - { \ - "PARABOLIC" \ - } -#define need_val \ - { \ - true \ - } -#define need_grad \ - { \ - true \ - } -#define need_hess \ - { \ - false \ - } -#define need_val_residual \ - { \ - true \ - } -#define need_grad_residual \ - { \ - true \ - } - -// define Allen-Cahn parameters -#define MnV 1.0 -#define KnV 4.0 - -// define the free energy and its derivative with respect to n -#define fV (n * n * n * n - 2.0 * n * n * n + n * n) -#define fnV (4.0 * n * (n - 1.0) * (n - 0.5)) - -// Define required residuals -#define rnV (n - constV(timeStep * MnV) * fnV) -#define rnxV (constV(-timeStep * KnV * MnV) * nx) - -// --------------------------------------------- - -template -void -generalizedProblem::residualRHS( - const std::vector> &modelVariablesList, - std::vector> &modelResidualsList, - dealii::Point> q_point_loc) const -{ - // n - scalarvalueType n = modelVariablesList[0].scalarValue; - scalargradType nx = modelVariablesList[0].scalarGrad; - - modelResidualsList[0].scalarValueResidual = rnV; - modelResidualsList[0].scalarGradResidual = rnxV; -} - -template -void -generalizedProblem::residualLHS( - const std::vector> &modelVarList, - modelResidual &modelRes, - dealii::Point> q_point_loc) const -{} - -template -void -generalizedProblem::energyDensity( - const std::vector> &modelVarList, - const dealii::VectorizedArray &JxW_value, - dealii::Point> q_point_loc) -{ - scalarvalueType total_energy_density = constV(0.0); - - // n - scalarvalueType n = modelVarList[0].scalarValue; - scalargradType nx = modelVarList[0].scalarGrad; - - scalarvalueType f_chem = fV; - - scalarvalueType f_grad = constV(0.0); - - for (int i = 0; i < dim; i++) - { - for (int j = 0; j < dim; j++) - { - f_grad += constV(0.5 * KnV) * nx[i] * nx[j]; - } - } - - total_energy_density = f_chem + f_grad; - - assembler_lock.acquire(); - for (unsigned i = 0; i < n.size(); i++) - { - // For some reason, some of the values in this loop - if (n[i] > 1.0e-10) - { - this->energy += total_energy_density[i] * JxW_value[i]; - this->energy_components[0] += f_chem[i] * JxW_value[i]; - this->energy_components[1] += f_grad[i] * JxW_value[i]; - } - } - assembler_lock.release(); -} diff --git a/tests/deprecated_tests/finite_difference_comparison/CHAC_speed_comparison/CMakeLists.txt b/tests/deprecated_tests/finite_difference_comparison/CHAC_speed_comparison/CMakeLists.txt deleted file mode 100644 index 0444f179d..000000000 --- a/tests/deprecated_tests/finite_difference_comparison/CHAC_speed_comparison/CMakeLists.txt +++ /dev/null @@ -1,32 +0,0 @@ -## -# CMake script for the phaseField applications: -## - - -# Set the name of the project and target: -SET(TARGET "main") - -# Declare all source files the target consists of: -SET(TARGET_SRC - ${TARGET}.cc - # You can specify additional files here! - ) - -# Usually, you will not need to modify anything beyond this point... - -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8) - -FIND_PACKAGE(deal.II 8.0 QUIET - HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} - ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" - "*** Could not locate deal.II. ***\n\n" - "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" - "or set an environment variable \"DEAL_II_DIR\" that contains this path." - ) -ENDIF() - -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() diff --git a/tests/deprecated_tests/finite_difference_comparison/CHAC_speed_comparison/ICs_and_BCs.h b/tests/deprecated_tests/finite_difference_comparison/CHAC_speed_comparison/ICs_and_BCs.h deleted file mode 100644 index cf1610f2a..000000000 --- a/tests/deprecated_tests/finite_difference_comparison/CHAC_speed_comparison/ICs_and_BCs.h +++ /dev/null @@ -1,144 +0,0 @@ -template -class InitialCondition : public Function -{ -public: - unsigned int index; - Vector values; - - InitialCondition(const unsigned int _index) - : Function(1) - , index(_index) - { - std::srand(Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) + 1); - } - - double - value(const Point &p, const unsigned int component = 0) const - { - double scalar_IC = 0; - // ===================================================================== - // ENTER THE INITIAL CONDITIONS HERE FOR SCALAR FIELDS - // ===================================================================== - // Enter the function describing conditions for the fields at point "p". - // Use "if" statements to set the initial condition for each variable - // according to its variable index. - - double avg_c = 0.02; - double initial_radius = 1.0; - double x_denom = 36.0; - double y_denom = 36.0; - double z_denom = 16.0; - double initial_interface_coeff = 0.5; - - double dx = spanX / ((double) subdivisionsX) / std::pow(2.0, refineFactor); - double r = 0.0; - - // Initial condition for the concentration field - if (index == 0) - { - // return the value of the initial concentration field at point p - double dx = spanX / ((double) subdivisionsX) / std::pow(2.0, refineFactor); - double r = 0.0; -#if problemDIM == 1 - r = p[0]; - return 0.005 + - 0.5 * (0.125 - 0.005) * (1 - std::tanh((r - spanX / 2.0) / (3 * dx))); -#elif problemDIM == 2 - r = p.distance(Point(spanX / 2.0, spanY / 2.0)); - return 0.005 + - 0.5 * (0.125 - 0.005) * (1 - std::tanh((r - spanX / 8.0) / (3 * dx))); -#elif problemDIM == 3 - r = sqrt( - (p.operator()(0) - spanX / 2.0) * (p.operator()(0) - spanX / 2.0) / x_denom + - (p.operator()(1) - spanY / 2.0) * (p.operator()(1) - spanY / 2.0) / y_denom + - (p.operator()(2) - spanZ / 2.0) * (p.operator()(2) - spanZ / 2.0) / z_denom); - return 0.5 * (0.12 - avg_c) * - (1.0 - std::tanh((r - initial_radius) / (initial_interface_coeff))) + - avg_c; -#endif - } - // Initial condition for the structural order parameter field - else - { - // return the value of the initial order parameter field at point p - double dx = spanX / ((double) subdivisionsX) / std::pow(2.0, refineFactor); - double r = 0.0; -#if problemDIM == 1 - r = p[0]; - return 0.5 * (1.0 - std::tanh((r - spanX / 2.0) / (6.2 * dx))); -#elif problemDIM == 2 - r = p.distance(Point(spanX / 2.0, spanY / 2.0)); - return 0.5 * (1.0 - std::tanh((r - spanX / 8.0) / (3 * dx))); -#elif problemDIM == 3 - - r = sqrt( - (p.operator()(0) - spanX / 2.0) * (p.operator()(0) - spanX / 2.0) / x_denom + - (p.operator()(1) - spanY / 2.0) * (p.operator()(1) - spanY / 2.0) / y_denom + - (p.operator()(2) - spanZ / 2.0) * (p.operator()(2) - spanZ / 2.0) / z_denom); - return 0.5 * (1.0 - std::tanh((r - initial_radius) / (initial_interface_coeff))); - -#endif - } - - // ===================================================================== - return scalar_IC; - } -}; - -// initial condition -template -class InitialConditionVec : public Function -{ -public: - unsigned int index; - - // Vector values; - InitialConditionVec(const unsigned int _index) - : Function(dim) - , index(_index) - { - std::srand(Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) + 1); - } - - void - vector_value(const Point &p, Vector &vector_IC) const - { - // ===================================================================== - // ENTER THE INITIAL CONDITIONS HERE FOR VECTOR FIELDS - // ===================================================================== - // Enter the function describing conditions for the fields at point "p". - // Use "if" statements to set the initial condition for each variable - // according to its variable index. - - // ===================================================================== - } -}; - -template -void -generalizedProblem::setBCs() -{ - // ===================================================================== - // ENTER THE BOUNDARY CONDITIONS HERE - // ===================================================================== - // This function sets the BCs for the problem variables - // The function "inputBCs" should be called for each component of - // each variable and should be in numerical order. Four input arguments - // set the same BC on the entire boundary. Two plus two times the - // number of dimensions inputs sets separate BCs on each face of the domain. - // Inputs to "inputBCs": - // First input: variable number - // Second input: component number - // Third input: BC type (options are "ZERO_DERIVATIVE" and "DIRICHLET") - // Fourth input: BC value (ignored unless the BC type is "DIRICHLET") - // Odd inputs after the third: BC type - // Even inputs after the third: BC value - // Face numbering: starts at zero with the minimum of the first direction, one - // for the maximum of the first direction - // two for the minimum of the second direction, etc. - - inputBCs(0, 0, "ZERO_DERIVATIVE", 0); - inputBCs(1, 0, "ZERO_DERIVATIVE", 0); - - // ===================================================================== -} diff --git a/tests/deprecated_tests/finite_difference_comparison/CHAC_speed_comparison/equations.h b/tests/deprecated_tests/finite_difference_comparison/CHAC_speed_comparison/equations.h deleted file mode 100644 index 22736b41b..000000000 --- a/tests/deprecated_tests/finite_difference_comparison/CHAC_speed_comparison/equations.h +++ /dev/null @@ -1,204 +0,0 @@ -// List of variables and residual equations for the coupled -// Allen-Cahn/Cahn-Hilliard example application - -// ================================================================================= -// Define the variables in the model -// ================================================================================= -// The number of variables -#define num_var 2 - -// The names of the variables, whether they are scalars or vectors and whether -// the governing eqn for the variable is parabolic or elliptic -#define variable_name \ - { \ - "c", "n" \ - } -#define variable_type \ - { \ - "SCALAR", "SCALAR" \ - } -#define variable_eq_type \ - { \ - "PARABOLIC", "PARABOLIC" \ - } - -// Flags for whether the value, gradient, and Hessian are needed in the residual -// eqns -#define need_val \ - { \ - true, true \ - } -#define need_grad \ - { \ - true, true \ - } -#define need_hess \ - { \ - false, false \ - } - -// Flags for whether the residual equation has a term multiplied by the test -// function (need_val_residual) and/or the gradient of the test function -// (need_grad_residual) -#define need_val_residual \ - { \ - true, true \ - } -#define need_grad_residual \ - { \ - true, true \ - } - -// ================================================================================= -// Define the model parameters and the residual equations -// ================================================================================= -// Parameters in the residual equations and expressions for the residual -// equations can be set here. For simple cases, the entire residual equation can -// be written here. For more complex cases with loops or conditional statements, -// residual equations (or parts of residual equations) can be written below in -// "residualRHS". - -// Cahn-Hilliard mobility -#define McV 1.0 - -// Allen-Cahn mobility -#define MnV 5.0 - -// Allen-Cahn gradient energy coefficient -#define KnV 0.5 - -// Free energy for each phase and they're first and second derivatives -#define faV (24.7939 * c * c - 1.6752 * c - 1.9453e-06) -#define facV (49.5878 * c - 1.6752) -#define faccV (49.5878) -#define fbV (37.9316 * c * c - 10.7373 * c + 0.5401) -#define fbcV (75.8633 * c - 10.7373) -#define fbccV (75.8633) - -// Interpolation function and its derivative -#define hV (3.0 * n * n - 2.0 * n * n * n) -#define hnV (6.0 * n - 6.0 * n * n) - -// Residual equations -#define muxV (cx * ((1.0 - hV) * faccV + hV * fbccV) + nx * ((fbcV - facV) * hnV)) -#define rcV (c) -#define rcxV (constV(-McV * timeStep) * muxV) -#define rnV (n - constV(timeStep * MnV) * (fbV - faV) * hnV) -#define rnxV (constV(-timeStep * KnV * MnV) * nx) - -// ================================================================================= -// residualRHS -// ================================================================================= -// This function calculates the residual equations for each variable. It takes -// "modelVariablesList" as an input, which is a list of the value and -// derivatives of each of the variables at a specific quadrature point. The -// (x,y,z) location of that quadrature point is given by "q_point_loc". The -// function outputs "modelResidualsList", a list of the value and gradient terms -// of the residual for each residual equation. The index for each variable in -// these lists corresponds to the order it is defined at the top of this file -// (starting at 0). -template -void -generalizedProblem::residualRHS( - const std::vector> &modelVariablesList, - std::vector> &modelResidualsList, - dealii::Point> q_point_loc) const -{ - // The concentration and its derivatives (names here should match those in the - // macros above) - scalarvalueType c = modelVariablesList[0].scalarValue; - scalargradType cx = modelVariablesList[0].scalarGrad; - - // The order parameter and its derivatives (names here should match those in - // the macros above) - scalarvalueType n = modelVariablesList[1].scalarValue; - scalargradType nx = modelVariablesList[1].scalarGrad; - - // Residuals for the equation to evolve the concentration (names here should - // match those in the macros above) - modelResidualsList[0].scalarValueResidual = rcV; - modelResidualsList[0].scalarGradResidual = rcxV; - - // Residuals for the equation to evolve the order parameter (names here should - // match those in the macros above) - modelResidualsList[1].scalarValueResidual = rnV; - modelResidualsList[1].scalarGradResidual = rnxV; -} - -// ================================================================================= -// residualLHS (needed only if at least one equation is elliptic) -// ================================================================================= -// This function calculates the residual equations for the iterative solver for -// elliptic equations.for each variable. It takes "modelVariablesList" as an -// input, which is a list of the value and derivatives of each of the variables -// at a specific quadrature point. The (x,y,z) location of that quadrature point -// is given by "q_point_loc". The function outputs "modelRes", the value and -// gradient terms of for the left-hand-side of the residual equation for the -// iterative solver. The index for each variable in these lists corresponds to -// the order it is defined at the top of this file (starting at 0), not counting -// variables that have "need_val_LHS", "need_grad_LHS", and "need_hess_LHS" all -// set to "false". If there are multiple elliptic equations, conditional -// statements should be used to ensure that the correct residual is being -// submitted. The index of the field being solved can be accessed by -// "this->currentFieldIndex". -template -void -generalizedProblem::residualLHS( - const std::vector> &modelVariablesList, - modelResidual &modelRes, - dealii::Point> q_point_loc) const -{} - -// ================================================================================= -// energyDensity (needed only if calcEnergy == true) -// ================================================================================= -// This function integrates the free energy density across the computational -// domain. It takes "modelVariablesList" as an input, which is a list of the -// value and derivatives of each of the variables at a specific quadrature -// point. It also takes the mapped quadrature weight, "JxW_value", as an input. -// The (x,y,z) location of the quadrature point is given by "q_point_loc". The -// weighted value of the energy density is added to "energy" variable and the -// components of the energy density are added to the "energy_components" -// variable (index 0: chemical energy, index 1: gradient energy, index 2: -// elastic energy). -template -void -generalizedProblem::energyDensity( - const std::vector> &modelVariablesList, - const dealii::VectorizedArray &JxW_value, - dealii::Point> q_point_loc) -{ - // The concentration and its derivatives (names here should match those in the - // macros above) - scalarvalueType c = modelVariablesList[0].scalarValue; - scalargradType cx = modelVariablesList[0].scalarGrad; - - // The order parameter and its derivatives (names here should match those in - // the macros above) - scalarvalueType n = modelVariablesList[1].scalarValue; - scalargradType nx = modelVariablesList[1].scalarGrad; - - // The homogenous free energy - scalarvalueType f_chem = (constV(1.0) - hV) * faV + hV * fbV; - - // The gradient free energy - scalarvalueType f_grad = constV(0.5 * KnV) * nx * nx; - - // The total free energy - scalarvalueType total_energy_density; - total_energy_density = f_chem + f_grad; - - // Loop to step through each element of the vectorized arrays. Working with - // deal.ii developers to see if there is a more elegant way to do this. - assembler_lock.acquire(); - for (unsigned i = 0; i < c.size(); i++) - { - if (c[i] > 1.0e-10) - { - this->energy += total_energy_density[i] * JxW_value[i]; - this->energy_components[0] += f_chem[i] * JxW_value[i]; - this->energy_components[1] += f_grad[i] * JxW_value[i]; - } - } - assembler_lock.release(); -} diff --git a/tests/deprecated_tests/finite_difference_comparison/CHAC_speed_comparison/finite_difference_CHAC/CHAC_finite_difference.f90 b/tests/deprecated_tests/finite_difference_comparison/CHAC_speed_comparison/finite_difference_CHAC/CHAC_finite_difference.f90 deleted file mode 100644 index fb08f5eb2..000000000 --- a/tests/deprecated_tests/finite_difference_comparison/CHAC_speed_comparison/finite_difference_CHAC/CHAC_finite_difference.f90 +++ /dev/null @@ -1,1048 +0,0 @@ -MODULE parameters -IMPLICIT NONE -SAVE - - CHARACTER(LEN=3), PARAMETER :: run_num = '064' - CHARACTER(LEN=0), PARAMETER :: output_path = '' - - INTEGER, PARAMETER :: num_outputs = 10 - - !! Grid size - - - REAL(KIND=8), PARAMETER :: domain_size_x = 64.0d0 - REAL(KIND=8), PARAMETER :: domain_size_y = 64.0d0 - REAL(KIND=8), PARAMETER :: domain_size_z = 64.0d0 - - INTEGER, PARAMETER :: xg = 128 - INTEGER, PARAMETER :: yg = 128 - INTEGER, PARAMETER :: zg = 128 - - INTEGER, PARAMETER :: bb = 1 - - REAL(KIND=8), PARAMETER :: dz = domain_size_z/DBLE(zg) !! Grid spacing (nm) - REAL(KIND=8), PARAMETER :: dx = domain_size_x/DBLE(xg) !! Grid spacing (nm) - REAL(KIND=8), PARAMETER :: dy = domain_size_y/DBLE(yg) !! Grid spacing (nm) - - !! The number of subdomains in each direction for MPI - INTEGER, PARAMETER :: num_subdomain_x = 2 - INTEGER, PARAMETER :: num_subdomain_y = 2 - INTEGER, PARAMETER :: num_subdomain_z = 1 - - !! Particle initialization - REAL(KIND=8), PARAMETER :: particle_x = domain_size_x/2.0d0 !! nm - REAL(KIND=8), PARAMETER :: particle_y = domain_size_y/2.0d0 !! nm - REAL(KIND=8), PARAMETER :: particle_z = domain_size_z/2.0d0 !! nm - REAL(KIND=8), PARAMETER :: rad = 1.0d0 !! nm - - - !! Phase field constants - - REAL(KIND=8), PARAMETER :: A_alpha = 24.7939d0 - REAL(KIND=8), PARAMETER :: B_alpha = -1.6752d0 - REAL(KIND=8), PARAMETER :: C_alpha = -1.9453d-6 - REAL(KIND=8), PARAMETER :: A_beta = 37.9316d0 - REAL(KIND=8), PARAMETER :: B_beta = -10.7373d0 - REAL(KIND=8), PARAMETER :: C_beta = 0.5401d0 - - REAL(KIND=8), PARAMETER :: M = 1.0d0 - REAL(KIND=8), PARAMETER :: L = 5.0d0 - REAL(KIND=8), PARAMETER :: kappa_x = 0.5d0 - REAL(KIND=8), PARAMETER :: kappa_y = 0.5d0 - REAL(KIND=8), PARAMETER :: kappa_z = 0.5d0 - - REAL(KIND=8), PARAMETER :: avg_Nd = 0.02d0 - REAL(KIND=8), PARAMETER :: delta = 0.5d0 - - REAL(KIND=8), PARAMETER :: pi = ACOS(-1.0d0) - - INTEGER, PARAMETER :: max_iter = 50000 - REAL(KIND=8), PARAMETER :: dt = 3.0d-4 !! seconds - - !! Tags for MPI communication - INTEGER, PARAMETER :: c1Tag=91,c2Tag=92,c3Tag=93,c4Tag=94, pTag=95 - INTEGER, PARAMETER :: r1Tag=101,l1Tag=102,f1Tag=103,b1Tag=104,t1Tag=105,d1Tag=106 - INTEGER, PARAMETER :: r2Tag=111,l2Tag=112,f2Tag=113,b2Tag=114,t2Tag=115,d2Tag=116 - INTEGER, PARAMETER :: Sr1Req=81,Sl1Req=82,Sf1Req=83,Sb1Req=84,St1Req=85,Sd1Req=86 - INTEGER, PARAMETER :: Rr1Req=71,Rl1Req=72,Rf1Req=73,Rb1Req=74,Rt1Req=75,Rd1Req=76 - INTEGER, PARAMETER :: Sr2Req=61,Sl2Req=62,Sf2Req=63,Sb2Req=64,St2Req=65,Sd2Req=66 - INTEGER, PARAMETER :: Rr2Req=51,Rl2Req=52,Rf2Req=53,Rb2Req=54,Rt2Req=55,Rd2Req=56 - -END MODULE parameters - -!! CHAC_finite_difference: This program solves the coupled Cahn-Hilliard-Allen-Cahn system -!! of equations. It was developed for comparison to the PRISMS-PF finite element code to -!! ensure that its performance was competitive with finite difference. -!! -!! Author: Stephen DeWitt (stvdwtt@umich.edu) -!! Date Started: 1/6/2016 -!! -!! ============================================================================= - -PROGRAM CHAC_finite_difference -USE parameters -IMPLICIT NONE - -INCLUDE 'mpif.h' -INTEGER :: len -CHARACTER(MPI_MAX_PROCESSOR_NAME) :: hostname - -INTEGER errcode -INTEGER rank, nsize -INTEGER :: dims(1:3),coord(1:3),left,right,front,back,top,bot,ndims,cartcomm -LOGICAL :: reorder,periodic(1:3) -INTEGER L1, L2, L3, S1, S2, S3, Id1, Id2, Id3, Rm1, Rm2, Rm3 - -CALL outputDomainInfo() - -!! Starting the MPI section of the code - -CALL MPI_INIT (errcode) - -CALL MPI_COMM_RANK (MPI_COMM_WORLD, rank, errcode) -CALL MPI_COMM_SIZE (MPI_COMM_WORLD, nsize, errcode) -CALL MPI_GET_PROCESSOR_NAME(hostname, len, errcode) - -IF (rank .eq. 0) PRINT *, 'number of partitions', num_subdomain_x*num_subdomain_y*num_subdomain_z - -!! Start off by partitioning the domain - -!! Number of dimensions (for the MPI Cartesian communicator) -ndims = 3 - -!! Set the number of partitions in each direction -dims(1) = num_subdomain_x -dims(2) = num_subdomain_y -dims(3) = num_subdomain_z - -periodic(1) = .TRUE. -periodic(2) = .TRUE. -periodic(3) = .FALSE. -reorder = .true. - -!! Create the Cartesian communicator -call MPI_CART_CREATE(MPI_COMM_WORLD,ndims,dims,periodic,reorder,cartcomm,errcode) -!PRINT *, 'rank', rank, 'cartcomm', cartcomm - -!! Calculate the non-ghost-zone length of each partition (L#) and the remaining grid points (Rm#) -L1 = floor(xg/real(num_subdomain_x)) -Rm1 = mod(xg,num_subdomain_x) - -L2 = floor(yg/real(num_subdomain_y)) -Rm2 = mod(yg,num_subdomain_y) - -L3 = floor(zg/real(num_subdomain_z)) -Rm3 = mod(zg,num_subdomain_z) - -!! Get coordinates of each partition using MPI_CART_COORDS -call MPI_CART_COORDS(cartcomm,rank,ndims,coord,errcode) - -!! The index of the partition in all three directions -Id3 = coord(3) -Id2 = coord(2) -Id1 = coord(1) - -!! Defines the 6 neighbor partitions -call MPI_CART_SHIFT(cartcomm,0,1,left,right,errcode) !+/- x shifts are left/right -call MPI_CART_SHIFT(cartcomm,1,1,front,back,errcode) !+/- y shifts are front/back -call MPI_CART_SHIFT(cartcomm,2,1,bot,top,errcode) !+/- z shifts are top/bottom - -!! Find the starting point for each partition with respect to the global array location (S#), also find the length of each partition (L#) -if(Id1 == 0)then ! starting point of domain is set to 1, end point is n1 - S1 = 1-bb - L1=L1+2*bb -elseif(Id1 == num_subdomain_x-1)then - S1 = Id1*L1+1-bb - L1 = L1+2*bb+Rm1 -else - S1 = Id1*L1+1-bb - L1= L1+2*bb -endif -if(Id2 == 0)then ! starting point of domain is set to 1, end point is n1 - S2 = 1-bb - L2= L2+2*bb -elseif(Id2 == num_subdomain_y-1)then - S2 = Id2*L2+1-bb - L2 = L2+2*bb+Rm2 -else - S2 = Id2*L2+1-bb - L2 = L2+2*bb -endif -if(Id3 == 0)then ! starting point of domain is set to 1, end point is n1 - S3 = 1-bb - L3= L3+2*bb -elseif(Id3 == num_subdomain_z-1)then - S3 = Id3*L3+1-bb - L3 = L3+2*bb+Rm3 -else - S3 = Id3*L3+1-bb - L3= L3+2*bb -endif - -CALL main_subroutine(Id1,Id2,Id3,S1,S2,S3,L1,L2,L3,left,right,front,back,top,bot,cartcomm) - -CALL MPI_FINALIZE(errcode) - - -END PROGRAM - -!! =================================================================================== -!! Main subroutine where most of the calculations are done -!! =================================================================================== - -SUBROUTINE main_subroutine(Id1,Id2,Id3,S1,S2,S3,L1,L2,L3,left,right,front,back,top,bot,cartcomm) -USE parameters -IMPLICIT NONE - -INCLUDE 'mpif.h' -INTEGER :: L1, L2, L3, S1, S2, S3, Id1, Id2, Id3, Is1, Is2, Is3, Ie1, Ie2, Ie3, k, iter -INTEGER :: left,right,front,back,top,bot, cartcomm -REAL(KIND=8), DIMENSION(S1:S1+L1-1,S2:S2+L2-1,S3:S3+L3-1) :: c, eta, x, y, z -REAL(KIND=8) :: time_elapsed, dist_particle -INTEGER :: i,j, out_num, output_crit -INTEGER :: errcode -CHARACTER(len=3) :: counter - -out_num = 0 - -time_elapsed = 0.0d0 - -!! Real grid points inside the subdomain (without ghost cells) -Is1 = S1 + bb -Ie1 = S1 + L1 - 1 - bb -Is2 = S2 + bb -Ie2 = S2 + L2 - 1 - bb -Is3 = S3 + bb -Ie3 = S3 + L3 - 1 - bb - -!! Initialize the fields - -DO k = Is3-1,Ie3+1 -DO j = Is2-1,Ie2+1 -DO i = Is1-1,Ie1+1 - - x(i,j,k) = dx * DBLE(i) -dx/2.0d0 - y(i,j,k) = dy * DBLE(j) -dy/2.0d0 - z(i,j,k) = dz * DBLE(k) -dz/2.0d0 - - !! Distance functions for spherical particles - !dist_particle = SQRT(DBLE((particle_1_x-x(i,j,k))**2)+DBLE((particle_1_y-y(i,j,k))**2)+DBLE((particle_1_z-z(i,j,k))**2)) - - !! Distance functions for ellipsoidal particles (squished in z direction) - dist_particle = SQRT(DBLE((particle_x-x(i,j,k))**2)/36.0d0 + DBLE((particle_y-y(i,j,k))**2)/36.0d0 & - + DBLE( ((particle_z-z(i,j,k)))**2)/16.0d0 ) - - !! Flat interface - !dist_particle = SQRT((particle_z-z(i,j,k))**2) - - !! 3D Sphere - eta(i,j,k) = 0.5d0*(1.0d0 - ( TANH( (dist_particle - rad)/delta ))) - c(i,j,k) = 0.5d0*(0.12d0-avg_Nd) * (1.0d0 - ( TANH( ( dist_particle - rad )/delta ))) + avg_Nd - -END DO -END DO -END DO - -!! Apply boundary conditions -call commuBC(Id1,Id2,Id3,L1,L2,L3,S1,S2,S3,c,left,right,front,back,top,bot,cartcomm) -CALL external_BCs_Zero_Derivative(c,.TRUE.,1,Id1,Id2,Id3,L1-2,L2-2,L3-2) -CALL external_BCs_Zero_Derivative(c,.FALSE.,1,Id1,Id2,Id3,L1-2,L2-2,L3-2) -CALL external_BCs_Zero_Derivative(c,.TRUE.,2,Id1,Id2,Id3,L1-2,L2-2,L3-2) -CALL external_BCs_Zero_Derivative(c,.FALSE.,2,Id1,Id2,Id3,L1-2,L2-2,L3-2) -CALL external_BCs_Zero_Derivative(c,.TRUE.,3,Id1,Id2,Id3,L1-2,L2-2,L3-2) -CALL external_BCs_Zero_Derivative(c,.FALSE.,3,Id1,Id2,Id3,L1-2,L2-2,L3-2) - -call commuBC(Id1,Id2,Id3,L1,L2,L3,S1,S2,S3,eta,left,right,front,back,top,bot,cartcomm) -CALL external_BCs_Zero_Derivative(eta,.TRUE.,1,Id1,Id2,Id3,L1-2,L2-2,L3-2) -CALL external_BCs_Zero_Derivative(eta,.FALSE.,1,Id1,Id2,Id3,L1-2,L2-2,L3-2) -CALL external_BCs_Zero_Derivative(eta,.TRUE.,2,Id1,Id2,Id3,L1-2,L2-2,L3-2) -CALL external_BCs_Zero_Derivative(eta,.FALSE.,2,Id1,Id2,Id3,L1-2,L2-2,L3-2) -CALL external_BCs_Zero_Derivative(eta,.TRUE.,3,Id1,Id2,Id3,L1-2,L2-2,L3-2) -CALL external_BCs_Zero_Derivative(eta,.FALSE.,3,Id1,Id2,Id3,L1-2,L2-2,L3-2) - -!! Initial Outputs -IF (Id1+Id2+Id3.eq. 0) PRINT *, 'Time step: ', dt -CALL writeLotsFiles(c,'con_r',out_num,Is1,Ie1,Is2,Ie2,Is3,Ie3, Id1,Id2,Id3) -CALL writeLotsFiles(eta,'eta_r',out_num,Is1,Ie1,Is2,Ie2,Is3,Ie3, Id1,Id2,Id3) -CALL writeLotsFiles(x,'xgrid',out_num,Is1,Ie1,Is2,Ie2,Is3,Ie3, Id1,Id2,Id3) -CALL writeLotsFiles(y,'ygrid',out_num,Is1,Ie1,Is2,Ie2,Is3,Ie3, Id1,Id2,Id3) -CALL writeLotsFiles(z,'zgrid',out_num,Is1,Ie1,Is2,Ie2,Is3,Ie3, Id1,Id2,Id3) - - -out_num = out_num + 1 - - -!! ------------------------------------------------------------------------- -!! Iterate through time -!! ------------------------------------------------------------------------- - -DO iter = 1,max_iter - - CALL simultaneous_CHAC_solver(c,eta,S1,S2,S3,L1,L2,L3,Is1,Ie1,Is2,Ie2,Is3,Ie3,Id1,Id2,Id3, & - left,right,front,back,top,bot,cartcomm) - - - !CALL cahnhilliard_solver_explicit(c,eta,S1,S2,S3,L1,L2,L3,Is1,Ie1,Is2,Ie2,Is3,Ie3,Id1,Id2,Id3, & -! left,right,front,back,top,bot,cartcomm) - - !! Check to see if c contains a NAN - IF (ANY(ISNAN(c))) THEN - PRINT *, 'Error: Element in c is NAN' - STOP - END IF - - !CALL allenCahn_solver_explicit(c,eta,S1,S2,S3,L1,L2,L3,Is1,Ie1,Is2,Ie2,Is3,Ie3,Id1,Id2,Id3, & -! left,right,front,back,top,bot,cartcomm) - - IF (ANY(ISNAN(eta))) THEN - PRINT *, 'Error: Element in eta is NAN' - STOP - END IF - - time_elapsed = time_elapsed + dt - - !! ------------------------------------------------------------------------- - !! Output files - IF (max_iter <= num_outputs) THEN - output_crit = 0 - ELSE - output_crit = MOD(iter,max_iter/num_outputs) - END IF - - IF (output_crit == 0) THEN - IF (Id1 .eq. 0 .and. Id2 .eq. 0 .and. Id3 .eq. 0) PRINT *, 'Output number ', out_num, ' complete' - - - CALL writeLotsFiles(c,'con_r',out_num,Is1,Ie1,Is2,Ie2,Is3,Ie3, Id1,Id2,Id3) - CALL writeLotsFiles(eta,'eta_r',out_num,Is1,Ie1,Is2,Ie2,Is3,Ie3, Id1,Id2,Id3) - - out_num = out_num + 1 - - END IF - -END DO - -IF (Id1+Id2+Id3.eq. 0) PRINT *, 'Total time elapsed: ', max_iter*dt - -END SUBROUTINE - -!! =================================================================================== -!! Explicit Combined Cahn-Hilliard Allen-Cahn Solver -!! =================================================================================== - -SUBROUTINE simultaneous_CHAC_solver(c,eta,S1,S2,S3,L1,L2,L3,Is1,Ie1,Is2,Ie2,Is3,Ie3,Id1,Id2,Id3, & - left,right,front,back,top,bot,cartcomm) -USE parameters -IMPLICIT NONE - -INCLUDE 'mpif.h' -INTEGER :: L1, L2, L3, S1, S2, S3, Id1, Id2, Id3, Is1, Is2, Is3, Ie1, Ie2, Ie3 -INTEGER :: left,right,front,back,top,bot, cartcomm -REAL(KIND=8), DIMENSION(S1:S1+L1-1,S2:S2+L2-1,S3:S3+L3-1) :: c, eta, mu, H, dHdeta -REAL(KIND=8), DIMENSION(S1+1:S1+L1-2,S2+1:S2+L2-2,S3+1:S3+L3-2) :: Lap_mu, kappa_Lap_eta - -H = 3.0d0*eta*eta - 2.0d0*eta*eta*eta -mu = (2.0d0*A_alpha*c + B_alpha)*(1.0d0-H) + (2.0d0*A_beta*c + B_beta)*H - -call commuBC(Id1,Id2,Id3,L1,L2,L3,S1,S2,S3,mu,left,right,front,back,top,bot,cartcomm) -CALL external_BCs_Zero_Derivative(mu,.TRUE.,1,Id1,Id2,Id3,L1-2,L2-2,L3-2) -CALL external_BCs_Zero_Derivative(mu,.FALSE.,1,Id1,Id2,Id3,L1-2,L2-2,L3-2) -CALL external_BCs_Zero_Derivative(mu,.TRUE.,2,Id1,Id2,Id3,L1-2,L2-2,L3-2) -CALL external_BCs_Zero_Derivative(mu,.FALSE.,2,Id1,Id2,Id3,L1-2,L2-2,L3-2) -CALL external_BCs_Zero_Derivative(mu,.TRUE.,3,Id1,Id2,Id3,L1-2,L2-2,L3-2) -CALL external_BCs_Zero_Derivative(mu,.FALSE.,3,Id1,Id2,Id3,L1-2,L2-2,L3-2) - -Lap_mu(Is1:Ie1,Is2:Ie2,Is3:Ie3) = (mu(Is1+1:Ie1+1,Is2:Ie2,Is3:Ie3) - 2.0d0*mu(Is1:Ie1,Is2:Ie2,Is3:Ie3) & - + mu(Is1-1:Ie1-1,Is2:Ie2,Is3:Ie3))/dx**2 & - + (mu(Is1:Ie1,Is2+1:Ie2+1,Is3:Ie3) - 2.0d0*mu(Is1:Ie1,Is2:Ie2,Is3:Ie3) & - + mu(Is1:Ie1,Is2-1:Ie2-1,Is3:Ie3))/dy**2 & - + (mu(Is1:Ie1,Is2:Ie2,Is3+1:Ie3+1) - 2.0d0*mu(Is1:Ie1,Is2:Ie2,Is3:Ie3) & - + mu(Is1:Ie1,Is2:Ie2,Is3-1:Ie3-1))/dz**2 - -dHdeta = 6.0d0*eta - 6.0d0*eta*eta - -kappa_Lap_eta(Is1:Ie1,Is2:Ie2,Is3:Ie3) = kappa_x*(eta(Is1+1:Ie1+1,Is2:Ie2,Is3:Ie3) - 2.0d0*eta(Is1:Ie1,Is2:Ie2,Is3:Ie3) & - + eta(Is1-1:Ie1-1,Is2:Ie2,Is3:Ie3))/dx**2 & - + kappa_y*(eta(Is1:Ie1,Is2+1:Ie2+1,Is3:Ie3) - 2.0d0*eta(Is1:Ie1,Is2:Ie2,Is3:Ie3) & - + eta(Is1:Ie1,Is2-1:Ie2-1,Is3:Ie3))/dy**2 & - + kappa_z*(eta(Is1:Ie1,Is2:Ie2,Is3+1:Ie3+1) - 2.0d0*eta(Is1:Ie1,Is2:Ie2,Is3:Ie3) & - + eta(Is1:Ie1,Is2:Ie2,Is3-1:Ie3-1))/dz**2 - -eta(Is1:Ie1,Is2:Ie2,Is3:Ie3) = eta(Is1:Ie1,Is2:Ie2,Is3:Ie3) & - - dt * L * ( ((A_beta*c(Is1:Ie1,Is2:Ie2,Is3:Ie3)**2 + B_beta*c(Is1:Ie1,Is2:Ie2,Is3:Ie3) + C_beta) & - - (A_alpha*c(Is1:Ie1,Is2:Ie2,Is3:Ie3)**2 + B_alpha*c(Is1:Ie1,Is2:Ie2,Is3:Ie3) + C_alpha))*dHdeta(Is1:Ie1,Is2:Ie2,Is3:Ie3) & - - kappa_Lap_eta) - -c(Is1:Ie1,Is2:Ie2,Is3:Ie3) = c(Is1:Ie1,Is2:Ie2,Is3:Ie3) & - + dt*M*Lap_mu(Is1:Ie1,Is2:Ie2,Is3:Ie3) - -call commuBC(Id1,Id2,Id3,L1,L2,L3,S1,S2,S3,c,left,right,front,back,top,bot,cartcomm) -CALL external_BCs_Zero_Derivative(c,.TRUE.,1,Id1,Id2,Id3,L1-2,L2-2,L3-2) -CALL external_BCs_Zero_Derivative(c,.FALSE.,1,Id1,Id2,Id3,L1-2,L2-2,L3-2) -CALL external_BCs_Zero_Derivative(c,.TRUE.,2,Id1,Id2,Id3,L1-2,L2-2,L3-2) -CALL external_BCs_Zero_Derivative(c,.FALSE.,2,Id1,Id2,Id3,L1-2,L2-2,L3-2) -CALL external_BCs_Zero_Derivative(c,.TRUE.,3,Id1,Id2,Id3,L1-2,L2-2,L3-2) -CALL external_BCs_Zero_Derivative(c,.FALSE.,3,Id1,Id2,Id3,L1-2,L2-2,L3-2) - -call commuBC(Id1,Id2,Id3,L1,L2,L3,S1,S2,S3,eta,left,right,front,back,top,bot,cartcomm) -CALL external_BCs_Zero_Derivative(eta,.TRUE.,1,Id1,Id2,Id3,L1-2,L2-2,L3-2) -CALL external_BCs_Zero_Derivative(eta,.FALSE.,1,Id1,Id2,Id3,L1-2,L2-2,L3-2) -CALL external_BCs_Zero_Derivative(eta,.TRUE.,2,Id1,Id2,Id3,L1-2,L2-2,L3-2) -CALL external_BCs_Zero_Derivative(eta,.FALSE.,2,Id1,Id2,Id3,L1-2,L2-2,L3-2) -CALL external_BCs_Zero_Derivative(eta,.TRUE.,3,Id1,Id2,Id3,L1-2,L2-2,L3-2) -CALL external_BCs_Zero_Derivative(eta,.FALSE.,3,Id1,Id2,Id3,L1-2,L2-2,L3-2) - - -END SUBROUTINE simultaneous_CHAC_solver - -!! =================================================================================== -!! Explicit Cahn-Hilliard Solver -!! =================================================================================== - -SUBROUTINE cahnhilliard_solver_explicit(c,eta,S1,S2,S3,L1,L2,L3,Is1,Ie1,Is2,Ie2,Is3,Ie3,Id1,Id2,Id3, & - left,right,front,back,top,bot,cartcomm) -USE parameters -IMPLICIT NONE - -INCLUDE 'mpif.h' -INTEGER :: L1, L2, L3, S1, S2, S3, Id1, Id2, Id3, Is1, Is2, Is3, Ie1, Ie2, Ie3 -INTEGER :: left,right,front,back,top,bot, cartcomm -REAL(KIND=8), DIMENSION(S1:S1+L1-1,S2:S2+L2-1,S3:S3+L3-1) :: c, eta, mu, H -REAL(KIND=8), DIMENSION(S1+1:S1+L1-2,S2+1:S2+L2-2,S3+1:S3+L3-2) :: Lap_mu - -H = 3.0d0*eta*eta - 2.0d0*eta*eta*eta -mu = (2.0d0*A_alpha*c + B_alpha)*(1.0d0-H) + (2.0d0*A_beta*c + B_beta)*H - -call commuBC(Id1,Id2,Id3,L1,L2,L3,S1,S2,S3,mu,left,right,front,back,top,bot,cartcomm) -CALL external_BCs_Zero_Derivative(mu,.TRUE.,1,Id1,Id2,Id3,L1-2,L2-2,L3-2) -CALL external_BCs_Zero_Derivative(mu,.FALSE.,1,Id1,Id2,Id3,L1-2,L2-2,L3-2) -CALL external_BCs_Zero_Derivative(mu,.TRUE.,2,Id1,Id2,Id3,L1-2,L2-2,L3-2) -CALL external_BCs_Zero_Derivative(mu,.FALSE.,2,Id1,Id2,Id3,L1-2,L2-2,L3-2) -CALL external_BCs_Zero_Derivative(mu,.TRUE.,3,Id1,Id2,Id3,L1-2,L2-2,L3-2) -CALL external_BCs_Zero_Derivative(mu,.FALSE.,3,Id1,Id2,Id3,L1-2,L2-2,L3-2) - -Lap_mu(Is1:Ie1,Is2:Ie2,Is3:Ie3) = (mu(Is1+1:Ie1+1,Is2:Ie2,Is3:Ie3) - 2.0d0*mu(Is1:Ie1,Is2:Ie2,Is3:Ie3) & - + mu(Is1-1:Ie1-1,Is2:Ie2,Is3:Ie3))/dx**2 & - + (mu(Is1:Ie1,Is2+1:Ie2+1,Is3:Ie3) - 2.0d0*mu(Is1:Ie1,Is2:Ie2,Is3:Ie3) & - + mu(Is1:Ie1,Is2-1:Ie2-1,Is3:Ie3))/dy**2 & - + (mu(Is1:Ie1,Is2:Ie2,Is3+1:Ie3+1) - 2.0d0*mu(Is1:Ie1,Is2:Ie2,Is3:Ie3) & - + mu(Is1:Ie1,Is2:Ie2,Is3-1:Ie3-1))/dz**2 - -c(Is1:Ie1,Is2:Ie2,Is3:Ie3) = c(Is1:Ie1,Is2:Ie2,Is3:Ie3) & - + dt*M*Lap_mu(Is1:Ie1,Is2:Ie2,Is3:Ie3) - -call commuBC(Id1,Id2,Id3,L1,L2,L3,S1,S2,S3,c,left,right,front,back,top,bot,cartcomm) -CALL external_BCs_Zero_Derivative(c,.TRUE.,1,Id1,Id2,Id3,L1-2,L2-2,L3-2) -CALL external_BCs_Zero_Derivative(c,.FALSE.,1,Id1,Id2,Id3,L1-2,L2-2,L3-2) -CALL external_BCs_Zero_Derivative(c,.TRUE.,2,Id1,Id2,Id3,L1-2,L2-2,L3-2) -CALL external_BCs_Zero_Derivative(c,.FALSE.,2,Id1,Id2,Id3,L1-2,L2-2,L3-2) -CALL external_BCs_Zero_Derivative(c,.TRUE.,3,Id1,Id2,Id3,L1-2,L2-2,L3-2) -CALL external_BCs_Zero_Derivative(c,.FALSE.,3,Id1,Id2,Id3,L1-2,L2-2,L3-2) - - -END SUBROUTINE cahnhilliard_solver_explicit - -!! =================================================================================== -!! Explicit Allen-Cahn Solver -!! =================================================================================== - -SUBROUTINE allenCahn_solver_explicit(c,eta,S1,S2,S3,L1,L2,L3,Is1,Ie1,Is2,Ie2,Is3,Ie3,Id1,Id2,Id3, & - left,right,front,back,top,bot,cartcomm) -USE parameters -IMPLICIT NONE - -INCLUDE 'mpif.h' -INTEGER :: L1, L2, L3, S1, S2, S3, Id1, Id2, Id3, Is1, Is2, Is3, Ie1, Ie2, Ie3 -INTEGER :: left,right,front,back,top,bot, cartcomm -REAL(KIND=8), DIMENSION(S1:S1+L1-1,S2:S2+L2-1,S3:S3+L3-1) :: c, eta, mu, dHdeta -REAL(KIND=8), DIMENSION(S1+1:S1+L1-2,S2+1:S2+L2-2,S3+1:S3+L3-2) :: kappa_Lap_eta - -dHdeta = 6.0d0*eta - 6.0d0*eta*eta - -kappa_Lap_eta(Is1:Ie1,Is2:Ie2,Is3:Ie3) = kappa_x*(eta(Is1+1:Ie1+1,Is2:Ie2,Is3:Ie3) - 2.0d0*eta(Is1:Ie1,Is2:Ie2,Is3:Ie3) & - + eta(Is1-1:Ie1-1,Is2:Ie2,Is3:Ie3))/dx**2 & - + kappa_y*(eta(Is1:Ie1,Is2+1:Ie2+1,Is3:Ie3) - 2.0d0*eta(Is1:Ie1,Is2:Ie2,Is3:Ie3) & - + eta(Is1:Ie1,Is2-1:Ie2-1,Is3:Ie3))/dy**2 & - + kappa_z*(eta(Is1:Ie1,Is2:Ie2,Is3+1:Ie3+1) - 2.0d0*eta(Is1:Ie1,Is2:Ie2,Is3:Ie3) & - + eta(Is1:Ie1,Is2:Ie2,Is3-1:Ie3-1))/dz**2 - -eta(Is1:Ie1,Is2:Ie2,Is3:Ie3) = eta(Is1:Ie1,Is2:Ie2,Is3:Ie3) & - - dt * L * ( ((A_beta*c(Is1:Ie1,Is2:Ie2,Is3:Ie3)**2 + B_beta*c(Is1:Ie1,Is2:Ie2,Is3:Ie3) + C_beta) & - - (A_alpha*c(Is1:Ie1,Is2:Ie2,Is3:Ie3)**2 + B_alpha*c(Is1:Ie1,Is2:Ie2,Is3:Ie3) + C_alpha))*dHdeta(Is1:Ie1,Is2:Ie2,Is3:Ie3) & - - kappa_Lap_eta) - -call commuBC(Id1,Id2,Id3,L1,L2,L3,S1,S2,S3,eta,left,right,front,back,top,bot,cartcomm) -CALL external_BCs_Zero_Derivative(eta,.TRUE.,1,Id1,Id2,Id3,L1-2,L2-2,L3-2) -CALL external_BCs_Zero_Derivative(eta,.FALSE.,1,Id1,Id2,Id3,L1-2,L2-2,L3-2) -CALL external_BCs_Zero_Derivative(eta,.TRUE.,2,Id1,Id2,Id3,L1-2,L2-2,L3-2) -CALL external_BCs_Zero_Derivative(eta,.FALSE.,2,Id1,Id2,Id3,L1-2,L2-2,L3-2) -CALL external_BCs_Zero_Derivative(eta,.TRUE.,3,Id1,Id2,Id3,L1-2,L2-2,L3-2) -CALL external_BCs_Zero_Derivative(eta,.FALSE.,3,Id1,Id2,Id3,L1-2,L2-2,L3-2) - - -END SUBROUTINE allenCahn_solver_explicit - - -!! =================================================================================== - -SUBROUTINE applyBCs(Id1,Id2,Id3,L1,L2,L3,S1,S2,S3,phi1,U_BC_top,left,right,front,back,top,bot,cartcomm,direction) -use parameters -implicit none -INCLUDE 'mpif.h' - -INTEGER S1, S2, S3, Id1, Id2, Id3,L1,L2,L3 -INTEGER :: left,right,front,back,top,bot,cartcomm !ranks of processors to shift to and cartcomm -INTEGER :: i,j,k, direction -INTEGER :: errcode -REAL(KIND=8) :: phi1(S1:S1+L1-1,S2:S2+L2-1,S3:S3+L3-1), U_BC_top -INTEGER,DIMENSION(MPI_STATUS_SIZE) :: nstatus - -REAL(KIND=8), DIMENSION(1:L2,1:L3) :: Buffer_x1, Buffer_x2, Buffer_x3, Buffer_x4 -REAL(KIND=8), DIMENSION(1:L1,1:L3) :: Buffer_y1, Buffer_y2, Buffer_y3, Buffer_y4 -REAL(KIND=8), DIMENSION(1:L1,1:L2) :: Buffer_z1, Buffer_z2, Buffer_z3, Buffer_z4 -INTEGER,DIMENSION(12) :: req - -!! Communication in n1 direction - -IF ( direction .EQ. 0 .OR. direction .EQ. 1 ) THEN - - ! x-direction - Buffer_x3 = phi1(S1+L1-1-bb,S2:S2+L2-1,S3:S3+L3-1) - Buffer_x2 = phi1(S1+bb,S2:S2+L2-1,S3:S3+L3-1) - - CALL MPI_iSEND(Buffer_x3,L2*L3,MPI_DOUBLE_PRECISION,right,r1Tag,cartcomm,req(1),errcode) - CALL MPI_iRECV(Buffer_x4,L2*L3,MPI_DOUBLE_PRECISION,right,l1Tag,cartcomm,req(2),errcode) - CALL MPI_iSEND(Buffer_x2,L2*L3,MPI_DOUBLE_PRECISION,left ,l1Tag,cartcomm,req(4),errcode) - CALL MPI_iRECV(Buffer_x1,L2*L3,MPI_DOUBLE_PRECISION,left ,r1Tag,cartcomm,req(3),errcode) - call MPI_waitall(4,req(1:4),MPI_STATUS_IGNORE,errcode) - - phi1(S1,S2:S2+L2-1,S3:S3+L3-1) = Buffer_x1 - phi1(S1+L1-1,S2:S2+L2-1,S3:S3+L3-1) = Buffer_x4 - -ENDIF - -!! Communication in n2 direction - -IF ( direction .EQ. 0 .OR. direction .EQ. 2 ) THEN - ! y-direction - Buffer_y3 = phi1(S1:S1+L1-1,S2+L2-1-bb,S3:S3+L3-1) - Buffer_y2 = phi1(S1:S1+L1-1,S2+bb,S3:S3+L3-1) - CALL MPI_iSEND(Buffer_y3,L1*L3,MPI_DOUBLE_PRECISION,back ,b1Tag,cartcomm,req(5),errcode) - CALL MPI_iRECV(Buffer_y4,L1*L3,MPI_DOUBLE_PRECISION,back ,f1Tag,cartcomm,req(6),errcode) - CALL MPI_iSEND(Buffer_y2,L1*L3,MPI_DOUBLE_PRECISION,front,f1Tag,cartcomm,req(8),errcode) - CALL MPI_iRECV(Buffer_y1,L1*L3,MPI_DOUBLE_PRECISION,front,b1Tag,cartcomm,req(7),errcode) - call MPI_waitall(4,req(5:8),MPI_STATUS_IGNORE,errcode) - phi1(S1:S1+L1-1,S2,S3:S3+L3-1) = Buffer_y1 - phi1(S1:S1+L1-1,S2+L2-1,S3:S3+L3-1) = Buffer_y4 - -ENDIF - -!! Communication in n3 direction - -IF ( direction .EQ. 0 .OR. direction .EQ. 3 ) THEN - ! z-direction - Buffer_z3=phi1(S1:S1+L1-1,S2:S2+L2-1,S3+L3-1-bb) - Buffer_z2=phi1(S1:S1+L1-1,S2:S2+L2-1,S3+bb) - IF ( Id3 .NE. num_subdomain_z-1 ) THEN - CALL MPI_iSEND(Buffer_z3,L1*L2,MPI_DOUBLE_PRECISION,top,t1Tag,cartcomm,req(9),errcode) - CALL MPI_iRECV(Buffer_z4,L1*L2,MPI_DOUBLE_PRECISION,top,b1Tag,cartcomm,req(10),errcode) - ELSE - !CALL external_BCs_Dirichlet(phi1,U_BC_top,.TRUE.,3,Id1,Id2,Id3,L1-2,L2-2,L3-2) - Buffer_z4 = U_BC_top - ENDIF - - IF ( Id3 .NE. 0 ) THEN - CALL MPI_iSEND(Buffer_z2,L1*L2,MPI_DOUBLE_PRECISION,bot,b1Tag,cartcomm,req(12),errcode) - CALL MPI_iRECV(Buffer_z1,L1*L2,MPI_DOUBLE_PRECISION,bot,t1Tag,cartcomm,req(11),errcode) - ELSE - !CALL external_BCs_Zero_Derivative(phi1,.FALSE.,3,Id1,Id2,Id3,L1-2,L2-2,L3-2) - Buffer_z1 = phi1(S1:S1+L1-1,S2:S2+L2-1,S3+bb) - ENDIF - - IF ( Id3 .NE. num_subdomain_z-1 ) call MPI_waitall(2,req(9:10),MPI_STATUS_IGNORE,errcode) - IF ( Id3 .NE. 0 ) call MPI_waitall(2,req(11:12),MPI_STATUS_IGNORE,errcode) - phi1(S1:S1+L1-1,S2:S2+L2-1,S3)=Buffer_z1 - phi1(S1:S1+L1-1,S2:S2+L2-1,S3+L3-1)=Buffer_z4 - -ENDIF - -!! External BCs in the z-direction -!CALL external_BCs_Dirichlet(phi1,U_BC_top,.TRUE.,3,Id1,Id2,Id3,L1-2,L2-2,L3-2) -!CALL external_BCs_Zero_Derivative(phi1,.FALSE.,3,Id1,Id2,Id3,L1-2,L2-2,L3-2) - -RETURN -END SUBROUTINE applyBCs - -!! =================================================================================== -!! External BC calculation subroutines -!! =================================================================================== - -SUBROUTINE external_BCs_Dirichlet(array,BC_value,is_top,dimension_num,Id1,Id2,Id3,px,py,pz) -USE parameters -IMPLICIT NONE - -INTEGER :: px, py, pz -REAL(KIND=8), DIMENSION(0:px+1,0:py+1,0:pz+1) :: array -REAL(KIND=8) :: BC_value -INTEGER :: dimension_num,Id1,Id2,Id3 -LOGICAL :: is_top - -SELECT CASE (dimension_num) - -CASE (1) - IF (is_top .eqv. .TRUE.) THEN - IF (Id1 .eq. num_subdomain_x-1) THEN - array(px+1,0:py+1,0:pz+1) = BC_value - END IF - ELSE - IF (Id1 .eq. 0) THEN - array(0,0:py+1,0:pz+1) = BC_value - END IF - END IF - -CASE (2) - IF (is_top .eqv. .TRUE.) THEN - IF (Id2 .eq. num_subdomain_y-1) THEN - array(0:px+1,py+1,0:pz+1) = BC_value - END IF - ELSE - IF (Id2 .eq. 0) THEN - array(0:px+1,0,0:pz+1) = BC_value - END IF - END IF - -CASE (3) - IF (is_top .eqv. .TRUE.) THEN - IF (Id3 .eq. num_subdomain_z-1) THEN - array(0:px+1,0:py+1,pz+1) = BC_value - END IF - ELSE - IF (Id3 .eq. 0) THEN - array(0:px+1,0:py+1,0) = BC_value - END IF - END IF - -END SELECT - -!PRINT *, 'in BC subroutine', array(40, 10, pz+1), array(40, 10, 0), top_val, bottom_val - -END SUBROUTINE external_BCs_Dirichlet - -!! =================================================================================== - -SUBROUTINE external_BCs_Zero_Derivative(array,is_top,dimension_num,Id1,Id2,Id3,px,py,pz) -USE parameters -IMPLICIT NONE - -INTEGER :: px, py, pz -REAL(KIND=8), DIMENSION(0:px+1,0:py+1,0:pz+1) :: array -REAL(KIND=8) :: BC_value -INTEGER :: dimension_num,Id1,Id2,Id3 -LOGICAL :: is_top - -SELECT CASE (dimension_num) - -CASE (1) - IF (is_top .eqv. .TRUE.) THEN - IF (Id1 .eq. num_subdomain_x-1) THEN - array(px+1,0:py+1,0:pz+1) = array(px,0:py+1,0:pz+1) - END IF - ELSE - IF (Id1 .eq. 0) THEN - array(0,0:py+1,0:pz+1) = array(1,0:py+1,0:pz+1) - END IF - END IF - -CASE (2) - IF (is_top .eqv. .TRUE.) THEN - IF (Id2 .eq. num_subdomain_y-1) THEN - array(0:px+1,py+1,0:pz+1) = array(0:px+1,py,0:pz+1) - END IF - ELSE - IF (Id2 .eq. 0) THEN - array(0:px+1,0,0:pz+1) = array(0:px+1,1,0:pz+1) - END IF - END IF - -CASE (3) - IF (is_top .eqv. .TRUE.) THEN - IF (Id3 .eq. num_subdomain_z-1) THEN - array(0:px+1,0:py+1,pz+1) = array(0:px+1,0:py+1,pz) - END IF - ELSE - IF (Id3 .eq. 0) THEN - array(0:px+1,0:py+1,0) = array(0:px+1,0:py+1,1) - END IF - END IF - -END SELECT - -!PRINT *, 'in BC subroutine', array(40, 10, pz+1), array(40, 10, 0), top_val, bottom_val - -END SUBROUTINE external_BCs_Zero_Derivative - -!! =================================================================================== - -SUBROUTINE external_BCs_Neumann(array,derivative,is_top,dimension_num,Id1,Id2,Id3,px,py,pz) -USE parameters -IMPLICIT NONE - -INTEGER :: px, py, pz -REAL(KIND=8), DIMENSION(0:px+1,0:py+1,0:pz+1) :: array -REAL(KIND=8) :: derivative -INTEGER :: dimension_num,Id1,Id2,Id3 -LOGICAL :: is_top - -SELECT CASE (dimension_num) - -CASE (1) - IF (is_top .eqv. .TRUE.) THEN - IF (Id1 .eq. num_subdomain_x-1) THEN - array(px+1,0:py+1,0:pz+1) = array(px,0:py+1,0:pz+1) + derivative - END IF - ELSE - IF (Id1 .eq. 0) THEN - array(0,0:py+1,0:pz+1) = array(1,0:py+1,0:pz+1) - derivative - END IF - END IF - -CASE (2) - IF (is_top .eqv. .TRUE.) THEN - IF (Id2 .eq. num_subdomain_y-1) THEN - array(0:px+1,py+1,0:pz+1) = array(0:px+1,py,0:pz+1) + derivative - END IF - ELSE - IF (Id2 .eq. 0) THEN - array(0:px+1,0,0:pz+1) = array(0:px+1,1,0:pz+1) - derivative - END IF - END IF - -CASE (3) - IF (is_top .eqv. .TRUE.) THEN - IF (Id3 .eq. num_subdomain_z-1) THEN - array(0:px+1,0:py+1,pz+1) = array(0:px+1,0:py+1,pz) + derivative - END IF - ELSE - IF (Id3 .eq. 0) THEN - array(0:px+1,0:py+1,0) = array(0:px+1,0:py+1,1) - derivative - END IF - END IF - -END SELECT - -END SUBROUTINE external_BCs_Neumann - -!! =================================================================================== - -SUBROUTINE external_BCs_Periodic(array,dimension_num,Id1,Id2,Id3,px,py,pz,left,right,front,back,top,bot,cartcomm) -USE parameters -IMPLICIT NONE -INCLUDE 'mpif.h' - -INTEGER :: px, py, pz -REAL(KIND=8), DIMENSION(0:px+1,0:py+1,0:pz+1) :: array -INTEGER :: dimension_num,Id1,Id2,Id3 -INTEGER :: left,right,front,back,top,bot,cartcomm -INTEGER :: errcode -INTEGER,DIMENSION(MPI_STATUS_SIZE) :: nstatus - -SELECT CASE (dimension_num) - -CASE (1) - IF ( num_subdomain_x .eq. 1) THEN - array(0,0:py+1,0:pz+1) = array(px,0:py+1,0:pz+1) - array(px+1,0:py+1,0:pz+1) = array(1,0:py+1,0:pz+1) - ELSE - IF (Id1 .eq. num_subdomain_x-1) & - call MPI_SEND(array(px,0:py+1,0:pz+1),(py+2)*(pz+2),MPI_DOUBLE_PRECISION,right,r1Tag+100,cartcomm,errcode) - - IF (Id1 .eq. 0) & - call MPI_RECV(array(0,0:py+1,0:pz+1),(py+2)*(pz+2),MPI_DOUBLE_PRECISION,left,r1Tag+100,cartcomm,nstatus,errcode) - - IF (Id1 .eq. 0) & - call MPI_SEND(array(1,0:py+1,0:pz+1),(py+2)*(pz+2),MPI_DOUBLE_PRECISION,left,l1Tag+100,cartcomm,errcode) - - IF (Id1 .eq. num_subdomain_x-1) & - call MPI_RECV(array(px+1,0:py+1,0:pz+1),(py+2)*(pz+2),MPI_DOUBLE_PRECISION,right,l1Tag+100,cartcomm,nstatus,errcode) - END IF - -CASE (2) - IF ( num_subdomain_y .eq. 1) THEN - array(0:px+1,0,0:pz+1) = array(0:px+1,py,0:pz+1) - array(0:px+1,py+1,0:pz+1) = array(0:px+1,1,0:pz+1) - ELSE - IF (Id2 .eq. num_subdomain_y-1) THEN - call MPI_SEND(array(0:px+1,py,0:pz+1),(px+2)*(pz+2),MPI_DOUBLE_PRECISION,back,f1Tag+100,cartcomm,errcode) - END IF - - IF (Id2 .eq. 0) THEN - call MPI_RECV(array(0:px+1,0,0:pz+1),(px+2)*(pz+2),MPI_DOUBLE_PRECISION,front,f1Tag+100,cartcomm,nstatus,errcode) - END IF - - IF (Id2 .eq. 0) & - call MPI_SEND(array(0:px+1,1,0:pz+1),(px+2)*(pz+2),MPI_DOUBLE_PRECISION,front,b1Tag+100,cartcomm,errcode) - - IF (Id2 .eq. num_subdomain_y-1) & - call MPI_RECV(array(0:px+1,py+1,0:pz+1),(px+2)*(pz+2),MPI_DOUBLE_PRECISION,back,b1Tag+100,cartcomm,nstatus,errcode) - END IF -CASE (3) - IF ( num_subdomain_z .eq. 1) THEN - array(0:px+1,0:py+1,0) = array(0:px+1,0:py+1,pz) - array(0:px+1,0:py+1,pz+1) = array(0:px+1,0:py+1,1) - ELSE - IF (Id3 .eq. num_subdomain_z-1) & - call MPI_SEND(array(0:px+1,0:py+1,pz),(px+2)*(py+2),MPI_DOUBLE_PRECISION,top,t1Tag+100,cartcomm,errcode) - - IF (Id3 .eq. 0) & - call MPI_RECV(array(0:px+1,0:py+1,0),(px+2)*(py+2),MPI_DOUBLE_PRECISION,bot,t1Tag+100,cartcomm,nstatus,errcode) - - IF (Id3 .eq. 0) & - call MPI_SEND(array(0:px+1,0:py+1,1),(px+2)*(py+2),MPI_DOUBLE_PRECISION,bot,d1Tag+100,cartcomm,errcode) - - IF (Id3 .eq. num_subdomain_z-1) & - call MPI_RECV(array(0:px+1,0:py+1,pz+1),(px+2)*(py+2),MPI_DOUBLE_PRECISION,top,d1Tag+100,cartcomm,nstatus,errcode) - END IF - -END SELECT - -END SUBROUTINE external_BCs_Periodic - -!!=================================================================================== -!! Internal BC Communication Subroutine -!!=================================================================================== - -SUBROUTINE commuBC(Id1,Id2,Id3,L1,L2,L3,S1,S2,S3,phi1,left,right,front,back,top,bot,cartcomm) -use parameters -implicit none -INCLUDE 'mpif.h' - -INTEGER S1, S2, S3, Id1, Id2, Id3,L1,L2,L3 -INTEGER :: left,right,front,back,top,bot,cartcomm !ranks of processors to shift to and cartcomm -INTEGER :: i,j,k -INTEGER :: errcode -REAL(KIND=8) :: phi1(S1:S1+L1-1,S2:S2+L2-1,S3:S3+L3-1) -INTEGER,DIMENSION(MPI_STATUS_SIZE) :: nstatus - -! Interior boundary condition -! communication in n1 direction - -If(Id1 .NE. num_subdomain_x-1) call MPI_SEND(phi1(S1+L1-1-bb,S2:S2+L2-1,S3:S3+L3-1), & - bb*L2*L3,MPI_DOUBLE_PRECISION,right,r1Tag,cartcomm,errcode) !Send real grid - -If(Id1 .NE. 0) call MPI_RECV(phi1(S1,S2:S2+L2-1,S3:S3+L3-1), & - bb*L2*L3,MPI_DOUBLE_PRECISION,left,r1Tag,cartcomm,nstatus,errcode) !receive by ghost grid - -If(Id1 .NE. 0) call MPI_SEND(phi1(S1+bb,S2:S2+L2-1,S3:S3+L3-1), & - bb*L2*L3,MPI_DOUBLE_PRECISION,left,l1Tag,cartcomm,errcode) - -If(Id1 .NE. num_subdomain_x-1) call MPI_RECV(phi1(S1+L1-1,S2:S2+L2-1,S3:S3+L3-1), & - bb*L2*L3,MPI_DOUBLE_PRECISION,right,l1Tag,cartcomm,nstatus,errcode) - -! communication in n2 direction - -If(Id2 .NE. num_subdomain_y-1) call MPI_SEND(phi1(S1:S1+L1-1,S2+L2-1-bb,S3:S3+L3-1), & - L1*bb*L3,MPI_DOUBLE_PRECISION,back,f1Tag,cartcomm,errcode) - -If(Id2 .NE. 0) call MPI_RECV(phi1(S1:S1+L1-1,S2,S3:S3+L3-1), & - L1*bb*L3,MPI_DOUBLE_PRECISION,front,f1Tag,cartcomm,nstatus,errcode) - -If(Id2 .NE. 0) call MPI_SEND(phi1(S1:S1+L1-1,S2+bb,S3:S3+L3-1), & - L1*bb*L3,MPI_DOUBLE_PRECISION,front,b1Tag,cartcomm,errcode) - -If(Id2 .NE. num_subdomain_y-1) call MPI_RECV(phi1(S1:S1+L1-1,S2+L2-1,S3:S3+L3-1), & - L1*bb*L3,MPI_DOUBLE_PRECISION,back,b1Tag,cartcomm,nstatus,errcode) - -! communication in n3 direction - - -If(Id3 .NE. num_subdomain_z-1) call MPI_SEND(phi1(S1:S1+L1-1,S2:S2+L2-1,S3+L3-1-bb), & - L1*L2*bb,MPI_DOUBLE_PRECISION,top,t1Tag,cartcomm,errcode) - -If(Id3 .NE. 0) call MPI_RECV(phi1(S1:S1+L1-1,S2:S2+L2-1,S3), & - L1*L2*bb,MPI_DOUBLE_PRECISION,bot,t1Tag,cartcomm,nstatus,errcode) - -If(Id3 .NE. 0) call MPI_SEND(phi1(S1:S1+L1-1,S2:S2+L2-1,S3+bb), & - L1*L2*bb,MPI_DOUBLE_PRECISION,bot,d1Tag,cartcomm,errcode) - -If(Id3 .NE. num_subdomain_z-1) call MPI_RECV(phi1(S1:S1+L1-1,S2:S2+L2-1,S3+L3-1), & - L1*L2*bb,MPI_DOUBLE_PRECISION,top,d1Tag,cartcomm,nstatus,errcode) - -RETURN -END SUBROUTINE - -!! =================================================================================== -!! Input subroutine -!! =================================================================================== - -!SUBROUTINE loadLotsFiles(arrIn,name_string,Is1,Ie1,Is2,Ie2,Is3,Ie3, Id1,Id2,Id3) -!! Purpose: -!! Write arrIn to an individual file for each core. -!! File has Id1,Id2,Id3 in filename as _XXYYZZ.frt -! -!USE parameters -!IMPLICIT NONE -! -!! Declare variables:--------------------------------------------------------+ -!INTEGER, INTENT(in) :: Is1,Ie1,Is2,Ie2,Is3,Ie3, Id1,Id2,Id3 -!REAL(KIND=8), DIMENSION(Is1-bb:Ie1+bb,Is2-bb:Ie2+bb,Is3-bb:Ie3+bb) :: arrIn ! Array to load -!CHARACTER(LEN=29) :: filename ! Filename of input or output -!CHARACTER(LEN=5) :: tstring, name_string -!CHARACTER(LEN=2) :: Id1string, Id2string, Id3string -!CHARACTER(LEN=3) :: counter -!INTEGER :: status -!INTEGER :: tpStep, i, outFreq -!!---------------------------------------------------------------------------+ -! -!WRITE(counter,'(I3)') 100+load_from_output -! -!write(Id1string,'(i2.2)')Id1 -!write(Id2string,'(i2.2)')Id2 -!write(Id3string,'(i2.2)')Id3 -! -!filename=name_string//load_from_run//'_'//counter(2:3)//'_'//Id1string//Id2string//Id3string//'.frt' -!!PRINT *,'Filename:', filename -!OPEN (FILE=output_path//filename, UNIT=300, STATUS='UNKNOWN', FORM='UNFORMATTED') -!READ (300) arrIn(Is1:Ie1,Is2:Ie2,Is3:Ie3) -!CLOSE (300) -! -!RETURN -! -!END SUBROUTINE loadLotsFiles - - -!! =================================================================================== -!! Output subroutine -!! =================================================================================== - -SUBROUTINE writeLotsFiles(arrIn,name_string,step,Is1,Ie1,Is2,Ie2,Is3,Ie3,Id1,Id2,Id3) -! Purpose: -! Write arrIn to an individual file for each core. -! File has Id1,Id2,Id3 in filename as _XXYYZZ.frt - -USE parameters -IMPLICIT NONE - -! Declare variables:--------------------------------------------------------+ -INTEGER, INTENT(in) :: Is1,Ie1,Is2,Ie2,Is3,Ie3, Id1,Id2,Id3 -REAL(KIND=8), DIMENSION(Is1-bb:Ie1+bb,Is2-bb:Ie2+bb,Is3-bb:Ie3+bb), INTENT(IN) :: arrIn ! Array to write -CHARACTER(LEN=29) :: filename ! Filename of input or output -CHARACTER(LEN=5) :: tstring, name_string -CHARACTER(LEN=2) :: Id1string, Id2string, Id3string -CHARACTER(LEN=3) :: counter -INTEGER, INTENT(in) :: step -INTEGER :: tpStep, i, outFreq -!---------------------------------------------------------------------------+ - -WRITE(counter,'(I3)') 100+step - -write(Id1string,'(i2.2)')Id1 -write(Id2string,'(i2.2)')Id2 -write(Id3string,'(i2.2)')Id3 - -filename=name_string//run_num//'_'//counter(2:3)//'_'//Id1string//Id2string//Id3string//'.frt' -OPEN (FILE=output_path//filename, UNIT=300, STATUS='UNKNOWN', FORM='UNFORMATTED') -WRITE (300) arrIn(Is1:Ie1,Is2:Ie2,Is3:Ie3) -CLOSE (300) - -RETURN - -END SUBROUTINE writeLotsFiles - -!! =================================================================================== - -SUBROUTINE writeLotsFiles2(arrIn,name_string,step,Is1,Ie1,Is2,Ie2,Is3,Ie3,Id1,Id2,Id3) -! Purpose: -! Write arrIn to an individual file for each core. -! File has Id1,Id2,Id3 in filename as _XXYYZZ.frt - -USE parameters -IMPLICIT NONE - -! Declare variables:--------------------------------------------------------+ -INTEGER, INTENT(in) :: Is1,Ie1,Is2,Ie2,Is3,Ie3, Id1,Id2,Id3 -REAL(KIND=8), DIMENSION(Is1:Ie1,Is2:Ie2,Is3:Ie3), INTENT(IN) :: arrIn ! Array to write -CHARACTER(LEN=29) :: filename ! Filename of input or output -CHARACTER(LEN=5) :: tstring, name_string -CHARACTER(LEN=2) :: Id1string, Id2string, Id3string -CHARACTER(LEN=3) :: counter -INTEGER, INTENT(in) :: step -INTEGER :: tpStep, i, outFreq -!---------------------------------------------------------------------------+ - -WRITE(counter,'(I3)') 100+step - -write(Id1string,'(i2.2)')Id1 -write(Id2string,'(i2.2)')Id2 -write(Id3string,'(i2.2)')Id3 - -filename=name_string//run_num//'_'//counter(2:3)//'_'//Id1string//Id2string//Id3string//'.frt' -OPEN (FILE=output_path//filename, UNIT=300, STATUS='UNKNOWN', FORM='UNFORMATTED') -WRITE (300) arrIn(Is1:Ie1,Is2:Ie2,Is3:Ie3) -CLOSE (300) - -RETURN - -END SUBROUTINE writeLotsFiles2 - -!! ================================================================================================= - -SUBROUTINE outputVector(vector,outName,length) -USE parameters -IMPLICIT NONE -INTEGER :: length, outNum -REAL(KIND=8),DIMENSION(1:length) :: vector -CHARACTER(LEN=8) :: outName -CHARACTER(LEN=12) :: filename - -!! This subroutine outputs arrays of length "length" to file. - -WRITE(filename, '(A8,A4)') outName,'.dat' -OPEN(UNIT=300,FILE=output_path//filename,FORM='FORMATTED',ACTION='WRITE') -WRITE(300,'(E25.12)') vector -CLOSE(300) - -END SUBROUTINE outputVector - -!! ================================================================================================= - -!SUBROUTINE loadVector(vector,outName,length) -!USE parameters -!IMPLICIT NONE -!INTEGER :: length, outNum -!REAL(KIND=8),DIMENSION(1:length) :: vector -!CHARACTER(LEN=8) :: outName -!CHARACTER(LEN=12) :: filename -! -!!! This subroutine outputs arrays of length "length" to file. -! -!WRITE(filename, '(A8,A4)') outName,'.dat' -!OPEN(UNIT=300,FILE=output_path//filename,FORM='FORMATTED',ACTION='READ') -!READ(300,'(E25.12)') vector -!CLOSE(300) -! -!END SUBROUTINE loadVector - -!! ================================================================================================= - -SUBROUTINE outputDomainInfo() -USE parameters -IMPLICIT NONE - -CHARACTER(LEN=3) :: counter -CHARACTER(LEN=18) :: filename - -!! This subroutine outputs the dimensions of the domain and the number of subdomains - -WRITE(filename, '(A11,A3,A4)') 'domain_info',run_num,'.frt' -OPEN(UNIT=20,FILE=output_path//filename,ACTION='WRITE') -WRITE(20,*) xg -WRITE(20,*) yg -WRITE(20,*) zg -WRITE(20,*) num_subdomain_x -WRITE(20,*) num_subdomain_y -WRITE(20,*) num_subdomain_z -CLOSE(20) - -END SUBROUTINE - - diff --git a/tests/deprecated_tests/finite_difference_comparison/CHAC_speed_comparison/finite_difference_CHAC/fd_results.tar b/tests/deprecated_tests/finite_difference_comparison/CHAC_speed_comparison/finite_difference_CHAC/fd_results.tar deleted file mode 100644 index 7c6404194..000000000 Binary files a/tests/deprecated_tests/finite_difference_comparison/CHAC_speed_comparison/finite_difference_CHAC/fd_results.tar and /dev/null differ diff --git a/tests/deprecated_tests/finite_difference_comparison/CHAC_speed_comparison/finite_difference_CHAC/fd_results/assemble_MPI_output.m b/tests/deprecated_tests/finite_difference_comparison/CHAC_speed_comparison/finite_difference_CHAC/fd_results/assemble_MPI_output.m deleted file mode 100644 index dea7b9455..000000000 --- a/tests/deprecated_tests/finite_difference_comparison/CHAC_speed_comparison/finite_difference_CHAC/fd_results/assemble_MPI_output.m +++ /dev/null @@ -1,70 +0,0 @@ -function array_global = assemble_MPI_output(prda,path,run_num) - -domain_info = importdata(['domain_info' run_num '.frt']); - -xg = domain_info(1); -yg = domain_info(2); -zg = domain_info(3); - -num_x_subdomain = domain_info(4); -num_y_subdomain = domain_info(5); -num_z_subdomain = domain_info(6); - -plot_start_x = 1; -plot_end_x = xg; -plot_start_y = 1; -plot_end_y = yg; -plot_start_z = 1; -plot_end_z = zg; - -% Cycle through each subdomain -for x_subdomain = 0:num_x_subdomain-1 - for y_subdomain = 0:num_y_subdomain-1 - for z_subdomain = 0:num_z_subdomain-1 - - if x_subdomain < num_x_subdomain-1 - px = floor(xg/num_x_subdomain); - else - px = xg - (num_x_subdomain-1)*floor(xg/num_x_subdomain); - end - - if y_subdomain < num_y_subdomain-1 - py = floor(yg/num_y_subdomain); - else - py = yg - (num_y_subdomain-1)*floor(yg/num_y_subdomain); - end - - if z_subdomain < num_z_subdomain-1 - pz = floor(zg/num_z_subdomain); - else - pz = zg - (num_z_subdomain-1)*floor(zg/num_z_subdomain); - end - - Is1 = x_subdomain*floor(xg/num_x_subdomain) + 1; - Ie1 = Is1 + px - 1; - - Is2 = y_subdomain*floor(yg/num_y_subdomain) + 1; - Ie2 = Is2 + py - 1; - - Is3 = z_subdomain*floor(zg/num_z_subdomain) + 1; - Ie3 = Is3 + pz - 1; - - subdomain_index = strcat(sprintf('%02d', x_subdomain), sprintf('%02d', y_subdomain), sprintf('%02d', z_subdomain)); - - ext = '.frt'; - - %% domain parameter - fname = [path prda subdomain_index ext]; - fid = fopen(fname); - skip1 = fread(fid,1,'int32'); - BD = fread(fid,inf,'double'); - fclose(fid); - [r1 c1] = size(BD); - [r1 px*py*pz]; - array_local = reshape(BD(1:r1),px,py,pz); - - array_global(Is1:Ie1,Is2:Ie2,Is3:Ie3) = array_local; - - end - end -end diff --git a/tests/deprecated_tests/finite_difference_comparison/CHAC_speed_comparison/finite_difference_CHAC/fd_results/plot_FD_CHAC.m b/tests/deprecated_tests/finite_difference_comparison/CHAC_speed_comparison/finite_difference_CHAC/fd_results/plot_FD_CHAC.m deleted file mode 100644 index d8ee0684a..000000000 --- a/tests/deprecated_tests/finite_difference_comparison/CHAC_speed_comparison/finite_difference_CHAC/fd_results/plot_FD_CHAC.m +++ /dev/null @@ -1,69 +0,0 @@ -function [z,c_0,c_1] = plot_FD_CHAC() - -% -------------------------------------------------------------------------------------------------------- -% Plot the concentration -% -------------------------------------------------------------------------------------------------------- - -run_num = '001'; - -domain_info = importdata(['domain_info' run_num '.frt']); - -xg = domain_info(1); -yg = domain_info(2); -zg = domain_info(3); - -output_num = '00'; -c_0 = assemble_MPI_output(['con_r' run_num '_' output_num '_'],'',run_num); -eta_0 = assemble_MPI_output(['eta_r' run_num '_' output_num '_'],'',run_num); - -x = assemble_MPI_output(['xgrid' run_num '_' output_num '_'],'',run_num); -y = assemble_MPI_output(['ygrid' run_num '_' output_num '_'],'',run_num); -z = assemble_MPI_output(['zgrid' run_num '_' output_num '_'],'',run_num); - -output_num = '01'; -c_1 = assemble_MPI_output(['con_r' run_num '_' output_num '_'],'',run_num); -eta_1 = assemble_MPI_output(['eta_r' run_num '_' output_num '_'],'',run_num); - -threeD_precipitate_plotter(c_1,xg,yg,zg,1); -drawnow; - -vtkwrite('fd_results.vtk','structured_grid',x,y,z,... - 'scalars','c_0',c_0,'scalars','c_1',c_1); - - -end - -function threeD_precipitate_plotter(c,xg,yg,zg,fig_num) - -plot_start_x = 1; -plot_end_x = xg; -plot_start_y = 1; -plot_end_y = yg; -plot_start_z = 1; -plot_end_z = zg; - -figure(fig_num); -whitebg('w') - -ite = 1; -isovL = 0.06; -isovC = 0.06; - -[NewY,NewX,NewZ] = meshgrid(plot_start_y:plot_end_y,plot_start_x:plot_end_x,plot_start_z:plot_end_z); - -p1 = patch(isosurface(NewY,NewX,NewZ,c(plot_start_x:plot_end_x,plot_start_y:plot_end_y,plot_start_z:plot_end_z),isovL)); -p2 = patch(isocaps(NewY,NewX,NewZ,c(plot_start_x:plot_end_x,plot_start_y:plot_end_y,plot_start_z:plot_end_z),isovL)); - -isocolors(c(plot_start_x:plot_end_x,plot_start_y:plot_end_y,plot_start_z:plot_end_z),p1) -set(p1,'FaceColor','interp','EdgeColor','none') -isonormals(c(plot_start_x:plot_end_x,plot_start_y:plot_end_y,plot_start_z:plot_end_z),p1) -isocolors(c(plot_start_x:plot_end_x,plot_start_y:plot_end_y,plot_start_z:plot_end_z),p2) -set(p2,'FaceColor','interp','EdgeColor','none') - -set(gca,'Projection','perspective') -view(3); daspect([1,1,1]); -axis([1 yg 1 xg 1 zg]);box on; -lightangle(45,60) -lighting phong - -end diff --git a/tests/deprecated_tests/finite_difference_comparison/CHAC_speed_comparison/finite_difference_CHAC/fd_results/vtkwrite.m b/tests/deprecated_tests/finite_difference_comparison/CHAC_speed_comparison/finite_difference_CHAC/fd_results/vtkwrite.m deleted file mode 100644 index cbb6298f3..000000000 --- a/tests/deprecated_tests/finite_difference_comparison/CHAC_speed_comparison/finite_difference_CHAC/fd_results/vtkwrite.m +++ /dev/null @@ -1,185 +0,0 @@ -function vtkwrite( filename,dataType,varargin ) -% VTKWRITE Writes 3D Matlab array into VTK file format. -% vtkwrite(filename,'structured_grid',x,y,z,'vectors',title,u,v,w) writes -% a structured 3D vector data into VTK file, with name specified by the string -% filename. (u,v,w) are the vector components at the points (x,y,z). x,y,z -% should be 3-D matrices like those generated by meshgrid, where -% point(ijk) is specified by x(i,j,k), y(i,j,k) and z(i,j,k). -% The matrices x,y,z,u,v,w must all be the same size and contain -% corrresponding position and vector component. The string title specifies -% the name of the vector field to be saved. -% -% vtkwrite(filename,'structured_grid',x,y,z,'scalars',title,r) writes a 3D -% scalar data into VTK file whose name is specified by the string -% filename. r is the scalar value at the points (x,y,z). The matrices -% x,y,z,r must all be the same size and contain the corresponding position -% and scalar values. -% -% vtkwrite(filename,'structured_grid',x,y,z,'vectors',title1,u,v,w,'scalars', -% title2,r) writes a 3D structured grid that contains both vector and scalar values. -% x,y,z,u,v,w,r must all be the same size and contain the corresponding -% positon, vector and scalar values. -% -% vtkwrite(filename,'unstructured_grid',x,y,z,'vectors',title1,u,v,w,'scalars', -% title2,r) writes a 3D unstructured grid that contains both vector and scalar values. -% x,y,z,u,v,w,r must all be the same size and contain the corresponding -% positon, vector and scalar values. -% -% vtkwrite(filename,'polydata','lines',x,y,z) exports a 3D line where -% x,y,z are coordinates of the points that make the line. x,y,z are -% vectors containing the coordinates of points of the line, where point(n) -% is specified by x(n),y(n) and z(n). -% -% vtkwrite(filename,'polydata','lines',x,y,z,'Precision',n) allows you to -% specify precision of the exported number up to n digits after decimal -% point. Default precision is 3 digits. -% -% vtkwrite(filename,'polydata','triangle',x,y,z,tri) exports a list of -% triangles where x,y,z are the coordinates of the points and tri is an -% m*3 matrix whose rows denote the points of the individual triangles. -% -% vtkwrite(filename,'polydata','tetrahedron',x,y,z,tetra) exports a list -% of tetrahedrons where x,y,z are the coordinates of the points -% and tetra is an m*4 matrix whose rows denote the points of individual -% tetrahedrons. -% -% vtkwrite('execute','polydata','lines',x,y,z) will save data with default -% filename ''matlab_export.vtk' and automatically loads data into -% ParaView. -% -% Version 2.2.1 -% Chaoyuan Yeh, 2015 -% Codes are modified from William Thielicke and David Gingras's submission. - -if strcmpi(filename,'execute'), filename = 'matlab_export.vtk'; end -fid = fopen(filename, 'w'); -% VTK files contain five major parts -% 1. VTK DataFile Version -fprintf(fid, '# vtk DataFile Version 2.0\n'); -% 2. Title -fprintf(fid, 'VTK from Matlab\n'); -switch upper(dataType) - case {'STRUCTURED_GRID','UNSTRUCTURED_GRID'} - % 3. The format data proper is saved in (ASCII or Binary). Use - % fprintf to write data in the case of ASCII and fwrite for binary. - if numel(varargin)<6, error('Not enough input arguments'); end - fprintf(fid, 'BINARY\n'); - x = varargin{1}; - y = varargin{2}; - z = varargin{3}; - if sum(size(x)==size(y) & size(y)==size(z))~=length(size(x)) - error('Input dimesions do not match') - end - n_elements = numel(x); - % 4. Type of Dataset ( can be STRUCTURED_POINTS, STRUCTURED_GRID, - % UNSTRUCTURED_GRID, POLYDATA, RECTILINEAR_GRID or FIELD ) - % This part, dataset structure, begins with a line containing the - % keyword 'DATASET' followed by a keyword describing the type of dataset. - % Then the geomettry part describes geometry and topology of the dataset. - if strcmpi(dataType,'STRUCTURED_GRID') - fprintf(fid, 'DATASET STRUCTURED_GRID\n'); - fprintf(fid, ['DIMENSIONS ' num2str(size(x,2)) ' ' num2str(size(x,1)) ' ' num2str(size(x,3)) '\n']); - else - fprintf(fid, 'DATASET UNSTRUCTURED_GRID\n'); - end - fprintf(fid, ['POINTS ' num2str(n_elements) ' float\n']); - fwrite(fid, [x(:)';y(:)';z(:)'],'float','b'); - % 5.This final part describe the dataset attributes and begins with the - % keywords 'POINT_DATA' or 'CELL_DATA', followed by an integer number - % specifying the number of points of cells. Other keyword/data combination - % then define the actual dataset attribute values. - fprintf(fid, ['\nPOINT_DATA ' num2str(n_elements)]); - % Parse remaining argument. - vidx = find(strcmpi(varargin,'VECTORS')); - sidx = find(strcmpi(varargin,'SCALARS')); - if vidx~=0 - for ii = 1:length(vidx) - title = varargin{vidx(ii)+1}; - % Data enteries begin with a keyword specifying data type - % and numeric format. - fprintf(fid, ['\nVECTORS ', title,' float\n']); - fwrite(fid, [reshape(varargin{vidx(ii)+2},1,n_elements);... - reshape(varargin{vidx(ii)+3},1,n_elements);... - reshape(varargin{vidx(ii)+4},1,n_elements)],'float','b'); - end - end - if sidx~=0 - for ii = 1:length(sidx) - title = varargin{sidx(ii)+1}; - fprintf(fid, ['\nSCALARS ', title,' float\n']); - fprintf(fid, 'LOOKUP_TABLE default\n'); - fwrite(fid, reshape(varargin{sidx(ii)+2},1,n_elements),'float','b'); - end - end - - case 'POLYDATA' - fprintf(fid, 'ASCII\n'); - if numel(varargin)<4, error('Not enough input arguments'); end - x = varargin{2}(:); - y = varargin{3}(:); - z = varargin{4}(:); - if numel(varargin)<4, error('Not enough input arguments'); end - if sum(size(x)==size(y) & size(y)==size(z))~= length(size(x)) - error('Input dimesions do not match') - end - n_elements = numel(x); - fprintf(fid, 'DATASET POLYDATA\n'); - if mod(n_elements,3)==1 - x(n_elements+1:n_elements+2,1)=[0;0]; - y(n_elements+1:n_elements+2,1)=[0;0]; - z(n_elements+1:n_elements+2,1)=[0;0]; - elseif mod(n_elements,3)==2 - x(n_elements+1,1)=0; - y(n_elements+1,1)=0; - z(n_elements+1,1)=0; - end - nbpoint = numel(x); - fprintf(fid, ['POINTS ' num2str(nbpoint) ' float\n']); - precision = '3'; - if any(strcmpi(varargin,'PRECISION')) - precision = num2str(uint8(varargin{find(strcmpi(varargin,'PRECISION'))+1})); - if str2double(precision) < 0, error('Invalid precision spec.');end - end - spec = [repmat(['%0.',precision,'f '],1,9),'\n']; - fprintf(fid,spec, [x(1:3:end-2) y(1:3:end-2) z(1:3:end-2) ... - x(2:3:end-1) y(2:3:end-1) z(2:3:end-1) ... - x(3:3:end) y(3:3:end) z(3:3:end)]'); - switch upper(varargin{1}) - case 'LINES' - if mod(n_elements,2)==0 - nbLine = 2*n_elements-2; - else - nbLine = 2*(n_elements-1); - end - conn1 = zeros(nbLine,1); - conn2 = zeros(nbLine,1); - conn2(1:nbLine/2) = 1:nbLine/2; - conn1(1:nbLine/2) = conn2(1:nbLine/2)-1; - conn1(nbLine/2+1:end) = 1:nbLine/2; - conn2(nbLine/2+1:end) = conn1(nbLine/2+1:end)-1; - fprintf(fid,'\nLINES %d %d\n',nbLine,3*nbLine); - fprintf(fid,'2 %d %d\n',[conn1';conn2']); - case 'TRIANGLE' - ntri = length(varargin{5}); - fprintf(fid,'\nPOLYGONS %d %d\n',ntri,4*ntri); - fprintf(fid,'3 %d %d %d\n',(varargin{5}-1)'); - case 'TETRAHEDRON' - ntetra = length(varargin{5}); - fprintf(fid,'\nPOLYGONS %d %d\n',ntetra,5*ntetra); - fprintf(fid,'4 %d %d %d %d\n',(varargin{5}-1)'); - end -end -fclose(fid); -if strcmpi(filename,'matlab_export.vtk') - switch computer - case {'PCWIN','PCWIN64'} - !paraview.exe --data='matlab_export.vtk' & - % Exclamation point character is a shell escape, the rest of the - % input line will be sent to operating system. It can not take - % variables, though. The & at the end of line will return control to - % Matlab even when the outside process is still running. - case {'GLNXA64','MACI64'} - !paraview --data='matlab_export.vtk' & - end -end -end \ No newline at end of file diff --git a/tests/deprecated_tests/finite_difference_comparison/CHAC_speed_comparison/finite_difference_CHAC/parameters.mod b/tests/deprecated_tests/finite_difference_comparison/CHAC_speed_comparison/finite_difference_CHAC/parameters.mod deleted file mode 100644 index fda55eb1e..000000000 Binary files a/tests/deprecated_tests/finite_difference_comparison/CHAC_speed_comparison/finite_difference_CHAC/parameters.mod and /dev/null differ diff --git a/tests/deprecated_tests/finite_difference_comparison/CHAC_speed_comparison/main.cc b/tests/deprecated_tests/finite_difference_comparison/CHAC_speed_comparison/main.cc deleted file mode 100644 index 5172f5398..000000000 --- a/tests/deprecated_tests/finite_difference_comparison/CHAC_speed_comparison/main.cc +++ /dev/null @@ -1,53 +0,0 @@ -// Coupled Cahn-Hilliard, Allen-Cahn and Mechanics problem -// general headers -#include "../../../include/dealIIheaders.h" - -// Coupled Cahn-Hilliard+Allen-Cahn+Mechanics problem headers -#include "ICs_and_BCs.h" -#include "equations.h" -#include "parameters.h" - -#include "../../../src/models/coupled/generalized_model.h" -#include "../../../src/models/coupled/generalized_model_functions.h" - -// main -int -main(int argc, char **argv) -{ - Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, - argv, - numbers::invalid_unsigned_int); - try - { - deallog.depth_console(0); - generalizedProblem problem; - - problem.setBCs(); - problem.buildFields(); - problem.init(); - problem.solve(); - } - catch (std::exception &exc) - { - std::cerr << std::endl - << std::endl - << "----------------------------------------------------" << std::endl; - std::cerr << "Exception on processing: " << std::endl - << exc.what() << std::endl - << "Aborting!" << std::endl - << "----------------------------------------------------" << std::endl; - return 1; - } - catch (...) - { - std::cerr << std::endl - << std::endl - << "----------------------------------------------------" << std::endl; - std::cerr << "Unknown exception!" << std::endl - << "Aborting!" << std::endl - << "----------------------------------------------------" << std::endl; - return 1; - } - - return 0; -} diff --git a/tests/deprecated_tests/finite_difference_comparison/CHAC_speed_comparison/parameters.h b/tests/deprecated_tests/finite_difference_comparison/CHAC_speed_comparison/parameters.h deleted file mode 100644 index e6c07eb41..000000000 --- a/tests/deprecated_tests/finite_difference_comparison/CHAC_speed_comparison/parameters.h +++ /dev/null @@ -1,67 +0,0 @@ -// Parameter list for the coupled Allen-Cahn/Cahn-Hilliard example application -// All strictly numerical parameters should be set in this file - -// ================================================================================= -// Set the number of dimensions (1, 2, or 3 for a 1D, 2D, or 3D calculation) -// ================================================================================= -#define problemDIM 3 -// ================================================================================= - -// ================================================================================= -// Set the length of the domain in all three dimensions -// ================================================================================= -// Each axes spans from zero to the specified length -#define spanX 64.0 -#define spanY 64.0 -#define spanZ 64.0 -// ================================================================================= - -// ================================================================================= -// Set the element parameters -// ================================================================================= -// The number of elements in each direction is 2^(refineFactor) * subdivisions -// For optimal performance, use refineFactor primarily to determine the element -// size -#define subdivisionsX 5 -#define subdivisionsY 5 -#define subdivisionsZ 5 -#define refineFactor 3 - -// Set the polynomial degree of the element -// Suggested values are either 1 or 2 -#define finiteElementDegree 2 -// ================================================================================= - -// ================================================================================= -// Set the time step parameters -// ================================================================================= -// The size of the time step -#define timeStep (5.0 / 5500.0) - -// The simulation ends when either timeFinal is reached or the number of time -// steps equals timeIncrements -#define timeFinal 10000.0 -#define timeIncrements 27500 -// ================================================================================= - -// ================================================================================= -// Set the output parameters -// ================================================================================= -// Each field in the problem will be output is writeOutput is set to "true" -#define writeOutput true - -// Type of spacing between outputs ("EQUAL_SPACING", "LOG_SPACING", or -// "N_PER_DECADE") -#define outputCondition "EQUAL_SPACING" - -// Number of times the program outputs the fields (total number for -// "EQUAL_SPACING" and "LOG_SPACING", number per decade for "N_PER_DECADE") -#define numOutputs 1 -// ================================================================================= - -// ================================================================================= -// Set the flag determining if the total free energy is calculated for each -// output -// ================================================================================= -#define calcEnergy false -// ================================================================================= diff --git a/tests/deprecated_tests/higher_order_element_tests/hoe_test_2D/CMakeLists.txt b/tests/deprecated_tests/higher_order_element_tests/hoe_test_2D/CMakeLists.txt deleted file mode 100644 index 0444f179d..000000000 --- a/tests/deprecated_tests/higher_order_element_tests/hoe_test_2D/CMakeLists.txt +++ /dev/null @@ -1,32 +0,0 @@ -## -# CMake script for the phaseField applications: -## - - -# Set the name of the project and target: -SET(TARGET "main") - -# Declare all source files the target consists of: -SET(TARGET_SRC - ${TARGET}.cc - # You can specify additional files here! - ) - -# Usually, you will not need to modify anything beyond this point... - -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8) - -FIND_PACKAGE(deal.II 8.0 QUIET - HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} - ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" - "*** Could not locate deal.II. ***\n\n" - "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" - "or set an environment variable \"DEAL_II_DIR\" that contains this path." - ) -ENDIF() - -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() diff --git a/tests/deprecated_tests/higher_order_element_tests/hoe_test_2D/ICs_and_BCs.h b/tests/deprecated_tests/higher_order_element_tests/hoe_test_2D/ICs_and_BCs.h deleted file mode 100644 index 7129dffae..000000000 --- a/tests/deprecated_tests/higher_order_element_tests/hoe_test_2D/ICs_and_BCs.h +++ /dev/null @@ -1,187 +0,0 @@ -// initial condition -template -class InitialCondition : public Function -{ -public: - unsigned int index; - Vector values; - - InitialCondition(const unsigned int _index) - : Function(1) - , index(_index) - { - std::srand(Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) + 1); - } - - double - value(const Point &p, const unsigned int component = 0) const - { - double scalar_IC = 0; - // ===================================================================== - // ENTER THE INITIAL CONDITIONS HERE FOR SCALAR FIELDS - // ===================================================================== - // Enter the function describing conditions for the fields at point "p". - // Use "if" statements to set the initial condition for each variable - // according to its variable index. - -#define x_denom 1.0 -#define y_denom 1.0 -#define z_denom 1.0 -#define initial_interface_coeff 1.0 -#define initial_radius 7.0 -#define avg_Nd 0.004 - - if (index == 0) - { - // return the value of the initial concentration field at point p - double dx = spanX / ((double) subdivisionsX) / std::pow(2.0, refineFactor); - double dy = spanY / ((double) subdivisionsY) / std::pow(2.0, refineFactor); - double dz = spanZ / ((double) subdivisionsZ) / std::pow(2.0, refineFactor); - double r = 0.0; - // return 0.02 + 1.0e-3*(2*(0.5 - (double)(std::rand() % 100 )/100.0)); -#if problemDIM == 1 - r = p.operator()(0); - return 0.5 * (0.12 - 0.00) * (1 - std::tanh((r - spanX / 16.0) / (0.1 * dx))); -#elif problemDIM == 2 - - r = sqrt((p.operator()(0)) * (p.operator()(0)) / x_denom + - (p.operator()(1)) * (p.operator()(1)) / y_denom); - return 0.5 * (0.12 - avg_Nd) * - (1.0 - std::tanh((r - initial_radius) / (initial_interface_coeff))) + - avg_Nd; - -#elif problemDIM == 3 - - r = sqrt((p.operator()(0)) * (p.operator()(0)) / x_denom + - (p.operator()(1)) * (p.operator()(1)) / y_denom + - (p.operator()(2)) * (p.operator()(2)) / z_denom); - return 0.5 * (0.12 - avg_Nd) * - (1.0 - std::tanh((r - initial_radius) / (initial_interface_coeff))) + - avg_Nd; - -#endif - } - else if (index == 1) - { - // set result equal to the structural order paramter initial condition - double dx = spanX / ((double) subdivisionsX) / std::pow(2.0, refineFactor); - double dy = spanY / ((double) subdivisionsY) / std::pow(2.0, refineFactor); - double dz = spanZ / ((double) subdivisionsZ) / std::pow(2.0, refineFactor); - double r = 0.0; -#if problemDIM == 1 - r = p.operator()(0); - return 0.5 * (1.0 - std::tanh((r - spanX / 16.0) / (0.1 * dx))); -#elif problemDIM == 2 - - r = sqrt((p.operator()(0)) * (p.operator()(0)) / x_denom + - (p.operator()(1)) * (p.operator()(1)) / y_denom); - return 0.5 * (1.0 - std::tanh((r - initial_radius) / (initial_interface_coeff))); - -#elif problemDIM == 3 - // r=p.distance(Point(spanX/2.0,spanY/2.0,spanZ/2.0)); - // return 0.5*(1.0-std::tanh((r-spanX/8.0)/(3*dx))); - - r = sqrt((p.operator()(0)) * (p.operator()(0)) / x_denom + - (p.operator()(1)) * (p.operator()(1)) / y_denom + - (p.operator()(2)) * (p.operator()(2)) / z_denom); - return 0.5 * (1.0 - std::tanh((r - initial_radius) / (initial_interface_coeff))); - - // planar interface - // r=sqrt((p.operator()(2)-spanZ/2.0)*(p.operator()(2)-spanZ/2.0)); - // return 0.5*(1.0-std::tanh((r)/(initial_interface_coeff))); - // return - // 0.5*(1.0-std::tanh((r-initial_radius)/(initial_interface_coeff))); -#endif - return 0.0; - } - else if (index == 2) - { - scalar_IC = 0.0; - } - else if (index == 3) - { - scalar_IC = 0.0; - } - - // ===================================================================== - return scalar_IC; - } -}; - -// initial condition -template -class InitialConditionVec : public Function -{ -public: - unsigned int index; - - // Vector values; - InitialConditionVec(const unsigned int _index) - : Function(dim) - , index(_index) - { - std::srand(Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) + 1); - } - - void - vector_value(const Point &p, Vector &vector_IC) const - { - // ===================================================================== - // ENTER THE INITIAL CONDITIONS HERE FOR VECTOR FIELDS - // ===================================================================== - // Enter the function describing conditions for the fields at point "p". - // Use "if" statements to set the initial condition for each variable - // according to its variable index. - - if (index == 4) - { - vector_IC(0) = 0.0; - vector_IC(1) = 0.0; - if (dim == 3) - { - vector_IC(2) = 0.0; - } - } - // ===================================================================== - } -}; - -template -void -generalizedProblem::setBCs() -{ - // ===================================================================== - // ENTER THE BOUNDARY CONDITIONS HERE - // ===================================================================== - // This function sets the BCs for the problem variables - // The function "inputBCs" should be called for each component of - // each variable and should be in numerical order. Four input arguments - // set the same BC on the entire boundary. Two plus two times the - // number of dimensions inputs sets separate BCs on each face of the domain. - // Inputs to "inputBCs": - // First input: variable number - // Second input: component number - // Third input: BC type (options are "ZERO_DERIVATIVE" and "DIRICHLET") - // Fourth input: BC value (ignored unless the BC type is "DIRICHLET") - // Odd inputs after the third: BC type - // Even inputs after the third: BC value - // Face numbering: starts at zero with the minimum of the first direction, one - // for the maximum of the first direction - // two for the minimum of the second direction, etc. - inputBCs(0, 0, "ZERO_DERIVATIVE", 0); - - inputBCs(1, 0, "ZERO_DERIVATIVE", 0); - - inputBCs(2, 0, "ZERO_DERIVATIVE", 0); - - inputBCs(3, 0, "ZERO_DERIVATIVE", 0); - - inputBCs(4, 0, "DIRICHLET", 0.0); - inputBCs(4, 1, "DIRICHLET", 0.0); - if (dim == 3) - { - inputBCs(4, 2, "DIRICHLET", 0.0); - } - - // ===================================================================== -} diff --git a/tests/deprecated_tests/higher_order_element_tests/hoe_test_2D/error.txt b/tests/deprecated_tests/higher_order_element_tests/hoe_test_2D/error.txt deleted file mode 100644 index 75061cc13..000000000 --- a/tests/deprecated_tests/higher_order_element_tests/hoe_test_2D/error.txt +++ /dev/null @@ -1 +0,0 @@ -9.96684211846e-08 \ No newline at end of file diff --git a/tests/deprecated_tests/higher_order_element_tests/hoe_test_2D/error1.txt b/tests/deprecated_tests/higher_order_element_tests/hoe_test_2D/error1.txt deleted file mode 100644 index b0183ae2d..000000000 --- a/tests/deprecated_tests/higher_order_element_tests/hoe_test_2D/error1.txt +++ /dev/null @@ -1 +0,0 @@ -0.0044260378927 \ No newline at end of file diff --git a/tests/deprecated_tests/higher_order_element_tests/hoe_test_2D/error2.txt b/tests/deprecated_tests/higher_order_element_tests/hoe_test_2D/error2.txt deleted file mode 100644 index 41b6d8c6c..000000000 --- a/tests/deprecated_tests/higher_order_element_tests/hoe_test_2D/error2.txt +++ /dev/null @@ -1 +0,0 @@ -0.00117394141853 \ No newline at end of file diff --git a/tests/deprecated_tests/higher_order_element_tests/hoe_test_2D/error3.txt b/tests/deprecated_tests/higher_order_element_tests/hoe_test_2D/error3.txt deleted file mode 100644 index 67fa0e06a..000000000 --- a/tests/deprecated_tests/higher_order_element_tests/hoe_test_2D/error3.txt +++ /dev/null @@ -1 +0,0 @@ -0.000283651053905 \ No newline at end of file diff --git a/tests/deprecated_tests/higher_order_element_tests/hoe_test_2D/error4.txt b/tests/deprecated_tests/higher_order_element_tests/hoe_test_2D/error4.txt deleted file mode 100644 index 8cbef5208..000000000 --- a/tests/deprecated_tests/higher_order_element_tests/hoe_test_2D/error4.txt +++ /dev/null @@ -1 +0,0 @@ -5.74858859181e-05 \ No newline at end of file diff --git a/tests/deprecated_tests/higher_order_element_tests/hoe_test_2D/getError.py b/tests/deprecated_tests/higher_order_element_tests/hoe_test_2D/getError.py deleted file mode 100644 index 412740181..000000000 --- a/tests/deprecated_tests/higher_order_element_tests/hoe_test_2D/getError.py +++ /dev/null @@ -1,74 +0,0 @@ -import sys - -variable_1 = 'c' -variable_2 = 'c' - -output_num_1 = "100000" -output_num_2 = "100000" - -f = open('run_num_1.txt','r') -run_num_1 = f.read() -f.close() - -f = open('run_num_2.txt','r') -run_num_2 = f.read() -f.close() - -use_mesh_1 = True -apply_3slice = False -apply_box_crop = False - -directory_1 = run_num_1+"/solution-"+output_num_1+".pvtu" -directory_2 = run_num_2+"/solution-"+output_num_2+".pvtu" - -if use_mesh_1 == True: - OpenDatabase(directory_1) - DefineScalarExpression("diff","abs(("+variable_1+"-pos_cmfe(<"+directory_2+":"+variable_2+">, mesh,0))^2)") -else: - OpenDatabase(directory_2) - DefineScalarExpression("diff","abs(("+variable_2+"-pos_cmfe(<"+directory_1+":"+variable_1+">, mesh,0))^2)") - -#AddPlot("Contour","diff") -AddPlot("Pseudocolor","diff") - -PseudocolorAtts = PseudocolorAttributes() -PseudocolorAtts.limitsMode = PseudocolorAtts.CurrentPlot -SetPlotOptions(PseudocolorAtts) - -if apply_box_crop == True: - AddOperator("Box", 1) - BoxAtts = BoxAttributes() - BoxAtts.amount = BoxAtts.Some # Some, All - BoxAtts.minx = 2.0 - BoxAtts.maxx = 30.0 - BoxAtts.miny = 2.0 - BoxAtts.maxy = 30.0 - BoxAtts.minz = 2.0 - BoxAtts.maxz = 30.0 - BoxAtts.inverse = 0 - SetOperatorOptions(BoxAtts, 1) - -if apply_3slice == True: - AddOperator("ThreeSlice") - slice_atts = ThreeSliceAttributes() - slice_atts.x = 16 - slice_atts.y = 16 - slice_atts.z = 16 - SetOperatorOptions(slice_atts) - -DrawPlots() - -#Query("MinMax", use_actual_data=1) -#min_max_val = GetQueryOutputValue() -#error = max(abs(min_max_val[0]),abs(min_max_val[1])) - -# Calculate the L2 error: -Query("Weighted Variable Sum", use_actual_data=1) -error = GetQueryOutputValue() - - -text_file = open("error.txt","w") -text_file.write(str(error)) -text_file.close() - -sys.exit() \ No newline at end of file diff --git a/tests/deprecated_tests/higher_order_element_tests/hoe_test_2D/hoe_test_2D.py b/tests/deprecated_tests/higher_order_element_tests/hoe_test_2D/hoe_test_2D.py deleted file mode 100644 index 5153f4ea9..000000000 --- a/tests/deprecated_tests/higher_order_element_tests/hoe_test_2D/hoe_test_2D.py +++ /dev/null @@ -1,115 +0,0 @@ -import subprocess -import shutil -import glob -import math -import os.path - -# ---------------------------------------------------------------------------------------- -# Function that generates a header file for the simulation, compiles the PRISMS-PF code -# and runs the executable. -# ---------------------------------------------------------------------------------------- -def run_simulation(refineFactor,degree,run_name): - - subdivisionsX = 1 - subdivisionsY = 1 - subdivisionsZ = 1 - finiteElementDegree = degree - - text_file = open("space_parameters.h","w") - text_file.write("// Parameters list for the parameters involved in mesh generation \n") - text_file.write("#define subdivisionsX " + str(subdivisionsX) + "\n") - text_file.write("#define subdivisionsY " + str(subdivisionsY) + "\n") - text_file.write("#define subdivisionsZ " + str(subdivisionsZ) + "\n") - text_file.write("#define refineFactor " + str(refineFactor) + "\n") - text_file.write("#define finiteElementDegree " + str(finiteElementDegree) + "\n") - text_file.close() - - subprocess.call(["make", "release"]) - #subprocess.call(["./main"]) - subprocess.call(["mpirun", "-n", "4", "main"]) - - subprocess.call(["mkdir",run_name]) - for output_files in glob.glob('*vtu'): - shutil.move(output_files,run_name) - -# ---------------------------------------------------------------------------------------- -# Function that calculates the maximum error between a run and a reference result. -# ---------------------------------------------------------------------------------------- -def getError(run_num): - - text_file = open("run_num_1.txt","w") - text_file.write('run_00'+str(run_num)) - text_file.close() - subprocess.call(["visit", "-cli","-s","getError.py"]) - f = open('error.txt','r') - error = float(f.read()) - f.close() - - return error - -# ---------------------------------------------------------------------------------------- - -# If files exist from previous tests, delete them -if os.path.exists("run_001") == True: - shutil.rmtree("run_001") -if os.path.exists("run_002") == True: - shutil.rmtree("run_002") -if os.path.exists("run_003") == True: - shutil.rmtree("run_003") -if os.path.exists("run_004") == True: - shutil.rmtree("run_004") -if os.path.exists("run_005") == True: - shutil.rmtree("run_005") -if os.path.exists("run_006") == True: - shutil.rmtree("run_006") -if os.path.exists("run_007") == True: - shutil.rmtree("run_007") -if os.path.exists("run_008") == True: - shutil.rmtree("run_008") -if os.path.exists("run_009") == True: - shutil.rmtree("run_009") -# -# # Run simulations with a decreasing time step (and an corresponding increase in number of iterations) -run_simulation(4,1,'run_001') -run_simulation(5,1,'run_002') -run_simulation(6,1,'run_003') -run_simulation(3,2,'run_004') -run_simulation(4,2,'run_005') -run_simulation(5,2,'run_006') -run_simulation(3,3,'run_007') -run_simulation(4,3,'run_008') -run_simulation(8,1,'run_009') - -# Find the error for runs 1-8 (as compared to run 9) -text_file = open("run_num_2.txt","w") -text_file.write('run_009') -text_file.close() - -error = [] -error.append(getError(1)) -error.append(getError(2)) -error.append(getError(3)) -error.append(getError(4)) -error.append(getError(5)) -error.append(getError(6)) -error.append(getError(7)) -error.append(getError(8)) - -# Calculate and output the error - -print "Error results: \n" -print "First order element error:", str(error[0]), "(refine level 4)", str(error[1]), "(refine level 5)", \ - str(error[2]), "(refine level 6)", "\n" - -print "Second order element error:", str(error[3]), "(refine level 3)", str(error[4]), "(refine level 4)", \ - str(error[5]), "(refine level 5)", "\n" - -print "Third order element error:", str(error[6]), "(refine level 3)", str(error[7]), "(refine level 4)", "\n" - -# text_file = open("hoe_2D_results.txt","w") -# text_file.write("Results of 2D spatial order of accuracy test: \n") -# text_file.write("From coarse mesh to medium mesh: " + str(ooa_1_to_2) + "\n") -# text_file.write("From from medium mesh to fine mesh: " + str(ooa_2_to_3) + "\n") -# text_file.write("From from fine mesh to very fine mesh: " + str(ooa_3_to_4) + "\n") -# text_file.close() - diff --git a/tests/deprecated_tests/higher_order_element_tests/hoe_test_2D/main.cc b/tests/deprecated_tests/higher_order_element_tests/hoe_test_2D/main.cc deleted file mode 100644 index a62d5cdca..000000000 --- a/tests/deprecated_tests/higher_order_element_tests/hoe_test_2D/main.cc +++ /dev/null @@ -1,54 +0,0 @@ -// Coupled Cahn-Hilliard, Allen-Cahn and Mechanics problem -// general headers -#include "../../../include/dealIIheaders.h" - -// Coupled Cahn-Hilliard+Allen-Cahn+Mechanics problem headers -#include "ICs_and_BCs.h" -#include "parameters.h" -#include "residuals.h" -#include "space_parameters.h" - -#include "../../../src/models/coupled/generalized_model.h" -#include "../../../src/models/coupled/generalized_model_functions.h" - -// main -int -main(int argc, char **argv) -{ - Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, - argv, - numbers::invalid_unsigned_int); - try - { - deallog.depth_console(0); - generalizedProblem problem; - - problem.setBCs(); - problem.buildFields(); - problem.init(); - problem.solve(); - } - catch (std::exception &exc) - { - std::cerr << std::endl - << std::endl - << "----------------------------------------------------" << std::endl; - std::cerr << "Exception on processing: " << std::endl - << exc.what() << std::endl - << "Aborting!" << std::endl - << "----------------------------------------------------" << std::endl; - return 1; - } - catch (...) - { - std::cerr << std::endl - << std::endl - << "----------------------------------------------------" << std::endl; - std::cerr << "Unknown exception!" << std::endl - << "Aborting!" << std::endl - << "----------------------------------------------------" << std::endl; - return 1; - } - - return 0; -} diff --git a/tests/deprecated_tests/higher_order_element_tests/hoe_test_2D/parameters.h b/tests/deprecated_tests/higher_order_element_tests/hoe_test_2D/parameters.h deleted file mode 100644 index 60a9c368d..000000000 --- a/tests/deprecated_tests/higher_order_element_tests/hoe_test_2D/parameters.h +++ /dev/null @@ -1,101 +0,0 @@ -// Parameter list for the precipitate evolution example application -// All strictly numerical parameters should be set in this file - -// ================================================================================= -// Set the number of dimensions (1, 2, or 3 for a 1D, 2D, or 3D calculation) -// ================================================================================= -#define problemDIM 2 - -// ================================================================================= -// Set the length of the domain in all three dimensions -// ================================================================================= -// Each axes spans from zero to the specified length -#define spanX 16.0 -#define spanY 16.0 -#define spanZ 16.0 - -// ================================================================================= -// Set the element parameters -// ================================================================================= -// The number of elements in each direction is 2^(refineFactor) * subdivisions -// For optimal performance, use refineFactor primarily to determine the element -// size #define subdivisionsX 3 #define subdivisionsY 3 #define subdivisionsZ 3 -// #define refineFactor 5 - -// Set the polynomial degree of the element (suggested values: 1 or 2) -// #define finiteElementDegree 2 - -// ================================================================================= -// Set the adaptive mesh refinement parameters -// ================================================================================= -// Set the flag determining if adaptive meshing is activated -#define hAdaptivity false - -// Set the maximum and minimum level of refinement -#define maxRefinementLevel (refineFactor) -#define minRefinementLevel (refineFactor - 2) - -// Set the fields used to determine the refinement. Fields determined by the -// order declared in "equations.h", starting at zero -#define refineCriterionFields \ - { \ - 1, 2, 3 \ - } - -// Set the maximum and minimum value of the fields where the mesh should be -// refined -#define refineWindowMax \ - { \ - 0.99, 0.99, 0.99 \ - } -#define refineWindowMin \ - { \ - 0.01, 0.01, 0.01 \ - } - -// Set the number of time steps between remeshing operations -#define skipRemeshingSteps 1000 - -// ================================================================================= -// Set the time step parameters -// ================================================================================= -// The size of the time step -#define timeStep 9.0e-6 -#define timeFinal 100000000 -#define timeIncrements 100000 - -// ================================================================================= -// Set the elliptic solver parameters -// ================================================================================= -// The solver type (currently the only recommended option is conjugate gradient) -#define solverType SolverCG - -// The flag that determines whether the tolerance for solver convergence should -// be an absolute tolerance (absTol=true) or a relative tolerance (absTol=false) -#define absTol true - -// The tolerance for convergence (L2 norm of the residual) -#define solverTolerance 1.0e-4 - -// The maximum number of solver iterations per time step -#define maxSolverIterations 1000 - -// ================================================================================= -// Set the output parameters -// ================================================================================= -// Each field in the problem will be output is writeOutput is set to "true" -#define writeOutput true - -// Type of spacing between outputs ("EQUAL_SPACING", "LOG_SPACING", or -// "N_PER_DECADE") -#define outputCondition "EQUAL_SPACING" - -// Number of times the program outputs the fields (total number for -// "EQUAL_SPACING" and "LOG_SPACING", number per decade for "N_PER_DECADE") -#define numOutputs 10 - -// ================================================================================= -// Set the flag determining if the total free energy is calculated for each -// output -// ================================================================================= -#define calcEnergy false diff --git a/tests/deprecated_tests/higher_order_element_tests/hoe_test_2D/residuals.h b/tests/deprecated_tests/higher_order_element_tests/hoe_test_2D/residuals.h deleted file mode 100644 index 3c8190016..000000000 --- a/tests/deprecated_tests/higher_order_element_tests/hoe_test_2D/residuals.h +++ /dev/null @@ -1,682 +0,0 @@ -// List of variables and residual equations for the Precipitate Evolution -// example application - -// ================================================================================= -// Define the variables in the model -// ================================================================================= -// The number of variables -#define num_var 5 - -// The names of the variables, whether they are scalars or vectors and whether -// the governing eqn for the variable is parabolic or elliptic -#define variable_name \ - { \ - "c", "n1", "n2", "n3", "u" \ - } -#define variable_type \ - { \ - "SCALAR", "SCALAR", "SCALAR", "SCALAR", "VECTOR" \ - } -#define variable_eq_type \ - { \ - "PARABOLIC", "PARABOLIC", "PARABOLIC", "PARABOLIC", "ELLIPTIC" \ - } - -// Flags for whether the value, gradient, and Hessian are needed in the residual -// eqns -#define need_val \ - { \ - true, true, true, true, false \ - } -#define need_grad \ - { \ - true, true, true, true, true \ - } -#define need_hess \ - { \ - false, false, false, false, false \ - } - -// Flags for whether the residual equation has a term multiplied by the test -// function (need_val_residual) and/or the gradient of the test function -// (need_grad_residual) -#define need_val_residual \ - { \ - true, true, true, true, false \ - } -#define need_grad_residual \ - { \ - true, true, true, true, true \ - } - -// Flags for whether the value, gradient, and Hessian are needed in the residual -// eqn for the left-hand-side of the iterative solver for elliptic equations -#define need_val_LHS \ - { \ - false, true, true, true, false \ - } -#define need_grad_LHS \ - { \ - false, false, false, false, true \ - } -#define need_hess_LHS \ - { \ - false, false, false, false, false \ - } - -// Flags for whether the residual equation for the left-hand-side of the -// iterative solver for elliptic equations has a term multiplied by the test -// function (need_val_residual) and/or the gradient of the test function -// (need_grad_residual) -#define need_val_residual_LHS \ - { \ - false, false, false, false, false \ - } -#define need_grad_residual_LHS \ - { \ - false, false, false, false, true \ - } - -// ================================================================================= -// Define the model parameters and the residual equations -// ================================================================================= -// Parameters in the residual equations and expressions for the residual -// equations can be set here. For simple cases, the entire residual equation can -// be written here. For more complex cases with loops or conditional statements, -// residual equations (or parts of residual equations) can be written below in -// "residualRHS". - -// Cahn-Hilliard mobility -#define McV 1.0 - -// Allen-Cahn mobilities -#define Mn1V 50.0 -#define Mn2V 50.0 -#define Mn3V 50.0 - -// Gradient energy coefficients -double Kn1[3][3] = { - {1.0, 0, 0 }, - {0, 0.5, 0 }, - {0, 0, 1.0} -}; -double Kn2[3][3] = { - {1.0, 0, 0 }, - {0, 0.5, 0 }, - {0, 0, 1.0} -}; -double Kn3[3][3] = { - {1.0, 0, 0 }, - {0, 0.5, 0 }, - {0, 0, 1.0} -}; - -// define energy barrier coefficient (used to tune the interfacial energy) -#define W -1.0 - -// Define mechanical properties -#define n_dependent_stiffness false -// Mechanical symmetry of the material and stiffness parameters -// If n_dependent_stiffness == false the first entry is used for all phases -#define MaterialModels \ - { \ - { \ - "ISOTROPIC" \ - } \ - } -#define MaterialConstants \ - { \ - { \ - 1.0, 0.3 \ - } \ - } - -// Stress-free transformation strains -// Linear fits for the stress-free transformation strains in for sfts = -// sfts_linear * c + sfts_const -double sfts_linear1[3][3] = { - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0} -}; -double sfts_const1[3][3] = { - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0} -}; - -double sfts_linear2[3][3] = { - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0} -}; -double sfts_const2[3][3] = { - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0} -}; - -double sfts_linear3[3][3] = { - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0} -}; -double sfts_const3[3][3] = { - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0} -}; - -// Free energy expressions -#define faV (24.7939 * c * c - 1.6752 * c - 1.9453e-06) -#define facV (49.5878 * c - 1.6752) -#define faccV (49.5878) -#define fbV (37.9316 * c * c - 10.7373 * c + 0.5401) -#define fbcV (75.8633 * c - 10.7373) -#define fbccV (75.8633) -#define h1V (3.0 * n1 * n1 - 2.0 * n1 * n1 * n1) -#define h2V (3.0 * n2 * n2 - 2.0 * n2 * n2 * n2) -#define h3V (3.0 * n3 * n3 - 2.0 * n3 * n3 * n3) -#define hn1V (6.0 * n1 - 6.0 * n1 * n1) -#define hn2V (6.0 * n2 - 6.0 * n2 * n2) -#define hn3V (6.0 * n3 - 6.0 * n3 * n3) - -// This double-well function can be used to tune the interfacial energy -#define fbarrierV (n1 * n1 - 2.0 * n1 * n1 * n1 + n1 * n1 * n1 * n1) -#define fbarriernV (2.0 * n1 - 6.0 * n1 * n1 + 4.0 * n1 * n1 * n1) - -// Residuals -#define rcV (c) -#define rcxTemp \ - (cx * ((1.0 - h1V - h2V - h3V) * faccV + (h1V + h2V + h3V) * fbccV) + \ - n1x * ((fbcV - facV) * hn1V) + n2x * ((fbcV - facV) * hn2V) + \ - n3x * ((fbcV - facV) * hn3V)) -#define rcxV (constV(-timeStep * McV) * rcxTemp) - -#define rn1V \ - (n1 - constV(timeStep * Mn1V) * \ - ((fbV - faV) * hn1V + W * fbarriernV + nDependentMisfitAC1)) -#define rn2V (n2 - constV(timeStep * Mn2V) * ((fbV - faV) * hn2V)) -#define rn3V (n3 - constV(timeStep * Mn3V) * ((fbV - faV) * hn3V)) -#define rn1xV (constV(-timeStep * Mn1V) * Knx1) -#define rn2xV (constV(-timeStep * Mn2V) * Knx2) -#define rn3xV (constV(-timeStep * Mn3V) * Knx3) - -// ================================================================================= -// residualRHS -// ================================================================================= -// This function calculates the residual equations for each variable. It takes -// "modelVariablesList" as an input, which is a list of the value and -// derivatives of each of the variables at a specific quadrature point. The -// (x,y,z) location of that quadrature point is given by "q_point_loc". The -// function outputs "modelResidualsList", a list of the value and gradient terms -// of the residual for each residual equation. The index for each variable in -// these lists corresponds to the order it is defined at the top of this file -// (starting at 0). -template -void -generalizedProblem::residualRHS( - const std::vector> &modelVariablesList, - std::vector> &modelResidualsList, - dealii::Point> q_point_loc) const -{ - // The concentration and its derivatives (names here should match those in the - // macros above) - scalarvalueType c = modelVariablesList[0].scalarValue; - scalargradType cx = modelVariablesList[0].scalarGrad; - - // The first order parameter and its derivatives (names here should match - // those in the macros above) - scalarvalueType n1 = modelVariablesList[1].scalarValue; - scalargradType n1x = modelVariablesList[1].scalarGrad; - - // The second order parameter and its derivatives (names here should match - // those in the macros above) - scalarvalueType n2 = modelVariablesList[2].scalarValue; - scalargradType n2x = modelVariablesList[2].scalarGrad; - - // The third order parameter and its derivatives (names here should match - // those in the macros above) - scalarvalueType n3 = modelVariablesList[3].scalarValue; - scalargradType n3x = modelVariablesList[3].scalarGrad; - - // The derivative of the displacement vector (names here should match those in - // the macros above) - vectorgradType ux = modelVariablesList[4].vectorGrad; - vectorgradType ruxV; - - vectorhessType uxx; - - if (c_dependent_misfit == true) - { - uxx = modelVariablesList[4].vectorHess; - } - - // Calculate the stress-free transformation strain and its derivatives at the - // quadrature point - dealii::Tensor<2, problemDIM, dealii::VectorizedArray> sfts1, sfts1c, sfts1cc, - sfts2, sfts2c, sfts2cc, sfts3, sfts3c, sfts3cc; - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - // Polynomial fits for the stress-free transformation strains, of the - // form: sfts = a_p * c + b_p - sfts1[i][j] = constV(sfts_linear1[i][j]) * c + constV(sfts_const1[i][j]); - sfts1c[i][j] = constV(sfts_linear1[i][j]); - sfts1cc[i][j] = constV(0.0); - - // Polynomial fits for the stress-free transformation strains, of the - // form: sfts = a_p * c + b_p - sfts2[i][j] = constV(sfts_linear2[i][j]) * c + constV(sfts_const2[i][j]); - sfts2c[i][j] = constV(sfts_linear1[i][j]); - sfts2cc[i][j] = constV(0.0); - - // Polynomial fits for the stress-free transformation strains, of the - // form: sfts = a_p * c + b_p - sfts3[i][j] = constV(sfts_linear3[i][j]) * c + constV(sfts_const3[i][j]); - sfts3c[i][j] = constV(sfts_linear3[i][j]); - sfts3cc[i][j] = constV(0.0); - } - } - - // compute E2=(E-E0) - dealii::VectorizedArray E2[dim][dim], S[dim][dim]; - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - E2[i][j] = constV(0.5) * (ux[i][j] + ux[j][i]) - - (sfts1[i][j] * h1V + sfts2[i][j] * h2V + sfts3[i][j] * h3V); - } - } - - // compute stress - // S=C*(E-E0) - // Compute stress tensor (which is equal to the residual, Rux) - dealii::VectorizedArray CIJ_combined[CIJ_tensor_size][CIJ_tensor_size]; - - if (n_dependent_stiffness == true) - { - dealii::VectorizedArray sum_hV; - sum_hV = h1V + h2V + h3V; - for (unsigned int i = 0; i < 2 * dim - 1 + dim / 3; i++) - { - for (unsigned int j = 0; j < 2 * dim - 1 + dim / 3; j++) - { - CIJ_combined[i][j] = - CIJ_list[0][i][j] * (constV(1.0) - sum_hV) + CIJ_list[1][i][j] * sum_hV; - } - } - computeStress(CIJ_combined, E2, S); - } - else - { - computeStress(CIJ_list[0], E2, S); - } - - // Fill residual corresponding to mechanics - // R=-C*(E-E0) - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - ruxV[i][j] = -S[i][j]; - } - } - - // Compute one of the stress terms in the order parameter chemical potential, - // nDependentMisfitACp = C*(E-E0)*(E0_p*Hn) - dealii::VectorizedArray nDependentMisfitAC1 = constV(0.0); - dealii::VectorizedArray nDependentMisfitAC2 = constV(0.0); - dealii::VectorizedArray nDependentMisfitAC3 = constV(0.0); - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - nDependentMisfitAC1 += S[i][j] * (sfts1[i][j]); - nDependentMisfitAC2 += S[i][j] * (sfts2[i][j]); - nDependentMisfitAC3 += S[i][j] * (sfts3[i][j]); - } - } - - nDependentMisfitAC1 *= -hn1V; - nDependentMisfitAC2 *= -hn2V; - nDependentMisfitAC3 *= -hn3V; - - // Compute the other stress term in the order parameter chemical potential, - // heterMechACp = 0.5*Hn*(C_beta-C_alpha)*(E-E0)*(E-E0) - dealii::VectorizedArray heterMechAC1 = constV(0.0); - dealii::VectorizedArray heterMechAC2 = constV(0.0); - dealii::VectorizedArray heterMechAC3 = constV(0.0); - dealii::VectorizedArray S2[dim][dim]; - - if (n_dependent_stiffness == true) - { - // computeStress(CIJ_diff, E2, S2); - computeStress(CIJ_list[1] - CIJ_list[0], E2, S2); - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - heterMechAC1 += S2[i][j] * E2[i][j]; - } - } - // Aside from HnpV, heterMechAC1, heterMechAC2, and heterMechAC3 are equal - heterMechAC2 = 0.5 * hn2V * heterMechAC1; - heterMechAC3 = 0.5 * hn3V * heterMechAC1; - - heterMechAC1 = 0.5 * hn1V * heterMechAC1; - } - - // compute the stress term in the gradient of the concentration chemical - // potential, grad_mu_el = [C*(E-E0)*E0c]x, must be a vector with length dim - scalargradType grad_mu_el; - - if (c_dependent_misfit == true) - { - dealii::VectorizedArray E3[dim][dim], S3[dim][dim]; - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - E3[i][j] = -(sfts1c[i][j] * h1V + sfts2c[i][j] * h2V + sfts3c[i][j] * h3V); - } - } - - if (n_dependent_stiffness == true) - { - computeStress(CIJ_combined, E3, S3); - } - else - { - computeStress(CIJ_list[0], E3, S3); - } - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - for (unsigned int k = 0; k < dim; k++) - { - grad_mu_el[k] += - S3[i][j] * - (constV(0.5) * (uxx[i][j][k] + uxx[j][i][k]) + E3[i][j] * cx[k] - - (sfts1[i][j] * hn1V * n1x[k] + sfts2[i][j] * hn2V * n2x[k] + - sfts3[i][j] * hn3V * n3x[k])); - - grad_mu_el[k] += - -S[i][j] * - (sfts1c[i][j] * hn1V * n1x[k] + sfts2c[i][j] * hn2V * n2x[k] + - sfts3c[i][j] * hn3V * n3x[k] + - (sfts1cc[i][j] * h1V + sfts2cc[i][j] * h2V + sfts3cc[i][j] * h3V) * - cx[k]); - - if (n_dependent_stiffness == true) - { - grad_mu_el[k] += -S2[i][j] * (sfts1c[i][j] * hn1V * n1x[k] + - sfts2c[i][j] * hn2V * n2x[k] + - sfts3c[i][j] * hn3V * n3x[k]); - } - } - } - } - } - - // compute K*nx - scalargradType Knx1, Knx2, Knx3; - for (unsigned int a = 0; a < dim; a++) - { - Knx1[a] = 0.0; - Knx2[a] = 0.0; - Knx3[a] = 0.0; - for (unsigned int b = 0; b < dim; b++) - { - Knx1[a] += constV(Kn1[a][b]) * n1x[b]; - Knx2[a] += constV(Kn2[a][b]) * n2x[b]; - Knx3[a] += constV(Kn3[a][b]) * n3x[b]; - } - } - - modelResidualsList[0].scalarValueResidual = rcV; - modelResidualsList[0].scalarGradResidual = rcxV; - - modelResidualsList[1].scalarValueResidual = rn1V; - modelResidualsList[1].scalarGradResidual = rn1xV; - - modelResidualsList[2].scalarValueResidual = rn2V; - modelResidualsList[2].scalarGradResidual = rn2xV; - - modelResidualsList[3].scalarValueResidual = rn3V; - modelResidualsList[3].scalarGradResidual = rn3xV; - - modelResidualsList[4].vectorGradResidual = ruxV; -} - -// ================================================================================= -// residualLHS (needed only if at least one equation is elliptic) -// ================================================================================= -// This function calculates the residual equations for the iterative solver for -// elliptic equations.for each variable. It takes "modelVariablesList" as an -// input, which is a list of the value and derivatives of each of the variables -// at a specific quadrature point. The (x,y,z) location of that quadrature point -// is given by "q_point_loc". The function outputs "modelRes", the value and -// gradient terms of for the left-hand-side of the residual equation for the -// iterative solver. The index for each variable in these lists corresponds to -// the order it is defined at the top of this file (starting at 0), not counting -// variables that have "need_val_LHS", "need_grad_LHS", and "need_hess_LHS" all -// set to "false". If there are multiple elliptic equations, conditional -// statements should be used to ensure that the correct residual is being -// submitted. The index of the field being solved can be accessed by -// "this->currentFieldIndex". -template -void -generalizedProblem::residualLHS( - const std::vector> &modelVariablesList, - modelResidual &modelRes, - dealii::Point> q_point_loc) const -{ - // n1 - scalarvalueType n1 = modelVariablesList[0].scalarValue; - - // n2 - scalarvalueType n2 = modelVariablesList[1].scalarValue; - - // n3 - scalarvalueType n3 = modelVariablesList[2].scalarValue; - - // u - vectorgradType ux = modelVariablesList[3].vectorGrad; - vectorgradType ruxV; - - // Take advantage of E being simply 0.5*(ux + transpose(ux)) and use the - // dealii "symmetrize" function - dealii::Tensor<2, dim, dealii::VectorizedArray> E; - E = symmetrize(ux); - - // Compute stress tensor (which is equal to the residual, Rux) - if (n_dependent_stiffness == true) - { - dealii::Tensor<2, CIJ_tensor_size, dealii::VectorizedArray> CIJ_combined; - CIJ_combined = - CIJ_list[0] * (constV(1.0) - h1V - h2V - h3V) + CIJ_list[1] * (h1V + h2V + h3V); - - computeStress(CIJ_combined, E, ruxV); - } - else - { - computeStress(CIJ_list[0], E, ruxV); - } - - modelRes.vectorGradResidual = ruxV; -} - -// ================================================================================= -// energyDensity (needed only if calcEnergy == true) -// ================================================================================= -// This function integrates the free energy density across the computational -// domain. It takes "modelVariablesList" as an input, which is a list of the -// value and derivatives of each of the variables at a specific quadrature -// point. It also takes the mapped quadrature weight, "JxW_value", as an input. -// The (x,y,z) location of the quadrature point is given by "q_point_loc". The -// weighted value of the energy density is added to "energy" variable and the -// components of the energy density are added to the "energy_components" -// variable (index 0: chemical energy, index 1: gradient energy, index 2: -// elastic energy). -template -void -generalizedProblem::energyDensity( - const std::vector> &modelVarList, - const dealii::VectorizedArray &JxW_value, - dealii::Point> q_point_loc) -{ - scalarvalueType total_energy_density = constV(0.0); - - // c - scalarvalueType c = modelVarList[0].scalarValue; - scalargradType cx = modelVarList[0].scalarGrad; - - // n1 - scalarvalueType n1 = modelVarList[1].scalarValue; - scalargradType n1x = modelVarList[1].scalarGrad; - - // n2 - scalarvalueType n2 = modelVarList[2].scalarValue; - scalargradType n2x = modelVarList[2].scalarGrad; - - // n3 - scalarvalueType n3 = modelVarList[3].scalarValue; - scalargradType n3x = modelVarList[3].scalarGrad; - - // u - vectorgradType ux = modelVarList[4].vectorGrad; - - scalarvalueType f_chem = - (constV(1.0) - (h1V + h2V + h3V)) * faV + (h1V + h2V + h3V) * fbV; - - scalarvalueType f_grad = constV(0.0); - - for (int i = 0; i < dim; i++) - { - for (int j = 0; j < dim; j++) - { - f_grad += constV(0.5 * Kn1[i][j]) * n1x[i] * n1x[j]; - } - } -#if num_sop > 1 - for (int i = 0; i < dim; i++) - { - for (int j = 0; j < dim; j++) - { - f_grad += constV(0.5 * Kn2[i][j]) * n2x[i] * n2x[j]; - } - } -#endif -#if num_sop > 2 - for (int i = 0; i < dim; i++) - { - for (int j = 0; j < dim; j++) - { - f_grad += constV(0.5 * Kn3[i][j]) * n3x[i] * n3x[j]; - } - } -#endif - - // Calculate the stress-free transformation strain and its derivatives at the - // quadrature point - dealii::Tensor<2, problemDIM, dealii::VectorizedArray> sfts1, sfts1c, sfts1cc, - sfts2, sfts2c, sfts2cc, sfts3, sfts3c, sfts3cc; - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - // Polynomial fits for the stress-free transformation strains, of the - // form: sfts = a_p * c + b_p - sfts1[i][j] = constV(sfts_linear1[i][j]) * c + constV(sfts_const1[i][j]); - sfts1c[i][j] = constV(sfts_linear1[i][j]); - sfts1cc[i][j] = constV(0.0); - - // Polynomial fits for the stress-free transformation strains, of the - // form: sfts = a_p * c + b_p - sfts2[i][j] = constV(sfts_linear2[i][j]) * c + constV(sfts_const2[i][j]); - sfts2c[i][j] = constV(sfts_linear1[i][j]); - sfts2cc[i][j] = constV(0.0); - - // Polynomial fits for the stress-free transformation strains, of the - // form: sfts = a_p * c + b_p - sfts3[i][j] = constV(sfts_linear3[i][j]) * c + constV(sfts_const3[i][j]); - sfts3c[i][j] = constV(sfts_linear3[i][j]); - sfts3cc[i][j] = constV(0.0); - } - } - - // compute E2=(E-E0) - dealii::VectorizedArray E2[dim][dim], S[dim][dim]; - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - // E2[i][j]= constV(0.5)*(ux[i][j]+ux[j][i])-( sfts1[i][j]*h1V + - // sfts2[i][j]*h2V + sfts3[i][j]*h3V); - E2[i][j] = constV(0.5) * (ux[i][j] + ux[j][i]) - - (sfts1[i][j] * h1V + sfts2[i][j] * h2V + sfts3[i][j] * h3V); - } - } - - // compute stress - // S=C*(E-E0) - dealii::VectorizedArray CIJ_combined[2 * dim - 1 + dim / 3] - [2 * dim - 1 + dim / 3]; - - if (n_dependent_stiffness == true) - { - dealii::VectorizedArray sum_hV; - sum_hV = h1V + h2V + h3V; - for (unsigned int i = 0; i < 2 * dim - 1 + dim / 3; i++) - { - for (unsigned int j = 0; j < 2 * dim - 1 + dim / 3; j++) - { - CIJ_combined[i][j] = - CIJ_list[0][i][j] * (constV(1.0) - sum_hV) + CIJ_list[1][i][j] * sum_hV; - } - } - computeStress(CIJ_combined, E2, S); - } - else - { - computeStress(CIJ_list[0], E2, S); - } - - scalarvalueType f_el = constV(0.0); - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - f_el += constV(0.5) * S[i][j] * E2[i][j]; - } - } - - total_energy_density = f_chem + f_grad + f_el; - - assembler_lock.acquire(); - for (unsigned i = 0; i < c.size(); i++) - { - // For some reason, some of the values in this loop - if (c[i] > 1.0e-10) - { - this->energy += total_energy_density[i] * JxW_value[i]; - this->energy_components[0] += f_chem[i] * JxW_value[i]; - this->energy_components[1] += f_grad[i] * JxW_value[i]; - this->energy_components[2] += f_el[i] * JxW_value[i]; - } - } - assembler_lock.release(); -} diff --git a/tests/deprecated_tests/higher_order_element_tests/hoe_test_2D/run_num_1.txt b/tests/deprecated_tests/higher_order_element_tests/hoe_test_2D/run_num_1.txt deleted file mode 100644 index 39c8b850e..000000000 --- a/tests/deprecated_tests/higher_order_element_tests/hoe_test_2D/run_num_1.txt +++ /dev/null @@ -1 +0,0 @@ -run_008 \ No newline at end of file diff --git a/tests/deprecated_tests/higher_order_element_tests/hoe_test_2D/run_num_2.txt b/tests/deprecated_tests/higher_order_element_tests/hoe_test_2D/run_num_2.txt deleted file mode 100644 index 10b18858f..000000000 --- a/tests/deprecated_tests/higher_order_element_tests/hoe_test_2D/run_num_2.txt +++ /dev/null @@ -1 +0,0 @@ -run_009 \ No newline at end of file diff --git a/tests/deprecated_tests/higher_order_element_tests/hoe_test_2D/space_parameters.h b/tests/deprecated_tests/higher_order_element_tests/hoe_test_2D/space_parameters.h deleted file mode 100644 index 989383580..000000000 --- a/tests/deprecated_tests/higher_order_element_tests/hoe_test_2D/space_parameters.h +++ /dev/null @@ -1,6 +0,0 @@ -// Parameters list for the parameters involved in mesh generation -#define subdivisionsX 1 -#define subdivisionsY 1 -#define subdivisionsZ 1 -#define refineFactor 8 -#define finiteElementDegree 1 diff --git a/tests/deprecated_tests/higher_order_element_tests/hoe_test_2D/spat_ooa_results.txt b/tests/deprecated_tests/higher_order_element_tests/hoe_test_2D/spat_ooa_results.txt deleted file mode 100644 index 0e29d0d62..000000000 --- a/tests/deprecated_tests/higher_order_element_tests/hoe_test_2D/spat_ooa_results.txt +++ /dev/null @@ -1,4 +0,0 @@ -Results of 2D spatial order of accuracy test: -From coarse mesh to medium mesh: 1.48494896139 -From from medium mesh to fine mesh: 1.96770364326 -From from fine mesh to very fine mesh: 2.30070031779 diff --git a/tests/deprecated_tests/higher_order_element_tests/hoe_test_2D/visitlog.py b/tests/deprecated_tests/higher_order_element_tests/hoe_test_2D/visitlog.py deleted file mode 100644 index dfa5cdbca..000000000 --- a/tests/deprecated_tests/higher_order_element_tests/hoe_test_2D/visitlog.py +++ /dev/null @@ -1,57 +0,0 @@ -# Visit 2.7.3 log file -ScriptVersion = "2.7.3" -if ScriptVersion != Version(): - print "This script is for VisIt %s. It may not work with version %s" % (ScriptVersion, Version()) -ShowAllWindows() -OpenDatabase("run_008/solution-100000.pvtu", 0) -# The UpdateDBPluginInfo RPC is not supported in the VisIt module so it will not be logged. -DefineScalarExpression("diff", "abs((c-pos_cmfe(, mesh,0))^2)") -AddPlot("Pseudocolor", "diff", 1, 1) -PseudocolorAtts = PseudocolorAttributes() -PseudocolorAtts.scaling = PseudocolorAtts.Linear # Linear, Log, Skew -PseudocolorAtts.skewFactor = 1 -PseudocolorAtts.limitsMode = PseudocolorAtts.CurrentPlot # OriginalData, CurrentPlot -PseudocolorAtts.minFlag = 0 -PseudocolorAtts.min = 0 -PseudocolorAtts.maxFlag = 0 -PseudocolorAtts.max = 1 -PseudocolorAtts.centering = PseudocolorAtts.Natural # Natural, Nodal, Zonal -PseudocolorAtts.colorTableName = "hot" -PseudocolorAtts.invertColorTable = 0 -PseudocolorAtts.opacityType = PseudocolorAtts.FullyOpaque # ColorTable, FullyOpaque, Constant, Ramp, VariableRange -PseudocolorAtts.opacityVariable = "" -PseudocolorAtts.opacity = 1 -PseudocolorAtts.opacityVarMin = 0 -PseudocolorAtts.opacityVarMax = 1 -PseudocolorAtts.opacityVarMinFlag = 0 -PseudocolorAtts.opacityVarMaxFlag = 0 -PseudocolorAtts.pointSize = 0.05 -PseudocolorAtts.pointType = PseudocolorAtts.Point # Box, Axis, Icosahedron, Octahedron, Tetrahedron, SphereGeometry, Point, Sphere -PseudocolorAtts.pointSizeVarEnabled = 0 -PseudocolorAtts.pointSizeVar = "default" -PseudocolorAtts.pointSizePixels = 2 -PseudocolorAtts.lineType = PseudocolorAtts.Line # Line, Tube, Ribbon -PseudocolorAtts.lineStyle = PseudocolorAtts.SOLID # SOLID, DASH, DOT, DOTDASH -PseudocolorAtts.lineWidth = 0 -PseudocolorAtts.tubeDisplayDensity = 10 -PseudocolorAtts.tubeRadiusSizeType = PseudocolorAtts.FractionOfBBox # Absolute, FractionOfBBox -PseudocolorAtts.tubeRadiusAbsolute = 0.125 -PseudocolorAtts.tubeRadiusBBox = 0.005 -PseudocolorAtts.varyTubeRadius = 0 -PseudocolorAtts.varyTubeRadiusVariable = "" -PseudocolorAtts.varyTubeRadiusFactor = 10 -PseudocolorAtts.endPointType = PseudocolorAtts.None # None, Tails, Heads, Both -PseudocolorAtts.endPointStyle = PseudocolorAtts.Spheres # Spheres, Cones -PseudocolorAtts.endPointRadiusSizeType = PseudocolorAtts.FractionOfBBox # Absolute, FractionOfBBox -PseudocolorAtts.endPointRadiusAbsolute = 1 -PseudocolorAtts.endPointRadiusBBox = 0.005 -PseudocolorAtts.endPointRatio = 2 -PseudocolorAtts.renderSurfaces = 1 -PseudocolorAtts.renderWireframe = 0 -PseudocolorAtts.renderPoints = 0 -PseudocolorAtts.smoothingLevel = 0 -PseudocolorAtts.legendFlag = 1 -PseudocolorAtts.lightingFlag = 1 -SetPlotOptions(PseudocolorAtts) -DrawPlots() -Query("Weighted Variable Sum", use_actual_data=1) diff --git a/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D/CMakeLists.txt b/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D/CMakeLists.txt deleted file mode 100644 index 0444f179d..000000000 --- a/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D/CMakeLists.txt +++ /dev/null @@ -1,32 +0,0 @@ -## -# CMake script for the phaseField applications: -## - - -# Set the name of the project and target: -SET(TARGET "main") - -# Declare all source files the target consists of: -SET(TARGET_SRC - ${TARGET}.cc - # You can specify additional files here! - ) - -# Usually, you will not need to modify anything beyond this point... - -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8) - -FIND_PACKAGE(deal.II 8.0 QUIET - HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} - ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" - "*** Could not locate deal.II. ***\n\n" - "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" - "or set an environment variable \"DEAL_II_DIR\" that contains this path." - ) -ENDIF() - -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() diff --git a/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D/ICs_and_BCs.h b/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D/ICs_and_BCs.h deleted file mode 100644 index 5243f9cd9..000000000 --- a/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D/ICs_and_BCs.h +++ /dev/null @@ -1,187 +0,0 @@ -// initial condition -template -class InitialCondition : public Function -{ -public: - unsigned int index; - Vector values; - - InitialCondition(const unsigned int _index) - : Function(1) - , index(_index) - { - std::srand(Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) + 1); - } - - double - value(const Point &p, const unsigned int component = 0) const - { - double scalar_IC = 0; - // ===================================================================== - // ENTER THE INITIAL CONDITIONS HERE FOR SCALAR FIELDS - // ===================================================================== - // Enter the function describing conditions for the fields at point "p". - // Use "if" statements to set the initial condition for each variable - // according to its variable index. - -#define x_denom 1.0 -#define y_denom 1.0 -#define z_denom 1.0 -#define initial_interface_coeff 1.0 -#define initial_radius 5.5 -#define avg_Nd 0.004 - - if (index == 0) - { - // return the value of the initial concentration field at point p - double dx = spanX / ((double) subdivisionsX) / std::pow(2.0, refineFactor); - double dy = spanY / ((double) subdivisionsY) / std::pow(2.0, refineFactor); - double dz = spanZ / ((double) subdivisionsZ) / std::pow(2.0, refineFactor); - double r = 0.0; - // return 0.02 + 1.0e-3*(2*(0.5 - (double)(std::rand() % 100 )/100.0)); -#if problemDIM == 1 - r = p.operator()(0); - return 0.5 * (0.12 - 0.00) * (1 - std::tanh((r - spanX / 16.0) / (0.1 * dx))); -#elif problemDIM == 2 - - r = sqrt((p.operator()(0)) * (p.operator()(0)) / x_denom + - (p.operator()(1)) * (p.operator()(1)) / y_denom); - return 0.5 * (0.12 - avg_Nd) * - (1.0 - std::tanh((r - initial_radius) / (initial_interface_coeff))) + - avg_Nd; - -#elif problemDIM == 3 - - r = sqrt((p.operator()(0)) * (p.operator()(0)) / x_denom + - (p.operator()(1)) * (p.operator()(1)) / y_denom + - (p.operator()(2)) * (p.operator()(2)) / z_denom); - return 0.5 * (0.12 - avg_Nd) * - (1.0 - std::tanh((r - initial_radius) / (initial_interface_coeff))) + - avg_Nd; - -#endif - } - else if (index == 1) - { - // set result equal to the structural order paramter initial condition - double dx = spanX / ((double) subdivisionsX) / std::pow(2.0, refineFactor); - double dy = spanY / ((double) subdivisionsY) / std::pow(2.0, refineFactor); - double dz = spanZ / ((double) subdivisionsZ) / std::pow(2.0, refineFactor); - double r = 0.0; -#if problemDIM == 1 - r = p.operator()(0); - return 0.5 * (1.0 - std::tanh((r - spanX / 16.0) / (0.1 * dx))); -#elif problemDIM == 2 - - r = sqrt((p.operator()(0)) * (p.operator()(0)) / x_denom + - (p.operator()(1)) * (p.operator()(1)) / y_denom); - return 0.5 * (1.0 - std::tanh((r - initial_radius) / (initial_interface_coeff))); - -#elif problemDIM == 3 - // r=p.distance(Point(spanX/2.0,spanY/2.0,spanZ/2.0)); - // return 0.5*(1.0-std::tanh((r-spanX/8.0)/(3*dx))); - - r = sqrt((p.operator()(0)) * (p.operator()(0)) / x_denom + - (p.operator()(1)) * (p.operator()(1)) / y_denom + - (p.operator()(2)) * (p.operator()(2)) / z_denom); - return 0.5 * (1.0 - std::tanh((r - initial_radius) / (initial_interface_coeff))); - - // planar interface - // r=sqrt((p.operator()(2)-spanZ/2.0)*(p.operator()(2)-spanZ/2.0)); - // return 0.5*(1.0-std::tanh((r)/(initial_interface_coeff))); - // return - // 0.5*(1.0-std::tanh((r-initial_radius)/(initial_interface_coeff))); -#endif - return 0.0; - } - else if (index == 2) - { - scalar_IC = 0.0; - } - else if (index == 3) - { - scalar_IC = 0.0; - } - - // ===================================================================== - return scalar_IC; - } -}; - -// initial condition -template -class InitialConditionVec : public Function -{ -public: - unsigned int index; - - // Vector values; - InitialConditionVec(const unsigned int _index) - : Function(dim) - , index(_index) - { - std::srand(Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) + 1); - } - - void - vector_value(const Point &p, Vector &vector_IC) const - { - // ===================================================================== - // ENTER THE INITIAL CONDITIONS HERE FOR VECTOR FIELDS - // ===================================================================== - // Enter the function describing conditions for the fields at point "p". - // Use "if" statements to set the initial condition for each variable - // according to its variable index. - - if (index == 4) - { - vector_IC(0) = 0.0; - vector_IC(1) = 0.0; - if (dim == 3) - { - vector_IC(2) = 0.0; - } - } - // ===================================================================== - } -}; - -template -void -generalizedProblem::setBCs() -{ - // ===================================================================== - // ENTER THE BOUNDARY CONDITIONS HERE - // ===================================================================== - // This function sets the BCs for the problem variables - // The function "inputBCs" should be called for each component of - // each variable and should be in numerical order. Four input arguments - // set the same BC on the entire boundary. Two plus two times the - // number of dimensions inputs sets separate BCs on each face of the domain. - // Inputs to "inputBCs": - // First input: variable number - // Second input: component number - // Third input: BC type (options are "ZERO_DERIVATIVE" and "DIRICHLET") - // Fourth input: BC value (ignored unless the BC type is "DIRICHLET") - // Odd inputs after the third: BC type - // Even inputs after the third: BC value - // Face numbering: starts at zero with the minimum of the first direction, one - // for the maximum of the first direction - // two for the minimum of the second direction, etc. - inputBCs(0, 0, "ZERO_DERIVATIVE", 0); - - inputBCs(1, 0, "ZERO_DERIVATIVE", 0); - - inputBCs(2, 0, "ZERO_DERIVATIVE", 0); - - inputBCs(3, 0, "ZERO_DERIVATIVE", 0); - - inputBCs(4, 0, "DIRICHLET", 0.0); - inputBCs(4, 1, "DIRICHLET", 0.0); - if (dim == 3) - { - inputBCs(4, 2, "DIRICHLET", 0.0); - } - - // ===================================================================== -} diff --git a/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D/error.txt b/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D/error.txt deleted file mode 100644 index 70b153878..000000000 --- a/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D/error.txt +++ /dev/null @@ -1 +0,0 @@ -0.000226726733005 \ No newline at end of file diff --git a/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D/error1.txt b/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D/error1.txt deleted file mode 100644 index b0183ae2d..000000000 --- a/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D/error1.txt +++ /dev/null @@ -1 +0,0 @@ -0.0044260378927 \ No newline at end of file diff --git a/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D/error2.txt b/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D/error2.txt deleted file mode 100644 index 41b6d8c6c..000000000 --- a/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D/error2.txt +++ /dev/null @@ -1 +0,0 @@ -0.00117394141853 \ No newline at end of file diff --git a/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D/error3.txt b/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D/error3.txt deleted file mode 100644 index 67fa0e06a..000000000 --- a/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D/error3.txt +++ /dev/null @@ -1 +0,0 @@ -0.000283651053905 \ No newline at end of file diff --git a/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D/error4.txt b/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D/error4.txt deleted file mode 100644 index 8cbef5208..000000000 --- a/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D/error4.txt +++ /dev/null @@ -1 +0,0 @@ -5.74858859181e-05 \ No newline at end of file diff --git a/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D/getError.py b/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D/getError.py deleted file mode 100644 index bfae94293..000000000 --- a/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D/getError.py +++ /dev/null @@ -1,78 +0,0 @@ -import sys -import math - -variable_1 = 'c' -variable_2 = 'c' - -output_num_1 = "100000" -output_num_2 = "100000" - -f = open('run_num_1.txt','r') -run_num_1 = f.read() -f.close() - -f = open('run_num_2.txt','r') -run_num_2 = f.read() -f.close() - -use_mesh_1 = True -apply_3slice = False -apply_box_crop = False - -directory_1 = run_num_1+"/solution-"+output_num_1+".pvtu" -directory_2 = run_num_2+"/solution-"+output_num_2+".pvtu" - -if use_mesh_1 == True: - OpenDatabase(directory_1) - DefineScalarExpression("diff","("+variable_1+"-pos_cmfe(<"+directory_2+":"+variable_2+">, mesh,0))^2") - #DefineScalarExpression("diff","abs(("+variable_1+"-pos_cmfe(<"+directory_2+":"+variable_2+">, mesh,0)))") -else: - OpenDatabase(directory_2) - #DefineScalarExpression("diff","("+variable_2+"-pos_cmfe(<"+directory_1+":"+variable_1+">, mesh,0))^2") - DefineScalarExpression("diff","abs(("+variable_2+"-pos_cmfe(<"+directory_1+":"+variable_1+">, mesh,0)))") - -#AddPlot("Contour","diff") -AddPlot("Pseudocolor","diff") - -PseudocolorAtts = PseudocolorAttributes() -PseudocolorAtts.limitsMode = PseudocolorAtts.CurrentPlot -SetPlotOptions(PseudocolorAtts) - -if apply_box_crop == True: - AddOperator("Box", 1) - BoxAtts = BoxAttributes() - BoxAtts.amount = BoxAtts.Some # Some, All - BoxAtts.minx = 2.0 - BoxAtts.maxx = 30.0 - BoxAtts.miny = 2.0 - BoxAtts.maxy = 30.0 - BoxAtts.minz = 2.0 - BoxAtts.maxz = 30.0 - BoxAtts.inverse = 0 - SetOperatorOptions(BoxAtts, 1) - -if apply_3slice == True: - AddOperator("ThreeSlice") - slice_atts = ThreeSliceAttributes() - slice_atts.x = 16 - slice_atts.y = 16 - slice_atts.z = 16 - SetOperatorOptions(slice_atts) - -DrawPlots() - -#Query("MinMax", use_actual_data=1) -#min_max_val = GetQueryOutputValue() -#error = max(abs(min_max_val[0]),abs(min_max_val[1])) - -# Calculate the L2 error: -Query("Weighted Variable Sum", use_actual_data=1) -error = math.sqrt(GetQueryOutputValue()) - -text_file = open("error.txt","w") -text_file.write(str(error)) -text_file.close() - - - -sys.exit() \ No newline at end of file diff --git a/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D/hoe_test_3D.py b/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D/hoe_test_3D.py deleted file mode 100644 index aa2e4c529..000000000 --- a/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D/hoe_test_3D.py +++ /dev/null @@ -1,107 +0,0 @@ -import subprocess -import shutil -import glob -import math -import os.path - -# ---------------------------------------------------------------------------------------- -# Function that generates a header file for the simulation, compiles the PRISMS-PF code -# and runs the executable. -# ---------------------------------------------------------------------------------------- -def run_simulation(refineFactor,degree,subdivisionsX,subdivisionsY,subdivisionsZ,run_name): - - text_file = open("space_parameters.h","w") - text_file.write("// Parameters list for the parameters involved in mesh generation \n") - text_file.write("#define subdivisionsX " + str(subdivisionsX) + "\n") - text_file.write("#define subdivisionsY " + str(subdivisionsY) + "\n") - text_file.write("#define subdivisionsZ " + str(subdivisionsZ) + "\n") - text_file.write("#define refineFactor " + str(refineFactor) + "\n") - text_file.write("#define finiteElementDegree " + str(degree) + "\n") - text_file.close() - - subprocess.call(["make", "release"]) - #subprocess.call(["./main"]) - subprocess.call(["mpirun", "-n", "6", "main"]) - - subprocess.call(["mkdir",run_name]) - for output_files in glob.glob('*vtu'): - shutil.move(output_files,run_name) - -# ---------------------------------------------------------------------------------------- -# Function that calculates the maximum error between a run and a reference result. -# ---------------------------------------------------------------------------------------- -def getError(run_num): - - text_file = open("run_num_1.txt","w") - - if run_num < 10: - text_file.write('run_00'+str(run_num)) - elif run_num < 100: - text_file.write('run_0'+str(run_num)) - elif run_num < 1000: - text_file.write('run_'+str(run_num)) - else: - print "error: run number must be lower than 1000" - - text_file.close() - subprocess.call(["visit","-nowin", "-cli","-s","getError.py"]) - f = open('error.txt','r') - error = float(f.read()) - f.close() - - return error - -# ---------------------------------------------------------------------------------------- - -# Choose whether or not to re-run the reference simulation (warning, takes several hours) -re_run_ref_simulation = False - -# If files exist from previous tests, delete them -if os.path.exists("run_001") == True: - shutil.rmtree("run_001") -if os.path.exists("run_002") == True: - shutil.rmtree("run_002") -if os.path.exists("run_003") == True: - shutil.rmtree("run_003") -if os.path.exists("run_004") == True: - shutil.rmtree("run_004") -if os.path.exists("run_005") == True: - shutil.rmtree("run_005") -if os.path.exists("run_006") == True: - shutil.rmtree("run_006") -if re_run_ref_simulation == True: - if os.path.exists("reference_solution") == True: - shutil.rmtree("reference_solution") - -# Run simulations with varying mesh size and element order: -run_simulation(3,1,1,1,1,'run_001') -run_simulation(4,1,1,1,1,'run_002') -run_simulation(5,1,1,1,1,'run_003') -run_simulation(2,2,1,1,1,'run_004') -run_simulation(3,2,1,1,1,'run_005') -run_simulation(4,2,1,1,1,'run_006') -if re_run_ref_simulation == True: - run_simulation(7,1,1,1,1,'reference_solution') - - -# Find the error for runs 1-6 (as compared to the reference solution) -text_file = open("run_num_2.txt","w") -text_file.write('reference_solution') -text_file.close() - -error = [] -error.append(getError(1)) -error.append(getError(2)) -error.append(getError(3)) -error.append(getError(4)) -error.append(getError(5)) -error.append(getError(6)) - -# Calculate and output the error - -print "Error results: \n" -print "First order element error:", str(error[0]), "(refine level 3)", str(error[1]), "(refine level 4)", \ - str(error[2]), "(refine level 5)", "\n" - -print "Second order element error:", str(error[3]), "(refine level 2)", str(error[4]), "(refine level 3)", \ - str(error[5]), "(refine level 4)", "\n" diff --git a/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D/main.cc b/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D/main.cc deleted file mode 100644 index a62d5cdca..000000000 --- a/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D/main.cc +++ /dev/null @@ -1,54 +0,0 @@ -// Coupled Cahn-Hilliard, Allen-Cahn and Mechanics problem -// general headers -#include "../../../include/dealIIheaders.h" - -// Coupled Cahn-Hilliard+Allen-Cahn+Mechanics problem headers -#include "ICs_and_BCs.h" -#include "parameters.h" -#include "residuals.h" -#include "space_parameters.h" - -#include "../../../src/models/coupled/generalized_model.h" -#include "../../../src/models/coupled/generalized_model_functions.h" - -// main -int -main(int argc, char **argv) -{ - Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, - argv, - numbers::invalid_unsigned_int); - try - { - deallog.depth_console(0); - generalizedProblem problem; - - problem.setBCs(); - problem.buildFields(); - problem.init(); - problem.solve(); - } - catch (std::exception &exc) - { - std::cerr << std::endl - << std::endl - << "----------------------------------------------------" << std::endl; - std::cerr << "Exception on processing: " << std::endl - << exc.what() << std::endl - << "Aborting!" << std::endl - << "----------------------------------------------------" << std::endl; - return 1; - } - catch (...) - { - std::cerr << std::endl - << std::endl - << "----------------------------------------------------" << std::endl; - std::cerr << "Unknown exception!" << std::endl - << "Aborting!" << std::endl - << "----------------------------------------------------" << std::endl; - return 1; - } - - return 0; -} diff --git a/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D/parameters.h b/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D/parameters.h deleted file mode 100644 index 34415938c..000000000 --- a/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D/parameters.h +++ /dev/null @@ -1,101 +0,0 @@ -// Parameter list for the precipitate evolution example application -// All strictly numerical parameters should be set in this file - -// ================================================================================= -// Set the number of dimensions (1, 2, or 3 for a 1D, 2D, or 3D calculation) -// ================================================================================= -#define problemDIM 3 - -// ================================================================================= -// Set the length of the domain in all three dimensions -// ================================================================================= -// Each axes spans from zero to the specified length -#define spanX 8.0 -#define spanY 8.0 -#define spanZ 8.0 - -// ================================================================================= -// Set the element parameters -// ================================================================================= -// The number of elements in each direction is 2^(refineFactor) * subdivisions -// For optimal performance, use refineFactor primarily to determine the element -// size #define subdivisionsX 3 #define subdivisionsY 3 #define subdivisionsZ 3 -// #define refineFactor 5 - -// Set the polynomial degree of the element (suggested values: 1 or 2) -// #define finiteElementDegree 2 - -// ================================================================================= -// Set the adaptive mesh refinement parameters -// ================================================================================= -// Set the flag determining if adaptive meshing is activated -#define hAdaptivity false - -// Set the maximum and minimum level of refinement -#define maxRefinementLevel (refineFactor) -#define minRefinementLevel (refineFactor - 2) - -// Set the fields used to determine the refinement. Fields determined by the -// order declared in "equations.h", starting at zero -#define refineCriterionFields \ - { \ - 1, 2, 3 \ - } - -// Set the maximum and minimum value of the fields where the mesh should be -// refined -#define refineWindowMax \ - { \ - 0.99, 0.99, 0.99 \ - } -#define refineWindowMin \ - { \ - 0.01, 0.01, 0.01 \ - } - -// Set the number of time steps between remeshing operations -#define skipRemeshingSteps 1000 - -// ================================================================================= -// Set the time step parameters -// ================================================================================= -// The size of the time step -#define timeStep 8.0e-6 -#define timeFinal 100000000 -#define timeIncrements 100000 - -// ================================================================================= -// Set the elliptic solver parameters -// ================================================================================= -// The solver type (currently the only recommended option is conjugate gradient) -#define solverType SolverCG - -// The flag that determines whether the tolerance for solver convergence should -// be an absolute tolerance (absTol=true) or a relative tolerance (absTol=false) -#define absTol true - -// The tolerance for convergence (L2 norm of the residual) -#define solverTolerance 1.0e-4 - -// The maximum number of solver iterations per time step -#define maxSolverIterations 1000 - -// ================================================================================= -// Set the output parameters -// ================================================================================= -// Each field in the problem will be output is writeOutput is set to "true" -#define writeOutput true - -// Type of spacing between outputs ("EQUAL_SPACING", "LOG_SPACING", or -// "N_PER_DECADE") -#define outputCondition "EQUAL_SPACING" - -// Number of times the program outputs the fields (total number for -// "EQUAL_SPACING" and "LOG_SPACING", number per decade for "N_PER_DECADE") -#define numOutputs 10 - -// ================================================================================= -// Set the flag determining if the total free energy is calculated for each -// output -// ================================================================================= -#define calcEnergy false diff --git a/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D/residuals.h b/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D/residuals.h deleted file mode 100644 index 3c8190016..000000000 --- a/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D/residuals.h +++ /dev/null @@ -1,682 +0,0 @@ -// List of variables and residual equations for the Precipitate Evolution -// example application - -// ================================================================================= -// Define the variables in the model -// ================================================================================= -// The number of variables -#define num_var 5 - -// The names of the variables, whether they are scalars or vectors and whether -// the governing eqn for the variable is parabolic or elliptic -#define variable_name \ - { \ - "c", "n1", "n2", "n3", "u" \ - } -#define variable_type \ - { \ - "SCALAR", "SCALAR", "SCALAR", "SCALAR", "VECTOR" \ - } -#define variable_eq_type \ - { \ - "PARABOLIC", "PARABOLIC", "PARABOLIC", "PARABOLIC", "ELLIPTIC" \ - } - -// Flags for whether the value, gradient, and Hessian are needed in the residual -// eqns -#define need_val \ - { \ - true, true, true, true, false \ - } -#define need_grad \ - { \ - true, true, true, true, true \ - } -#define need_hess \ - { \ - false, false, false, false, false \ - } - -// Flags for whether the residual equation has a term multiplied by the test -// function (need_val_residual) and/or the gradient of the test function -// (need_grad_residual) -#define need_val_residual \ - { \ - true, true, true, true, false \ - } -#define need_grad_residual \ - { \ - true, true, true, true, true \ - } - -// Flags for whether the value, gradient, and Hessian are needed in the residual -// eqn for the left-hand-side of the iterative solver for elliptic equations -#define need_val_LHS \ - { \ - false, true, true, true, false \ - } -#define need_grad_LHS \ - { \ - false, false, false, false, true \ - } -#define need_hess_LHS \ - { \ - false, false, false, false, false \ - } - -// Flags for whether the residual equation for the left-hand-side of the -// iterative solver for elliptic equations has a term multiplied by the test -// function (need_val_residual) and/or the gradient of the test function -// (need_grad_residual) -#define need_val_residual_LHS \ - { \ - false, false, false, false, false \ - } -#define need_grad_residual_LHS \ - { \ - false, false, false, false, true \ - } - -// ================================================================================= -// Define the model parameters and the residual equations -// ================================================================================= -// Parameters in the residual equations and expressions for the residual -// equations can be set here. For simple cases, the entire residual equation can -// be written here. For more complex cases with loops or conditional statements, -// residual equations (or parts of residual equations) can be written below in -// "residualRHS". - -// Cahn-Hilliard mobility -#define McV 1.0 - -// Allen-Cahn mobilities -#define Mn1V 50.0 -#define Mn2V 50.0 -#define Mn3V 50.0 - -// Gradient energy coefficients -double Kn1[3][3] = { - {1.0, 0, 0 }, - {0, 0.5, 0 }, - {0, 0, 1.0} -}; -double Kn2[3][3] = { - {1.0, 0, 0 }, - {0, 0.5, 0 }, - {0, 0, 1.0} -}; -double Kn3[3][3] = { - {1.0, 0, 0 }, - {0, 0.5, 0 }, - {0, 0, 1.0} -}; - -// define energy barrier coefficient (used to tune the interfacial energy) -#define W -1.0 - -// Define mechanical properties -#define n_dependent_stiffness false -// Mechanical symmetry of the material and stiffness parameters -// If n_dependent_stiffness == false the first entry is used for all phases -#define MaterialModels \ - { \ - { \ - "ISOTROPIC" \ - } \ - } -#define MaterialConstants \ - { \ - { \ - 1.0, 0.3 \ - } \ - } - -// Stress-free transformation strains -// Linear fits for the stress-free transformation strains in for sfts = -// sfts_linear * c + sfts_const -double sfts_linear1[3][3] = { - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0} -}; -double sfts_const1[3][3] = { - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0} -}; - -double sfts_linear2[3][3] = { - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0} -}; -double sfts_const2[3][3] = { - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0} -}; - -double sfts_linear3[3][3] = { - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0} -}; -double sfts_const3[3][3] = { - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0} -}; - -// Free energy expressions -#define faV (24.7939 * c * c - 1.6752 * c - 1.9453e-06) -#define facV (49.5878 * c - 1.6752) -#define faccV (49.5878) -#define fbV (37.9316 * c * c - 10.7373 * c + 0.5401) -#define fbcV (75.8633 * c - 10.7373) -#define fbccV (75.8633) -#define h1V (3.0 * n1 * n1 - 2.0 * n1 * n1 * n1) -#define h2V (3.0 * n2 * n2 - 2.0 * n2 * n2 * n2) -#define h3V (3.0 * n3 * n3 - 2.0 * n3 * n3 * n3) -#define hn1V (6.0 * n1 - 6.0 * n1 * n1) -#define hn2V (6.0 * n2 - 6.0 * n2 * n2) -#define hn3V (6.0 * n3 - 6.0 * n3 * n3) - -// This double-well function can be used to tune the interfacial energy -#define fbarrierV (n1 * n1 - 2.0 * n1 * n1 * n1 + n1 * n1 * n1 * n1) -#define fbarriernV (2.0 * n1 - 6.0 * n1 * n1 + 4.0 * n1 * n1 * n1) - -// Residuals -#define rcV (c) -#define rcxTemp \ - (cx * ((1.0 - h1V - h2V - h3V) * faccV + (h1V + h2V + h3V) * fbccV) + \ - n1x * ((fbcV - facV) * hn1V) + n2x * ((fbcV - facV) * hn2V) + \ - n3x * ((fbcV - facV) * hn3V)) -#define rcxV (constV(-timeStep * McV) * rcxTemp) - -#define rn1V \ - (n1 - constV(timeStep * Mn1V) * \ - ((fbV - faV) * hn1V + W * fbarriernV + nDependentMisfitAC1)) -#define rn2V (n2 - constV(timeStep * Mn2V) * ((fbV - faV) * hn2V)) -#define rn3V (n3 - constV(timeStep * Mn3V) * ((fbV - faV) * hn3V)) -#define rn1xV (constV(-timeStep * Mn1V) * Knx1) -#define rn2xV (constV(-timeStep * Mn2V) * Knx2) -#define rn3xV (constV(-timeStep * Mn3V) * Knx3) - -// ================================================================================= -// residualRHS -// ================================================================================= -// This function calculates the residual equations for each variable. It takes -// "modelVariablesList" as an input, which is a list of the value and -// derivatives of each of the variables at a specific quadrature point. The -// (x,y,z) location of that quadrature point is given by "q_point_loc". The -// function outputs "modelResidualsList", a list of the value and gradient terms -// of the residual for each residual equation. The index for each variable in -// these lists corresponds to the order it is defined at the top of this file -// (starting at 0). -template -void -generalizedProblem::residualRHS( - const std::vector> &modelVariablesList, - std::vector> &modelResidualsList, - dealii::Point> q_point_loc) const -{ - // The concentration and its derivatives (names here should match those in the - // macros above) - scalarvalueType c = modelVariablesList[0].scalarValue; - scalargradType cx = modelVariablesList[0].scalarGrad; - - // The first order parameter and its derivatives (names here should match - // those in the macros above) - scalarvalueType n1 = modelVariablesList[1].scalarValue; - scalargradType n1x = modelVariablesList[1].scalarGrad; - - // The second order parameter and its derivatives (names here should match - // those in the macros above) - scalarvalueType n2 = modelVariablesList[2].scalarValue; - scalargradType n2x = modelVariablesList[2].scalarGrad; - - // The third order parameter and its derivatives (names here should match - // those in the macros above) - scalarvalueType n3 = modelVariablesList[3].scalarValue; - scalargradType n3x = modelVariablesList[3].scalarGrad; - - // The derivative of the displacement vector (names here should match those in - // the macros above) - vectorgradType ux = modelVariablesList[4].vectorGrad; - vectorgradType ruxV; - - vectorhessType uxx; - - if (c_dependent_misfit == true) - { - uxx = modelVariablesList[4].vectorHess; - } - - // Calculate the stress-free transformation strain and its derivatives at the - // quadrature point - dealii::Tensor<2, problemDIM, dealii::VectorizedArray> sfts1, sfts1c, sfts1cc, - sfts2, sfts2c, sfts2cc, sfts3, sfts3c, sfts3cc; - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - // Polynomial fits for the stress-free transformation strains, of the - // form: sfts = a_p * c + b_p - sfts1[i][j] = constV(sfts_linear1[i][j]) * c + constV(sfts_const1[i][j]); - sfts1c[i][j] = constV(sfts_linear1[i][j]); - sfts1cc[i][j] = constV(0.0); - - // Polynomial fits for the stress-free transformation strains, of the - // form: sfts = a_p * c + b_p - sfts2[i][j] = constV(sfts_linear2[i][j]) * c + constV(sfts_const2[i][j]); - sfts2c[i][j] = constV(sfts_linear1[i][j]); - sfts2cc[i][j] = constV(0.0); - - // Polynomial fits for the stress-free transformation strains, of the - // form: sfts = a_p * c + b_p - sfts3[i][j] = constV(sfts_linear3[i][j]) * c + constV(sfts_const3[i][j]); - sfts3c[i][j] = constV(sfts_linear3[i][j]); - sfts3cc[i][j] = constV(0.0); - } - } - - // compute E2=(E-E0) - dealii::VectorizedArray E2[dim][dim], S[dim][dim]; - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - E2[i][j] = constV(0.5) * (ux[i][j] + ux[j][i]) - - (sfts1[i][j] * h1V + sfts2[i][j] * h2V + sfts3[i][j] * h3V); - } - } - - // compute stress - // S=C*(E-E0) - // Compute stress tensor (which is equal to the residual, Rux) - dealii::VectorizedArray CIJ_combined[CIJ_tensor_size][CIJ_tensor_size]; - - if (n_dependent_stiffness == true) - { - dealii::VectorizedArray sum_hV; - sum_hV = h1V + h2V + h3V; - for (unsigned int i = 0; i < 2 * dim - 1 + dim / 3; i++) - { - for (unsigned int j = 0; j < 2 * dim - 1 + dim / 3; j++) - { - CIJ_combined[i][j] = - CIJ_list[0][i][j] * (constV(1.0) - sum_hV) + CIJ_list[1][i][j] * sum_hV; - } - } - computeStress(CIJ_combined, E2, S); - } - else - { - computeStress(CIJ_list[0], E2, S); - } - - // Fill residual corresponding to mechanics - // R=-C*(E-E0) - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - ruxV[i][j] = -S[i][j]; - } - } - - // Compute one of the stress terms in the order parameter chemical potential, - // nDependentMisfitACp = C*(E-E0)*(E0_p*Hn) - dealii::VectorizedArray nDependentMisfitAC1 = constV(0.0); - dealii::VectorizedArray nDependentMisfitAC2 = constV(0.0); - dealii::VectorizedArray nDependentMisfitAC3 = constV(0.0); - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - nDependentMisfitAC1 += S[i][j] * (sfts1[i][j]); - nDependentMisfitAC2 += S[i][j] * (sfts2[i][j]); - nDependentMisfitAC3 += S[i][j] * (sfts3[i][j]); - } - } - - nDependentMisfitAC1 *= -hn1V; - nDependentMisfitAC2 *= -hn2V; - nDependentMisfitAC3 *= -hn3V; - - // Compute the other stress term in the order parameter chemical potential, - // heterMechACp = 0.5*Hn*(C_beta-C_alpha)*(E-E0)*(E-E0) - dealii::VectorizedArray heterMechAC1 = constV(0.0); - dealii::VectorizedArray heterMechAC2 = constV(0.0); - dealii::VectorizedArray heterMechAC3 = constV(0.0); - dealii::VectorizedArray S2[dim][dim]; - - if (n_dependent_stiffness == true) - { - // computeStress(CIJ_diff, E2, S2); - computeStress(CIJ_list[1] - CIJ_list[0], E2, S2); - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - heterMechAC1 += S2[i][j] * E2[i][j]; - } - } - // Aside from HnpV, heterMechAC1, heterMechAC2, and heterMechAC3 are equal - heterMechAC2 = 0.5 * hn2V * heterMechAC1; - heterMechAC3 = 0.5 * hn3V * heterMechAC1; - - heterMechAC1 = 0.5 * hn1V * heterMechAC1; - } - - // compute the stress term in the gradient of the concentration chemical - // potential, grad_mu_el = [C*(E-E0)*E0c]x, must be a vector with length dim - scalargradType grad_mu_el; - - if (c_dependent_misfit == true) - { - dealii::VectorizedArray E3[dim][dim], S3[dim][dim]; - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - E3[i][j] = -(sfts1c[i][j] * h1V + sfts2c[i][j] * h2V + sfts3c[i][j] * h3V); - } - } - - if (n_dependent_stiffness == true) - { - computeStress(CIJ_combined, E3, S3); - } - else - { - computeStress(CIJ_list[0], E3, S3); - } - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - for (unsigned int k = 0; k < dim; k++) - { - grad_mu_el[k] += - S3[i][j] * - (constV(0.5) * (uxx[i][j][k] + uxx[j][i][k]) + E3[i][j] * cx[k] - - (sfts1[i][j] * hn1V * n1x[k] + sfts2[i][j] * hn2V * n2x[k] + - sfts3[i][j] * hn3V * n3x[k])); - - grad_mu_el[k] += - -S[i][j] * - (sfts1c[i][j] * hn1V * n1x[k] + sfts2c[i][j] * hn2V * n2x[k] + - sfts3c[i][j] * hn3V * n3x[k] + - (sfts1cc[i][j] * h1V + sfts2cc[i][j] * h2V + sfts3cc[i][j] * h3V) * - cx[k]); - - if (n_dependent_stiffness == true) - { - grad_mu_el[k] += -S2[i][j] * (sfts1c[i][j] * hn1V * n1x[k] + - sfts2c[i][j] * hn2V * n2x[k] + - sfts3c[i][j] * hn3V * n3x[k]); - } - } - } - } - } - - // compute K*nx - scalargradType Knx1, Knx2, Knx3; - for (unsigned int a = 0; a < dim; a++) - { - Knx1[a] = 0.0; - Knx2[a] = 0.0; - Knx3[a] = 0.0; - for (unsigned int b = 0; b < dim; b++) - { - Knx1[a] += constV(Kn1[a][b]) * n1x[b]; - Knx2[a] += constV(Kn2[a][b]) * n2x[b]; - Knx3[a] += constV(Kn3[a][b]) * n3x[b]; - } - } - - modelResidualsList[0].scalarValueResidual = rcV; - modelResidualsList[0].scalarGradResidual = rcxV; - - modelResidualsList[1].scalarValueResidual = rn1V; - modelResidualsList[1].scalarGradResidual = rn1xV; - - modelResidualsList[2].scalarValueResidual = rn2V; - modelResidualsList[2].scalarGradResidual = rn2xV; - - modelResidualsList[3].scalarValueResidual = rn3V; - modelResidualsList[3].scalarGradResidual = rn3xV; - - modelResidualsList[4].vectorGradResidual = ruxV; -} - -// ================================================================================= -// residualLHS (needed only if at least one equation is elliptic) -// ================================================================================= -// This function calculates the residual equations for the iterative solver for -// elliptic equations.for each variable. It takes "modelVariablesList" as an -// input, which is a list of the value and derivatives of each of the variables -// at a specific quadrature point. The (x,y,z) location of that quadrature point -// is given by "q_point_loc". The function outputs "modelRes", the value and -// gradient terms of for the left-hand-side of the residual equation for the -// iterative solver. The index for each variable in these lists corresponds to -// the order it is defined at the top of this file (starting at 0), not counting -// variables that have "need_val_LHS", "need_grad_LHS", and "need_hess_LHS" all -// set to "false". If there are multiple elliptic equations, conditional -// statements should be used to ensure that the correct residual is being -// submitted. The index of the field being solved can be accessed by -// "this->currentFieldIndex". -template -void -generalizedProblem::residualLHS( - const std::vector> &modelVariablesList, - modelResidual &modelRes, - dealii::Point> q_point_loc) const -{ - // n1 - scalarvalueType n1 = modelVariablesList[0].scalarValue; - - // n2 - scalarvalueType n2 = modelVariablesList[1].scalarValue; - - // n3 - scalarvalueType n3 = modelVariablesList[2].scalarValue; - - // u - vectorgradType ux = modelVariablesList[3].vectorGrad; - vectorgradType ruxV; - - // Take advantage of E being simply 0.5*(ux + transpose(ux)) and use the - // dealii "symmetrize" function - dealii::Tensor<2, dim, dealii::VectorizedArray> E; - E = symmetrize(ux); - - // Compute stress tensor (which is equal to the residual, Rux) - if (n_dependent_stiffness == true) - { - dealii::Tensor<2, CIJ_tensor_size, dealii::VectorizedArray> CIJ_combined; - CIJ_combined = - CIJ_list[0] * (constV(1.0) - h1V - h2V - h3V) + CIJ_list[1] * (h1V + h2V + h3V); - - computeStress(CIJ_combined, E, ruxV); - } - else - { - computeStress(CIJ_list[0], E, ruxV); - } - - modelRes.vectorGradResidual = ruxV; -} - -// ================================================================================= -// energyDensity (needed only if calcEnergy == true) -// ================================================================================= -// This function integrates the free energy density across the computational -// domain. It takes "modelVariablesList" as an input, which is a list of the -// value and derivatives of each of the variables at a specific quadrature -// point. It also takes the mapped quadrature weight, "JxW_value", as an input. -// The (x,y,z) location of the quadrature point is given by "q_point_loc". The -// weighted value of the energy density is added to "energy" variable and the -// components of the energy density are added to the "energy_components" -// variable (index 0: chemical energy, index 1: gradient energy, index 2: -// elastic energy). -template -void -generalizedProblem::energyDensity( - const std::vector> &modelVarList, - const dealii::VectorizedArray &JxW_value, - dealii::Point> q_point_loc) -{ - scalarvalueType total_energy_density = constV(0.0); - - // c - scalarvalueType c = modelVarList[0].scalarValue; - scalargradType cx = modelVarList[0].scalarGrad; - - // n1 - scalarvalueType n1 = modelVarList[1].scalarValue; - scalargradType n1x = modelVarList[1].scalarGrad; - - // n2 - scalarvalueType n2 = modelVarList[2].scalarValue; - scalargradType n2x = modelVarList[2].scalarGrad; - - // n3 - scalarvalueType n3 = modelVarList[3].scalarValue; - scalargradType n3x = modelVarList[3].scalarGrad; - - // u - vectorgradType ux = modelVarList[4].vectorGrad; - - scalarvalueType f_chem = - (constV(1.0) - (h1V + h2V + h3V)) * faV + (h1V + h2V + h3V) * fbV; - - scalarvalueType f_grad = constV(0.0); - - for (int i = 0; i < dim; i++) - { - for (int j = 0; j < dim; j++) - { - f_grad += constV(0.5 * Kn1[i][j]) * n1x[i] * n1x[j]; - } - } -#if num_sop > 1 - for (int i = 0; i < dim; i++) - { - for (int j = 0; j < dim; j++) - { - f_grad += constV(0.5 * Kn2[i][j]) * n2x[i] * n2x[j]; - } - } -#endif -#if num_sop > 2 - for (int i = 0; i < dim; i++) - { - for (int j = 0; j < dim; j++) - { - f_grad += constV(0.5 * Kn3[i][j]) * n3x[i] * n3x[j]; - } - } -#endif - - // Calculate the stress-free transformation strain and its derivatives at the - // quadrature point - dealii::Tensor<2, problemDIM, dealii::VectorizedArray> sfts1, sfts1c, sfts1cc, - sfts2, sfts2c, sfts2cc, sfts3, sfts3c, sfts3cc; - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - // Polynomial fits for the stress-free transformation strains, of the - // form: sfts = a_p * c + b_p - sfts1[i][j] = constV(sfts_linear1[i][j]) * c + constV(sfts_const1[i][j]); - sfts1c[i][j] = constV(sfts_linear1[i][j]); - sfts1cc[i][j] = constV(0.0); - - // Polynomial fits for the stress-free transformation strains, of the - // form: sfts = a_p * c + b_p - sfts2[i][j] = constV(sfts_linear2[i][j]) * c + constV(sfts_const2[i][j]); - sfts2c[i][j] = constV(sfts_linear1[i][j]); - sfts2cc[i][j] = constV(0.0); - - // Polynomial fits for the stress-free transformation strains, of the - // form: sfts = a_p * c + b_p - sfts3[i][j] = constV(sfts_linear3[i][j]) * c + constV(sfts_const3[i][j]); - sfts3c[i][j] = constV(sfts_linear3[i][j]); - sfts3cc[i][j] = constV(0.0); - } - } - - // compute E2=(E-E0) - dealii::VectorizedArray E2[dim][dim], S[dim][dim]; - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - // E2[i][j]= constV(0.5)*(ux[i][j]+ux[j][i])-( sfts1[i][j]*h1V + - // sfts2[i][j]*h2V + sfts3[i][j]*h3V); - E2[i][j] = constV(0.5) * (ux[i][j] + ux[j][i]) - - (sfts1[i][j] * h1V + sfts2[i][j] * h2V + sfts3[i][j] * h3V); - } - } - - // compute stress - // S=C*(E-E0) - dealii::VectorizedArray CIJ_combined[2 * dim - 1 + dim / 3] - [2 * dim - 1 + dim / 3]; - - if (n_dependent_stiffness == true) - { - dealii::VectorizedArray sum_hV; - sum_hV = h1V + h2V + h3V; - for (unsigned int i = 0; i < 2 * dim - 1 + dim / 3; i++) - { - for (unsigned int j = 0; j < 2 * dim - 1 + dim / 3; j++) - { - CIJ_combined[i][j] = - CIJ_list[0][i][j] * (constV(1.0) - sum_hV) + CIJ_list[1][i][j] * sum_hV; - } - } - computeStress(CIJ_combined, E2, S); - } - else - { - computeStress(CIJ_list[0], E2, S); - } - - scalarvalueType f_el = constV(0.0); - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - f_el += constV(0.5) * S[i][j] * E2[i][j]; - } - } - - total_energy_density = f_chem + f_grad + f_el; - - assembler_lock.acquire(); - for (unsigned i = 0; i < c.size(); i++) - { - // For some reason, some of the values in this loop - if (c[i] > 1.0e-10) - { - this->energy += total_energy_density[i] * JxW_value[i]; - this->energy_components[0] += f_chem[i] * JxW_value[i]; - this->energy_components[1] += f_grad[i] * JxW_value[i]; - this->energy_components[2] += f_el[i] * JxW_value[i]; - } - } - assembler_lock.release(); -} diff --git a/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D/run_num_1.txt b/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D/run_num_1.txt deleted file mode 100644 index b632c805c..000000000 --- a/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D/run_num_1.txt +++ /dev/null @@ -1 +0,0 @@ -run_006 \ No newline at end of file diff --git a/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D/run_num_2.txt b/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D/run_num_2.txt deleted file mode 100644 index 5396e09d4..000000000 --- a/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D/run_num_2.txt +++ /dev/null @@ -1 +0,0 @@ -reference_solution \ No newline at end of file diff --git a/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D/space_parameters.h b/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D/space_parameters.h deleted file mode 100644 index d0a932604..000000000 --- a/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D/space_parameters.h +++ /dev/null @@ -1,6 +0,0 @@ -// Parameters list for the parameters involved in mesh generation -#define subdivisionsX 1 -#define subdivisionsY 1 -#define subdivisionsZ 1 -#define refineFactor 4 -#define finiteElementDegree 2 diff --git a/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D/visitlog.py b/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D/visitlog.py deleted file mode 100644 index 090b61656..000000000 --- a/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D/visitlog.py +++ /dev/null @@ -1,57 +0,0 @@ -# Visit 2.7.0 log file -ScriptVersion = "2.7.0" -if ScriptVersion != Version(): - print "This script is for VisIt %s. It may not work with version %s" % (ScriptVersion, Version()) -ShowAllWindows() -OpenDatabase("run_006/solution-100000.pvtu", 0) -# The UpdateDBPluginInfo RPC is not supported in the VisIt module so it will not be logged. -DefineScalarExpression("diff", "(c-pos_cmfe(, mesh,0))^2") -AddPlot("Pseudocolor", "diff", 1, 1) -PseudocolorAtts = PseudocolorAttributes() -PseudocolorAtts.scaling = PseudocolorAtts.Linear # Linear, Log, Skew -PseudocolorAtts.skewFactor = 1 -PseudocolorAtts.limitsMode = PseudocolorAtts.CurrentPlot # OriginalData, CurrentPlot -PseudocolorAtts.minFlag = 0 -PseudocolorAtts.min = 0 -PseudocolorAtts.maxFlag = 0 -PseudocolorAtts.max = 1 -PseudocolorAtts.centering = PseudocolorAtts.Natural # Natural, Nodal, Zonal -PseudocolorAtts.colorTableName = "hot" -PseudocolorAtts.invertColorTable = 0 -PseudocolorAtts.opacityType = PseudocolorAtts.FullyOpaque # ColorTable, FullyOpaque, Constant, Ramp, VariableRange -PseudocolorAtts.opacityVariable = "" -PseudocolorAtts.opacity = 1 -PseudocolorAtts.opacityVarMin = 0 -PseudocolorAtts.opacityVarMax = 1 -PseudocolorAtts.opacityVarMinFlag = 0 -PseudocolorAtts.opacityVarMaxFlag = 0 -PseudocolorAtts.pointSize = 0.05 -PseudocolorAtts.pointType = PseudocolorAtts.Point # Box, Axis, Icosahedron, Octahedron, Tetrahedron, SphereGeometry, Point, Sphere -PseudocolorAtts.pointSizeVarEnabled = 0 -PseudocolorAtts.pointSizeVar = "default" -PseudocolorAtts.pointSizePixels = 2 -PseudocolorAtts.lineType = PseudocolorAtts.Line # Line, Tube, Ribbon -PseudocolorAtts.lineStyle = PseudocolorAtts.SOLID # SOLID, DASH, DOT, DOTDASH -PseudocolorAtts.lineWidth = 0 -PseudocolorAtts.tubeDisplayDensity = 10 -PseudocolorAtts.tubeRadiusSizeType = PseudocolorAtts.FractionOfBBox # Absolute, FractionOfBBox -PseudocolorAtts.tubeRadiusAbsolute = 0.125 -PseudocolorAtts.tubeRadiusBBox = 0.005 -PseudocolorAtts.varyTubeRadius = 0 -PseudocolorAtts.varyTubeRadiusVariable = "" -PseudocolorAtts.varyTubeRadiusFactor = 10 -PseudocolorAtts.endPointType = PseudocolorAtts.None # None, Tails, Heads, Both -PseudocolorAtts.endPointStyle = PseudocolorAtts.Spheres # Spheres, Cones -PseudocolorAtts.endPointRadiusSizeType = PseudocolorAtts.FractionOfBBox # Absolute, FractionOfBBox -PseudocolorAtts.endPointRadiusAbsolute = 1 -PseudocolorAtts.endPointRadiusBBox = 0.005 -PseudocolorAtts.endPointRatio = 2 -PseudocolorAtts.renderSurfaces = 1 -PseudocolorAtts.renderWireframe = 0 -PseudocolorAtts.renderPoints = 0 -PseudocolorAtts.smoothingLevel = 0 -PseudocolorAtts.legendFlag = 1 -PseudocolorAtts.lightingFlag = 1 -SetPlotOptions(PseudocolorAtts) -DrawPlots() -Query("Weighted Variable Sum", use_actual_data=1) diff --git a/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D_timestep/CMakeLists.txt b/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D_timestep/CMakeLists.txt deleted file mode 100644 index 0444f179d..000000000 --- a/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D_timestep/CMakeLists.txt +++ /dev/null @@ -1,32 +0,0 @@ -## -# CMake script for the phaseField applications: -## - - -# Set the name of the project and target: -SET(TARGET "main") - -# Declare all source files the target consists of: -SET(TARGET_SRC - ${TARGET}.cc - # You can specify additional files here! - ) - -# Usually, you will not need to modify anything beyond this point... - -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8) - -FIND_PACKAGE(deal.II 8.0 QUIET - HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} - ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" - "*** Could not locate deal.II. ***\n\n" - "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" - "or set an environment variable \"DEAL_II_DIR\" that contains this path." - ) -ENDIF() - -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() diff --git a/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D_timestep/ICs_and_BCs.h b/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D_timestep/ICs_and_BCs.h deleted file mode 100644 index 5243f9cd9..000000000 --- a/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D_timestep/ICs_and_BCs.h +++ /dev/null @@ -1,187 +0,0 @@ -// initial condition -template -class InitialCondition : public Function -{ -public: - unsigned int index; - Vector values; - - InitialCondition(const unsigned int _index) - : Function(1) - , index(_index) - { - std::srand(Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) + 1); - } - - double - value(const Point &p, const unsigned int component = 0) const - { - double scalar_IC = 0; - // ===================================================================== - // ENTER THE INITIAL CONDITIONS HERE FOR SCALAR FIELDS - // ===================================================================== - // Enter the function describing conditions for the fields at point "p". - // Use "if" statements to set the initial condition for each variable - // according to its variable index. - -#define x_denom 1.0 -#define y_denom 1.0 -#define z_denom 1.0 -#define initial_interface_coeff 1.0 -#define initial_radius 5.5 -#define avg_Nd 0.004 - - if (index == 0) - { - // return the value of the initial concentration field at point p - double dx = spanX / ((double) subdivisionsX) / std::pow(2.0, refineFactor); - double dy = spanY / ((double) subdivisionsY) / std::pow(2.0, refineFactor); - double dz = spanZ / ((double) subdivisionsZ) / std::pow(2.0, refineFactor); - double r = 0.0; - // return 0.02 + 1.0e-3*(2*(0.5 - (double)(std::rand() % 100 )/100.0)); -#if problemDIM == 1 - r = p.operator()(0); - return 0.5 * (0.12 - 0.00) * (1 - std::tanh((r - spanX / 16.0) / (0.1 * dx))); -#elif problemDIM == 2 - - r = sqrt((p.operator()(0)) * (p.operator()(0)) / x_denom + - (p.operator()(1)) * (p.operator()(1)) / y_denom); - return 0.5 * (0.12 - avg_Nd) * - (1.0 - std::tanh((r - initial_radius) / (initial_interface_coeff))) + - avg_Nd; - -#elif problemDIM == 3 - - r = sqrt((p.operator()(0)) * (p.operator()(0)) / x_denom + - (p.operator()(1)) * (p.operator()(1)) / y_denom + - (p.operator()(2)) * (p.operator()(2)) / z_denom); - return 0.5 * (0.12 - avg_Nd) * - (1.0 - std::tanh((r - initial_radius) / (initial_interface_coeff))) + - avg_Nd; - -#endif - } - else if (index == 1) - { - // set result equal to the structural order paramter initial condition - double dx = spanX / ((double) subdivisionsX) / std::pow(2.0, refineFactor); - double dy = spanY / ((double) subdivisionsY) / std::pow(2.0, refineFactor); - double dz = spanZ / ((double) subdivisionsZ) / std::pow(2.0, refineFactor); - double r = 0.0; -#if problemDIM == 1 - r = p.operator()(0); - return 0.5 * (1.0 - std::tanh((r - spanX / 16.0) / (0.1 * dx))); -#elif problemDIM == 2 - - r = sqrt((p.operator()(0)) * (p.operator()(0)) / x_denom + - (p.operator()(1)) * (p.operator()(1)) / y_denom); - return 0.5 * (1.0 - std::tanh((r - initial_radius) / (initial_interface_coeff))); - -#elif problemDIM == 3 - // r=p.distance(Point(spanX/2.0,spanY/2.0,spanZ/2.0)); - // return 0.5*(1.0-std::tanh((r-spanX/8.0)/(3*dx))); - - r = sqrt((p.operator()(0)) * (p.operator()(0)) / x_denom + - (p.operator()(1)) * (p.operator()(1)) / y_denom + - (p.operator()(2)) * (p.operator()(2)) / z_denom); - return 0.5 * (1.0 - std::tanh((r - initial_radius) / (initial_interface_coeff))); - - // planar interface - // r=sqrt((p.operator()(2)-spanZ/2.0)*(p.operator()(2)-spanZ/2.0)); - // return 0.5*(1.0-std::tanh((r)/(initial_interface_coeff))); - // return - // 0.5*(1.0-std::tanh((r-initial_radius)/(initial_interface_coeff))); -#endif - return 0.0; - } - else if (index == 2) - { - scalar_IC = 0.0; - } - else if (index == 3) - { - scalar_IC = 0.0; - } - - // ===================================================================== - return scalar_IC; - } -}; - -// initial condition -template -class InitialConditionVec : public Function -{ -public: - unsigned int index; - - // Vector values; - InitialConditionVec(const unsigned int _index) - : Function(dim) - , index(_index) - { - std::srand(Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) + 1); - } - - void - vector_value(const Point &p, Vector &vector_IC) const - { - // ===================================================================== - // ENTER THE INITIAL CONDITIONS HERE FOR VECTOR FIELDS - // ===================================================================== - // Enter the function describing conditions for the fields at point "p". - // Use "if" statements to set the initial condition for each variable - // according to its variable index. - - if (index == 4) - { - vector_IC(0) = 0.0; - vector_IC(1) = 0.0; - if (dim == 3) - { - vector_IC(2) = 0.0; - } - } - // ===================================================================== - } -}; - -template -void -generalizedProblem::setBCs() -{ - // ===================================================================== - // ENTER THE BOUNDARY CONDITIONS HERE - // ===================================================================== - // This function sets the BCs for the problem variables - // The function "inputBCs" should be called for each component of - // each variable and should be in numerical order. Four input arguments - // set the same BC on the entire boundary. Two plus two times the - // number of dimensions inputs sets separate BCs on each face of the domain. - // Inputs to "inputBCs": - // First input: variable number - // Second input: component number - // Third input: BC type (options are "ZERO_DERIVATIVE" and "DIRICHLET") - // Fourth input: BC value (ignored unless the BC type is "DIRICHLET") - // Odd inputs after the third: BC type - // Even inputs after the third: BC value - // Face numbering: starts at zero with the minimum of the first direction, one - // for the maximum of the first direction - // two for the minimum of the second direction, etc. - inputBCs(0, 0, "ZERO_DERIVATIVE", 0); - - inputBCs(1, 0, "ZERO_DERIVATIVE", 0); - - inputBCs(2, 0, "ZERO_DERIVATIVE", 0); - - inputBCs(3, 0, "ZERO_DERIVATIVE", 0); - - inputBCs(4, 0, "DIRICHLET", 0.0); - inputBCs(4, 1, "DIRICHLET", 0.0); - if (dim == 3) - { - inputBCs(4, 2, "DIRICHLET", 0.0); - } - - // ===================================================================== -} diff --git a/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D_timestep/error.txt b/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D_timestep/error.txt deleted file mode 100644 index dc11e02e0..000000000 --- a/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D_timestep/error.txt +++ /dev/null @@ -1 +0,0 @@ -0.0140394102896 \ No newline at end of file diff --git a/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D_timestep/error1.txt b/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D_timestep/error1.txt deleted file mode 100644 index b0183ae2d..000000000 --- a/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D_timestep/error1.txt +++ /dev/null @@ -1 +0,0 @@ -0.0044260378927 \ No newline at end of file diff --git a/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D_timestep/error2.txt b/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D_timestep/error2.txt deleted file mode 100644 index 41b6d8c6c..000000000 --- a/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D_timestep/error2.txt +++ /dev/null @@ -1 +0,0 @@ -0.00117394141853 \ No newline at end of file diff --git a/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D_timestep/error3.txt b/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D_timestep/error3.txt deleted file mode 100644 index 67fa0e06a..000000000 --- a/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D_timestep/error3.txt +++ /dev/null @@ -1 +0,0 @@ -0.000283651053905 \ No newline at end of file diff --git a/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D_timestep/error4.txt b/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D_timestep/error4.txt deleted file mode 100644 index 8cbef5208..000000000 --- a/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D_timestep/error4.txt +++ /dev/null @@ -1 +0,0 @@ -5.74858859181e-05 \ No newline at end of file diff --git a/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D_timestep/getError.py b/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D_timestep/getError.py deleted file mode 100644 index bdb92b746..000000000 --- a/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D_timestep/getError.py +++ /dev/null @@ -1,83 +0,0 @@ -import sys -import math - -variable_1 = 'c' -variable_2 = 'c' - -f = open('output_num_1.txt','r') -output_num_1 = f.read() -f.close() - -f = open('output_num_2.txt','r') -output_num_2 = f.read() -f.close() - -f = open('run_num_1.txt','r') -run_num_1 = f.read() -f.close() - -f = open('run_num_2.txt','r') -run_num_2 = f.read() -f.close() - -use_mesh_1 = True -apply_3slice = False -apply_box_crop = False - -directory_1 = run_num_1+"/solution-"+output_num_1+".pvtu" -directory_2 = run_num_2+"/solution-"+output_num_2+".pvtu" - -if use_mesh_1 == True: - OpenDatabase(directory_1) - DefineScalarExpression("diff","("+variable_1+"-pos_cmfe(<"+directory_2+":"+variable_2+">, mesh,0))^2") - #DefineScalarExpression("diff","abs(("+variable_1+"-pos_cmfe(<"+directory_2+":"+variable_2+">, mesh,0)))") -else: - OpenDatabase(directory_2) - #DefineScalarExpression("diff","("+variable_2+"-pos_cmfe(<"+directory_1+":"+variable_1+">, mesh,0))^2") - DefineScalarExpression("diff","abs(("+variable_2+"-pos_cmfe(<"+directory_1+":"+variable_1+">, mesh,0)))") - -#AddPlot("Contour","diff") -AddPlot("Pseudocolor","diff") - -PseudocolorAtts = PseudocolorAttributes() -PseudocolorAtts.limitsMode = PseudocolorAtts.CurrentPlot -SetPlotOptions(PseudocolorAtts) - -if apply_box_crop == True: - AddOperator("Box", 1) - BoxAtts = BoxAttributes() - BoxAtts.amount = BoxAtts.Some # Some, All - BoxAtts.minx = 2.0 - BoxAtts.maxx = 30.0 - BoxAtts.miny = 2.0 - BoxAtts.maxy = 30.0 - BoxAtts.minz = 2.0 - BoxAtts.maxz = 30.0 - BoxAtts.inverse = 0 - SetOperatorOptions(BoxAtts, 1) - -if apply_3slice == True: - AddOperator("ThreeSlice") - slice_atts = ThreeSliceAttributes() - slice_atts.x = 16 - slice_atts.y = 16 - slice_atts.z = 16 - SetOperatorOptions(slice_atts) - -DrawPlots() - -#Query("MinMax", use_actual_data=1) -#min_max_val = GetQueryOutputValue() -#error = max(abs(min_max_val[0]),abs(min_max_val[1])) - -# Calculate the L2 error: -Query("Weighted Variable Sum", use_actual_data=1) -error = math.sqrt(GetQueryOutputValue()) - -text_file = open("error.txt","w") -text_file.write(str(error)) -text_file.close() - - - -sys.exit() \ No newline at end of file diff --git a/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D_timestep/hoe_test_3D_timestep.py b/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D_timestep/hoe_test_3D_timestep.py deleted file mode 100644 index 04f905142..000000000 --- a/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D_timestep/hoe_test_3D_timestep.py +++ /dev/null @@ -1,123 +0,0 @@ -import subprocess -import shutil -import glob -import math -import os.path - -# ---------------------------------------------------------------------------------------- -# Function that generates a header file for the simulation, compiles the PRISMS-PF code -# and runs the executable. -# ---------------------------------------------------------------------------------------- -def run_simulation(refineFactor,degree,subdivisionsX,subdivisionsY,subdivisionsZ,timeIncrements,timeStep,run_name): - - timeFinal = 100000000 - skipImplicitSolves = 10000000 - - text_file = open("time_and_space_parameters.h","w") - text_file.write("// Parameters list for the parameters involved in mesh generation and time stepping \n") - text_file.write("#define subdivisionsX " + str(subdivisionsX) + "\n") - text_file.write("#define subdivisionsY " + str(subdivisionsY) + "\n") - text_file.write("#define subdivisionsZ " + str(subdivisionsZ) + "\n") - text_file.write("#define refineFactor " + str(refineFactor) + "\n") - text_file.write("#define finiteElementDegree " + str(degree) + "\n") - - text_file.write("// Parameters list for the parameters involved in time stepping \n") - text_file.write("#define timeStep " + str(timeStep) + "\n") - text_file.write("#define timeIncrements " + str(timeIncrements) + "\n") - text_file.write("#define timeFinal " + str(timeFinal) + "\n") - text_file.write("#define skipImplicitSolves " + str(skipImplicitSolves) + "\n") - text_file.close() - - subprocess.call(["make", "release"]) - #subprocess.call(["./main"]) - subprocess.call(["mpirun", "-n", "4", "main"]) - - subprocess.call(["mkdir",run_name]) - for output_files in glob.glob('*vtu'): - shutil.move(output_files,run_name) - -# ---------------------------------------------------------------------------------------- -# Function that calculates the maximum error between a run and a reference result. -# ---------------------------------------------------------------------------------------- -def getError(run_num,maxIter): - - text_file = open("run_num_1.txt","w") - - if run_num < 10: - text_file.write('run_00'+str(run_num)) - elif run_num < 100: - text_file.write('run_0'+str(run_num)) - elif run_num < 1000: - text_file.write('run_'+str(run_num)) - else: - print "error: run number must be lower than 1000" - - text_file.close() - - text_file = open("output_num_1.txt","w") - text_file.write(maxIter) - text_file.close() - - subprocess.call(["visit","-nowin", "-cli","-s","getError.py"]) - f = open('error.txt','r') - error = float(f.read()) - f.close() - - return error - -# ---------------------------------------------------------------------------------------- - -# Choose whether or not to re-run the reference simulation (warning, takes several hours) -re_run_ref_simulation = False - -# If files exist from previous tests, delete them -if os.path.exists("run_001") == True: - shutil.rmtree("run_001") -if os.path.exists("run_002") == True: - shutil.rmtree("run_002") -if os.path.exists("run_003") == True: - shutil.rmtree("run_003") -if os.path.exists("run_004") == True: - shutil.rmtree("run_004") -if os.path.exists("run_005") == True: - shutil.rmtree("run_005") -if os.path.exists("run_006") == True: - shutil.rmtree("run_006") -if re_run_ref_simulation == True: - if os.path.exists("reference_solution") == True: - shutil.rmtree("reference_solution") - -# Run simulations with varying mesh size and element order: -run_simulation(4,1,1,1,1,1600,5e-4,'run_001') # Highest stable dt for this order and mesh size -run_simulation(0,2,5,5,5,1600,5e-4,'run_002') -run_simulation(0,2,5,5,5,800,1.0e-3,'run_003') -run_simulation(0,2,5,5,5,850,0.8/850.0,'run_004') # Highest stable dt for this order and mesh size -run_simulation(4,1,1,1,1,100000,8.0e-6,'run_005') -run_simulation(0,2,5,5,5,100000,8.0e-6,'run_006') -if re_run_ref_simulation == True: - run_simulation(7,1,1,1,1,100000,8.0e-6,'reference_solution') - - -# Find the error for runs 1-6 (as compared to the reference solution) -text_file = open("run_num_2.txt","w") -text_file.write('reference_solution') -text_file.close() - -text_file = open("output_num_2.txt","w") -text_file.write('100000') -text_file.close() - - - -error = [] -error.append(getError(1,'01600')) -error.append(getError(2,'01600')) -error.append(getError(3,'0800')) -error.append(getError(4,'0850')) -error.append(getError(5,'100000')) -error.append(getError(6,'100000')) - -# Calculate and output the error - -print "Error results: \n" -print str(error[0]), str(error[1]), str(error[2]), str(error[3]), str(error[4]), str(error[5]) diff --git a/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D_timestep/main.cc b/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D_timestep/main.cc deleted file mode 100644 index fba809548..000000000 --- a/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D_timestep/main.cc +++ /dev/null @@ -1,54 +0,0 @@ -// Coupled Cahn-Hilliard, Allen-Cahn and Mechanics problem -// general headers -#include "../../../include/dealIIheaders.h" - -// Coupled Cahn-Hilliard+Allen-Cahn+Mechanics problem headers -#include "ICs_and_BCs.h" -#include "parameters.h" -#include "residuals.h" -#include "time_and_space_parameters.h" - -#include "../../../src/models/coupled/generalized_model.h" -#include "../../../src/models/coupled/generalized_model_functions.h" - -// main -int -main(int argc, char **argv) -{ - Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, - argv, - numbers::invalid_unsigned_int); - try - { - deallog.depth_console(0); - generalizedProblem problem; - - problem.setBCs(); - problem.buildFields(); - problem.init(); - problem.solve(); - } - catch (std::exception &exc) - { - std::cerr << std::endl - << std::endl - << "----------------------------------------------------" << std::endl; - std::cerr << "Exception on processing: " << std::endl - << exc.what() << std::endl - << "Aborting!" << std::endl - << "----------------------------------------------------" << std::endl; - return 1; - } - catch (...) - { - std::cerr << std::endl - << std::endl - << "----------------------------------------------------" << std::endl; - std::cerr << "Unknown exception!" << std::endl - << "Aborting!" << std::endl - << "----------------------------------------------------" << std::endl; - return 1; - } - - return 0; -} diff --git a/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D_timestep/output_num_1.txt b/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D_timestep/output_num_1.txt deleted file mode 100644 index 483fb82b6..000000000 --- a/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D_timestep/output_num_1.txt +++ /dev/null @@ -1 +0,0 @@ -100000 \ No newline at end of file diff --git a/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D_timestep/output_num_2.txt b/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D_timestep/output_num_2.txt deleted file mode 100644 index 483fb82b6..000000000 --- a/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D_timestep/output_num_2.txt +++ /dev/null @@ -1 +0,0 @@ -100000 \ No newline at end of file diff --git a/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D_timestep/parameters.h b/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D_timestep/parameters.h deleted file mode 100644 index 0112569b6..000000000 --- a/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D_timestep/parameters.h +++ /dev/null @@ -1,101 +0,0 @@ -// Parameter list for the precipitate evolution example application -// All strictly numerical parameters should be set in this file - -// ================================================================================= -// Set the number of dimensions (1, 2, or 3 for a 1D, 2D, or 3D calculation) -// ================================================================================= -#define problemDIM 3 - -// ================================================================================= -// Set the length of the domain in all three dimensions -// ================================================================================= -// Each axes spans from zero to the specified length -#define spanX 8.0 -#define spanY 8.0 -#define spanZ 8.0 - -// ================================================================================= -// Set the element parameters -// ================================================================================= -// The number of elements in each direction is 2^(refineFactor) * subdivisions -// For optimal performance, use refineFactor primarily to determine the element -// size #define subdivisionsX 3 #define subdivisionsY 3 #define subdivisionsZ 3 -// #define refineFactor 5 - -// Set the polynomial degree of the element (suggested values: 1 or 2) -// #define finiteElementDegree 2 - -// ================================================================================= -// Set the adaptive mesh refinement parameters -// ================================================================================= -// Set the flag determining if adaptive meshing is activated -#define hAdaptivity false - -// Set the maximum and minimum level of refinement -#define maxRefinementLevel (refineFactor) -#define minRefinementLevel (refineFactor - 2) - -// Set the fields used to determine the refinement. Fields determined by the -// order declared in "equations.h", starting at zero -#define refineCriterionFields \ - { \ - 1, 2, 3 \ - } - -// Set the maximum and minimum value of the fields where the mesh should be -// refined -#define refineWindowMax \ - { \ - 0.99, 0.99, 0.99 \ - } -#define refineWindowMin \ - { \ - 0.01, 0.01, 0.01 \ - } - -// Set the number of time steps between remeshing operations -#define skipRemeshingSteps 1000 - -// ================================================================================= -// Set the time step parameters -// ================================================================================= -// The size of the time step -// #define timeStep 8.0e-6 -// #define timeFinal 100000000 -// #define timeIncrements 100000 - -// ================================================================================= -// Set the elliptic solver parameters -// ================================================================================= -// The solver type (currently the only recommended option is conjugate gradient) -#define solverType SolverCG - -// The flag that determines whether the tolerance for solver convergence should -// be an absolute tolerance (absTol=true) or a relative tolerance (absTol=false) -#define absTol true - -// The tolerance for convergence (L2 norm of the residual) -#define solverTolerance 1.0e-4 - -// The maximum number of solver iterations per time step -#define maxSolverIterations 1000 - -// ================================================================================= -// Set the output parameters -// ================================================================================= -// Each field in the problem will be output is writeOutput is set to "true" -#define writeOutput true - -// Type of spacing between outputs ("EQUAL_SPACING", "LOG_SPACING", or -// "N_PER_DECADE") -#define outputCondition "EQUAL_SPACING" - -// Number of times the program outputs the fields (total number for -// "EQUAL_SPACING" and "LOG_SPACING", number per decade for "N_PER_DECADE") -#define numOutputs 10 - -// ================================================================================= -// Set the flag determining if the total free energy is calculated for each -// output -// ================================================================================= -#define calcEnergy false diff --git a/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D_timestep/residuals.h b/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D_timestep/residuals.h deleted file mode 100644 index 3c8190016..000000000 --- a/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D_timestep/residuals.h +++ /dev/null @@ -1,682 +0,0 @@ -// List of variables and residual equations for the Precipitate Evolution -// example application - -// ================================================================================= -// Define the variables in the model -// ================================================================================= -// The number of variables -#define num_var 5 - -// The names of the variables, whether they are scalars or vectors and whether -// the governing eqn for the variable is parabolic or elliptic -#define variable_name \ - { \ - "c", "n1", "n2", "n3", "u" \ - } -#define variable_type \ - { \ - "SCALAR", "SCALAR", "SCALAR", "SCALAR", "VECTOR" \ - } -#define variable_eq_type \ - { \ - "PARABOLIC", "PARABOLIC", "PARABOLIC", "PARABOLIC", "ELLIPTIC" \ - } - -// Flags for whether the value, gradient, and Hessian are needed in the residual -// eqns -#define need_val \ - { \ - true, true, true, true, false \ - } -#define need_grad \ - { \ - true, true, true, true, true \ - } -#define need_hess \ - { \ - false, false, false, false, false \ - } - -// Flags for whether the residual equation has a term multiplied by the test -// function (need_val_residual) and/or the gradient of the test function -// (need_grad_residual) -#define need_val_residual \ - { \ - true, true, true, true, false \ - } -#define need_grad_residual \ - { \ - true, true, true, true, true \ - } - -// Flags for whether the value, gradient, and Hessian are needed in the residual -// eqn for the left-hand-side of the iterative solver for elliptic equations -#define need_val_LHS \ - { \ - false, true, true, true, false \ - } -#define need_grad_LHS \ - { \ - false, false, false, false, true \ - } -#define need_hess_LHS \ - { \ - false, false, false, false, false \ - } - -// Flags for whether the residual equation for the left-hand-side of the -// iterative solver for elliptic equations has a term multiplied by the test -// function (need_val_residual) and/or the gradient of the test function -// (need_grad_residual) -#define need_val_residual_LHS \ - { \ - false, false, false, false, false \ - } -#define need_grad_residual_LHS \ - { \ - false, false, false, false, true \ - } - -// ================================================================================= -// Define the model parameters and the residual equations -// ================================================================================= -// Parameters in the residual equations and expressions for the residual -// equations can be set here. For simple cases, the entire residual equation can -// be written here. For more complex cases with loops or conditional statements, -// residual equations (or parts of residual equations) can be written below in -// "residualRHS". - -// Cahn-Hilliard mobility -#define McV 1.0 - -// Allen-Cahn mobilities -#define Mn1V 50.0 -#define Mn2V 50.0 -#define Mn3V 50.0 - -// Gradient energy coefficients -double Kn1[3][3] = { - {1.0, 0, 0 }, - {0, 0.5, 0 }, - {0, 0, 1.0} -}; -double Kn2[3][3] = { - {1.0, 0, 0 }, - {0, 0.5, 0 }, - {0, 0, 1.0} -}; -double Kn3[3][3] = { - {1.0, 0, 0 }, - {0, 0.5, 0 }, - {0, 0, 1.0} -}; - -// define energy barrier coefficient (used to tune the interfacial energy) -#define W -1.0 - -// Define mechanical properties -#define n_dependent_stiffness false -// Mechanical symmetry of the material and stiffness parameters -// If n_dependent_stiffness == false the first entry is used for all phases -#define MaterialModels \ - { \ - { \ - "ISOTROPIC" \ - } \ - } -#define MaterialConstants \ - { \ - { \ - 1.0, 0.3 \ - } \ - } - -// Stress-free transformation strains -// Linear fits for the stress-free transformation strains in for sfts = -// sfts_linear * c + sfts_const -double sfts_linear1[3][3] = { - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0} -}; -double sfts_const1[3][3] = { - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0} -}; - -double sfts_linear2[3][3] = { - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0} -}; -double sfts_const2[3][3] = { - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0} -}; - -double sfts_linear3[3][3] = { - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0} -}; -double sfts_const3[3][3] = { - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0} -}; - -// Free energy expressions -#define faV (24.7939 * c * c - 1.6752 * c - 1.9453e-06) -#define facV (49.5878 * c - 1.6752) -#define faccV (49.5878) -#define fbV (37.9316 * c * c - 10.7373 * c + 0.5401) -#define fbcV (75.8633 * c - 10.7373) -#define fbccV (75.8633) -#define h1V (3.0 * n1 * n1 - 2.0 * n1 * n1 * n1) -#define h2V (3.0 * n2 * n2 - 2.0 * n2 * n2 * n2) -#define h3V (3.0 * n3 * n3 - 2.0 * n3 * n3 * n3) -#define hn1V (6.0 * n1 - 6.0 * n1 * n1) -#define hn2V (6.0 * n2 - 6.0 * n2 * n2) -#define hn3V (6.0 * n3 - 6.0 * n3 * n3) - -// This double-well function can be used to tune the interfacial energy -#define fbarrierV (n1 * n1 - 2.0 * n1 * n1 * n1 + n1 * n1 * n1 * n1) -#define fbarriernV (2.0 * n1 - 6.0 * n1 * n1 + 4.0 * n1 * n1 * n1) - -// Residuals -#define rcV (c) -#define rcxTemp \ - (cx * ((1.0 - h1V - h2V - h3V) * faccV + (h1V + h2V + h3V) * fbccV) + \ - n1x * ((fbcV - facV) * hn1V) + n2x * ((fbcV - facV) * hn2V) + \ - n3x * ((fbcV - facV) * hn3V)) -#define rcxV (constV(-timeStep * McV) * rcxTemp) - -#define rn1V \ - (n1 - constV(timeStep * Mn1V) * \ - ((fbV - faV) * hn1V + W * fbarriernV + nDependentMisfitAC1)) -#define rn2V (n2 - constV(timeStep * Mn2V) * ((fbV - faV) * hn2V)) -#define rn3V (n3 - constV(timeStep * Mn3V) * ((fbV - faV) * hn3V)) -#define rn1xV (constV(-timeStep * Mn1V) * Knx1) -#define rn2xV (constV(-timeStep * Mn2V) * Knx2) -#define rn3xV (constV(-timeStep * Mn3V) * Knx3) - -// ================================================================================= -// residualRHS -// ================================================================================= -// This function calculates the residual equations for each variable. It takes -// "modelVariablesList" as an input, which is a list of the value and -// derivatives of each of the variables at a specific quadrature point. The -// (x,y,z) location of that quadrature point is given by "q_point_loc". The -// function outputs "modelResidualsList", a list of the value and gradient terms -// of the residual for each residual equation. The index for each variable in -// these lists corresponds to the order it is defined at the top of this file -// (starting at 0). -template -void -generalizedProblem::residualRHS( - const std::vector> &modelVariablesList, - std::vector> &modelResidualsList, - dealii::Point> q_point_loc) const -{ - // The concentration and its derivatives (names here should match those in the - // macros above) - scalarvalueType c = modelVariablesList[0].scalarValue; - scalargradType cx = modelVariablesList[0].scalarGrad; - - // The first order parameter and its derivatives (names here should match - // those in the macros above) - scalarvalueType n1 = modelVariablesList[1].scalarValue; - scalargradType n1x = modelVariablesList[1].scalarGrad; - - // The second order parameter and its derivatives (names here should match - // those in the macros above) - scalarvalueType n2 = modelVariablesList[2].scalarValue; - scalargradType n2x = modelVariablesList[2].scalarGrad; - - // The third order parameter and its derivatives (names here should match - // those in the macros above) - scalarvalueType n3 = modelVariablesList[3].scalarValue; - scalargradType n3x = modelVariablesList[3].scalarGrad; - - // The derivative of the displacement vector (names here should match those in - // the macros above) - vectorgradType ux = modelVariablesList[4].vectorGrad; - vectorgradType ruxV; - - vectorhessType uxx; - - if (c_dependent_misfit == true) - { - uxx = modelVariablesList[4].vectorHess; - } - - // Calculate the stress-free transformation strain and its derivatives at the - // quadrature point - dealii::Tensor<2, problemDIM, dealii::VectorizedArray> sfts1, sfts1c, sfts1cc, - sfts2, sfts2c, sfts2cc, sfts3, sfts3c, sfts3cc; - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - // Polynomial fits for the stress-free transformation strains, of the - // form: sfts = a_p * c + b_p - sfts1[i][j] = constV(sfts_linear1[i][j]) * c + constV(sfts_const1[i][j]); - sfts1c[i][j] = constV(sfts_linear1[i][j]); - sfts1cc[i][j] = constV(0.0); - - // Polynomial fits for the stress-free transformation strains, of the - // form: sfts = a_p * c + b_p - sfts2[i][j] = constV(sfts_linear2[i][j]) * c + constV(sfts_const2[i][j]); - sfts2c[i][j] = constV(sfts_linear1[i][j]); - sfts2cc[i][j] = constV(0.0); - - // Polynomial fits for the stress-free transformation strains, of the - // form: sfts = a_p * c + b_p - sfts3[i][j] = constV(sfts_linear3[i][j]) * c + constV(sfts_const3[i][j]); - sfts3c[i][j] = constV(sfts_linear3[i][j]); - sfts3cc[i][j] = constV(0.0); - } - } - - // compute E2=(E-E0) - dealii::VectorizedArray E2[dim][dim], S[dim][dim]; - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - E2[i][j] = constV(0.5) * (ux[i][j] + ux[j][i]) - - (sfts1[i][j] * h1V + sfts2[i][j] * h2V + sfts3[i][j] * h3V); - } - } - - // compute stress - // S=C*(E-E0) - // Compute stress tensor (which is equal to the residual, Rux) - dealii::VectorizedArray CIJ_combined[CIJ_tensor_size][CIJ_tensor_size]; - - if (n_dependent_stiffness == true) - { - dealii::VectorizedArray sum_hV; - sum_hV = h1V + h2V + h3V; - for (unsigned int i = 0; i < 2 * dim - 1 + dim / 3; i++) - { - for (unsigned int j = 0; j < 2 * dim - 1 + dim / 3; j++) - { - CIJ_combined[i][j] = - CIJ_list[0][i][j] * (constV(1.0) - sum_hV) + CIJ_list[1][i][j] * sum_hV; - } - } - computeStress(CIJ_combined, E2, S); - } - else - { - computeStress(CIJ_list[0], E2, S); - } - - // Fill residual corresponding to mechanics - // R=-C*(E-E0) - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - ruxV[i][j] = -S[i][j]; - } - } - - // Compute one of the stress terms in the order parameter chemical potential, - // nDependentMisfitACp = C*(E-E0)*(E0_p*Hn) - dealii::VectorizedArray nDependentMisfitAC1 = constV(0.0); - dealii::VectorizedArray nDependentMisfitAC2 = constV(0.0); - dealii::VectorizedArray nDependentMisfitAC3 = constV(0.0); - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - nDependentMisfitAC1 += S[i][j] * (sfts1[i][j]); - nDependentMisfitAC2 += S[i][j] * (sfts2[i][j]); - nDependentMisfitAC3 += S[i][j] * (sfts3[i][j]); - } - } - - nDependentMisfitAC1 *= -hn1V; - nDependentMisfitAC2 *= -hn2V; - nDependentMisfitAC3 *= -hn3V; - - // Compute the other stress term in the order parameter chemical potential, - // heterMechACp = 0.5*Hn*(C_beta-C_alpha)*(E-E0)*(E-E0) - dealii::VectorizedArray heterMechAC1 = constV(0.0); - dealii::VectorizedArray heterMechAC2 = constV(0.0); - dealii::VectorizedArray heterMechAC3 = constV(0.0); - dealii::VectorizedArray S2[dim][dim]; - - if (n_dependent_stiffness == true) - { - // computeStress(CIJ_diff, E2, S2); - computeStress(CIJ_list[1] - CIJ_list[0], E2, S2); - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - heterMechAC1 += S2[i][j] * E2[i][j]; - } - } - // Aside from HnpV, heterMechAC1, heterMechAC2, and heterMechAC3 are equal - heterMechAC2 = 0.5 * hn2V * heterMechAC1; - heterMechAC3 = 0.5 * hn3V * heterMechAC1; - - heterMechAC1 = 0.5 * hn1V * heterMechAC1; - } - - // compute the stress term in the gradient of the concentration chemical - // potential, grad_mu_el = [C*(E-E0)*E0c]x, must be a vector with length dim - scalargradType grad_mu_el; - - if (c_dependent_misfit == true) - { - dealii::VectorizedArray E3[dim][dim], S3[dim][dim]; - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - E3[i][j] = -(sfts1c[i][j] * h1V + sfts2c[i][j] * h2V + sfts3c[i][j] * h3V); - } - } - - if (n_dependent_stiffness == true) - { - computeStress(CIJ_combined, E3, S3); - } - else - { - computeStress(CIJ_list[0], E3, S3); - } - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - for (unsigned int k = 0; k < dim; k++) - { - grad_mu_el[k] += - S3[i][j] * - (constV(0.5) * (uxx[i][j][k] + uxx[j][i][k]) + E3[i][j] * cx[k] - - (sfts1[i][j] * hn1V * n1x[k] + sfts2[i][j] * hn2V * n2x[k] + - sfts3[i][j] * hn3V * n3x[k])); - - grad_mu_el[k] += - -S[i][j] * - (sfts1c[i][j] * hn1V * n1x[k] + sfts2c[i][j] * hn2V * n2x[k] + - sfts3c[i][j] * hn3V * n3x[k] + - (sfts1cc[i][j] * h1V + sfts2cc[i][j] * h2V + sfts3cc[i][j] * h3V) * - cx[k]); - - if (n_dependent_stiffness == true) - { - grad_mu_el[k] += -S2[i][j] * (sfts1c[i][j] * hn1V * n1x[k] + - sfts2c[i][j] * hn2V * n2x[k] + - sfts3c[i][j] * hn3V * n3x[k]); - } - } - } - } - } - - // compute K*nx - scalargradType Knx1, Knx2, Knx3; - for (unsigned int a = 0; a < dim; a++) - { - Knx1[a] = 0.0; - Knx2[a] = 0.0; - Knx3[a] = 0.0; - for (unsigned int b = 0; b < dim; b++) - { - Knx1[a] += constV(Kn1[a][b]) * n1x[b]; - Knx2[a] += constV(Kn2[a][b]) * n2x[b]; - Knx3[a] += constV(Kn3[a][b]) * n3x[b]; - } - } - - modelResidualsList[0].scalarValueResidual = rcV; - modelResidualsList[0].scalarGradResidual = rcxV; - - modelResidualsList[1].scalarValueResidual = rn1V; - modelResidualsList[1].scalarGradResidual = rn1xV; - - modelResidualsList[2].scalarValueResidual = rn2V; - modelResidualsList[2].scalarGradResidual = rn2xV; - - modelResidualsList[3].scalarValueResidual = rn3V; - modelResidualsList[3].scalarGradResidual = rn3xV; - - modelResidualsList[4].vectorGradResidual = ruxV; -} - -// ================================================================================= -// residualLHS (needed only if at least one equation is elliptic) -// ================================================================================= -// This function calculates the residual equations for the iterative solver for -// elliptic equations.for each variable. It takes "modelVariablesList" as an -// input, which is a list of the value and derivatives of each of the variables -// at a specific quadrature point. The (x,y,z) location of that quadrature point -// is given by "q_point_loc". The function outputs "modelRes", the value and -// gradient terms of for the left-hand-side of the residual equation for the -// iterative solver. The index for each variable in these lists corresponds to -// the order it is defined at the top of this file (starting at 0), not counting -// variables that have "need_val_LHS", "need_grad_LHS", and "need_hess_LHS" all -// set to "false". If there are multiple elliptic equations, conditional -// statements should be used to ensure that the correct residual is being -// submitted. The index of the field being solved can be accessed by -// "this->currentFieldIndex". -template -void -generalizedProblem::residualLHS( - const std::vector> &modelVariablesList, - modelResidual &modelRes, - dealii::Point> q_point_loc) const -{ - // n1 - scalarvalueType n1 = modelVariablesList[0].scalarValue; - - // n2 - scalarvalueType n2 = modelVariablesList[1].scalarValue; - - // n3 - scalarvalueType n3 = modelVariablesList[2].scalarValue; - - // u - vectorgradType ux = modelVariablesList[3].vectorGrad; - vectorgradType ruxV; - - // Take advantage of E being simply 0.5*(ux + transpose(ux)) and use the - // dealii "symmetrize" function - dealii::Tensor<2, dim, dealii::VectorizedArray> E; - E = symmetrize(ux); - - // Compute stress tensor (which is equal to the residual, Rux) - if (n_dependent_stiffness == true) - { - dealii::Tensor<2, CIJ_tensor_size, dealii::VectorizedArray> CIJ_combined; - CIJ_combined = - CIJ_list[0] * (constV(1.0) - h1V - h2V - h3V) + CIJ_list[1] * (h1V + h2V + h3V); - - computeStress(CIJ_combined, E, ruxV); - } - else - { - computeStress(CIJ_list[0], E, ruxV); - } - - modelRes.vectorGradResidual = ruxV; -} - -// ================================================================================= -// energyDensity (needed only if calcEnergy == true) -// ================================================================================= -// This function integrates the free energy density across the computational -// domain. It takes "modelVariablesList" as an input, which is a list of the -// value and derivatives of each of the variables at a specific quadrature -// point. It also takes the mapped quadrature weight, "JxW_value", as an input. -// The (x,y,z) location of the quadrature point is given by "q_point_loc". The -// weighted value of the energy density is added to "energy" variable and the -// components of the energy density are added to the "energy_components" -// variable (index 0: chemical energy, index 1: gradient energy, index 2: -// elastic energy). -template -void -generalizedProblem::energyDensity( - const std::vector> &modelVarList, - const dealii::VectorizedArray &JxW_value, - dealii::Point> q_point_loc) -{ - scalarvalueType total_energy_density = constV(0.0); - - // c - scalarvalueType c = modelVarList[0].scalarValue; - scalargradType cx = modelVarList[0].scalarGrad; - - // n1 - scalarvalueType n1 = modelVarList[1].scalarValue; - scalargradType n1x = modelVarList[1].scalarGrad; - - // n2 - scalarvalueType n2 = modelVarList[2].scalarValue; - scalargradType n2x = modelVarList[2].scalarGrad; - - // n3 - scalarvalueType n3 = modelVarList[3].scalarValue; - scalargradType n3x = modelVarList[3].scalarGrad; - - // u - vectorgradType ux = modelVarList[4].vectorGrad; - - scalarvalueType f_chem = - (constV(1.0) - (h1V + h2V + h3V)) * faV + (h1V + h2V + h3V) * fbV; - - scalarvalueType f_grad = constV(0.0); - - for (int i = 0; i < dim; i++) - { - for (int j = 0; j < dim; j++) - { - f_grad += constV(0.5 * Kn1[i][j]) * n1x[i] * n1x[j]; - } - } -#if num_sop > 1 - for (int i = 0; i < dim; i++) - { - for (int j = 0; j < dim; j++) - { - f_grad += constV(0.5 * Kn2[i][j]) * n2x[i] * n2x[j]; - } - } -#endif -#if num_sop > 2 - for (int i = 0; i < dim; i++) - { - for (int j = 0; j < dim; j++) - { - f_grad += constV(0.5 * Kn3[i][j]) * n3x[i] * n3x[j]; - } - } -#endif - - // Calculate the stress-free transformation strain and its derivatives at the - // quadrature point - dealii::Tensor<2, problemDIM, dealii::VectorizedArray> sfts1, sfts1c, sfts1cc, - sfts2, sfts2c, sfts2cc, sfts3, sfts3c, sfts3cc; - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - // Polynomial fits for the stress-free transformation strains, of the - // form: sfts = a_p * c + b_p - sfts1[i][j] = constV(sfts_linear1[i][j]) * c + constV(sfts_const1[i][j]); - sfts1c[i][j] = constV(sfts_linear1[i][j]); - sfts1cc[i][j] = constV(0.0); - - // Polynomial fits for the stress-free transformation strains, of the - // form: sfts = a_p * c + b_p - sfts2[i][j] = constV(sfts_linear2[i][j]) * c + constV(sfts_const2[i][j]); - sfts2c[i][j] = constV(sfts_linear1[i][j]); - sfts2cc[i][j] = constV(0.0); - - // Polynomial fits for the stress-free transformation strains, of the - // form: sfts = a_p * c + b_p - sfts3[i][j] = constV(sfts_linear3[i][j]) * c + constV(sfts_const3[i][j]); - sfts3c[i][j] = constV(sfts_linear3[i][j]); - sfts3cc[i][j] = constV(0.0); - } - } - - // compute E2=(E-E0) - dealii::VectorizedArray E2[dim][dim], S[dim][dim]; - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - // E2[i][j]= constV(0.5)*(ux[i][j]+ux[j][i])-( sfts1[i][j]*h1V + - // sfts2[i][j]*h2V + sfts3[i][j]*h3V); - E2[i][j] = constV(0.5) * (ux[i][j] + ux[j][i]) - - (sfts1[i][j] * h1V + sfts2[i][j] * h2V + sfts3[i][j] * h3V); - } - } - - // compute stress - // S=C*(E-E0) - dealii::VectorizedArray CIJ_combined[2 * dim - 1 + dim / 3] - [2 * dim - 1 + dim / 3]; - - if (n_dependent_stiffness == true) - { - dealii::VectorizedArray sum_hV; - sum_hV = h1V + h2V + h3V; - for (unsigned int i = 0; i < 2 * dim - 1 + dim / 3; i++) - { - for (unsigned int j = 0; j < 2 * dim - 1 + dim / 3; j++) - { - CIJ_combined[i][j] = - CIJ_list[0][i][j] * (constV(1.0) - sum_hV) + CIJ_list[1][i][j] * sum_hV; - } - } - computeStress(CIJ_combined, E2, S); - } - else - { - computeStress(CIJ_list[0], E2, S); - } - - scalarvalueType f_el = constV(0.0); - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - f_el += constV(0.5) * S[i][j] * E2[i][j]; - } - } - - total_energy_density = f_chem + f_grad + f_el; - - assembler_lock.acquire(); - for (unsigned i = 0; i < c.size(); i++) - { - // For some reason, some of the values in this loop - if (c[i] > 1.0e-10) - { - this->energy += total_energy_density[i] * JxW_value[i]; - this->energy_components[0] += f_chem[i] * JxW_value[i]; - this->energy_components[1] += f_grad[i] * JxW_value[i]; - this->energy_components[2] += f_el[i] * JxW_value[i]; - } - } - assembler_lock.release(); -} diff --git a/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D_timestep/run_num_1.txt b/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D_timestep/run_num_1.txt deleted file mode 100644 index b632c805c..000000000 --- a/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D_timestep/run_num_1.txt +++ /dev/null @@ -1 +0,0 @@ -run_006 \ No newline at end of file diff --git a/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D_timestep/run_num_2.txt b/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D_timestep/run_num_2.txt deleted file mode 100644 index 5396e09d4..000000000 --- a/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D_timestep/run_num_2.txt +++ /dev/null @@ -1 +0,0 @@ -reference_solution \ No newline at end of file diff --git a/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D_timestep/time_and_space_parameters.h b/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D_timestep/time_and_space_parameters.h deleted file mode 100644 index 8effa3187..000000000 --- a/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D_timestep/time_and_space_parameters.h +++ /dev/null @@ -1,12 +0,0 @@ -// Parameters list for the parameters involved in mesh generation and time -// stepping -#define subdivisionsX 5 -#define subdivisionsY 5 -#define subdivisionsZ 5 -#define refineFactor 0 -#define finiteElementDegree 2 -// Parameters list for the parameters involved in time stepping -#define timeStep 8e-06 -#define timeIncrements 100000 -#define timeFinal 100000000 -#define skipImplicitSolves 10000000 diff --git a/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D_timestep/visitlog.py b/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D_timestep/visitlog.py deleted file mode 100644 index 090b61656..000000000 --- a/tests/deprecated_tests/higher_order_element_tests/hoe_test_3D_timestep/visitlog.py +++ /dev/null @@ -1,57 +0,0 @@ -# Visit 2.7.0 log file -ScriptVersion = "2.7.0" -if ScriptVersion != Version(): - print "This script is for VisIt %s. It may not work with version %s" % (ScriptVersion, Version()) -ShowAllWindows() -OpenDatabase("run_006/solution-100000.pvtu", 0) -# The UpdateDBPluginInfo RPC is not supported in the VisIt module so it will not be logged. -DefineScalarExpression("diff", "(c-pos_cmfe(, mesh,0))^2") -AddPlot("Pseudocolor", "diff", 1, 1) -PseudocolorAtts = PseudocolorAttributes() -PseudocolorAtts.scaling = PseudocolorAtts.Linear # Linear, Log, Skew -PseudocolorAtts.skewFactor = 1 -PseudocolorAtts.limitsMode = PseudocolorAtts.CurrentPlot # OriginalData, CurrentPlot -PseudocolorAtts.minFlag = 0 -PseudocolorAtts.min = 0 -PseudocolorAtts.maxFlag = 0 -PseudocolorAtts.max = 1 -PseudocolorAtts.centering = PseudocolorAtts.Natural # Natural, Nodal, Zonal -PseudocolorAtts.colorTableName = "hot" -PseudocolorAtts.invertColorTable = 0 -PseudocolorAtts.opacityType = PseudocolorAtts.FullyOpaque # ColorTable, FullyOpaque, Constant, Ramp, VariableRange -PseudocolorAtts.opacityVariable = "" -PseudocolorAtts.opacity = 1 -PseudocolorAtts.opacityVarMin = 0 -PseudocolorAtts.opacityVarMax = 1 -PseudocolorAtts.opacityVarMinFlag = 0 -PseudocolorAtts.opacityVarMaxFlag = 0 -PseudocolorAtts.pointSize = 0.05 -PseudocolorAtts.pointType = PseudocolorAtts.Point # Box, Axis, Icosahedron, Octahedron, Tetrahedron, SphereGeometry, Point, Sphere -PseudocolorAtts.pointSizeVarEnabled = 0 -PseudocolorAtts.pointSizeVar = "default" -PseudocolorAtts.pointSizePixels = 2 -PseudocolorAtts.lineType = PseudocolorAtts.Line # Line, Tube, Ribbon -PseudocolorAtts.lineStyle = PseudocolorAtts.SOLID # SOLID, DASH, DOT, DOTDASH -PseudocolorAtts.lineWidth = 0 -PseudocolorAtts.tubeDisplayDensity = 10 -PseudocolorAtts.tubeRadiusSizeType = PseudocolorAtts.FractionOfBBox # Absolute, FractionOfBBox -PseudocolorAtts.tubeRadiusAbsolute = 0.125 -PseudocolorAtts.tubeRadiusBBox = 0.005 -PseudocolorAtts.varyTubeRadius = 0 -PseudocolorAtts.varyTubeRadiusVariable = "" -PseudocolorAtts.varyTubeRadiusFactor = 10 -PseudocolorAtts.endPointType = PseudocolorAtts.None # None, Tails, Heads, Both -PseudocolorAtts.endPointStyle = PseudocolorAtts.Spheres # Spheres, Cones -PseudocolorAtts.endPointRadiusSizeType = PseudocolorAtts.FractionOfBBox # Absolute, FractionOfBBox -PseudocolorAtts.endPointRadiusAbsolute = 1 -PseudocolorAtts.endPointRadiusBBox = 0.005 -PseudocolorAtts.endPointRatio = 2 -PseudocolorAtts.renderSurfaces = 1 -PseudocolorAtts.renderWireframe = 0 -PseudocolorAtts.renderPoints = 0 -PseudocolorAtts.smoothingLevel = 0 -PseudocolorAtts.legendFlag = 1 -PseudocolorAtts.lightingFlag = 1 -SetPlotOptions(PseudocolorAtts) -DrawPlots() -Query("Weighted Variable Sum", use_actual_data=1) diff --git a/tests/deprecated_tests/indexing_tests/indexTest/CMakeLists.txt b/tests/deprecated_tests/indexing_tests/indexTest/CMakeLists.txt deleted file mode 100644 index 8eecee41b..000000000 --- a/tests/deprecated_tests/indexing_tests/indexTest/CMakeLists.txt +++ /dev/null @@ -1,34 +0,0 @@ -## -# CMake script for the phaseField applications: -## - - -# Set the name of the project and target: -SET(TARGET "main") - -# Declare all source files the target consists of: -SET(TARGET_SRC - ${TARGET}.cc - # You can specify additional files here! - ) - -# Usually, you will not need to modify anything beyond this point... - -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8) - -FIND_PACKAGE(deal.II 8.0 QUIET - HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} - ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" - "*** Could not locate deal.II. ***\n\n" - "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" - "or set an environment variable \"DEAL_II_DIR\" that contains this path." - ) -ENDIF() - -DEAL_II_INITIALIZE_CACHED_VARIABLES() -#set(DEAL_II_CXX_FLAGS_DEBUG "${DEAL_II_CXX_FLAGS_DEBUG} -Wno-maybe-uninitialized -Wno-deprecated-declarations -Wno-comment -Wno-unused-parameter -Wno-unused-variable -Wno-unused-but-set-variable") -#set(DEAL_II_CXX_FLAGS_RELEASE "${DEAL_II_CXX_FLAGS_DEBUG} -Wno-maybe-uninitialized -Wno-deprecated-declarations -Wno-comment -Wno-unused-parameter -Wno-unused-variable -Wno-unused-but-set-variable") -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() diff --git a/tests/deprecated_tests/indexing_tests/indexTest/ICs_and_BCs.h b/tests/deprecated_tests/indexing_tests/indexTest/ICs_and_BCs.h deleted file mode 100644 index 7b57c0de7..000000000 --- a/tests/deprecated_tests/indexing_tests/indexTest/ICs_and_BCs.h +++ /dev/null @@ -1,112 +0,0 @@ -template -class InitialCondition : public Function -{ -public: - unsigned int index; - Vector values; - - InitialCondition(const unsigned int _index) - : Function(1) - , index(_index) - { - std::srand(Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) + 1); - } - - double - value(const Point &p, const unsigned int component = 0) const - { - double scalar_IC; - // ===================================================================== - // ENTER THE INITIAL CONDITIONS HERE FOR SCALAR FIELDS - // ===================================================================== - // Enter the function describing conditions for the fields at point "p". - // Use "if" statements to set the initial condition for each variable - // according to its variable index. - - double dx = spanX / ((double) subdivisionsX) / std::pow(2.0, refineFactor); - double x_loc[12] = {0.1, 0.8, 0.5, 0.4, 0.3, 0.8, 0.9, 0.0, 0.1, 0.5, 1, 0.7}; - double y_loc[12] = {0.3, 0.7, 0.2, 0.4, 0.9, 0.1, 0.5, 0.1, 0.6, 0.6, 1, 0.95}; - double rad[12] = {12, 14, 19, 16, 11, 12, 17, 15, 20, 10, 11, 14}; - double dist; - scalar_IC = 0; - for (unsigned int i = 0; i < 12; i++) - { -#if problemDIM == 2 - dist = p.distance(Point(x_loc[i] * spanX, y_loc[i] * spanY)); -#elif problemDIM == 3 - dist = p.distance(Point(x_loc[i] * spanX, y_loc[i] * spanY, 0.5 * spanZ)); -#endif - if (dist < rad[i]) - { - scalar_IC = 1.0; - } - }; - - // ===================================================================== - return scalar_IC; - } -}; - -template -class InitialConditionVec : public Function -{ -public: - unsigned int index; - - // Vector values; - InitialConditionVec(const unsigned int _index) - : Function(dim) - , index(_index) - { - std::srand(Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) + 1); - } - - void - vector_value(const Point &p, Vector &vector_IC) const - { - // ===================================================================== - // ENTER THE INITIAL CONDITIONS HERE FOR VECTOR FIELDS - // ===================================================================== - // Enter the function describing conditions for the fields at point "p". - // Use "if" statements to set the initial condition for each variable - // according to its variable index. - - if (index > 0) - { - vector_IC = 0.0; - } - - // ===================================================================== - } -}; - -template -void -generalizedProblem::setBCs() -{ - // ===================================================================== - // ENTER THE BOUNDARY CONDITIONS HERE - // ===================================================================== - // This function sets the BCs for the problem variables - // The function "inputBCs" should be called for each component of - // each variable and should be in numerical order. Four input arguments - // set the same BC on the entire boundary. Two plus two times the - // number of dimensions inputs sets separate BCs on each face of the domain. - // Inputs to "inputBCs": - // First input: variable number - // Second input: component number - // Third input: BC type (options are "ZERO_DERIVATIVE", "DIRICHLET", and - // "PERIODIC") Fourth input: BC value (ignored unless the BC type is - // "DIRICHLET") Odd inputs after the third: BC type Even inputs after the - // third: BC value Face numbering: starts at zero with the minimum of the - // first direction, one for the maximum of the first direction - // two for the minimum of the second direction, etc. - - inputBCs(0, 0, "ZERO_DERIVATIVE", 0); - inputBCs(1, 0, "ZERO_DERIVATIVE", 0); - inputBCs(1, 1, "ZERO_DERIVATIVE", 0); - inputBCs(2, 0, "ZERO_DERIVATIVE", 0); - inputBCs(2, 1, "ZERO_DERIVATIVE", 0); - - // ===================================================================== -} diff --git a/tests/deprecated_tests/indexing_tests/indexTest/equations.h b/tests/deprecated_tests/indexing_tests/indexTest/equations.h deleted file mode 100644 index 61d9a0bd4..000000000 --- a/tests/deprecated_tests/indexing_tests/indexTest/equations.h +++ /dev/null @@ -1,233 +0,0 @@ -// List of variables and residual equations for the coupled Allen-Cahn example -// application - -// ================================================================================= -// Define the variables in the model -// ================================================================================= -// The number of variables -#define num_var 3 - -// The names of the variables, whether they are scalars or vectors and whether -// the governing eqn for the variable is parabolic or elliptic -#define variable_name \ - { \ - "n", "vec1", "vec2" \ - } -#define variable_type \ - { \ - "SCALAR", "VECTOR", "VECTOR" \ - } -#define variable_eq_type \ - { \ - "PARABOLIC", "PARABOLIC", "PARABOLIC" \ - } - -// Flags for whether the value, gradient, and Hessian are needed in the residual -// eqns -#define need_val \ - { \ - true, true, true \ - } -#define need_grad \ - { \ - true, true, true \ - } -#define need_hess \ - { \ - false, false, false \ - } - -// Flags for whether the residual equation has a term multiplied by the test -// function (need_val_residual) and/or the gradient of the test function -// (need_grad_residual) -#define need_val_residual \ - { \ - true, true, true \ - } -#define need_grad_residual \ - { \ - true, true, true \ - } - -//// -///================================================================================= -//// Define the variables in the model -//// -///================================================================================= -//// The number of variables -// #define num_var 2 -// -//// The names of the variables, whether they are scalars or vectors and whether -/// the / governing eqn for the variable is parabolic or elliptic -// #define variable_name {"n","vec1"} -// #define variable_type {"SCALAR","VECTOR"} -// #define variable_eq_type {"PARABOLIC","PARABOLIC"} -// -//// Flags for whether the value, gradient, and Hessian are needed in the -/// residual eqns -// #define need_val {true,true} -// #define need_grad {true,true} -// #define need_hess {false,false} -// -//// Flags for whether the residual equation has a term multiplied by the test -/// function / (need_val_residual) and/or the gradient of the test function -///(need_grad_residual) -// #define need_val_residual {true,true} -// #define need_grad_residual {true,true} - -// ================================================================================= -// Define the model parameters and the residual equations -// ================================================================================= -// Parameters in the residual equations and expressions for the residual -// equations can be set here. For simple cases, the entire residual equation can -// be written here. For more complex cases with loops or conditional statements, -// residual equations (or parts of residual equations) can be written below in -// "residualRHS". - -// Mobility -#define MnV 1.0 - -// Gradient energy coefficient -#define KnV 4.0 - -// Free energy and its derivative -#define fV (n * n * n * n - 2.0 * n * n * n + n * n) -#define fnV (4.0 * n * (n - 1.0) * (n - 0.5)) - -// Residual equations -#define rnV (n - constV(timeStep * MnV) * fnV) -#define rnxV (constV(-timeStep * KnV * MnV) * nx) - -// ================================================================================= -// residualRHS -// ================================================================================= -// This function calculates the residual equations for each variable. It takes -// "modelVariablesList" as an input, which is a list of the value and -// derivatives of each of the variables at a specific quadrature point. The -// (x,y,z) location of that quadrature point is given by "q_point_loc". The -// function outputs "modelResidualsList", a list of the value and gradient terms -// of the residual for each residual equation. The index for each variable in -// these lists corresponds to the order it is defined at the top of this file -// (starting at 0). -template -void -generalizedProblem::residualRHS( - const std::vector> &modelVariablesList, - std::vector> &modelResidualsList, - dealii::Point> q_point_loc) const -{ - // The order parameter and its derivatives (names here should match those in - // the macros above) - scalarvalueType n = modelVariablesList[0].scalarValue; - scalargradType nx = modelVariablesList[0].scalarGrad; - - vectorvalueType vec1 = modelVariablesList[1].vectorValue; - vectorgradType vec1x = modelVariablesList[1].vectorGrad; - - vectorvalueType vec2 = modelVariablesList[2].vectorValue; - vectorgradType vec2x = modelVariablesList[2].vectorGrad; - - // Residuals for the equation to evolve the order parameter (names here should - // match those in the macros above) - modelResidualsList[0].scalarValueResidual = rnV; - modelResidualsList[0].scalarGradResidual = rnxV; - - vectorvalueType rvecV; - rvecV[0] = constV(1.0); - rvecV[1] = constV(1.0); - - vectorgradType rvecxV; - rvecxV[0][0] = constV(1.0); - rvecxV[1][0] = constV(1.0); - rvecxV[0][1] = constV(1.0); - rvecxV[1][1] = constV(1.0); - - modelResidualsList[1].vectorValueResidual = rvecV; - modelResidualsList[1].vectorGradResidual = rvecxV; - - modelResidualsList[2].vectorValueResidual = rvecV; - modelResidualsList[2].vectorGradResidual = rvecxV; -} - -// ================================================================================= -// residualLHS (needed only if at least one equation is elliptic) -// ================================================================================= -// This function calculates the residual equations for the iterative solver for -// elliptic equations.for each variable. It takes "modelVariablesList" as an -// input, which is a list of the value and derivatives of each of the variables -// at a specific quadrature point. The (x,y,z) location of that quadrature point -// is given by "q_point_loc". The function outputs "modelRes", the value and -// gradient terms of for the left-hand-side of the residual equation for the -// iterative solver. The index for each variable in these lists corresponds to -// the order it is defined at the top of this file (starting at 0), not counting -// variables that have "need_val_LHS", "need_grad_LHS", and "need_hess_LHS" all -// set to "false". If there are multiple elliptic equations, conditional -// statements should be used to ensure that the correct residual is being -// submitted. The index of the field being solved can be accessed by -// "this->currentFieldIndex". -template -void -generalizedProblem::residualLHS( - const std::vector> &modelVarList, - modelResidual &modelRes, - dealii::Point> q_point_loc) const -{} - -// ================================================================================= -// energyDensity (needed only if calcEnergy == true) -// ================================================================================= -// This function integrates the free energy density across the computational -// domain. It takes "modelVariablesList" as an input, which is a list of the -// value and derivatives of each of the variables at a specific quadrature -// point. It also takes the mapped quadrature weight, "JxW_value", as an input. -// The (x,y,z) location of the quadrature point is given by "q_point_loc". The -// weighted value of the energy density is added to "energy" variable and the -// components of the energy density are added to the "energy_components" -// variable (index 0: chemical energy, index 1: gradient energy, index 2: -// elastic energy). -template -void -generalizedProblem::energyDensity( - const std::vector> &modelVarList, - const dealii::VectorizedArray &JxW_value, - dealii::Point> q_point_loc) -{ - scalarvalueType total_energy_density = constV(0.0); - - // The order parameter and its derivatives (names here should match those in - // the macros above) - scalarvalueType n = modelVarList[0].scalarValue; - scalargradType nx = modelVarList[0].scalarGrad; - - // The homogenous free energy - scalarvalueType f_chem = fV; - - // The gradient free energy - scalarvalueType f_grad = constV(0.0); - - for (int i = 0; i < dim; i++) - { - for (int j = 0; j < dim; j++) - { - f_grad += constV(0.5 * KnV) * nx[i] * nx[j]; - } - } - - // The total free energy - total_energy_density = f_chem + f_grad; - - // Loop to step through each element of the vectorized arrays. Working with - // deal.ii developers to see if there is a more elegant way to do this. - assembler_lock.acquire(); - for (unsigned i = 0; i < n.size(); i++) - { - // For some reason, some of the values in this loop - if (n[i] > 1.0e-10) - { - this->energy += total_energy_density[i] * JxW_value[i]; - this->energy_components[0] += f_chem[i] * JxW_value[i]; - this->energy_components[1] += f_grad[i] * JxW_value[i]; - } - } - assembler_lock.release(); -} diff --git a/tests/deprecated_tests/indexing_tests/indexTest/formulation_allenCahn.pdf b/tests/deprecated_tests/indexing_tests/indexTest/formulation_allenCahn.pdf deleted file mode 100644 index aa82cf7b1..000000000 Binary files a/tests/deprecated_tests/indexing_tests/indexTest/formulation_allenCahn.pdf and /dev/null differ diff --git a/tests/deprecated_tests/indexing_tests/indexTest/main.cc b/tests/deprecated_tests/indexing_tests/indexTest/main.cc deleted file mode 100644 index 9f717943a..000000000 --- a/tests/deprecated_tests/indexing_tests/indexTest/main.cc +++ /dev/null @@ -1,52 +0,0 @@ -// Allen-Cahn example application - -// Header files -#include "ICs_and_BCs.h" -#include "equations.h" -#include "parameters.h" - -#include "../../../include/dealIIheaders.h" -#include "../../../src/models/coupled/generalized_model.h" -#include "../../../src/models/coupled/generalized_model_functions.h" - -// main -int -main(int argc, char **argv) -{ - Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, - argv, - numbers::invalid_unsigned_int); - try - { - deallog.depth_console(0); - generalizedProblem problem; - - problem.setBCs(); - problem.buildFields(); - problem.init(); - problem.solve(); - } - catch (std::exception &exc) - { - std::cerr << std::endl - << std::endl - << "----------------------------------------------------" << std::endl; - std::cerr << "Exception on processing: " << std::endl - << exc.what() << std::endl - << "Aborting!" << std::endl - << "----------------------------------------------------" << std::endl; - return 1; - } - catch (...) - { - std::cerr << std::endl - << std::endl - << "----------------------------------------------------" << std::endl; - std::cerr << "Unknown exception!" << std::endl - << "Aborting!" << std::endl - << "----------------------------------------------------" << std::endl; - return 1; - } - - return 0; -} diff --git a/tests/deprecated_tests/indexing_tests/indexTest/parameters.h b/tests/deprecated_tests/indexing_tests/indexTest/parameters.h deleted file mode 100644 index 097387c48..000000000 --- a/tests/deprecated_tests/indexing_tests/indexTest/parameters.h +++ /dev/null @@ -1,69 +0,0 @@ -// Parameter list for the Allen-Cahn example application -// All strictly numerical parameters should be set in this file - -// ================================================================================= -// Set the number of dimensions (1, 2, or 3 for a 1D, 2D, or 3D calculation) -// ================================================================================= -#define problemDIM 2 - -// ================================================================================= -// Set the length of the domain in all three dimensions -// ================================================================================= -// Each axes spans from zero to the specified length -#define spanX 100.0 -#define spanY 100.0 -#define spanZ 100.0 - -// ================================================================================= -// Set the element parameters -// ================================================================================= -// The number of elements in each direction is 2^(refineFactor) * subdivisions -// For optimal performance, use refineFactor primarily to determine the element -// size -#define subdivisionsX 1 -#define subdivisionsY 1 -#define subdivisionsZ 1 -#define refineFactor 7 - -// Set the polynomial degree of the element (suggested values: 1 or 2) -#define finiteElementDegree 1 - -// ================================================================================= -// Set the time step parameters -// ================================================================================= -// The size of the time step -#define timeStep 1.0e-3 - -// The simulation ends when either timeFinal is reached or the number of time -// steps equals timeIncrements -#define timeFinal 20.0 -#define timeIncrements 20000 - -// ================================================================================= -// Set the output parameters -// ================================================================================= -// Each field in the problem will be output is writeOutput is set to "true" -#define writeOutput true - -// Type of spacing between outputs ("EQUAL_SPACING", "LOG_SPACING", -// "N_PER_DECADE", or "LIST") -#define outputCondition "EQUAL_SPACING" - -// Number of times the program outputs the fields (total number for -// "EQUAL_SPACING" and "LOG_SPACING", number per decade for "N_PER_DECADE", -// ignored for "LIST") -#define numOutputs 10 - -// User-defined list of time steps where the program should output. Only used if -// outputCondition is "LIST" -#define outputList \ - {} - -// Status is printed to the screen every skipPrintSteps -#define skipPrintSteps 10 - -// ================================================================================= -// Set the flag determining if the total free energy is calculated for each -// output -// ================================================================================= -#define calcEnergy true diff --git a/tests/deprecated_tests/indexing_tests/indexTest/tex_files/allenCahn.tex b/tests/deprecated_tests/indexing_tests/indexTest/tex_files/allenCahn.tex deleted file mode 100644 index d2b763351..000000000 --- a/tests/deprecated_tests/indexing_tests/indexTest/tex_files/allenCahn.tex +++ /dev/null @@ -1,223 +0,0 @@ -\documentclass[10pt]{article} -\usepackage{amsmath} -\usepackage{bm} -\usepackage{bbm} -\usepackage{mathrsfs} -\usepackage{graphicx} -\usepackage{wrapfig} -\usepackage{subcaption} -\usepackage{epsfig} -\usepackage{amsfonts} -\usepackage{amssymb} -\usepackage{amsmath} -\usepackage{wrapfig} -\usepackage{graphicx} -\usepackage{psfrag} -\newcommand{\sun}{\ensuremath{\odot}} % sun symbol is \sun -\let\vaccent=\v % rename builtin command \v{} to \vaccent{} -\renewcommand{\v}[1]{\ensuremath{\mathbf{#1}}} % for vectors -\newcommand{\gv}[1]{\ensuremath{\mbox{\boldmath$ #1 $}}} -\newcommand{\grad}[1]{\gv{\nabla} #1} -\renewcommand{\baselinestretch}{1.2} -\jot 5mm -\graphicspath{{./figures/}} -%text dimensions -\textwidth 6.5 in -\oddsidemargin .2 in -\topmargin -0.2 in -\textheight 8.5 in -\headheight 0.2in -\overfullrule = 0pt -\pagestyle{plain} -\def\newpar{\par\vskip 0.5cm} -\begin{document} -% -%---------------------------------------------------------------------- -% Define symbols -%---------------------------------------------------------------------- -% -\def\iso{\mathbbm{1}} -\def\half{{\textstyle{1 \over 2}}} -\def\third{{\textstyle{1 \over 3}}} -\def\fourth{{\textstyle{{1 \over 4}}}} -\def\twothird{{\textstyle {{2 \over 3}}}} -\def\ndim{{n_{\rm dim}}} -\def\nint{n_{\rm int}} -\def\lint{l_{\rm int}} -\def\nel{n_{\rm el}} -\def\nf{n_{\rm f}} -\def\DIV {\hbox{\af div}} -\def\GRAD{\hbox{\af Grad}} -\def\sym{\mathop{\rm sym}\nolimits} -\def\tr{\mathop{\rm tr}\nolimits} -\def\dev{\mathop{\rm dev}\nolimits} -\def\Dev{\mathop{\rm Dev}\nolimits} -\def\DEV{\mathop {\rm DEV}\nolimits} -\def\bfb {{\bi b}} -\def\Bnabla{\nabla} -\def\bG{{\bi G}} -\def\jmpdelu{{\lbrack\!\lbrack \Delta u\rbrack\!\rbrack}} -\def\jmpudot{{\lbrack\!\lbrack\dot u\rbrack\!\rbrack}} -\def\jmpu{{\lbrack\!\lbrack u\rbrack\!\rbrack}} -\def\jmphi{{\lbrack\!\lbrack\varphi\rbrack\!\rbrack}} -\def\ljmp{{\lbrack\!\lbrack}} -\def\rjmp{{\rbrack\!\rbrack}} -\def\sign{{\rm sign}} -\def\nn{{n+1}} -\def\na{{n+\vartheta}} -\def\nna{{n+(1-\vartheta)}} -\def\nt{{n+{1\over 2}}} -\def\nb{{n+\beta}} -\def\nbb{{n+(1-\beta)}} -%--------------------------------------------------------- -% Bold Face Math Characters: -% All In Format: \B***** . -%--------------------------------------------------------- -\def\bOne{\mbox{\boldmath$1$}} -\def\BGamma{\mbox{\boldmath$\Gamma$}} -\def\BDelta{\mbox{\boldmath$\Delta$}} -\def\BTheta{\mbox{\boldmath$\Theta$}} -\def\BLambda{\mbox{\boldmath$\Lambda$}} -\def\BXi{\mbox{\boldmath$\Xi$}} -\def\BPi{\mbox{\boldmath$\Pi$}} -\def\BSigma{\mbox{\boldmath$\Sigma$}} -\def\BUpsilon{\mbox{\boldmath$\Upsilon$}} -\def\BPhi{\mbox{\boldmath$\Phi$}} -\def\BPsi{\mbox{\boldmath$\Psi$}} -\def\BOmega{\mbox{\boldmath$\Omega$}} -\def\Balpha{\mbox{\boldmath$\alpha$}} -\def\Bbeta{\mbox{\boldmath$\beta$}} -\def\Bgamma{\mbox{\boldmath$\gamma$}} -\def\Bdelta{\mbox{\boldmath$\delta$}} -\def\Bepsilon{\mbox{\boldmath$\epsilon$}} -\def\Bzeta{\mbox{\boldmath$\zeta$}} -\def\Beta{\mbox{\boldmath$\eta$}} -\def\Btheta{\mbox{\boldmath$\theta$}} -\def\Biota{\mbox{\boldmath$\iota$}} -\def\Bkappa{\mbox{\boldmath$\kappa$}} -\def\Blambda{\mbox{\boldmath$\lambda$}} -\def\Bmu{\mbox{\boldmath$\mu$}} -\def\Bnu{\mbox{\boldmath$\nu$}} -\def\Bxi{\mbox{\boldmath$\xi$}} -\def\Bpi{\mbox{\boldmath$\pi$}} -\def\Brho{\mbox{\boldmath$\rho$}} -\def\Bsigma{\mbox{\boldmath$\sigma$}} -\def\Btau{\mbox{\boldmath$\tau$}} -\def\Bupsilon{\mbox{\boldmath$\upsilon$}} -\def\Bphi{\mbox{\boldmath$\phi$}} -\def\Bchi{\mbox{\boldmath$\chi$}} -\def\Bpsi{\mbox{\boldmath$\psi$}} -\def\Bomega{\mbox{\boldmath$\omega$}} -\def\Bvarepsilon{\mbox{\boldmath$\varepsilon$}} -\def\Bvartheta{\mbox{\boldmath$\vartheta$}} -\def\Bvarpi{\mbox{\boldmath$\varpi$}} -\def\Bvarrho{\mbox{\boldmath$\varrho$}} -\def\Bvarsigma{\mbox{\boldmath$\varsigma$}} -\def\Bvarphi{\mbox{\boldmath$\varphi$}} -\def\bone{\mathbf{1}} -\def\bzero{\mathbf{0}} -%--------------------------------------------------------- -% Bold Face Math Italic: -% All In Format: \b* . -%--------------------------------------------------------- -\def\bA{\mbox{\boldmath$ A$}} -\def\bB{\mbox{\boldmath$ B$}} -\def\bC{\mbox{\boldmath$ C$}} -\def\bD{\mbox{\boldmath$ D$}} -\def\bE{\mbox{\boldmath$ E$}} -\def\bF{\mbox{\boldmath$ F$}} -\def\bG{\mbox{\boldmath$ G$}} -\def\bH{\mbox{\boldmath$ H$}} -\def\bI{\mbox{\boldmath$ I$}} -\def\bJ{\mbox{\boldmath$ J$}} -\def\bK{\mbox{\boldmath$ K$}} -\def\bL{\mbox{\boldmath$ L$}} -\def\bM{\mbox{\boldmath$ M$}} -\def\bN{\mbox{\boldmath$ N$}} -\def\bO{\mbox{\boldmath$ O$}} -\def\bP{\mbox{\boldmath$ P$}} -\def\bQ{\mbox{\boldmath$ Q$}} -\def\bR{\mbox{\boldmath$ R$}} -\def\bS{\mbox{\boldmath$ S$}} -\def\bT{\mbox{\boldmath$ T$}} -\def\bU{\mbox{\boldmath$ U$}} -\def\bV{\mbox{\boldmath$ V$}} -\def\bW{\mbox{\boldmath$ W$}} -\def\bX{\mbox{\boldmath$ X$}} -\def\bY{\mbox{\boldmath$ Y$}} -\def\bZ{\mbox{\boldmath$ Z$}} -\def\ba{\mbox{\boldmath$ a$}} -\def\bb{\mbox{\boldmath$ b$}} -\def\bc{\mbox{\boldmath$ c$}} -\def\bd{\mbox{\boldmath$ d$}} -\def\be{\mbox{\boldmath$ e$}} -\def\bff{\mbox{\boldmath$ f$}} -\def\bg{\mbox{\boldmath$ g$}} -\def\bh{\mbox{\boldmath$ h$}} -\def\bi{\mbox{\boldmath$ i$}} -\def\bj{\mbox{\boldmath$ j$}} -\def\bk{\mbox{\boldmath$ k$}} -\def\bl{\mbox{\boldmath$ l$}} -\def\bm{\mbox{\boldmath$ m$}} -\def\bn{\mbox{\boldmath$ n$}} -\def\bo{\mbox{\boldmath$ o$}} -\def\bp{\mbox{\boldmath$ p$}} -\def\bq{\mbox{\boldmath$ q$}} -\def\br{\mbox{\boldmath$ r$}} -\def\bs{\mbox{\boldmath$ s$}} -\def\bt{\mbox{\boldmath$ t$}} -\def\bu{\mbox{\boldmath$ u$}} -\def\bv{\mbox{\boldmath$ v$}} -\def\bw{\mbox{\boldmath$ w$}} -\def\bx{\mbox{\boldmath$ x$}} -\def\by{\mbox{\boldmath$ y$}} -\def\bz{\mbox{\boldmath$ z$}} -%********************************* -%Start main paper -%********************************* -\centerline{\Large{\bf PRISMS PhaseField}} -\smallskip -\centerline{\Large{\bf Allen-Cahn Dynamics}} -\bigskip -Consider a free energy expression of the form: -\begin{equation} - \Pi(\eta, \grad \eta) = \int_{\Omega} f( \eta ) + \frac{\kappa}{2} \grad \eta \cdot \grad \eta ~dV -\end{equation} -where $\eta$ is the structural order parameter, and $\kappa$ is the gradient length scale parameter. - -\section{Variational treatment} -Considering variations on the primal field $\eta$ of the from $\eta+\epsilon w$, we have -\begin{align} -\delta \Pi &= \left. \frac{d}{d\epsilon} \int_{\Omega} f(\eta+\epsilon w) + \frac{\kappa}{2} \grad (\eta+\epsilon w) \cdot ~\grad (\eta+\epsilon w) ~dV \right\vert_{\epsilon=0} \\ -&= \int_{\Omega} w f_{,\eta} + \kappa \grad w \grad \eta ~dV \\ -&= \int_{\Omega} w \left( f_{,\eta} - \kappa \Delta \eta \right) ~dV + \int_{\partial \Omega} w \kappa \grad \eta \cdot n ~dS -\end{align} -Assuming $\kappa \grad \eta \cdot n = 0$, and using standard variational arguments on the equation $\delta \Pi =0$ we have the expression for chemical potential as -\begin{equation} - \mu = f_{,\eta} - \kappa \Delta \eta -\end{equation} - -\section{Kinetics} -Now the Parabolic PDE for Allen-Cahn dynamics is given by: -\begin{align} - \frac{\partial \eta}{\partial t} &= -M~(f_{,\eta} - \kappa \Delta \eta) -\end{align} -where $M$ is the constant mobility. -\section{Time discretization} -Considering forward Euler explicit time stepping, we have the time discretized kinetics equation: -\begin{align} - \eta^{n+1} &= \eta^{n} - \Delta t M~(f_{,\eta}^{n} - \kappa \Delta \eta^{n}) -\end{align} - -\section{Weak formulation} -In the weak formulation, considering an arbitrary variation $w$, the above equation can be expressed as a residual equation: -\begin{align} -\int_{\Omega} w \eta^{n+1} ~dV&= \int_{\Omega} w \eta^{n} - w \Delta t M~(f_{,\eta}^{n} - \kappa \Delta \eta^{n}) ~dV \\ -&= \int_{\Omega} w ( \underbrace{ \eta^{n} - \Delta t M~f_{,\eta}^{n} }_{r_{\eta}} ) + \grad w \underbrace{ (-\Delta t M \kappa)~ \cdot (\grad \eta^{n})}_{r_{\eta x}} ~dV \quad [\kappa \grad \eta \cdot n = 0 \quad \text{on} \quad \partial \Omega] -\end{align} -\vskip 0.25in -The above values of $r_{\eta}$ and $r_{\eta x}$ are used to define the residuals in the following parameters file: \\ -\textit{applications/allenCahn/parameters.h} - - -\end{document} \ No newline at end of file diff --git a/tests/deprecated_tests/indexing_tests/mechanics_doubleVec/CMakeLists.txt b/tests/deprecated_tests/indexing_tests/mechanics_doubleVec/CMakeLists.txt deleted file mode 100644 index 8eecee41b..000000000 --- a/tests/deprecated_tests/indexing_tests/mechanics_doubleVec/CMakeLists.txt +++ /dev/null @@ -1,34 +0,0 @@ -## -# CMake script for the phaseField applications: -## - - -# Set the name of the project and target: -SET(TARGET "main") - -# Declare all source files the target consists of: -SET(TARGET_SRC - ${TARGET}.cc - # You can specify additional files here! - ) - -# Usually, you will not need to modify anything beyond this point... - -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8) - -FIND_PACKAGE(deal.II 8.0 QUIET - HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} - ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" - "*** Could not locate deal.II. ***\n\n" - "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" - "or set an environment variable \"DEAL_II_DIR\" that contains this path." - ) -ENDIF() - -DEAL_II_INITIALIZE_CACHED_VARIABLES() -#set(DEAL_II_CXX_FLAGS_DEBUG "${DEAL_II_CXX_FLAGS_DEBUG} -Wno-maybe-uninitialized -Wno-deprecated-declarations -Wno-comment -Wno-unused-parameter -Wno-unused-variable -Wno-unused-but-set-variable") -#set(DEAL_II_CXX_FLAGS_RELEASE "${DEAL_II_CXX_FLAGS_DEBUG} -Wno-maybe-uninitialized -Wno-deprecated-declarations -Wno-comment -Wno-unused-parameter -Wno-unused-variable -Wno-unused-but-set-variable") -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() diff --git a/tests/deprecated_tests/indexing_tests/mechanics_doubleVec/ICs_and_BCs.h b/tests/deprecated_tests/indexing_tests/mechanics_doubleVec/ICs_and_BCs.h deleted file mode 100644 index ed815b766..000000000 --- a/tests/deprecated_tests/indexing_tests/mechanics_doubleVec/ICs_and_BCs.h +++ /dev/null @@ -1,241 +0,0 @@ -template -class InitialCondition : public Function -{ -public: - unsigned int index; - Vector values; - - InitialCondition(const unsigned int _index) - : Function(1) - , index(_index) - { - std::srand(Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) + 1); - } - - double - value(const Point &p, const unsigned int component = 0) const - { - double scalar_IC = 0; - // ===================================================================== - // ENTER THE INITIAL CONDITIONS HERE FOR SCALAR FIELDS - // ===================================================================== - // Enter the function describing conditions for the fields at point "p". - // Use "if" statements to set the initial condition for each variable - // according to its variable index. - - // ===================================================================== - return scalar_IC; - } -}; - -template -class InitialConditionVec : public Function -{ -public: - unsigned int index; - - // Vector values; - InitialConditionVec(const unsigned int _index) - : Function(dim) - , index(_index) - { - std::srand(Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) + 1); - } - - void - vector_value(const Point &p, Vector &vector_IC) const - { - // ===================================================================== - // ENTER THE INITIAL CONDITIONS HERE FOR VECTOR FIELDS - // ===================================================================== - // Enter the function describing conditions for the fields at point "p". - // Use "if" statements to set the initial condition for each variable - // according to its variable index. - - vector_IC(0) = 0.0; - vector_IC(1) = 0.0; - vector_IC(2) = 0.0; - - // ===================================================================== - } -}; - -// Sets the BCs for the problem variables -// "inputBCs" should be called for each component of each variable and should be -// in numerical order Four input arguments set the same BC on the entire -// boundary Two plus two times the number of dimensions inputs sets separate BCs -// on each face of the domain Inputs to "inputBCs": First input: variable number -// Second input: component number -// Third input: BC type (options are "ZERO_DERIVATIVE" and "DIRICHLET") -// Fourth input: BC value (ignored unless the BC type is "DIRICHLET") -// Odd inputs after the third: BC type -// Even inputs after the third: BC value -// Face numbering: starts at zero with the minimum of the first direction, one -// for the maximum of the first direction -// two for the minimum of the second direction, etc. -template -void -generalizedProblem::setBCs() -{ - // ===================================================================== - // ENTER THE BOUNDARY CONDITIONS HERE - // ===================================================================== - // This function sets the BCs for the problem variables - // The function "inputBCs" should be called for each component of - // each variable and should be in numerical order. Four input arguments - // set the same BC on the entire boundary. Two plus two times the - // number of dimensions inputs sets separate BCs on each face of the domain. - // Inputs to "inputBCs": - // First input: variable number - // Second input: component number - // Third input: BC type (options are "ZERO_DERIVATIVE", "DIRICHLET", and - // "PERIODIC") Fourth input: BC value (ignored unless the BC type is - // "DIRICHLET") Odd inputs after the third: BC type Even inputs after the - // third: BC value Face numbering: starts at zero with the minimum of the - // first direction, one for the maximum of the first direction - // two for the minimum of the second direction, etc. - - inputBCs(0, - 0, - "DIRICHLET", - -1.0, - "DIRICHLET", - 0.0, - "ZERO_DERIVATIVE", - 0.0, - "ZERO_DERIVATIVE", - 0.0, - "ZERO_DERIVATIVE", - 0.0, - "ZERO_DERIVATIVE", - 0.0); - inputBCs(0, - 1, - "DIRICHLET", - 0.0, - "DIRICHLET", - 0.0, - "ZERO_DERIVATIVE", - 0.0, - "ZERO_DERIVATIVE", - 0.0, - "ZERO_DERIVATIVE", - 0.0, - "ZERO_DERIVATIVE", - 0.0); - inputBCs(0, - 2, - "DIRICHLET", - 0.0, - "DIRICHLET", - 0.0, - "ZERO_DERIVATIVE", - 0.0, - "ZERO_DERIVATIVE", - 0.0, - "ZERO_DERIVATIVE", - 0.0, - "ZERO_DERIVATIVE", - 0.0); - - inputBCs(1, - 0, - "ZERO_DERIVATIVE", - 0.0, - "ZERO_DERIVATIVE", - 0.0, - "ZERO_DERIVATIVE", - 0.0, - "ZERO_DERIVATIVE", - 0.0, - "ZERO_DERIVATIVE", - 0.0, - "ZERO_DERIVATIVE", - 0.0); - inputBCs(1, - 1, - "ZERO_DERIVATIVE", - 0.0, - "ZERO_DERIVATIVE", - 0.0, - "ZERO_DERIVATIVE", - 0.0, - "ZERO_DERIVATIVE", - 0.0, - "ZERO_DERIVATIVE", - 0.0, - "ZERO_DERIVATIVE", - 0.0); - inputBCs(1, - 2, - "ZERO_DERIVATIVE", - 0.0, - "ZERO_DERIVATIVE", - 0.0, - "ZERO_DERIVATIVE", - 0.0, - "ZERO_DERIVATIVE", - 0.0, - "ZERO_DERIVATIVE", - 0.0, - "ZERO_DERIVATIVE", - 0.0); - - inputBCs(2, - 0, - "DIRICHLET", - -5.0, - "DIRICHLET", - 0.0, - "ZERO_DERIVATIVE", - 0.0, - "ZERO_DERIVATIVE", - 0.0, - "ZERO_DERIVATIVE", - 0.0, - "ZERO_DERIVATIVE", - 0.0); - inputBCs(2, - 1, - "DIRICHLET", - 0.0, - "DIRICHLET", - 0.0, - "ZERO_DERIVATIVE", - 0.0, - "ZERO_DERIVATIVE", - 0.0, - "ZERO_DERIVATIVE", - 0.0, - "ZERO_DERIVATIVE", - 0.0); - inputBCs(2, - 2, - "DIRICHLET", - 0.0, - "DIRICHLET", - 0.0, - "ZERO_DERIVATIVE", - 0.0, - "ZERO_DERIVATIVE", - 0.0, - "ZERO_DERIVATIVE", - 0.0, - "ZERO_DERIVATIVE", - 0.0); - - inputBCs(3, - 0, - "DIRICHLET", - -10.0, - "DIRICHLET", - 0.0, - "ZERO_DERIVATIVE", - 0.0, - "ZERO_DERIVATIVE", - 0.0, - "ZERO_DERIVATIVE", - 0.0, - "ZERO_DERIVATIVE", - 0.0); -} diff --git a/tests/deprecated_tests/indexing_tests/mechanics_doubleVec/equations.h b/tests/deprecated_tests/indexing_tests/mechanics_doubleVec/equations.h deleted file mode 100644 index 0e701ea4e..000000000 --- a/tests/deprecated_tests/indexing_tests/mechanics_doubleVec/equations.h +++ /dev/null @@ -1,262 +0,0 @@ -// List of variables and residual equations for the mechanics example -// application - -// ================================================================================= -// Define the variables in the model -// ================================================================================= -// The number of variables -#define num_var 4 - -// The names of the variables, whether they are scalars or vectors and whether -// the governing eqn for the variable is parabolic or elliptic -#define variable_name \ - { \ - "u", "u2", "u3", "c" \ - } -#define variable_type \ - { \ - "VECTOR", "VECTOR", "VECTOR", "SCALAR" \ - } -#define variable_eq_type \ - { \ - "ELLIPTIC", "PARABOLIC", "ELLIPTIC", "ELLIPTIC" \ - } - -// Flags for whether the value, gradient, and Hessian are needed in the residual -// eqns -#define need_val \ - { \ - false, false, false, false \ - } -#define need_grad \ - { \ - true, true, true, true \ - } -#define need_hess \ - { \ - false, false, false, false \ - } - -// Flags for whether the residual equation has a term multiplied by the test -// function (need_val_residual) and/or the gradient of the test function -// (need_grad_residual) -#define need_val_residual \ - { \ - false, false, false, false \ - } -#define need_grad_residual \ - { \ - true, true, true, true \ - } - -// Flags for whether the value, gradient, and Hessian are needed in the residual -// eqn for the left-hand-side of the iterative solver for elliptic equations -#define need_val_LHS \ - { \ - false, false, false, false \ - } -#define need_grad_LHS \ - { \ - true, true, true, true \ - } -#define need_hess_LHS \ - { \ - false, false, false, false \ - } - -// Flags for whether the residual equation for the left-hand-side of the -// iterative solver for elliptic equations has a term multiplied by the test -// function (need_val_residual) and/or the gradient of the test function -// (need_grad_residual) -#define need_val_residual_LHS \ - { \ - false, false, false, false \ - } -#define need_grad_residual_LHS \ - { \ - true, false, true, true \ - } - -// ================================================================================= -// Define the model parameters and the residual equations -// ================================================================================= -// Parameters in the residual equations and expressions for the residual -// equations can be set here. For simple cases, the entire residual equation can -// be written here. For more complex cases with loops or conditional statements, -// residual equations (or parts of residual equations) can be written below in -// "residualRHS". - -// Define Mechanical properties -// Mechanical symmetry of the material and stiffness parameters -#define MaterialModels \ - { \ - "ISOTROPIC" \ - } -#define MaterialConstants \ - { \ - { \ - 2.0, 0.3 \ - } \ - } - -// ================================================================================= -// residualRHS -// ================================================================================= -// This function calculates the residual equations for each variable. It takes -// "modelVariablesList" as an input, which is a list of the value and -// derivatives of each of the variables at a specific quadrature point. The -// (x,y,z) location of that quadrature point is given by "q_point_loc". The -// function outputs "modelResidualsList", a list of the value and gradient terms -// of the residual for each residual equation. The index for each variable in -// these lists corresponds to the order it is defined at the top of this file -// (starting at 0). -template -void -generalizedProblem::residualRHS( - const std::vector> &modelVariablesList, - std::vector> &modelResidualsList, - dealii::Point> q_point_loc) const -{ - // u - vectorgradType ux = modelVariablesList[0].vectorGrad; - vectorgradType u2x = modelVariablesList[1].vectorGrad; - vectorgradType u3x = modelVariablesList[2].vectorGrad; - scalargradType cx = modelVariablesList[3].scalarGrad; - vectorgradType Rux, Rux2; - - // compute strain tensor - dealii::VectorizedArray E[dim][dim], S[dim][dim]; - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - E[i][j] = constV(0.5) * (ux[i][j] + ux[j][i]); - } - } - - // compute strain tensor - dealii::VectorizedArray E2[dim][dim], S2[dim][dim]; - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - E2[i][j] = constV(0.5) * (u3x[i][j] + u3x[j][i]); - } - } - - // compute stress tensor - computeStress(CIJ_list[0], E, S); - - computeStress(CIJ_list[0], E2, S2); - - // compute residual - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - Rux[i][j] = -S[i][j]; - Rux2[i][j] = -S2[i][j]; - } - } - - modelResidualsList[0].vectorGradResidual = Rux; - modelResidualsList[1].vectorGradResidual = constV(0.0) * Rux; - modelResidualsList[2].vectorGradResidual = Rux2; - modelResidualsList[3].scalarGradResidual = -cx; -} - -// ================================================================================= -// residualLHS (needed only if at least one equation is elliptic) -// ================================================================================= -// This function calculates the residual equations for the iterative solver for -// elliptic equations.for each variable. It takes "modelVariablesList" as an -// input, which is a list of the value and derivatives of each of the variables -// at a specific quadrature point. The (x,y,z) location of that quadrature point -// is given by "q_point_loc". The function outputs "modelRes", the value and -// gradient terms of for the left-hand-side of the residual equation for the -// iterative solver. The index for each variable in these lists corresponds to -// the order it is defined at the top of this file (starting at 0), not counting -// variables that have "need_val_LHS", "need_grad_LHS", and "need_hess_LHS" all -// set to "false". If there are multiple elliptic equations, conditional -// statements should be used to ensure that the correct residual is being -// submitted. The index of the field being solved can be accessed by -// "this->currentFieldIndex". -template -void -generalizedProblem::residualLHS( - const std::vector> &modelVarList, - modelResidual &modelRes, - dealii::Point> q_point_loc) const -{ - // u - vectorgradType ux = modelVarList[0].vectorGrad; - vectorgradType u2x = modelVarList[1].vectorGrad; - vectorgradType u3x = modelVarList[2].vectorGrad; - scalargradType cx = modelVarList[3].scalarGrad; - vectorgradType Rux; - - dealii::VectorizedArray E[dim][dim], S[dim][dim]; - if (this->currentFieldIndex == 0) - { - // compute strain tensor - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - E[i][j] = constV(0.5) * (ux[i][j] + ux[j][i]); - } - } - } - else - { - // compute strain tensor - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - E[i][j] = constV(0.5) * (u3x[i][j] + u3x[j][i]); - } - } - } - - // compute stress tensor - computeStress(CIJ_list[0], E, S); - - // compute residual - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - Rux[i][j] = S[i][j]; - } - } - - if (this->currentFieldIndex < 3) - { - modelRes.vectorGradResidual = Rux; - } - else - { - modelRes.scalarGradResidual = cx; - } -} - -// ================================================================================= -// energyDensity (needed only if calcEnergy == true) -// ================================================================================= -// This function integrates the free energy density across the computational -// domain. It takes "modelVariablesList" as an input, which is a list of the -// value and derivatives of each of the variables at a specific quadrature -// point. It also takes the mapped quadrature weight, "JxW_value", as an input. -// The (x,y,z) location of the quadrature point is given by "q_point_loc". The -// weighted value of the energy density is added to "energy" variable and the -// components of the energy density are added to the "energy_components" -// variable (index 0: chemical energy, index 1: gradient energy, index 2: -// elastic energy). -template -void -generalizedProblem::energyDensity( - const std::vector> &modelVarList, - const dealii::VectorizedArray &JxW_value, - dealii::Point> q_point_loc) -{} diff --git a/tests/deprecated_tests/indexing_tests/mechanics_doubleVec/formulation_mechanics.pdf b/tests/deprecated_tests/indexing_tests/mechanics_doubleVec/formulation_mechanics.pdf deleted file mode 100644 index 57037ff2e..000000000 Binary files a/tests/deprecated_tests/indexing_tests/mechanics_doubleVec/formulation_mechanics.pdf and /dev/null differ diff --git a/tests/deprecated_tests/indexing_tests/mechanics_doubleVec/main.cc b/tests/deprecated_tests/indexing_tests/mechanics_doubleVec/main.cc deleted file mode 100644 index 098821797..000000000 --- a/tests/deprecated_tests/indexing_tests/mechanics_doubleVec/main.cc +++ /dev/null @@ -1,52 +0,0 @@ -// Linear elasticity example application - -// Header files -#include "ICs_and_BCs.h" -#include "equations.h" -#include "parameters.h" - -#include "../../../include/dealIIheaders.h" -#include "../../../src/models/coupled/generalized_model.h" -#include "../../../src/models/coupled/generalized_model_functions.h" - -// main -int -main(int argc, char **argv) -{ - Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, - argv, - numbers::invalid_unsigned_int); - try - { - deallog.depth_console(0); - generalizedProblem problem; - - problem.setBCs(); - problem.buildFields(); - problem.init(); - problem.solve(); - } - catch (std::exception &exc) - { - std::cerr << std::endl - << std::endl - << "----------------------------------------------------" << std::endl; - std::cerr << "Exception on processing: " << std::endl - << exc.what() << std::endl - << "Aborting!" << std::endl - << "----------------------------------------------------" << std::endl; - return 1; - } - catch (...) - { - std::cerr << std::endl - << std::endl - << "----------------------------------------------------" << std::endl; - std::cerr << "Unknown exception!" << std::endl - << "Aborting!" << std::endl - << "----------------------------------------------------" << std::endl; - return 1; - } - - return 0; -} diff --git a/tests/deprecated_tests/indexing_tests/mechanics_doubleVec/parameters.h b/tests/deprecated_tests/indexing_tests/mechanics_doubleVec/parameters.h deleted file mode 100644 index 3f234ee33..000000000 --- a/tests/deprecated_tests/indexing_tests/mechanics_doubleVec/parameters.h +++ /dev/null @@ -1,47 +0,0 @@ -// Parameter list for the mechanics example application -// All strictly numerical parameters should be set in this file - -// ================================================================================= -// Set the number of dimensions (1, 2, or 3 for a 1D, 2D, or 3D calculation) -// ================================================================================= -#define problemDIM 3 - -// ================================================================================= -// Set the length of the domain in all three dimensions -// ================================================================================= -// Each axes spans from zero to the specified length -#define spanX 100.0 -#define spanY 100.0 -#define spanZ 100.0 - -// ================================================================================= -// Set the element parameters -// ================================================================================= -// The number of elements in each direction is 2^(refineFactor) * subdivisions -// For optimal performance, use refineFactor primarily to determine the element -// size -#define subdivisionsX 1 -#define subdivisionsY 1 -#define subdivisionsZ 1 -#define refineFactor 4 - -// Set the polynomial degree of the element (suggested values: 1 or 2) -#define finiteElementDegree 1 - -// ================================================================================= -// Set the elliptic solver parameters -// ================================================================================= -// The solver type (currently the only recommended option is conjugate gradient) -#define solverType SolverCG - -// The tolerance for convergence (L2 norm of the residual) -#define solverTolerance 1.0e-10 - -// The maximum number of solver iterations per time step -#define maxSolverIterations 1000 - -// ================================================================================= -// Set the output parameters -// ================================================================================= -// Each field in the problem will be output is writeOutput is set to "true" -#define writeOutput true diff --git a/tests/deprecated_tests/indexing_tests/mechanics_doubleVec/tex_files/mechanics.tex b/tests/deprecated_tests/indexing_tests/mechanics_doubleVec/tex_files/mechanics.tex deleted file mode 100644 index c041b432e..000000000 --- a/tests/deprecated_tests/indexing_tests/mechanics_doubleVec/tex_files/mechanics.tex +++ /dev/null @@ -1,215 +0,0 @@ -\documentclass[10pt]{article} -\usepackage{amsmath} -\usepackage{bm} -\usepackage{bbm} -\usepackage{mathrsfs} -\usepackage{graphicx} -\usepackage{wrapfig} -\usepackage{subcaption} -\usepackage{epsfig} -\usepackage{amsfonts} -\usepackage{amssymb} -\usepackage{amsmath} -\usepackage{wrapfig} -\usepackage{graphicx} -\usepackage{psfrag} -\newcommand{\sun}{\ensuremath{\odot}} % sun symbol is \sun -\let\vaccent=\v % rename builtin command \v{} to \vaccent{} -\renewcommand{\v}[1]{\ensuremath{\mathbf{#1}}} % for vectors -\newcommand{\gv}[1]{\ensuremath{\mbox{\boldmath$ #1 $}}} -\newcommand{\grad}[1]{\gv{\nabla} #1} -\renewcommand{\baselinestretch}{1.2} -\jot 5mm -\graphicspath{{./figures/}} -%text dimensions -\textwidth 6.5 in -\oddsidemargin .2 in -\topmargin -0.2 in -\textheight 8.5 in -\headheight 0.2in -\overfullrule = 0pt -\pagestyle{plain} -\def\newpar{\par\vskip 0.5cm} -\begin{document} -% -%---------------------------------------------------------------------- -% Define symbols -%---------------------------------------------------------------------- -% -\def\iso{\mathbbm{1}} -\def\half{{\textstyle{1 \over 2}}} -\def\third{{\textstyle{1 \over 3}}} -\def\fourth{{\textstyle{{1 \over 4}}}} -\def\twothird{{\textstyle {{2 \over 3}}}} -\def\ndim{{n_{\rm dim}}} -\def\nint{n_{\rm int}} -\def\lint{l_{\rm int}} -\def\nel{n_{\rm el}} -\def\nf{n_{\rm f}} -\def\DIV {\hbox{\af div}} -\def\GRAD{\hbox{\af Grad}} -\def\sym{\mathop{\rm sym}\nolimits} -\def\tr{\mathop{\rm tr}\nolimits} -\def\dev{\mathop{\rm dev}\nolimits} -\def\Dev{\mathop{\rm Dev}\nolimits} -\def\DEV{\mathop {\rm DEV}\nolimits} -\def\bfb {{\bi b}} -\def\Bnabla{\nabla} -\def\bG{{\bi G}} -\def\jmpdelu{{\lbrack\!\lbrack \Delta u\rbrack\!\rbrack}} -\def\jmpudot{{\lbrack\!\lbrack\dot u\rbrack\!\rbrack}} -\def\jmpu{{\lbrack\!\lbrack u\rbrack\!\rbrack}} -\def\jmphi{{\lbrack\!\lbrack\varphi\rbrack\!\rbrack}} -\def\ljmp{{\lbrack\!\lbrack}} -\def\rjmp{{\rbrack\!\rbrack}} -\def\sign{{\rm sign}} -\def\nn{{n+1}} -\def\na{{n+\vartheta}} -\def\nna{{n+(1-\vartheta)}} -\def\nt{{n+{1\over 2}}} -\def\nb{{n+\beta}} -\def\nbb{{n+(1-\beta)}} -%--------------------------------------------------------- -% Bold Face Math Characters: -% All In Format: \B***** . -%--------------------------------------------------------- -\def\bOne{\mbox{\boldmath$1$}} -\def\BGamma{\mbox{\boldmath$\Gamma$}} -\def\BDelta{\mbox{\boldmath$\Delta$}} -\def\BTheta{\mbox{\boldmath$\Theta$}} -\def\BLambda{\mbox{\boldmath$\Lambda$}} -\def\BXi{\mbox{\boldmath$\Xi$}} -\def\BPi{\mbox{\boldmath$\Pi$}} -\def\BSigma{\mbox{\boldmath$\Sigma$}} -\def\BUpsilon{\mbox{\boldmath$\Upsilon$}} -\def\BPhi{\mbox{\boldmath$\Phi$}} -\def\BPsi{\mbox{\boldmath$\Psi$}} -\def\BOmega{\mbox{\boldmath$\Omega$}} -\def\Balpha{\mbox{\boldmath$\alpha$}} -\def\Bbeta{\mbox{\boldmath$\beta$}} -\def\Bgamma{\mbox{\boldmath$\gamma$}} -\def\Bdelta{\mbox{\boldmath$\delta$}} -\def\Bepsilon{\mbox{\boldmath$\epsilon$}} -\def\Bzeta{\mbox{\boldmath$\zeta$}} -\def\Beta{\mbox{\boldmath$\eta$}} -\def\Btheta{\mbox{\boldmath$\theta$}} -\def\Biota{\mbox{\boldmath$\iota$}} -\def\Bkappa{\mbox{\boldmath$\kappa$}} -\def\Blambda{\mbox{\boldmath$\lambda$}} -\def\Bmu{\mbox{\boldmath$\mu$}} -\def\Bnu{\mbox{\boldmath$\nu$}} -\def\Bxi{\mbox{\boldmath$\xi$}} -\def\Bpi{\mbox{\boldmath$\pi$}} -\def\Brho{\mbox{\boldmath$\rho$}} -\def\Bsigma{\mbox{\boldmath$\sigma$}} -\def\Btau{\mbox{\boldmath$\tau$}} -\def\Bupsilon{\mbox{\boldmath$\upsilon$}} -\def\Bphi{\mbox{\boldmath$\phi$}} -\def\Bchi{\mbox{\boldmath$\chi$}} -\def\Bpsi{\mbox{\boldmath$\psi$}} -\def\Bomega{\mbox{\boldmath$\omega$}} -\def\Bvarepsilon{\mbox{\boldmath$\varepsilon$}} -\def\Bvartheta{\mbox{\boldmath$\vartheta$}} -\def\Bvarpi{\mbox{\boldmath$\varpi$}} -\def\Bvarrho{\mbox{\boldmath$\varrho$}} -\def\Bvarsigma{\mbox{\boldmath$\varsigma$}} -\def\Bvarphi{\mbox{\boldmath$\varphi$}} -\def\bone{\mathbf{1}} -\def\bzero{\mathbf{0}} -%--------------------------------------------------------- -% Bold Face Math Italic: -% All In Format: \b* . -%--------------------------------------------------------- -\def\bA{\mbox{\boldmath$ A$}} -\def\bB{\mbox{\boldmath$ B$}} -\def\bC{\mbox{\boldmath$ C$}} -\def\bD{\mbox{\boldmath$ D$}} -\def\bE{\mbox{\boldmath$ E$}} -\def\bF{\mbox{\boldmath$ F$}} -\def\bG{\mbox{\boldmath$ G$}} -\def\bH{\mbox{\boldmath$ H$}} -\def\bI{\mbox{\boldmath$ I$}} -\def\bJ{\mbox{\boldmath$ J$}} -\def\bK{\mbox{\boldmath$ K$}} -\def\bL{\mbox{\boldmath$ L$}} -\def\bM{\mbox{\boldmath$ M$}} -\def\bN{\mbox{\boldmath$ N$}} -\def\bO{\mbox{\boldmath$ O$}} -\def\bP{\mbox{\boldmath$ P$}} -\def\bQ{\mbox{\boldmath$ Q$}} -\def\bR{\mbox{\boldmath$ R$}} -\def\bS{\mbox{\boldmath$ S$}} -\def\bT{\mbox{\boldmath$ T$}} -\def\bU{\mbox{\boldmath$ U$}} -\def\bV{\mbox{\boldmath$ V$}} -\def\bW{\mbox{\boldmath$ W$}} -\def\bX{\mbox{\boldmath$ X$}} -\def\bY{\mbox{\boldmath$ Y$}} -\def\bZ{\mbox{\boldmath$ Z$}} -\def\ba{\mbox{\boldmath$ a$}} -\def\bb{\mbox{\boldmath$ b$}} -\def\bc{\mbox{\boldmath$ c$}} -\def\bd{\mbox{\boldmath$ d$}} -\def\be{\mbox{\boldmath$ e$}} -\def\bff{\mbox{\boldmath$ f$}} -\def\bg{\mbox{\boldmath$ g$}} -\def\bh{\mbox{\boldmath$ h$}} -\def\bi{\mbox{\boldmath$ i$}} -\def\bj{\mbox{\boldmath$ j$}} -\def\bk{\mbox{\boldmath$ k$}} -\def\bl{\mbox{\boldmath$ l$}} -\def\bm{\mbox{\boldmath$ m$}} -\def\bn{\mbox{\boldmath$ n$}} -\def\bo{\mbox{\boldmath$ o$}} -\def\bp{\mbox{\boldmath$ p$}} -\def\bq{\mbox{\boldmath$ q$}} -\def\br{\mbox{\boldmath$ r$}} -\def\bs{\mbox{\boldmath$ s$}} -\def\bt{\mbox{\boldmath$ t$}} -\def\bu{\mbox{\boldmath$ u$}} -\def\bv{\mbox{\boldmath$ v$}} -\def\bw{\mbox{\boldmath$ w$}} -\def\bx{\mbox{\boldmath$ x$}} -\def\by{\mbox{\boldmath$ y$}} -\def\bz{\mbox{\boldmath$ z$}} -%********************************* -%Start main paper -%********************************* -\centerline{\Large{\bf PRISMS-PF}} -\smallskip -\centerline{\Large{\bf Mechanics (Infinitesimal Strain)}} -\bigskip -Consider a strain energy expression of the form: -\begin{equation} - \Pi(\varepsilon) = \int_{\Omega} \frac{1}{2} \varepsilon:C:\varepsilon ~dV -\end{equation} -where $\varepsilon$ is the infinitesimal strain tensor, $C_{ijkl}=\lambda \delta_{ij} \delta_{kl}+\mu ( \delta_{ik} \delta_{jl}+ \delta_{il} \delta_{jk} )$ is the fourth order elasticity tensor and ($\lambda$, $mu$) are the Lame parameters. - -\section{Variational treatment} -Considering variations on the displacement $u$ of the from $u+\epsilon w$, we have -\begin{align} -\delta \Pi &= \left. \frac{d}{d\epsilon} \int_{\Omega} \frac{1}{2} \varepsilon_{\epsilon}:C:\varepsilon_{\epsilon} ~dV \right\vert_{\epsilon=0} \\ -&= -\int_{\Omega} \grad w : C : \varepsilon ~dV + \int_{\partial \Omega} w \cdot (C : \varepsilon \cdot n) ~dS\\ -&= -\int_{\Omega} \grad w : \sigma ~dV + \int_{\partial \Omega} w \cdot (\sigma \cdot n) ~dS\\ -&= -\int_{\Omega} \grad w : \sigma ~dV + \int_{\partial \Omega} w \cdot t ~dS -\end{align} -where $\sigma = C : \varepsilon$ is the stress tensor and $t=\sigma \cdot n$ is the surface traction.\\ - -The minimization of the variation, $\delta \Pi=0$, gives the weak formulation of the governing equation of mechanics: - -\begin{align} -\int_{\Omega} \grad w : \sigma ~dV - \int_{\partial \Omega} w \cdot t ~dS = 0 -\end{align} - -If surface tractions are zero: \\ -\begin{align} -R &= \int_{\Omega} \grad w : \sigma ~dV = 0 -\end{align} -We solve for $R=0$ using a gradient scheme which involves the following linearization: -\begin{align} -R~|_{u}+ \frac{\partial R}{\partial u} \Delta u &= 0 \\ -\Rightarrow \frac{\partial R}{\partial u} \Delta u &= -R~|_{u} -\end{align} -This is the linear system $Ax=b$ which we solve implicitly using the Conjugate Gradient scheme. For clarity, here in the left hand side (LHS) $A=\frac{\partial R}{\partial u}$, $x=\Delta u$ and the right hand side (RHS) is $b=-R~|_{u}$. - -\end{document} \ No newline at end of file diff --git a/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test/CMakeLists.txt b/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test/CMakeLists.txt deleted file mode 100644 index 0444f179d..000000000 --- a/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test/CMakeLists.txt +++ /dev/null @@ -1,32 +0,0 @@ -## -# CMake script for the phaseField applications: -## - - -# Set the name of the project and target: -SET(TARGET "main") - -# Declare all source files the target consists of: -SET(TARGET_SRC - ${TARGET}.cc - # You can specify additional files here! - ) - -# Usually, you will not need to modify anything beyond this point... - -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8) - -FIND_PACKAGE(deal.II 8.0 QUIET - HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} - ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" - "*** Could not locate deal.II. ***\n\n" - "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" - "or set an environment variable \"DEAL_II_DIR\" that contains this path." - ) -ENDIF() - -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() diff --git a/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test/ICs_and_BCs.h b/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test/ICs_and_BCs.h deleted file mode 100644 index 7129dffae..000000000 --- a/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test/ICs_and_BCs.h +++ /dev/null @@ -1,187 +0,0 @@ -// initial condition -template -class InitialCondition : public Function -{ -public: - unsigned int index; - Vector values; - - InitialCondition(const unsigned int _index) - : Function(1) - , index(_index) - { - std::srand(Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) + 1); - } - - double - value(const Point &p, const unsigned int component = 0) const - { - double scalar_IC = 0; - // ===================================================================== - // ENTER THE INITIAL CONDITIONS HERE FOR SCALAR FIELDS - // ===================================================================== - // Enter the function describing conditions for the fields at point "p". - // Use "if" statements to set the initial condition for each variable - // according to its variable index. - -#define x_denom 1.0 -#define y_denom 1.0 -#define z_denom 1.0 -#define initial_interface_coeff 1.0 -#define initial_radius 7.0 -#define avg_Nd 0.004 - - if (index == 0) - { - // return the value of the initial concentration field at point p - double dx = spanX / ((double) subdivisionsX) / std::pow(2.0, refineFactor); - double dy = spanY / ((double) subdivisionsY) / std::pow(2.0, refineFactor); - double dz = spanZ / ((double) subdivisionsZ) / std::pow(2.0, refineFactor); - double r = 0.0; - // return 0.02 + 1.0e-3*(2*(0.5 - (double)(std::rand() % 100 )/100.0)); -#if problemDIM == 1 - r = p.operator()(0); - return 0.5 * (0.12 - 0.00) * (1 - std::tanh((r - spanX / 16.0) / (0.1 * dx))); -#elif problemDIM == 2 - - r = sqrt((p.operator()(0)) * (p.operator()(0)) / x_denom + - (p.operator()(1)) * (p.operator()(1)) / y_denom); - return 0.5 * (0.12 - avg_Nd) * - (1.0 - std::tanh((r - initial_radius) / (initial_interface_coeff))) + - avg_Nd; - -#elif problemDIM == 3 - - r = sqrt((p.operator()(0)) * (p.operator()(0)) / x_denom + - (p.operator()(1)) * (p.operator()(1)) / y_denom + - (p.operator()(2)) * (p.operator()(2)) / z_denom); - return 0.5 * (0.12 - avg_Nd) * - (1.0 - std::tanh((r - initial_radius) / (initial_interface_coeff))) + - avg_Nd; - -#endif - } - else if (index == 1) - { - // set result equal to the structural order paramter initial condition - double dx = spanX / ((double) subdivisionsX) / std::pow(2.0, refineFactor); - double dy = spanY / ((double) subdivisionsY) / std::pow(2.0, refineFactor); - double dz = spanZ / ((double) subdivisionsZ) / std::pow(2.0, refineFactor); - double r = 0.0; -#if problemDIM == 1 - r = p.operator()(0); - return 0.5 * (1.0 - std::tanh((r - spanX / 16.0) / (0.1 * dx))); -#elif problemDIM == 2 - - r = sqrt((p.operator()(0)) * (p.operator()(0)) / x_denom + - (p.operator()(1)) * (p.operator()(1)) / y_denom); - return 0.5 * (1.0 - std::tanh((r - initial_radius) / (initial_interface_coeff))); - -#elif problemDIM == 3 - // r=p.distance(Point(spanX/2.0,spanY/2.0,spanZ/2.0)); - // return 0.5*(1.0-std::tanh((r-spanX/8.0)/(3*dx))); - - r = sqrt((p.operator()(0)) * (p.operator()(0)) / x_denom + - (p.operator()(1)) * (p.operator()(1)) / y_denom + - (p.operator()(2)) * (p.operator()(2)) / z_denom); - return 0.5 * (1.0 - std::tanh((r - initial_radius) / (initial_interface_coeff))); - - // planar interface - // r=sqrt((p.operator()(2)-spanZ/2.0)*(p.operator()(2)-spanZ/2.0)); - // return 0.5*(1.0-std::tanh((r)/(initial_interface_coeff))); - // return - // 0.5*(1.0-std::tanh((r-initial_radius)/(initial_interface_coeff))); -#endif - return 0.0; - } - else if (index == 2) - { - scalar_IC = 0.0; - } - else if (index == 3) - { - scalar_IC = 0.0; - } - - // ===================================================================== - return scalar_IC; - } -}; - -// initial condition -template -class InitialConditionVec : public Function -{ -public: - unsigned int index; - - // Vector values; - InitialConditionVec(const unsigned int _index) - : Function(dim) - , index(_index) - { - std::srand(Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) + 1); - } - - void - vector_value(const Point &p, Vector &vector_IC) const - { - // ===================================================================== - // ENTER THE INITIAL CONDITIONS HERE FOR VECTOR FIELDS - // ===================================================================== - // Enter the function describing conditions for the fields at point "p". - // Use "if" statements to set the initial condition for each variable - // according to its variable index. - - if (index == 4) - { - vector_IC(0) = 0.0; - vector_IC(1) = 0.0; - if (dim == 3) - { - vector_IC(2) = 0.0; - } - } - // ===================================================================== - } -}; - -template -void -generalizedProblem::setBCs() -{ - // ===================================================================== - // ENTER THE BOUNDARY CONDITIONS HERE - // ===================================================================== - // This function sets the BCs for the problem variables - // The function "inputBCs" should be called for each component of - // each variable and should be in numerical order. Four input arguments - // set the same BC on the entire boundary. Two plus two times the - // number of dimensions inputs sets separate BCs on each face of the domain. - // Inputs to "inputBCs": - // First input: variable number - // Second input: component number - // Third input: BC type (options are "ZERO_DERIVATIVE" and "DIRICHLET") - // Fourth input: BC value (ignored unless the BC type is "DIRICHLET") - // Odd inputs after the third: BC type - // Even inputs after the third: BC value - // Face numbering: starts at zero with the minimum of the first direction, one - // for the maximum of the first direction - // two for the minimum of the second direction, etc. - inputBCs(0, 0, "ZERO_DERIVATIVE", 0); - - inputBCs(1, 0, "ZERO_DERIVATIVE", 0); - - inputBCs(2, 0, "ZERO_DERIVATIVE", 0); - - inputBCs(3, 0, "ZERO_DERIVATIVE", 0); - - inputBCs(4, 0, "DIRICHLET", 0.0); - inputBCs(4, 1, "DIRICHLET", 0.0); - if (dim == 3) - { - inputBCs(4, 2, "DIRICHLET", 0.0); - } - - // ===================================================================== -} diff --git a/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test/error1.txt b/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test/error1.txt deleted file mode 100644 index a99b71117..000000000 --- a/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test/error1.txt +++ /dev/null @@ -1 +0,0 @@ -0.00321809854358 \ No newline at end of file diff --git a/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test/error2.txt b/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test/error2.txt deleted file mode 100644 index cad323574..000000000 --- a/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test/error2.txt +++ /dev/null @@ -1 +0,0 @@ -0.000839648768306 \ No newline at end of file diff --git a/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test/error3.txt b/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test/error3.txt deleted file mode 100644 index c7e786da5..000000000 --- a/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test/error3.txt +++ /dev/null @@ -1 +0,0 @@ -0.000170818530023 \ No newline at end of file diff --git a/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test/getError1.py b/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test/getError1.py deleted file mode 100644 index 9d38eccd1..000000000 --- a/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test/getError1.py +++ /dev/null @@ -1,61 +0,0 @@ -import sys - -variable_1 = 'c' -variable_2 = 'c' - -output_num_1 = "1000" -output_num_2 = "1000" - -use_mesh_1 = True -apply_3slice = False -apply_box_crop = False - -directory_1 = "run_001/solution-"+output_num_1+".pvtu" -directory_2 = "run_004/solution-"+output_num_2+".pvtu" - -if use_mesh_1 == True: - OpenDatabase(directory_1) - DefineScalarExpression("diff","("+variable_1+"-pos_cmfe(<"+directory_2+":"+variable_2+">, mesh,0))") -else: - OpenDatabase(directory_2) - DefineScalarExpression("diff","("+variable_2+"-pos_cmfe(<"+directory_1+":"+variable_1+">, mesh,0))") - -#AddPlot("Contour","diff") -AddPlot("Pseudocolor","diff") - -PseudocolorAtts = PseudocolorAttributes() -PseudocolorAtts.limitsMode = PseudocolorAtts.CurrentPlot -SetPlotOptions(PseudocolorAtts) - -if apply_box_crop == True: - AddOperator("Box", 1) - BoxAtts = BoxAttributes() - BoxAtts.amount = BoxAtts.Some # Some, All - BoxAtts.minx = 2.0 - BoxAtts.maxx = 30.0 - BoxAtts.miny = 2.0 - BoxAtts.maxy = 30.0 - BoxAtts.minz = 2.0 - BoxAtts.maxz = 30.0 - BoxAtts.inverse = 0 - SetOperatorOptions(BoxAtts, 1) - -if apply_3slice == True: - AddOperator("ThreeSlice") - slice_atts = ThreeSliceAttributes() - slice_atts.x = 16 - slice_atts.y = 16 - slice_atts.z = 16 - SetOperatorOptions(slice_atts) - -DrawPlots() - -Query("MinMax", use_actual_data=1) -min_max_val = GetQueryOutputValue() -error = max(abs(min_max_val[0]),abs(min_max_val[1])) - -text_file = open("error1.txt","w") -text_file.write(str(error)) -text_file.close() - -sys.exit() \ No newline at end of file diff --git a/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test/getError2.py b/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test/getError2.py deleted file mode 100644 index 9842a3e8e..000000000 --- a/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test/getError2.py +++ /dev/null @@ -1,61 +0,0 @@ -import sys - -variable_1 = 'c' -variable_2 = 'c' - -output_num_1 = "1000" -output_num_2 = "1000" - -use_mesh_1 = True -apply_3slice = False -apply_box_crop = False - -directory_1 = "run_002/solution-"+output_num_1+".pvtu" -directory_2 = "run_004/solution-"+output_num_2+".pvtu" - -if use_mesh_1 == True: - OpenDatabase(directory_1) - DefineScalarExpression("diff","("+variable_1+"-pos_cmfe(<"+directory_2+":"+variable_2+">, mesh,0))") -else: - OpenDatabase(directory_2) - DefineScalarExpression("diff","("+variable_2+"-pos_cmfe(<"+directory_1+":"+variable_1+">, mesh,0))") - -#AddPlot("Contour","diff") -AddPlot("Pseudocolor","diff") - -PseudocolorAtts = PseudocolorAttributes() -PseudocolorAtts.limitsMode = PseudocolorAtts.CurrentPlot -SetPlotOptions(PseudocolorAtts) - -if apply_box_crop == True: - AddOperator("Box", 1) - BoxAtts = BoxAttributes() - BoxAtts.amount = BoxAtts.Some # Some, All - BoxAtts.minx = 2.0 - BoxAtts.maxx = 30.0 - BoxAtts.miny = 2.0 - BoxAtts.maxy = 30.0 - BoxAtts.minz = 2.0 - BoxAtts.maxz = 30.0 - BoxAtts.inverse = 0 - SetOperatorOptions(BoxAtts, 1) - -if apply_3slice == True: - AddOperator("ThreeSlice") - slice_atts = ThreeSliceAttributes() - slice_atts.x = 16 - slice_atts.y = 16 - slice_atts.z = 16 - SetOperatorOptions(slice_atts) - -DrawPlots() - -Query("MinMax", use_actual_data=1) -min_max_val = GetQueryOutputValue() -error = max(abs(min_max_val[0]),abs(min_max_val[1])) - -text_file = open("error2.txt","w") -text_file.write(str(error)) -text_file.close() - -sys.exit() \ No newline at end of file diff --git a/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test/getError3.py b/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test/getError3.py deleted file mode 100644 index 6cc1dd9cb..000000000 --- a/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test/getError3.py +++ /dev/null @@ -1,61 +0,0 @@ -import sys - -variable_1 = 'c' -variable_2 = 'c' - -output_num_1 = "1000" -output_num_2 = "1000" - -use_mesh_1 = True -apply_3slice = False -apply_box_crop = False - -directory_1 = "run_003/solution-"+output_num_1+".pvtu" -directory_2 = "run_004/solution-"+output_num_2+".pvtu" - -if use_mesh_1 == True: - OpenDatabase(directory_1) - DefineScalarExpression("diff","("+variable_1+"-pos_cmfe(<"+directory_2+":"+variable_2+">, mesh,0))") -else: - OpenDatabase(directory_2) - DefineScalarExpression("diff","("+variable_2+"-pos_cmfe(<"+directory_1+":"+variable_1+">, mesh,0))") - -#AddPlot("Contour","diff") -AddPlot("Pseudocolor","diff") - -PseudocolorAtts = PseudocolorAttributes() -PseudocolorAtts.limitsMode = PseudocolorAtts.CurrentPlot -SetPlotOptions(PseudocolorAtts) - -if apply_box_crop == True: - AddOperator("Box", 1) - BoxAtts = BoxAttributes() - BoxAtts.amount = BoxAtts.Some # Some, All - BoxAtts.minx = 2.0 - BoxAtts.maxx = 30.0 - BoxAtts.miny = 2.0 - BoxAtts.maxy = 30.0 - BoxAtts.minz = 2.0 - BoxAtts.maxz = 30.0 - BoxAtts.inverse = 0 - SetOperatorOptions(BoxAtts, 1) - -if apply_3slice == True: - AddOperator("ThreeSlice") - slice_atts = ThreeSliceAttributes() - slice_atts.x = 16 - slice_atts.y = 16 - slice_atts.z = 16 - SetOperatorOptions(slice_atts) - -DrawPlots() - -Query("MinMax", use_actual_data=1) -min_max_val = GetQueryOutputValue() -error = max(abs(min_max_val[0]),abs(min_max_val[1])) - -text_file = open("error3.txt","w") -text_file.write(str(error)) -text_file.close() - -sys.exit() \ No newline at end of file diff --git a/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test/main.cc b/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test/main.cc deleted file mode 100644 index a62d5cdca..000000000 --- a/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test/main.cc +++ /dev/null @@ -1,54 +0,0 @@ -// Coupled Cahn-Hilliard, Allen-Cahn and Mechanics problem -// general headers -#include "../../../include/dealIIheaders.h" - -// Coupled Cahn-Hilliard+Allen-Cahn+Mechanics problem headers -#include "ICs_and_BCs.h" -#include "parameters.h" -#include "residuals.h" -#include "space_parameters.h" - -#include "../../../src/models/coupled/generalized_model.h" -#include "../../../src/models/coupled/generalized_model_functions.h" - -// main -int -main(int argc, char **argv) -{ - Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, - argv, - numbers::invalid_unsigned_int); - try - { - deallog.depth_console(0); - generalizedProblem problem; - - problem.setBCs(); - problem.buildFields(); - problem.init(); - problem.solve(); - } - catch (std::exception &exc) - { - std::cerr << std::endl - << std::endl - << "----------------------------------------------------" << std::endl; - std::cerr << "Exception on processing: " << std::endl - << exc.what() << std::endl - << "Aborting!" << std::endl - << "----------------------------------------------------" << std::endl; - return 1; - } - catch (...) - { - std::cerr << std::endl - << std::endl - << "----------------------------------------------------" << std::endl; - std::cerr << "Unknown exception!" << std::endl - << "Aborting!" << std::endl - << "----------------------------------------------------" << std::endl; - return 1; - } - - return 0; -} diff --git a/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test/parameters.h b/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test/parameters.h deleted file mode 100644 index 8bf5faf29..000000000 --- a/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test/parameters.h +++ /dev/null @@ -1,101 +0,0 @@ -// Parameter list for the precipitate evolution example application -// All strictly numerical parameters should be set in this file - -// ================================================================================= -// Set the number of dimensions (1, 2, or 3 for a 1D, 2D, or 3D calculation) -// ================================================================================= -#define problemDIM 3 - -// ================================================================================= -// Set the length of the domain in all three dimensions -// ================================================================================= -// Each axes spans from zero to the specified length -#define spanX 16.0 -#define spanY 16.0 -#define spanZ 16.0 - -// ================================================================================= -// Set the element parameters -// ================================================================================= -// The number of elements in each direction is 2^(refineFactor) * subdivisions -// For optimal performance, use refineFactor primarily to determine the element -// size #define subdivisionsX 3 #define subdivisionsY 3 #define subdivisionsZ 3 -// #define refineFactor 5 - -// Set the polynomial degree of the element (suggested values: 1 or 2) -// #define finiteElementDegree 2 - -// ================================================================================= -// Set the adaptive mesh refinement parameters -// ================================================================================= -// Set the flag determining if adaptive meshing is activated -#define hAdaptivity false - -// Set the maximum and minimum level of refinement -#define maxRefinementLevel (refineFactor) -#define minRefinementLevel (refineFactor - 2) - -// Set the fields used to determine the refinement. Fields determined by the -// order declared in "equations.h", starting at zero -#define refineCriterionFields \ - { \ - 1, 2, 3 \ - } - -// Set the maximum and minimum value of the fields where the mesh should be -// refined -#define refineWindowMax \ - { \ - 0.99, 0.99, 0.99 \ - } -#define refineWindowMin \ - { \ - 0.01, 0.01, 0.01 \ - } - -// Set the number of time steps between remeshing operations -#define skipRemeshingSteps 1000 - -// ================================================================================= -// Set the time step parameters -// ================================================================================= -// The size of the time step -#define timeStep 3.0e-5 -#define timeFinal 100000000 -#define timeIncrements 1000 - -// ================================================================================= -// Set the elliptic solver parameters -// ================================================================================= -// The solver type (currently the only recommended option is conjugate gradient) -#define solverType SolverCG - -// The flag that determines whether the tolerance for solver convergence should -// be an absolute tolerance (absTol=true) or a relative tolerance (absTol=false) -#define absTol true - -// The tolerance for convergence (L2 norm of the residual) -#define solverTolerance 1.0e-4 - -// The maximum number of solver iterations per time step -#define maxSolverIterations 1000 - -// ================================================================================= -// Set the output parameters -// ================================================================================= -// Each field in the problem will be output is writeOutput is set to "true" -#define writeOutput true - -// Type of spacing between outputs ("EQUAL_SPACING", "LOG_SPACING", or -// "N_PER_DECADE") -#define outputCondition "EQUAL_SPACING" - -// Number of times the program outputs the fields (total number for -// "EQUAL_SPACING" and "LOG_SPACING", number per decade for "N_PER_DECADE") -#define numOutputs 1 - -// ================================================================================= -// Set the flag determining if the total free energy is calculated for each -// output -// ================================================================================= -#define calcEnergy false diff --git a/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test/residuals.h b/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test/residuals.h deleted file mode 100644 index 3c8190016..000000000 --- a/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test/residuals.h +++ /dev/null @@ -1,682 +0,0 @@ -// List of variables and residual equations for the Precipitate Evolution -// example application - -// ================================================================================= -// Define the variables in the model -// ================================================================================= -// The number of variables -#define num_var 5 - -// The names of the variables, whether they are scalars or vectors and whether -// the governing eqn for the variable is parabolic or elliptic -#define variable_name \ - { \ - "c", "n1", "n2", "n3", "u" \ - } -#define variable_type \ - { \ - "SCALAR", "SCALAR", "SCALAR", "SCALAR", "VECTOR" \ - } -#define variable_eq_type \ - { \ - "PARABOLIC", "PARABOLIC", "PARABOLIC", "PARABOLIC", "ELLIPTIC" \ - } - -// Flags for whether the value, gradient, and Hessian are needed in the residual -// eqns -#define need_val \ - { \ - true, true, true, true, false \ - } -#define need_grad \ - { \ - true, true, true, true, true \ - } -#define need_hess \ - { \ - false, false, false, false, false \ - } - -// Flags for whether the residual equation has a term multiplied by the test -// function (need_val_residual) and/or the gradient of the test function -// (need_grad_residual) -#define need_val_residual \ - { \ - true, true, true, true, false \ - } -#define need_grad_residual \ - { \ - true, true, true, true, true \ - } - -// Flags for whether the value, gradient, and Hessian are needed in the residual -// eqn for the left-hand-side of the iterative solver for elliptic equations -#define need_val_LHS \ - { \ - false, true, true, true, false \ - } -#define need_grad_LHS \ - { \ - false, false, false, false, true \ - } -#define need_hess_LHS \ - { \ - false, false, false, false, false \ - } - -// Flags for whether the residual equation for the left-hand-side of the -// iterative solver for elliptic equations has a term multiplied by the test -// function (need_val_residual) and/or the gradient of the test function -// (need_grad_residual) -#define need_val_residual_LHS \ - { \ - false, false, false, false, false \ - } -#define need_grad_residual_LHS \ - { \ - false, false, false, false, true \ - } - -// ================================================================================= -// Define the model parameters and the residual equations -// ================================================================================= -// Parameters in the residual equations and expressions for the residual -// equations can be set here. For simple cases, the entire residual equation can -// be written here. For more complex cases with loops or conditional statements, -// residual equations (or parts of residual equations) can be written below in -// "residualRHS". - -// Cahn-Hilliard mobility -#define McV 1.0 - -// Allen-Cahn mobilities -#define Mn1V 50.0 -#define Mn2V 50.0 -#define Mn3V 50.0 - -// Gradient energy coefficients -double Kn1[3][3] = { - {1.0, 0, 0 }, - {0, 0.5, 0 }, - {0, 0, 1.0} -}; -double Kn2[3][3] = { - {1.0, 0, 0 }, - {0, 0.5, 0 }, - {0, 0, 1.0} -}; -double Kn3[3][3] = { - {1.0, 0, 0 }, - {0, 0.5, 0 }, - {0, 0, 1.0} -}; - -// define energy barrier coefficient (used to tune the interfacial energy) -#define W -1.0 - -// Define mechanical properties -#define n_dependent_stiffness false -// Mechanical symmetry of the material and stiffness parameters -// If n_dependent_stiffness == false the first entry is used for all phases -#define MaterialModels \ - { \ - { \ - "ISOTROPIC" \ - } \ - } -#define MaterialConstants \ - { \ - { \ - 1.0, 0.3 \ - } \ - } - -// Stress-free transformation strains -// Linear fits for the stress-free transformation strains in for sfts = -// sfts_linear * c + sfts_const -double sfts_linear1[3][3] = { - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0} -}; -double sfts_const1[3][3] = { - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0} -}; - -double sfts_linear2[3][3] = { - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0} -}; -double sfts_const2[3][3] = { - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0} -}; - -double sfts_linear3[3][3] = { - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0} -}; -double sfts_const3[3][3] = { - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0} -}; - -// Free energy expressions -#define faV (24.7939 * c * c - 1.6752 * c - 1.9453e-06) -#define facV (49.5878 * c - 1.6752) -#define faccV (49.5878) -#define fbV (37.9316 * c * c - 10.7373 * c + 0.5401) -#define fbcV (75.8633 * c - 10.7373) -#define fbccV (75.8633) -#define h1V (3.0 * n1 * n1 - 2.0 * n1 * n1 * n1) -#define h2V (3.0 * n2 * n2 - 2.0 * n2 * n2 * n2) -#define h3V (3.0 * n3 * n3 - 2.0 * n3 * n3 * n3) -#define hn1V (6.0 * n1 - 6.0 * n1 * n1) -#define hn2V (6.0 * n2 - 6.0 * n2 * n2) -#define hn3V (6.0 * n3 - 6.0 * n3 * n3) - -// This double-well function can be used to tune the interfacial energy -#define fbarrierV (n1 * n1 - 2.0 * n1 * n1 * n1 + n1 * n1 * n1 * n1) -#define fbarriernV (2.0 * n1 - 6.0 * n1 * n1 + 4.0 * n1 * n1 * n1) - -// Residuals -#define rcV (c) -#define rcxTemp \ - (cx * ((1.0 - h1V - h2V - h3V) * faccV + (h1V + h2V + h3V) * fbccV) + \ - n1x * ((fbcV - facV) * hn1V) + n2x * ((fbcV - facV) * hn2V) + \ - n3x * ((fbcV - facV) * hn3V)) -#define rcxV (constV(-timeStep * McV) * rcxTemp) - -#define rn1V \ - (n1 - constV(timeStep * Mn1V) * \ - ((fbV - faV) * hn1V + W * fbarriernV + nDependentMisfitAC1)) -#define rn2V (n2 - constV(timeStep * Mn2V) * ((fbV - faV) * hn2V)) -#define rn3V (n3 - constV(timeStep * Mn3V) * ((fbV - faV) * hn3V)) -#define rn1xV (constV(-timeStep * Mn1V) * Knx1) -#define rn2xV (constV(-timeStep * Mn2V) * Knx2) -#define rn3xV (constV(-timeStep * Mn3V) * Knx3) - -// ================================================================================= -// residualRHS -// ================================================================================= -// This function calculates the residual equations for each variable. It takes -// "modelVariablesList" as an input, which is a list of the value and -// derivatives of each of the variables at a specific quadrature point. The -// (x,y,z) location of that quadrature point is given by "q_point_loc". The -// function outputs "modelResidualsList", a list of the value and gradient terms -// of the residual for each residual equation. The index for each variable in -// these lists corresponds to the order it is defined at the top of this file -// (starting at 0). -template -void -generalizedProblem::residualRHS( - const std::vector> &modelVariablesList, - std::vector> &modelResidualsList, - dealii::Point> q_point_loc) const -{ - // The concentration and its derivatives (names here should match those in the - // macros above) - scalarvalueType c = modelVariablesList[0].scalarValue; - scalargradType cx = modelVariablesList[0].scalarGrad; - - // The first order parameter and its derivatives (names here should match - // those in the macros above) - scalarvalueType n1 = modelVariablesList[1].scalarValue; - scalargradType n1x = modelVariablesList[1].scalarGrad; - - // The second order parameter and its derivatives (names here should match - // those in the macros above) - scalarvalueType n2 = modelVariablesList[2].scalarValue; - scalargradType n2x = modelVariablesList[2].scalarGrad; - - // The third order parameter and its derivatives (names here should match - // those in the macros above) - scalarvalueType n3 = modelVariablesList[3].scalarValue; - scalargradType n3x = modelVariablesList[3].scalarGrad; - - // The derivative of the displacement vector (names here should match those in - // the macros above) - vectorgradType ux = modelVariablesList[4].vectorGrad; - vectorgradType ruxV; - - vectorhessType uxx; - - if (c_dependent_misfit == true) - { - uxx = modelVariablesList[4].vectorHess; - } - - // Calculate the stress-free transformation strain and its derivatives at the - // quadrature point - dealii::Tensor<2, problemDIM, dealii::VectorizedArray> sfts1, sfts1c, sfts1cc, - sfts2, sfts2c, sfts2cc, sfts3, sfts3c, sfts3cc; - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - // Polynomial fits for the stress-free transformation strains, of the - // form: sfts = a_p * c + b_p - sfts1[i][j] = constV(sfts_linear1[i][j]) * c + constV(sfts_const1[i][j]); - sfts1c[i][j] = constV(sfts_linear1[i][j]); - sfts1cc[i][j] = constV(0.0); - - // Polynomial fits for the stress-free transformation strains, of the - // form: sfts = a_p * c + b_p - sfts2[i][j] = constV(sfts_linear2[i][j]) * c + constV(sfts_const2[i][j]); - sfts2c[i][j] = constV(sfts_linear1[i][j]); - sfts2cc[i][j] = constV(0.0); - - // Polynomial fits for the stress-free transformation strains, of the - // form: sfts = a_p * c + b_p - sfts3[i][j] = constV(sfts_linear3[i][j]) * c + constV(sfts_const3[i][j]); - sfts3c[i][j] = constV(sfts_linear3[i][j]); - sfts3cc[i][j] = constV(0.0); - } - } - - // compute E2=(E-E0) - dealii::VectorizedArray E2[dim][dim], S[dim][dim]; - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - E2[i][j] = constV(0.5) * (ux[i][j] + ux[j][i]) - - (sfts1[i][j] * h1V + sfts2[i][j] * h2V + sfts3[i][j] * h3V); - } - } - - // compute stress - // S=C*(E-E0) - // Compute stress tensor (which is equal to the residual, Rux) - dealii::VectorizedArray CIJ_combined[CIJ_tensor_size][CIJ_tensor_size]; - - if (n_dependent_stiffness == true) - { - dealii::VectorizedArray sum_hV; - sum_hV = h1V + h2V + h3V; - for (unsigned int i = 0; i < 2 * dim - 1 + dim / 3; i++) - { - for (unsigned int j = 0; j < 2 * dim - 1 + dim / 3; j++) - { - CIJ_combined[i][j] = - CIJ_list[0][i][j] * (constV(1.0) - sum_hV) + CIJ_list[1][i][j] * sum_hV; - } - } - computeStress(CIJ_combined, E2, S); - } - else - { - computeStress(CIJ_list[0], E2, S); - } - - // Fill residual corresponding to mechanics - // R=-C*(E-E0) - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - ruxV[i][j] = -S[i][j]; - } - } - - // Compute one of the stress terms in the order parameter chemical potential, - // nDependentMisfitACp = C*(E-E0)*(E0_p*Hn) - dealii::VectorizedArray nDependentMisfitAC1 = constV(0.0); - dealii::VectorizedArray nDependentMisfitAC2 = constV(0.0); - dealii::VectorizedArray nDependentMisfitAC3 = constV(0.0); - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - nDependentMisfitAC1 += S[i][j] * (sfts1[i][j]); - nDependentMisfitAC2 += S[i][j] * (sfts2[i][j]); - nDependentMisfitAC3 += S[i][j] * (sfts3[i][j]); - } - } - - nDependentMisfitAC1 *= -hn1V; - nDependentMisfitAC2 *= -hn2V; - nDependentMisfitAC3 *= -hn3V; - - // Compute the other stress term in the order parameter chemical potential, - // heterMechACp = 0.5*Hn*(C_beta-C_alpha)*(E-E0)*(E-E0) - dealii::VectorizedArray heterMechAC1 = constV(0.0); - dealii::VectorizedArray heterMechAC2 = constV(0.0); - dealii::VectorizedArray heterMechAC3 = constV(0.0); - dealii::VectorizedArray S2[dim][dim]; - - if (n_dependent_stiffness == true) - { - // computeStress(CIJ_diff, E2, S2); - computeStress(CIJ_list[1] - CIJ_list[0], E2, S2); - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - heterMechAC1 += S2[i][j] * E2[i][j]; - } - } - // Aside from HnpV, heterMechAC1, heterMechAC2, and heterMechAC3 are equal - heterMechAC2 = 0.5 * hn2V * heterMechAC1; - heterMechAC3 = 0.5 * hn3V * heterMechAC1; - - heterMechAC1 = 0.5 * hn1V * heterMechAC1; - } - - // compute the stress term in the gradient of the concentration chemical - // potential, grad_mu_el = [C*(E-E0)*E0c]x, must be a vector with length dim - scalargradType grad_mu_el; - - if (c_dependent_misfit == true) - { - dealii::VectorizedArray E3[dim][dim], S3[dim][dim]; - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - E3[i][j] = -(sfts1c[i][j] * h1V + sfts2c[i][j] * h2V + sfts3c[i][j] * h3V); - } - } - - if (n_dependent_stiffness == true) - { - computeStress(CIJ_combined, E3, S3); - } - else - { - computeStress(CIJ_list[0], E3, S3); - } - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - for (unsigned int k = 0; k < dim; k++) - { - grad_mu_el[k] += - S3[i][j] * - (constV(0.5) * (uxx[i][j][k] + uxx[j][i][k]) + E3[i][j] * cx[k] - - (sfts1[i][j] * hn1V * n1x[k] + sfts2[i][j] * hn2V * n2x[k] + - sfts3[i][j] * hn3V * n3x[k])); - - grad_mu_el[k] += - -S[i][j] * - (sfts1c[i][j] * hn1V * n1x[k] + sfts2c[i][j] * hn2V * n2x[k] + - sfts3c[i][j] * hn3V * n3x[k] + - (sfts1cc[i][j] * h1V + sfts2cc[i][j] * h2V + sfts3cc[i][j] * h3V) * - cx[k]); - - if (n_dependent_stiffness == true) - { - grad_mu_el[k] += -S2[i][j] * (sfts1c[i][j] * hn1V * n1x[k] + - sfts2c[i][j] * hn2V * n2x[k] + - sfts3c[i][j] * hn3V * n3x[k]); - } - } - } - } - } - - // compute K*nx - scalargradType Knx1, Knx2, Knx3; - for (unsigned int a = 0; a < dim; a++) - { - Knx1[a] = 0.0; - Knx2[a] = 0.0; - Knx3[a] = 0.0; - for (unsigned int b = 0; b < dim; b++) - { - Knx1[a] += constV(Kn1[a][b]) * n1x[b]; - Knx2[a] += constV(Kn2[a][b]) * n2x[b]; - Knx3[a] += constV(Kn3[a][b]) * n3x[b]; - } - } - - modelResidualsList[0].scalarValueResidual = rcV; - modelResidualsList[0].scalarGradResidual = rcxV; - - modelResidualsList[1].scalarValueResidual = rn1V; - modelResidualsList[1].scalarGradResidual = rn1xV; - - modelResidualsList[2].scalarValueResidual = rn2V; - modelResidualsList[2].scalarGradResidual = rn2xV; - - modelResidualsList[3].scalarValueResidual = rn3V; - modelResidualsList[3].scalarGradResidual = rn3xV; - - modelResidualsList[4].vectorGradResidual = ruxV; -} - -// ================================================================================= -// residualLHS (needed only if at least one equation is elliptic) -// ================================================================================= -// This function calculates the residual equations for the iterative solver for -// elliptic equations.for each variable. It takes "modelVariablesList" as an -// input, which is a list of the value and derivatives of each of the variables -// at a specific quadrature point. The (x,y,z) location of that quadrature point -// is given by "q_point_loc". The function outputs "modelRes", the value and -// gradient terms of for the left-hand-side of the residual equation for the -// iterative solver. The index for each variable in these lists corresponds to -// the order it is defined at the top of this file (starting at 0), not counting -// variables that have "need_val_LHS", "need_grad_LHS", and "need_hess_LHS" all -// set to "false". If there are multiple elliptic equations, conditional -// statements should be used to ensure that the correct residual is being -// submitted. The index of the field being solved can be accessed by -// "this->currentFieldIndex". -template -void -generalizedProblem::residualLHS( - const std::vector> &modelVariablesList, - modelResidual &modelRes, - dealii::Point> q_point_loc) const -{ - // n1 - scalarvalueType n1 = modelVariablesList[0].scalarValue; - - // n2 - scalarvalueType n2 = modelVariablesList[1].scalarValue; - - // n3 - scalarvalueType n3 = modelVariablesList[2].scalarValue; - - // u - vectorgradType ux = modelVariablesList[3].vectorGrad; - vectorgradType ruxV; - - // Take advantage of E being simply 0.5*(ux + transpose(ux)) and use the - // dealii "symmetrize" function - dealii::Tensor<2, dim, dealii::VectorizedArray> E; - E = symmetrize(ux); - - // Compute stress tensor (which is equal to the residual, Rux) - if (n_dependent_stiffness == true) - { - dealii::Tensor<2, CIJ_tensor_size, dealii::VectorizedArray> CIJ_combined; - CIJ_combined = - CIJ_list[0] * (constV(1.0) - h1V - h2V - h3V) + CIJ_list[1] * (h1V + h2V + h3V); - - computeStress(CIJ_combined, E, ruxV); - } - else - { - computeStress(CIJ_list[0], E, ruxV); - } - - modelRes.vectorGradResidual = ruxV; -} - -// ================================================================================= -// energyDensity (needed only if calcEnergy == true) -// ================================================================================= -// This function integrates the free energy density across the computational -// domain. It takes "modelVariablesList" as an input, which is a list of the -// value and derivatives of each of the variables at a specific quadrature -// point. It also takes the mapped quadrature weight, "JxW_value", as an input. -// The (x,y,z) location of the quadrature point is given by "q_point_loc". The -// weighted value of the energy density is added to "energy" variable and the -// components of the energy density are added to the "energy_components" -// variable (index 0: chemical energy, index 1: gradient energy, index 2: -// elastic energy). -template -void -generalizedProblem::energyDensity( - const std::vector> &modelVarList, - const dealii::VectorizedArray &JxW_value, - dealii::Point> q_point_loc) -{ - scalarvalueType total_energy_density = constV(0.0); - - // c - scalarvalueType c = modelVarList[0].scalarValue; - scalargradType cx = modelVarList[0].scalarGrad; - - // n1 - scalarvalueType n1 = modelVarList[1].scalarValue; - scalargradType n1x = modelVarList[1].scalarGrad; - - // n2 - scalarvalueType n2 = modelVarList[2].scalarValue; - scalargradType n2x = modelVarList[2].scalarGrad; - - // n3 - scalarvalueType n3 = modelVarList[3].scalarValue; - scalargradType n3x = modelVarList[3].scalarGrad; - - // u - vectorgradType ux = modelVarList[4].vectorGrad; - - scalarvalueType f_chem = - (constV(1.0) - (h1V + h2V + h3V)) * faV + (h1V + h2V + h3V) * fbV; - - scalarvalueType f_grad = constV(0.0); - - for (int i = 0; i < dim; i++) - { - for (int j = 0; j < dim; j++) - { - f_grad += constV(0.5 * Kn1[i][j]) * n1x[i] * n1x[j]; - } - } -#if num_sop > 1 - for (int i = 0; i < dim; i++) - { - for (int j = 0; j < dim; j++) - { - f_grad += constV(0.5 * Kn2[i][j]) * n2x[i] * n2x[j]; - } - } -#endif -#if num_sop > 2 - for (int i = 0; i < dim; i++) - { - for (int j = 0; j < dim; j++) - { - f_grad += constV(0.5 * Kn3[i][j]) * n3x[i] * n3x[j]; - } - } -#endif - - // Calculate the stress-free transformation strain and its derivatives at the - // quadrature point - dealii::Tensor<2, problemDIM, dealii::VectorizedArray> sfts1, sfts1c, sfts1cc, - sfts2, sfts2c, sfts2cc, sfts3, sfts3c, sfts3cc; - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - // Polynomial fits for the stress-free transformation strains, of the - // form: sfts = a_p * c + b_p - sfts1[i][j] = constV(sfts_linear1[i][j]) * c + constV(sfts_const1[i][j]); - sfts1c[i][j] = constV(sfts_linear1[i][j]); - sfts1cc[i][j] = constV(0.0); - - // Polynomial fits for the stress-free transformation strains, of the - // form: sfts = a_p * c + b_p - sfts2[i][j] = constV(sfts_linear2[i][j]) * c + constV(sfts_const2[i][j]); - sfts2c[i][j] = constV(sfts_linear1[i][j]); - sfts2cc[i][j] = constV(0.0); - - // Polynomial fits for the stress-free transformation strains, of the - // form: sfts = a_p * c + b_p - sfts3[i][j] = constV(sfts_linear3[i][j]) * c + constV(sfts_const3[i][j]); - sfts3c[i][j] = constV(sfts_linear3[i][j]); - sfts3cc[i][j] = constV(0.0); - } - } - - // compute E2=(E-E0) - dealii::VectorizedArray E2[dim][dim], S[dim][dim]; - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - // E2[i][j]= constV(0.5)*(ux[i][j]+ux[j][i])-( sfts1[i][j]*h1V + - // sfts2[i][j]*h2V + sfts3[i][j]*h3V); - E2[i][j] = constV(0.5) * (ux[i][j] + ux[j][i]) - - (sfts1[i][j] * h1V + sfts2[i][j] * h2V + sfts3[i][j] * h3V); - } - } - - // compute stress - // S=C*(E-E0) - dealii::VectorizedArray CIJ_combined[2 * dim - 1 + dim / 3] - [2 * dim - 1 + dim / 3]; - - if (n_dependent_stiffness == true) - { - dealii::VectorizedArray sum_hV; - sum_hV = h1V + h2V + h3V; - for (unsigned int i = 0; i < 2 * dim - 1 + dim / 3; i++) - { - for (unsigned int j = 0; j < 2 * dim - 1 + dim / 3; j++) - { - CIJ_combined[i][j] = - CIJ_list[0][i][j] * (constV(1.0) - sum_hV) + CIJ_list[1][i][j] * sum_hV; - } - } - computeStress(CIJ_combined, E2, S); - } - else - { - computeStress(CIJ_list[0], E2, S); - } - - scalarvalueType f_el = constV(0.0); - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - f_el += constV(0.5) * S[i][j] * E2[i][j]; - } - } - - total_energy_density = f_chem + f_grad + f_el; - - assembler_lock.acquire(); - for (unsigned i = 0; i < c.size(); i++) - { - // For some reason, some of the values in this loop - if (c[i] > 1.0e-10) - { - this->energy += total_energy_density[i] * JxW_value[i]; - this->energy_components[0] += f_chem[i] * JxW_value[i]; - this->energy_components[1] += f_grad[i] * JxW_value[i]; - this->energy_components[2] += f_el[i] * JxW_value[i]; - } - } - assembler_lock.release(); -} diff --git a/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test/run_spatial_ooa_test.py b/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test/run_spatial_ooa_test.py deleted file mode 100644 index 9f08e318f..000000000 --- a/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test/run_spatial_ooa_test.py +++ /dev/null @@ -1,83 +0,0 @@ -import subprocess -import shutil -import glob -import math -import os.path - -# ---------------------------------------------------------------------------------------- -# Function that generates a header file for the simulation, compiles the PRISMS-PF code -# and runs the executable. -# ---------------------------------------------------------------------------------------- -def run_simulation(refineFactor,run_name): - - subdivisionsX = 1 - subdivisionsY = 1 - subdivisionsZ = 1 - finiteElementDegree = 1 - - text_file = open("space_parameters.h","w") - text_file.write("// Parameters list for the parameters involved in mesh generation \n") - text_file.write("#define subdivisionsX " + str(subdivisionsX) + "\n") - text_file.write("#define subdivisionsY " + str(subdivisionsY) + "\n") - text_file.write("#define subdivisionsZ " + str(subdivisionsZ) + "\n") - text_file.write("#define refineFactor " + str(refineFactor) + "\n") - text_file.write("#define finiteElementDegree " + str(finiteElementDegree) + "\n") - text_file.close() - - subprocess.call(["make", "release"]) - #subprocess.call(["./main"]) - subprocess.call(["mpirun", "-n", "4", "main"]) - - subprocess.call(["mkdir",run_name]) - for output_files in glob.glob('*vtu'): - shutil.move(output_files,run_name) - -# ---------------------------------------------------------------------------------------- - -# If files exist from previous tests, delete them -if os.path.exists("run_001") == True: - shutil.rmtree("run_001") -if os.path.exists("run_002") == True: - shutil.rmtree("run_002") -if os.path.exists("run_003") == True: - shutil.rmtree("run_003") -if os.path.exists("run_004") == True: - shutil.rmtree("run_004") - -# Run simulations with a decreasing time step (and an corresponding increase in number of iterations) -run_simulation(4,'run_001') -run_simulation(5,'run_002') -run_simulation(6,'run_003') -run_simulation(7,'run_004') - -# Find the error for runs 1-3 (as compared to run 4) -subprocess.call(["visit", "-cli","-s","getError1.py"]) -subprocess.call(["visit", "-cli","-s","getError2.py"]) -subprocess.call(["visit", "-cli","-s","getError3.py"]) - -f = open('error1.txt','r') -error1 = float(f.read()) -f.close() - -f = open('error2.txt','r') -error2 = float(f.read()) -f.close() - -f = open('error3.txt','r') -error3 = float(f.read()) -f.close() - -# Calculate and output order of accuracy -ooa_1_to_2 = math.log10(error1/error2)/math.log10(2) -ooa_2_to_3 = math.log10(error2/error3)/math.log10(2) - -print "Order of accuracy results: \n" -print "Mesh refinement of 4 to mesh refinement of 5:", str(ooa_1_to_2), "\n" -print "Mesh refinement of 5 to mesh refinement of 6:", str(ooa_2_to_3), "\n" - -text_file = open("spat_ooa_results.txt","w") -text_file.write("Results of standard spatial order of accuracy test: \n") -text_file.write("From coarse mesh to medium mesh: " + str(ooa_1_to_2) + "\n") -text_file.write("From from medium mesh to fine mesh: " + str(ooa_2_to_3) + "\n") -text_file.close() - diff --git a/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test/space_parameters.h b/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test/space_parameters.h deleted file mode 100644 index a1f9a2438..000000000 --- a/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test/space_parameters.h +++ /dev/null @@ -1,6 +0,0 @@ -// Parameters list for the parameters involved in mesh generation -#define subdivisionsX 1 -#define subdivisionsY 1 -#define subdivisionsZ 1 -#define refineFactor 7 -#define finiteElementDegree 1 diff --git a/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test/spat_ooa_results.txt b/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test/spat_ooa_results.txt deleted file mode 100644 index a4e02b4a4..000000000 --- a/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test/spat_ooa_results.txt +++ /dev/null @@ -1,3 +0,0 @@ -Results of standard spatial order of accuracy test: -From coarse mesh to medium mesh: 1.93835063599 -From from medium mesh to fine mesh: 2.29732147951 diff --git a/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test/visitlog.py b/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test/visitlog.py deleted file mode 100644 index 3c673b642..000000000 --- a/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test/visitlog.py +++ /dev/null @@ -1,57 +0,0 @@ -# Visit 2.7.0 log file -ScriptVersion = "2.7.0" -if ScriptVersion != Version(): - print "This script is for VisIt %s. It may not work with version %s" % (ScriptVersion, Version()) -ShowAllWindows() -OpenDatabase("run_003/solution-1000.pvtu", 0) -# The UpdateDBPluginInfo RPC is not supported in the VisIt module so it will not be logged. -DefineScalarExpression("diff", "(c-pos_cmfe(, mesh,0))") -AddPlot("Pseudocolor", "diff", 1, 1) -PseudocolorAtts = PseudocolorAttributes() -PseudocolorAtts.scaling = PseudocolorAtts.Linear # Linear, Log, Skew -PseudocolorAtts.skewFactor = 1 -PseudocolorAtts.limitsMode = PseudocolorAtts.CurrentPlot # OriginalData, CurrentPlot -PseudocolorAtts.minFlag = 0 -PseudocolorAtts.min = 0 -PseudocolorAtts.maxFlag = 0 -PseudocolorAtts.max = 1 -PseudocolorAtts.centering = PseudocolorAtts.Natural # Natural, Nodal, Zonal -PseudocolorAtts.colorTableName = "hot" -PseudocolorAtts.invertColorTable = 0 -PseudocolorAtts.opacityType = PseudocolorAtts.FullyOpaque # ColorTable, FullyOpaque, Constant, Ramp, VariableRange -PseudocolorAtts.opacityVariable = "" -PseudocolorAtts.opacity = 1 -PseudocolorAtts.opacityVarMin = 0 -PseudocolorAtts.opacityVarMax = 1 -PseudocolorAtts.opacityVarMinFlag = 0 -PseudocolorAtts.opacityVarMaxFlag = 0 -PseudocolorAtts.pointSize = 0.05 -PseudocolorAtts.pointType = PseudocolorAtts.Point # Box, Axis, Icosahedron, Octahedron, Tetrahedron, SphereGeometry, Point, Sphere -PseudocolorAtts.pointSizeVarEnabled = 0 -PseudocolorAtts.pointSizeVar = "default" -PseudocolorAtts.pointSizePixels = 2 -PseudocolorAtts.lineType = PseudocolorAtts.Line # Line, Tube, Ribbon -PseudocolorAtts.lineStyle = PseudocolorAtts.SOLID # SOLID, DASH, DOT, DOTDASH -PseudocolorAtts.lineWidth = 0 -PseudocolorAtts.tubeDisplayDensity = 10 -PseudocolorAtts.tubeRadiusSizeType = PseudocolorAtts.FractionOfBBox # Absolute, FractionOfBBox -PseudocolorAtts.tubeRadiusAbsolute = 0.125 -PseudocolorAtts.tubeRadiusBBox = 0.005 -PseudocolorAtts.varyTubeRadius = 0 -PseudocolorAtts.varyTubeRadiusVariable = "" -PseudocolorAtts.varyTubeRadiusFactor = 10 -PseudocolorAtts.endPointType = PseudocolorAtts.None # None, Tails, Heads, Both -PseudocolorAtts.endPointStyle = PseudocolorAtts.Spheres # Spheres, Cones -PseudocolorAtts.endPointRadiusSizeType = PseudocolorAtts.FractionOfBBox # Absolute, FractionOfBBox -PseudocolorAtts.endPointRadiusAbsolute = 1 -PseudocolorAtts.endPointRadiusBBox = 0.005 -PseudocolorAtts.endPointRatio = 2 -PseudocolorAtts.renderSurfaces = 1 -PseudocolorAtts.renderWireframe = 0 -PseudocolorAtts.renderPoints = 0 -PseudocolorAtts.smoothingLevel = 0 -PseudocolorAtts.legendFlag = 1 -PseudocolorAtts.lightingFlag = 1 -SetPlotOptions(PseudocolorAtts) -DrawPlots() -Query("MinMax", use_actual_data=1) diff --git a/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test_2D/CMakeLists.txt b/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test_2D/CMakeLists.txt deleted file mode 100644 index 0444f179d..000000000 --- a/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test_2D/CMakeLists.txt +++ /dev/null @@ -1,32 +0,0 @@ -## -# CMake script for the phaseField applications: -## - - -# Set the name of the project and target: -SET(TARGET "main") - -# Declare all source files the target consists of: -SET(TARGET_SRC - ${TARGET}.cc - # You can specify additional files here! - ) - -# Usually, you will not need to modify anything beyond this point... - -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8) - -FIND_PACKAGE(deal.II 8.0 QUIET - HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} - ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" - "*** Could not locate deal.II. ***\n\n" - "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" - "or set an environment variable \"DEAL_II_DIR\" that contains this path." - ) -ENDIF() - -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() diff --git a/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test_2D/ICs_and_BCs.h b/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test_2D/ICs_and_BCs.h deleted file mode 100644 index 7129dffae..000000000 --- a/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test_2D/ICs_and_BCs.h +++ /dev/null @@ -1,187 +0,0 @@ -// initial condition -template -class InitialCondition : public Function -{ -public: - unsigned int index; - Vector values; - - InitialCondition(const unsigned int _index) - : Function(1) - , index(_index) - { - std::srand(Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) + 1); - } - - double - value(const Point &p, const unsigned int component = 0) const - { - double scalar_IC = 0; - // ===================================================================== - // ENTER THE INITIAL CONDITIONS HERE FOR SCALAR FIELDS - // ===================================================================== - // Enter the function describing conditions for the fields at point "p". - // Use "if" statements to set the initial condition for each variable - // according to its variable index. - -#define x_denom 1.0 -#define y_denom 1.0 -#define z_denom 1.0 -#define initial_interface_coeff 1.0 -#define initial_radius 7.0 -#define avg_Nd 0.004 - - if (index == 0) - { - // return the value of the initial concentration field at point p - double dx = spanX / ((double) subdivisionsX) / std::pow(2.0, refineFactor); - double dy = spanY / ((double) subdivisionsY) / std::pow(2.0, refineFactor); - double dz = spanZ / ((double) subdivisionsZ) / std::pow(2.0, refineFactor); - double r = 0.0; - // return 0.02 + 1.0e-3*(2*(0.5 - (double)(std::rand() % 100 )/100.0)); -#if problemDIM == 1 - r = p.operator()(0); - return 0.5 * (0.12 - 0.00) * (1 - std::tanh((r - spanX / 16.0) / (0.1 * dx))); -#elif problemDIM == 2 - - r = sqrt((p.operator()(0)) * (p.operator()(0)) / x_denom + - (p.operator()(1)) * (p.operator()(1)) / y_denom); - return 0.5 * (0.12 - avg_Nd) * - (1.0 - std::tanh((r - initial_radius) / (initial_interface_coeff))) + - avg_Nd; - -#elif problemDIM == 3 - - r = sqrt((p.operator()(0)) * (p.operator()(0)) / x_denom + - (p.operator()(1)) * (p.operator()(1)) / y_denom + - (p.operator()(2)) * (p.operator()(2)) / z_denom); - return 0.5 * (0.12 - avg_Nd) * - (1.0 - std::tanh((r - initial_radius) / (initial_interface_coeff))) + - avg_Nd; - -#endif - } - else if (index == 1) - { - // set result equal to the structural order paramter initial condition - double dx = spanX / ((double) subdivisionsX) / std::pow(2.0, refineFactor); - double dy = spanY / ((double) subdivisionsY) / std::pow(2.0, refineFactor); - double dz = spanZ / ((double) subdivisionsZ) / std::pow(2.0, refineFactor); - double r = 0.0; -#if problemDIM == 1 - r = p.operator()(0); - return 0.5 * (1.0 - std::tanh((r - spanX / 16.0) / (0.1 * dx))); -#elif problemDIM == 2 - - r = sqrt((p.operator()(0)) * (p.operator()(0)) / x_denom + - (p.operator()(1)) * (p.operator()(1)) / y_denom); - return 0.5 * (1.0 - std::tanh((r - initial_radius) / (initial_interface_coeff))); - -#elif problemDIM == 3 - // r=p.distance(Point(spanX/2.0,spanY/2.0,spanZ/2.0)); - // return 0.5*(1.0-std::tanh((r-spanX/8.0)/(3*dx))); - - r = sqrt((p.operator()(0)) * (p.operator()(0)) / x_denom + - (p.operator()(1)) * (p.operator()(1)) / y_denom + - (p.operator()(2)) * (p.operator()(2)) / z_denom); - return 0.5 * (1.0 - std::tanh((r - initial_radius) / (initial_interface_coeff))); - - // planar interface - // r=sqrt((p.operator()(2)-spanZ/2.0)*(p.operator()(2)-spanZ/2.0)); - // return 0.5*(1.0-std::tanh((r)/(initial_interface_coeff))); - // return - // 0.5*(1.0-std::tanh((r-initial_radius)/(initial_interface_coeff))); -#endif - return 0.0; - } - else if (index == 2) - { - scalar_IC = 0.0; - } - else if (index == 3) - { - scalar_IC = 0.0; - } - - // ===================================================================== - return scalar_IC; - } -}; - -// initial condition -template -class InitialConditionVec : public Function -{ -public: - unsigned int index; - - // Vector values; - InitialConditionVec(const unsigned int _index) - : Function(dim) - , index(_index) - { - std::srand(Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) + 1); - } - - void - vector_value(const Point &p, Vector &vector_IC) const - { - // ===================================================================== - // ENTER THE INITIAL CONDITIONS HERE FOR VECTOR FIELDS - // ===================================================================== - // Enter the function describing conditions for the fields at point "p". - // Use "if" statements to set the initial condition for each variable - // according to its variable index. - - if (index == 4) - { - vector_IC(0) = 0.0; - vector_IC(1) = 0.0; - if (dim == 3) - { - vector_IC(2) = 0.0; - } - } - // ===================================================================== - } -}; - -template -void -generalizedProblem::setBCs() -{ - // ===================================================================== - // ENTER THE BOUNDARY CONDITIONS HERE - // ===================================================================== - // This function sets the BCs for the problem variables - // The function "inputBCs" should be called for each component of - // each variable and should be in numerical order. Four input arguments - // set the same BC on the entire boundary. Two plus two times the - // number of dimensions inputs sets separate BCs on each face of the domain. - // Inputs to "inputBCs": - // First input: variable number - // Second input: component number - // Third input: BC type (options are "ZERO_DERIVATIVE" and "DIRICHLET") - // Fourth input: BC value (ignored unless the BC type is "DIRICHLET") - // Odd inputs after the third: BC type - // Even inputs after the third: BC value - // Face numbering: starts at zero with the minimum of the first direction, one - // for the maximum of the first direction - // two for the minimum of the second direction, etc. - inputBCs(0, 0, "ZERO_DERIVATIVE", 0); - - inputBCs(1, 0, "ZERO_DERIVATIVE", 0); - - inputBCs(2, 0, "ZERO_DERIVATIVE", 0); - - inputBCs(3, 0, "ZERO_DERIVATIVE", 0); - - inputBCs(4, 0, "DIRICHLET", 0.0); - inputBCs(4, 1, "DIRICHLET", 0.0); - if (dim == 3) - { - inputBCs(4, 2, "DIRICHLET", 0.0); - } - - // ===================================================================== -} diff --git a/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test_2D/error.txt b/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test_2D/error.txt deleted file mode 100644 index 8cbef5208..000000000 --- a/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test_2D/error.txt +++ /dev/null @@ -1 +0,0 @@ -5.74858859181e-05 \ No newline at end of file diff --git a/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test_2D/error1.txt b/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test_2D/error1.txt deleted file mode 100644 index b0183ae2d..000000000 --- a/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test_2D/error1.txt +++ /dev/null @@ -1 +0,0 @@ -0.0044260378927 \ No newline at end of file diff --git a/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test_2D/error2.txt b/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test_2D/error2.txt deleted file mode 100644 index 41b6d8c6c..000000000 --- a/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test_2D/error2.txt +++ /dev/null @@ -1 +0,0 @@ -0.00117394141853 \ No newline at end of file diff --git a/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test_2D/error3.txt b/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test_2D/error3.txt deleted file mode 100644 index 67fa0e06a..000000000 --- a/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test_2D/error3.txt +++ /dev/null @@ -1 +0,0 @@ -0.000283651053905 \ No newline at end of file diff --git a/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test_2D/error4.txt b/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test_2D/error4.txt deleted file mode 100644 index 8cbef5208..000000000 --- a/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test_2D/error4.txt +++ /dev/null @@ -1 +0,0 @@ -5.74858859181e-05 \ No newline at end of file diff --git a/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test_2D/getError.py b/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test_2D/getError.py deleted file mode 100644 index 66487f042..000000000 --- a/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test_2D/getError.py +++ /dev/null @@ -1,69 +0,0 @@ -import sys - -variable_1 = 'c' -variable_2 = 'c' - -output_num_1 = "10000" -output_num_2 = "10000" - -f = open('run_num_1.txt','r') -run_num_1 = f.read() -f.close() - -f = open('run_num_2.txt','r') -run_num_2 = f.read() -f.close() - -use_mesh_1 = True -apply_3slice = False -apply_box_crop = False - -directory_1 = run_num_1+"/solution-"+output_num_1+".pvtu" -directory_2 = run_num_2+"/solution-"+output_num_2+".pvtu" - -if use_mesh_1 == True: - OpenDatabase(directory_1) - DefineScalarExpression("diff","("+variable_1+"-pos_cmfe(<"+directory_2+":"+variable_2+">, mesh,0))") -else: - OpenDatabase(directory_2) - DefineScalarExpression("diff","("+variable_2+"-pos_cmfe(<"+directory_1+":"+variable_1+">, mesh,0))") - -#AddPlot("Contour","diff") -AddPlot("Pseudocolor","diff") - -PseudocolorAtts = PseudocolorAttributes() -PseudocolorAtts.limitsMode = PseudocolorAtts.CurrentPlot -SetPlotOptions(PseudocolorAtts) - -if apply_box_crop == True: - AddOperator("Box", 1) - BoxAtts = BoxAttributes() - BoxAtts.amount = BoxAtts.Some # Some, All - BoxAtts.minx = 2.0 - BoxAtts.maxx = 30.0 - BoxAtts.miny = 2.0 - BoxAtts.maxy = 30.0 - BoxAtts.minz = 2.0 - BoxAtts.maxz = 30.0 - BoxAtts.inverse = 0 - SetOperatorOptions(BoxAtts, 1) - -if apply_3slice == True: - AddOperator("ThreeSlice") - slice_atts = ThreeSliceAttributes() - slice_atts.x = 16 - slice_atts.y = 16 - slice_atts.z = 16 - SetOperatorOptions(slice_atts) - -DrawPlots() - -Query("MinMax", use_actual_data=1) -min_max_val = GetQueryOutputValue() -error = max(abs(min_max_val[0]),abs(min_max_val[1])) - -text_file = open("error.txt","w") -text_file.write(str(error)) -text_file.close() - -sys.exit() \ No newline at end of file diff --git a/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test_2D/main.cc b/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test_2D/main.cc deleted file mode 100644 index a62d5cdca..000000000 --- a/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test_2D/main.cc +++ /dev/null @@ -1,54 +0,0 @@ -// Coupled Cahn-Hilliard, Allen-Cahn and Mechanics problem -// general headers -#include "../../../include/dealIIheaders.h" - -// Coupled Cahn-Hilliard+Allen-Cahn+Mechanics problem headers -#include "ICs_and_BCs.h" -#include "parameters.h" -#include "residuals.h" -#include "space_parameters.h" - -#include "../../../src/models/coupled/generalized_model.h" -#include "../../../src/models/coupled/generalized_model_functions.h" - -// main -int -main(int argc, char **argv) -{ - Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, - argv, - numbers::invalid_unsigned_int); - try - { - deallog.depth_console(0); - generalizedProblem problem; - - problem.setBCs(); - problem.buildFields(); - problem.init(); - problem.solve(); - } - catch (std::exception &exc) - { - std::cerr << std::endl - << std::endl - << "----------------------------------------------------" << std::endl; - std::cerr << "Exception on processing: " << std::endl - << exc.what() << std::endl - << "Aborting!" << std::endl - << "----------------------------------------------------" << std::endl; - return 1; - } - catch (...) - { - std::cerr << std::endl - << std::endl - << "----------------------------------------------------" << std::endl; - std::cerr << "Unknown exception!" << std::endl - << "Aborting!" << std::endl - << "----------------------------------------------------" << std::endl; - return 1; - } - - return 0; -} diff --git a/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test_2D/parameters.h b/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test_2D/parameters.h deleted file mode 100644 index 73fd7add8..000000000 --- a/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test_2D/parameters.h +++ /dev/null @@ -1,101 +0,0 @@ -// Parameter list for the precipitate evolution example application -// All strictly numerical parameters should be set in this file - -// ================================================================================= -// Set the number of dimensions (1, 2, or 3 for a 1D, 2D, or 3D calculation) -// ================================================================================= -#define problemDIM 2 - -// ================================================================================= -// Set the length of the domain in all three dimensions -// ================================================================================= -// Each axes spans from zero to the specified length -#define spanX 16.0 -#define spanY 16.0 -#define spanZ 16.0 - -// ================================================================================= -// Set the element parameters -// ================================================================================= -// The number of elements in each direction is 2^(refineFactor) * subdivisions -// For optimal performance, use refineFactor primarily to determine the element -// size #define subdivisionsX 3 #define subdivisionsY 3 #define subdivisionsZ 3 -// #define refineFactor 5 - -// Set the polynomial degree of the element (suggested values: 1 or 2) -// #define finiteElementDegree 2 - -// ================================================================================= -// Set the adaptive mesh refinement parameters -// ================================================================================= -// Set the flag determining if adaptive meshing is activated -#define hAdaptivity false - -// Set the maximum and minimum level of refinement -#define maxRefinementLevel (refineFactor) -#define minRefinementLevel (refineFactor - 2) - -// Set the fields used to determine the refinement. Fields determined by the -// order declared in "equations.h", starting at zero -#define refineCriterionFields \ - { \ - 1, 2, 3 \ - } - -// Set the maximum and minimum value of the fields where the mesh should be -// refined -#define refineWindowMax \ - { \ - 0.99, 0.99, 0.99 \ - } -#define refineWindowMin \ - { \ - 0.01, 0.01, 0.01 \ - } - -// Set the number of time steps between remeshing operations -#define skipRemeshingSteps 1000 - -// ================================================================================= -// Set the time step parameters -// ================================================================================= -// The size of the time step -#define timeStep 9.0e-6 -#define timeFinal 100000000 -#define timeIncrements 10000 - -// ================================================================================= -// Set the elliptic solver parameters -// ================================================================================= -// The solver type (currently the only recommended option is conjugate gradient) -#define solverType SolverCG - -// The flag that determines whether the tolerance for solver convergence should -// be an absolute tolerance (absTol=true) or a relative tolerance (absTol=false) -#define absTol true - -// The tolerance for convergence (L2 norm of the residual) -#define solverTolerance 1.0e-4 - -// The maximum number of solver iterations per time step -#define maxSolverIterations 1000 - -// ================================================================================= -// Set the output parameters -// ================================================================================= -// Each field in the problem will be output is writeOutput is set to "true" -#define writeOutput true - -// Type of spacing between outputs ("EQUAL_SPACING", "LOG_SPACING", or -// "N_PER_DECADE") -#define outputCondition "EQUAL_SPACING" - -// Number of times the program outputs the fields (total number for -// "EQUAL_SPACING" and "LOG_SPACING", number per decade for "N_PER_DECADE") -#define numOutputs 1 - -// ================================================================================= -// Set the flag determining if the total free energy is calculated for each -// output -// ================================================================================= -#define calcEnergy false diff --git a/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test_2D/residuals.h b/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test_2D/residuals.h deleted file mode 100644 index 3c8190016..000000000 --- a/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test_2D/residuals.h +++ /dev/null @@ -1,682 +0,0 @@ -// List of variables and residual equations for the Precipitate Evolution -// example application - -// ================================================================================= -// Define the variables in the model -// ================================================================================= -// The number of variables -#define num_var 5 - -// The names of the variables, whether they are scalars or vectors and whether -// the governing eqn for the variable is parabolic or elliptic -#define variable_name \ - { \ - "c", "n1", "n2", "n3", "u" \ - } -#define variable_type \ - { \ - "SCALAR", "SCALAR", "SCALAR", "SCALAR", "VECTOR" \ - } -#define variable_eq_type \ - { \ - "PARABOLIC", "PARABOLIC", "PARABOLIC", "PARABOLIC", "ELLIPTIC" \ - } - -// Flags for whether the value, gradient, and Hessian are needed in the residual -// eqns -#define need_val \ - { \ - true, true, true, true, false \ - } -#define need_grad \ - { \ - true, true, true, true, true \ - } -#define need_hess \ - { \ - false, false, false, false, false \ - } - -// Flags for whether the residual equation has a term multiplied by the test -// function (need_val_residual) and/or the gradient of the test function -// (need_grad_residual) -#define need_val_residual \ - { \ - true, true, true, true, false \ - } -#define need_grad_residual \ - { \ - true, true, true, true, true \ - } - -// Flags for whether the value, gradient, and Hessian are needed in the residual -// eqn for the left-hand-side of the iterative solver for elliptic equations -#define need_val_LHS \ - { \ - false, true, true, true, false \ - } -#define need_grad_LHS \ - { \ - false, false, false, false, true \ - } -#define need_hess_LHS \ - { \ - false, false, false, false, false \ - } - -// Flags for whether the residual equation for the left-hand-side of the -// iterative solver for elliptic equations has a term multiplied by the test -// function (need_val_residual) and/or the gradient of the test function -// (need_grad_residual) -#define need_val_residual_LHS \ - { \ - false, false, false, false, false \ - } -#define need_grad_residual_LHS \ - { \ - false, false, false, false, true \ - } - -// ================================================================================= -// Define the model parameters and the residual equations -// ================================================================================= -// Parameters in the residual equations and expressions for the residual -// equations can be set here. For simple cases, the entire residual equation can -// be written here. For more complex cases with loops or conditional statements, -// residual equations (or parts of residual equations) can be written below in -// "residualRHS". - -// Cahn-Hilliard mobility -#define McV 1.0 - -// Allen-Cahn mobilities -#define Mn1V 50.0 -#define Mn2V 50.0 -#define Mn3V 50.0 - -// Gradient energy coefficients -double Kn1[3][3] = { - {1.0, 0, 0 }, - {0, 0.5, 0 }, - {0, 0, 1.0} -}; -double Kn2[3][3] = { - {1.0, 0, 0 }, - {0, 0.5, 0 }, - {0, 0, 1.0} -}; -double Kn3[3][3] = { - {1.0, 0, 0 }, - {0, 0.5, 0 }, - {0, 0, 1.0} -}; - -// define energy barrier coefficient (used to tune the interfacial energy) -#define W -1.0 - -// Define mechanical properties -#define n_dependent_stiffness false -// Mechanical symmetry of the material and stiffness parameters -// If n_dependent_stiffness == false the first entry is used for all phases -#define MaterialModels \ - { \ - { \ - "ISOTROPIC" \ - } \ - } -#define MaterialConstants \ - { \ - { \ - 1.0, 0.3 \ - } \ - } - -// Stress-free transformation strains -// Linear fits for the stress-free transformation strains in for sfts = -// sfts_linear * c + sfts_const -double sfts_linear1[3][3] = { - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0} -}; -double sfts_const1[3][3] = { - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0} -}; - -double sfts_linear2[3][3] = { - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0} -}; -double sfts_const2[3][3] = { - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0} -}; - -double sfts_linear3[3][3] = { - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0} -}; -double sfts_const3[3][3] = { - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0} -}; - -// Free energy expressions -#define faV (24.7939 * c * c - 1.6752 * c - 1.9453e-06) -#define facV (49.5878 * c - 1.6752) -#define faccV (49.5878) -#define fbV (37.9316 * c * c - 10.7373 * c + 0.5401) -#define fbcV (75.8633 * c - 10.7373) -#define fbccV (75.8633) -#define h1V (3.0 * n1 * n1 - 2.0 * n1 * n1 * n1) -#define h2V (3.0 * n2 * n2 - 2.0 * n2 * n2 * n2) -#define h3V (3.0 * n3 * n3 - 2.0 * n3 * n3 * n3) -#define hn1V (6.0 * n1 - 6.0 * n1 * n1) -#define hn2V (6.0 * n2 - 6.0 * n2 * n2) -#define hn3V (6.0 * n3 - 6.0 * n3 * n3) - -// This double-well function can be used to tune the interfacial energy -#define fbarrierV (n1 * n1 - 2.0 * n1 * n1 * n1 + n1 * n1 * n1 * n1) -#define fbarriernV (2.0 * n1 - 6.0 * n1 * n1 + 4.0 * n1 * n1 * n1) - -// Residuals -#define rcV (c) -#define rcxTemp \ - (cx * ((1.0 - h1V - h2V - h3V) * faccV + (h1V + h2V + h3V) * fbccV) + \ - n1x * ((fbcV - facV) * hn1V) + n2x * ((fbcV - facV) * hn2V) + \ - n3x * ((fbcV - facV) * hn3V)) -#define rcxV (constV(-timeStep * McV) * rcxTemp) - -#define rn1V \ - (n1 - constV(timeStep * Mn1V) * \ - ((fbV - faV) * hn1V + W * fbarriernV + nDependentMisfitAC1)) -#define rn2V (n2 - constV(timeStep * Mn2V) * ((fbV - faV) * hn2V)) -#define rn3V (n3 - constV(timeStep * Mn3V) * ((fbV - faV) * hn3V)) -#define rn1xV (constV(-timeStep * Mn1V) * Knx1) -#define rn2xV (constV(-timeStep * Mn2V) * Knx2) -#define rn3xV (constV(-timeStep * Mn3V) * Knx3) - -// ================================================================================= -// residualRHS -// ================================================================================= -// This function calculates the residual equations for each variable. It takes -// "modelVariablesList" as an input, which is a list of the value and -// derivatives of each of the variables at a specific quadrature point. The -// (x,y,z) location of that quadrature point is given by "q_point_loc". The -// function outputs "modelResidualsList", a list of the value and gradient terms -// of the residual for each residual equation. The index for each variable in -// these lists corresponds to the order it is defined at the top of this file -// (starting at 0). -template -void -generalizedProblem::residualRHS( - const std::vector> &modelVariablesList, - std::vector> &modelResidualsList, - dealii::Point> q_point_loc) const -{ - // The concentration and its derivatives (names here should match those in the - // macros above) - scalarvalueType c = modelVariablesList[0].scalarValue; - scalargradType cx = modelVariablesList[0].scalarGrad; - - // The first order parameter and its derivatives (names here should match - // those in the macros above) - scalarvalueType n1 = modelVariablesList[1].scalarValue; - scalargradType n1x = modelVariablesList[1].scalarGrad; - - // The second order parameter and its derivatives (names here should match - // those in the macros above) - scalarvalueType n2 = modelVariablesList[2].scalarValue; - scalargradType n2x = modelVariablesList[2].scalarGrad; - - // The third order parameter and its derivatives (names here should match - // those in the macros above) - scalarvalueType n3 = modelVariablesList[3].scalarValue; - scalargradType n3x = modelVariablesList[3].scalarGrad; - - // The derivative of the displacement vector (names here should match those in - // the macros above) - vectorgradType ux = modelVariablesList[4].vectorGrad; - vectorgradType ruxV; - - vectorhessType uxx; - - if (c_dependent_misfit == true) - { - uxx = modelVariablesList[4].vectorHess; - } - - // Calculate the stress-free transformation strain and its derivatives at the - // quadrature point - dealii::Tensor<2, problemDIM, dealii::VectorizedArray> sfts1, sfts1c, sfts1cc, - sfts2, sfts2c, sfts2cc, sfts3, sfts3c, sfts3cc; - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - // Polynomial fits for the stress-free transformation strains, of the - // form: sfts = a_p * c + b_p - sfts1[i][j] = constV(sfts_linear1[i][j]) * c + constV(sfts_const1[i][j]); - sfts1c[i][j] = constV(sfts_linear1[i][j]); - sfts1cc[i][j] = constV(0.0); - - // Polynomial fits for the stress-free transformation strains, of the - // form: sfts = a_p * c + b_p - sfts2[i][j] = constV(sfts_linear2[i][j]) * c + constV(sfts_const2[i][j]); - sfts2c[i][j] = constV(sfts_linear1[i][j]); - sfts2cc[i][j] = constV(0.0); - - // Polynomial fits for the stress-free transformation strains, of the - // form: sfts = a_p * c + b_p - sfts3[i][j] = constV(sfts_linear3[i][j]) * c + constV(sfts_const3[i][j]); - sfts3c[i][j] = constV(sfts_linear3[i][j]); - sfts3cc[i][j] = constV(0.0); - } - } - - // compute E2=(E-E0) - dealii::VectorizedArray E2[dim][dim], S[dim][dim]; - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - E2[i][j] = constV(0.5) * (ux[i][j] + ux[j][i]) - - (sfts1[i][j] * h1V + sfts2[i][j] * h2V + sfts3[i][j] * h3V); - } - } - - // compute stress - // S=C*(E-E0) - // Compute stress tensor (which is equal to the residual, Rux) - dealii::VectorizedArray CIJ_combined[CIJ_tensor_size][CIJ_tensor_size]; - - if (n_dependent_stiffness == true) - { - dealii::VectorizedArray sum_hV; - sum_hV = h1V + h2V + h3V; - for (unsigned int i = 0; i < 2 * dim - 1 + dim / 3; i++) - { - for (unsigned int j = 0; j < 2 * dim - 1 + dim / 3; j++) - { - CIJ_combined[i][j] = - CIJ_list[0][i][j] * (constV(1.0) - sum_hV) + CIJ_list[1][i][j] * sum_hV; - } - } - computeStress(CIJ_combined, E2, S); - } - else - { - computeStress(CIJ_list[0], E2, S); - } - - // Fill residual corresponding to mechanics - // R=-C*(E-E0) - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - ruxV[i][j] = -S[i][j]; - } - } - - // Compute one of the stress terms in the order parameter chemical potential, - // nDependentMisfitACp = C*(E-E0)*(E0_p*Hn) - dealii::VectorizedArray nDependentMisfitAC1 = constV(0.0); - dealii::VectorizedArray nDependentMisfitAC2 = constV(0.0); - dealii::VectorizedArray nDependentMisfitAC3 = constV(0.0); - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - nDependentMisfitAC1 += S[i][j] * (sfts1[i][j]); - nDependentMisfitAC2 += S[i][j] * (sfts2[i][j]); - nDependentMisfitAC3 += S[i][j] * (sfts3[i][j]); - } - } - - nDependentMisfitAC1 *= -hn1V; - nDependentMisfitAC2 *= -hn2V; - nDependentMisfitAC3 *= -hn3V; - - // Compute the other stress term in the order parameter chemical potential, - // heterMechACp = 0.5*Hn*(C_beta-C_alpha)*(E-E0)*(E-E0) - dealii::VectorizedArray heterMechAC1 = constV(0.0); - dealii::VectorizedArray heterMechAC2 = constV(0.0); - dealii::VectorizedArray heterMechAC3 = constV(0.0); - dealii::VectorizedArray S2[dim][dim]; - - if (n_dependent_stiffness == true) - { - // computeStress(CIJ_diff, E2, S2); - computeStress(CIJ_list[1] - CIJ_list[0], E2, S2); - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - heterMechAC1 += S2[i][j] * E2[i][j]; - } - } - // Aside from HnpV, heterMechAC1, heterMechAC2, and heterMechAC3 are equal - heterMechAC2 = 0.5 * hn2V * heterMechAC1; - heterMechAC3 = 0.5 * hn3V * heterMechAC1; - - heterMechAC1 = 0.5 * hn1V * heterMechAC1; - } - - // compute the stress term in the gradient of the concentration chemical - // potential, grad_mu_el = [C*(E-E0)*E0c]x, must be a vector with length dim - scalargradType grad_mu_el; - - if (c_dependent_misfit == true) - { - dealii::VectorizedArray E3[dim][dim], S3[dim][dim]; - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - E3[i][j] = -(sfts1c[i][j] * h1V + sfts2c[i][j] * h2V + sfts3c[i][j] * h3V); - } - } - - if (n_dependent_stiffness == true) - { - computeStress(CIJ_combined, E3, S3); - } - else - { - computeStress(CIJ_list[0], E3, S3); - } - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - for (unsigned int k = 0; k < dim; k++) - { - grad_mu_el[k] += - S3[i][j] * - (constV(0.5) * (uxx[i][j][k] + uxx[j][i][k]) + E3[i][j] * cx[k] - - (sfts1[i][j] * hn1V * n1x[k] + sfts2[i][j] * hn2V * n2x[k] + - sfts3[i][j] * hn3V * n3x[k])); - - grad_mu_el[k] += - -S[i][j] * - (sfts1c[i][j] * hn1V * n1x[k] + sfts2c[i][j] * hn2V * n2x[k] + - sfts3c[i][j] * hn3V * n3x[k] + - (sfts1cc[i][j] * h1V + sfts2cc[i][j] * h2V + sfts3cc[i][j] * h3V) * - cx[k]); - - if (n_dependent_stiffness == true) - { - grad_mu_el[k] += -S2[i][j] * (sfts1c[i][j] * hn1V * n1x[k] + - sfts2c[i][j] * hn2V * n2x[k] + - sfts3c[i][j] * hn3V * n3x[k]); - } - } - } - } - } - - // compute K*nx - scalargradType Knx1, Knx2, Knx3; - for (unsigned int a = 0; a < dim; a++) - { - Knx1[a] = 0.0; - Knx2[a] = 0.0; - Knx3[a] = 0.0; - for (unsigned int b = 0; b < dim; b++) - { - Knx1[a] += constV(Kn1[a][b]) * n1x[b]; - Knx2[a] += constV(Kn2[a][b]) * n2x[b]; - Knx3[a] += constV(Kn3[a][b]) * n3x[b]; - } - } - - modelResidualsList[0].scalarValueResidual = rcV; - modelResidualsList[0].scalarGradResidual = rcxV; - - modelResidualsList[1].scalarValueResidual = rn1V; - modelResidualsList[1].scalarGradResidual = rn1xV; - - modelResidualsList[2].scalarValueResidual = rn2V; - modelResidualsList[2].scalarGradResidual = rn2xV; - - modelResidualsList[3].scalarValueResidual = rn3V; - modelResidualsList[3].scalarGradResidual = rn3xV; - - modelResidualsList[4].vectorGradResidual = ruxV; -} - -// ================================================================================= -// residualLHS (needed only if at least one equation is elliptic) -// ================================================================================= -// This function calculates the residual equations for the iterative solver for -// elliptic equations.for each variable. It takes "modelVariablesList" as an -// input, which is a list of the value and derivatives of each of the variables -// at a specific quadrature point. The (x,y,z) location of that quadrature point -// is given by "q_point_loc". The function outputs "modelRes", the value and -// gradient terms of for the left-hand-side of the residual equation for the -// iterative solver. The index for each variable in these lists corresponds to -// the order it is defined at the top of this file (starting at 0), not counting -// variables that have "need_val_LHS", "need_grad_LHS", and "need_hess_LHS" all -// set to "false". If there are multiple elliptic equations, conditional -// statements should be used to ensure that the correct residual is being -// submitted. The index of the field being solved can be accessed by -// "this->currentFieldIndex". -template -void -generalizedProblem::residualLHS( - const std::vector> &modelVariablesList, - modelResidual &modelRes, - dealii::Point> q_point_loc) const -{ - // n1 - scalarvalueType n1 = modelVariablesList[0].scalarValue; - - // n2 - scalarvalueType n2 = modelVariablesList[1].scalarValue; - - // n3 - scalarvalueType n3 = modelVariablesList[2].scalarValue; - - // u - vectorgradType ux = modelVariablesList[3].vectorGrad; - vectorgradType ruxV; - - // Take advantage of E being simply 0.5*(ux + transpose(ux)) and use the - // dealii "symmetrize" function - dealii::Tensor<2, dim, dealii::VectorizedArray> E; - E = symmetrize(ux); - - // Compute stress tensor (which is equal to the residual, Rux) - if (n_dependent_stiffness == true) - { - dealii::Tensor<2, CIJ_tensor_size, dealii::VectorizedArray> CIJ_combined; - CIJ_combined = - CIJ_list[0] * (constV(1.0) - h1V - h2V - h3V) + CIJ_list[1] * (h1V + h2V + h3V); - - computeStress(CIJ_combined, E, ruxV); - } - else - { - computeStress(CIJ_list[0], E, ruxV); - } - - modelRes.vectorGradResidual = ruxV; -} - -// ================================================================================= -// energyDensity (needed only if calcEnergy == true) -// ================================================================================= -// This function integrates the free energy density across the computational -// domain. It takes "modelVariablesList" as an input, which is a list of the -// value and derivatives of each of the variables at a specific quadrature -// point. It also takes the mapped quadrature weight, "JxW_value", as an input. -// The (x,y,z) location of the quadrature point is given by "q_point_loc". The -// weighted value of the energy density is added to "energy" variable and the -// components of the energy density are added to the "energy_components" -// variable (index 0: chemical energy, index 1: gradient energy, index 2: -// elastic energy). -template -void -generalizedProblem::energyDensity( - const std::vector> &modelVarList, - const dealii::VectorizedArray &JxW_value, - dealii::Point> q_point_loc) -{ - scalarvalueType total_energy_density = constV(0.0); - - // c - scalarvalueType c = modelVarList[0].scalarValue; - scalargradType cx = modelVarList[0].scalarGrad; - - // n1 - scalarvalueType n1 = modelVarList[1].scalarValue; - scalargradType n1x = modelVarList[1].scalarGrad; - - // n2 - scalarvalueType n2 = modelVarList[2].scalarValue; - scalargradType n2x = modelVarList[2].scalarGrad; - - // n3 - scalarvalueType n3 = modelVarList[3].scalarValue; - scalargradType n3x = modelVarList[3].scalarGrad; - - // u - vectorgradType ux = modelVarList[4].vectorGrad; - - scalarvalueType f_chem = - (constV(1.0) - (h1V + h2V + h3V)) * faV + (h1V + h2V + h3V) * fbV; - - scalarvalueType f_grad = constV(0.0); - - for (int i = 0; i < dim; i++) - { - for (int j = 0; j < dim; j++) - { - f_grad += constV(0.5 * Kn1[i][j]) * n1x[i] * n1x[j]; - } - } -#if num_sop > 1 - for (int i = 0; i < dim; i++) - { - for (int j = 0; j < dim; j++) - { - f_grad += constV(0.5 * Kn2[i][j]) * n2x[i] * n2x[j]; - } - } -#endif -#if num_sop > 2 - for (int i = 0; i < dim; i++) - { - for (int j = 0; j < dim; j++) - { - f_grad += constV(0.5 * Kn3[i][j]) * n3x[i] * n3x[j]; - } - } -#endif - - // Calculate the stress-free transformation strain and its derivatives at the - // quadrature point - dealii::Tensor<2, problemDIM, dealii::VectorizedArray> sfts1, sfts1c, sfts1cc, - sfts2, sfts2c, sfts2cc, sfts3, sfts3c, sfts3cc; - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - // Polynomial fits for the stress-free transformation strains, of the - // form: sfts = a_p * c + b_p - sfts1[i][j] = constV(sfts_linear1[i][j]) * c + constV(sfts_const1[i][j]); - sfts1c[i][j] = constV(sfts_linear1[i][j]); - sfts1cc[i][j] = constV(0.0); - - // Polynomial fits for the stress-free transformation strains, of the - // form: sfts = a_p * c + b_p - sfts2[i][j] = constV(sfts_linear2[i][j]) * c + constV(sfts_const2[i][j]); - sfts2c[i][j] = constV(sfts_linear1[i][j]); - sfts2cc[i][j] = constV(0.0); - - // Polynomial fits for the stress-free transformation strains, of the - // form: sfts = a_p * c + b_p - sfts3[i][j] = constV(sfts_linear3[i][j]) * c + constV(sfts_const3[i][j]); - sfts3c[i][j] = constV(sfts_linear3[i][j]); - sfts3cc[i][j] = constV(0.0); - } - } - - // compute E2=(E-E0) - dealii::VectorizedArray E2[dim][dim], S[dim][dim]; - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - // E2[i][j]= constV(0.5)*(ux[i][j]+ux[j][i])-( sfts1[i][j]*h1V + - // sfts2[i][j]*h2V + sfts3[i][j]*h3V); - E2[i][j] = constV(0.5) * (ux[i][j] + ux[j][i]) - - (sfts1[i][j] * h1V + sfts2[i][j] * h2V + sfts3[i][j] * h3V); - } - } - - // compute stress - // S=C*(E-E0) - dealii::VectorizedArray CIJ_combined[2 * dim - 1 + dim / 3] - [2 * dim - 1 + dim / 3]; - - if (n_dependent_stiffness == true) - { - dealii::VectorizedArray sum_hV; - sum_hV = h1V + h2V + h3V; - for (unsigned int i = 0; i < 2 * dim - 1 + dim / 3; i++) - { - for (unsigned int j = 0; j < 2 * dim - 1 + dim / 3; j++) - { - CIJ_combined[i][j] = - CIJ_list[0][i][j] * (constV(1.0) - sum_hV) + CIJ_list[1][i][j] * sum_hV; - } - } - computeStress(CIJ_combined, E2, S); - } - else - { - computeStress(CIJ_list[0], E2, S); - } - - scalarvalueType f_el = constV(0.0); - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - f_el += constV(0.5) * S[i][j] * E2[i][j]; - } - } - - total_energy_density = f_chem + f_grad + f_el; - - assembler_lock.acquire(); - for (unsigned i = 0; i < c.size(); i++) - { - // For some reason, some of the values in this loop - if (c[i] > 1.0e-10) - { - this->energy += total_energy_density[i] * JxW_value[i]; - this->energy_components[0] += f_chem[i] * JxW_value[i]; - this->energy_components[1] += f_grad[i] * JxW_value[i]; - this->energy_components[2] += f_el[i] * JxW_value[i]; - } - } - assembler_lock.release(); -} diff --git a/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test_2D/run_num_1.txt b/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test_2D/run_num_1.txt deleted file mode 100644 index 1e67980cc..000000000 --- a/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test_2D/run_num_1.txt +++ /dev/null @@ -1 +0,0 @@ -run_004 \ No newline at end of file diff --git a/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test_2D/run_num_2.txt b/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test_2D/run_num_2.txt deleted file mode 100644 index 66c5b2fa4..000000000 --- a/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test_2D/run_num_2.txt +++ /dev/null @@ -1 +0,0 @@ -run_005 \ No newline at end of file diff --git a/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test_2D/run_spatial_ooa_test_2D.py b/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test_2D/run_spatial_ooa_test_2D.py deleted file mode 100644 index c242d8fa3..000000000 --- a/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test_2D/run_spatial_ooa_test_2D.py +++ /dev/null @@ -1,98 +0,0 @@ -import subprocess -import shutil -import glob -import math -import os.path - -# ---------------------------------------------------------------------------------------- -# Function that generates a header file for the simulation, compiles the PRISMS-PF code -# and runs the executable. -# ---------------------------------------------------------------------------------------- -def run_simulation(refineFactor,run_name): - - subdivisionsX = 1 - subdivisionsY = 1 - subdivisionsZ = 1 - finiteElementDegree = 1 - - text_file = open("space_parameters.h","w") - text_file.write("// Parameters list for the parameters involved in mesh generation \n") - text_file.write("#define subdivisionsX " + str(subdivisionsX) + "\n") - text_file.write("#define subdivisionsY " + str(subdivisionsY) + "\n") - text_file.write("#define subdivisionsZ " + str(subdivisionsZ) + "\n") - text_file.write("#define refineFactor " + str(refineFactor) + "\n") - text_file.write("#define finiteElementDegree " + str(finiteElementDegree) + "\n") - text_file.close() - - subprocess.call(["make", "release"]) - #subprocess.call(["./main"]) - subprocess.call(["mpirun", "-n", "4", "main"]) - - subprocess.call(["mkdir",run_name]) - for output_files in glob.glob('*vtu'): - shutil.move(output_files,run_name) - -# ---------------------------------------------------------------------------------------- -# Function that calculates the maximum error between a run and a reference result. -# ---------------------------------------------------------------------------------------- -def getError(run_num): - - text_file = open("run_num_1.txt","w") - text_file.write('run_00'+str(run_num)) - text_file.close() - subprocess.call(["visit", "-cli","-s","getError.py"]) - f = open('error.txt','r') - error = float(f.read()) - f.close() - - return error - -# ---------------------------------------------------------------------------------------- - -# If files exist from previous tests, delete them -if os.path.exists("run_001") == True: - shutil.rmtree("run_001") -if os.path.exists("run_002") == True: - shutil.rmtree("run_002") -if os.path.exists("run_003") == True: - shutil.rmtree("run_003") -if os.path.exists("run_004") == True: - shutil.rmtree("run_004") -if os.path.exists("run_005") == True: - shutil.rmtree("run_005") - -# Run simulations with a decreasing time step (and an corresponding increase in number of iterations) -run_simulation(4,'run_001') -run_simulation(5,'run_002') -run_simulation(6,'run_003') -run_simulation(7,'run_004') -run_simulation(8,'run_005') - -# Find the error for runs 1-4 (as compared to run 5) -text_file = open("run_num_2.txt","w") -text_file.write('run_005') -text_file.close() - -error = [] -error.append(getError(1)) -error.append(getError(2)) -error.append(getError(3)) -error.append(getError(4)) - -# Calculate and output order of accuracy -ooa_1_to_2 = math.log10(error[0]/error[1])/math.log10(2) -ooa_2_to_3 = math.log10(error[1]/error[2])/math.log10(2) -ooa_3_to_4 = math.log10(error[2]/error[3])/math.log10(2) - -print "Order of accuracy results: \n" -print "Mesh refinement of 4 to mesh refinement of 5:", str(ooa_1_to_2), "\n" -print "Mesh refinement of 5 to mesh refinement of 6:", str(ooa_2_to_3), "\n" -print "Mesh refinement of 6 to mesh refinement of 7:", str(ooa_3_to_4), "\n" - -text_file = open("spat_ooa_results.txt","w") -text_file.write("Results of 2D spatial order of accuracy test: \n") -text_file.write("From coarse mesh to medium mesh: " + str(ooa_1_to_2) + "\n") -text_file.write("From from medium mesh to fine mesh: " + str(ooa_2_to_3) + "\n") -text_file.write("From from fine mesh to very fine mesh: " + str(ooa_3_to_4) + "\n") -text_file.close() - diff --git a/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test_2D/space_parameters.h b/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test_2D/space_parameters.h deleted file mode 100644 index 989383580..000000000 --- a/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test_2D/space_parameters.h +++ /dev/null @@ -1,6 +0,0 @@ -// Parameters list for the parameters involved in mesh generation -#define subdivisionsX 1 -#define subdivisionsY 1 -#define subdivisionsZ 1 -#define refineFactor 8 -#define finiteElementDegree 1 diff --git a/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test_2D/spat_ooa_results.txt b/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test_2D/spat_ooa_results.txt deleted file mode 100644 index 503ef2981..000000000 --- a/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test_2D/spat_ooa_results.txt +++ /dev/null @@ -1,4 +0,0 @@ -Results of 2D spatial order of accuracy test: -From coarse mesh to medium mesh: 1.914655385 -From from medium mesh to fine mesh: 2.0491712881 -From from fine mesh to very fine mesh: 2.30283753388 diff --git a/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test_2D/visitlog.py b/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test_2D/visitlog.py deleted file mode 100644 index 6acc211fe..000000000 --- a/tests/deprecated_tests/order_of_accuracy_tests/spatial_ooa_test_2D/visitlog.py +++ /dev/null @@ -1,57 +0,0 @@ -# Visit 2.7.0 log file -ScriptVersion = "2.7.0" -if ScriptVersion != Version(): - print "This script is for VisIt %s. It may not work with version %s" % (ScriptVersion, Version()) -ShowAllWindows() -OpenDatabase("run_004/solution-10000.pvtu", 0) -# The UpdateDBPluginInfo RPC is not supported in the VisIt module so it will not be logged. -DefineScalarExpression("diff", "(c-pos_cmfe(, mesh,0))") -AddPlot("Pseudocolor", "diff", 1, 1) -PseudocolorAtts = PseudocolorAttributes() -PseudocolorAtts.scaling = PseudocolorAtts.Linear # Linear, Log, Skew -PseudocolorAtts.skewFactor = 1 -PseudocolorAtts.limitsMode = PseudocolorAtts.CurrentPlot # OriginalData, CurrentPlot -PseudocolorAtts.minFlag = 0 -PseudocolorAtts.min = 0 -PseudocolorAtts.maxFlag = 0 -PseudocolorAtts.max = 1 -PseudocolorAtts.centering = PseudocolorAtts.Natural # Natural, Nodal, Zonal -PseudocolorAtts.colorTableName = "hot" -PseudocolorAtts.invertColorTable = 0 -PseudocolorAtts.opacityType = PseudocolorAtts.FullyOpaque # ColorTable, FullyOpaque, Constant, Ramp, VariableRange -PseudocolorAtts.opacityVariable = "" -PseudocolorAtts.opacity = 1 -PseudocolorAtts.opacityVarMin = 0 -PseudocolorAtts.opacityVarMax = 1 -PseudocolorAtts.opacityVarMinFlag = 0 -PseudocolorAtts.opacityVarMaxFlag = 0 -PseudocolorAtts.pointSize = 0.05 -PseudocolorAtts.pointType = PseudocolorAtts.Point # Box, Axis, Icosahedron, Octahedron, Tetrahedron, SphereGeometry, Point, Sphere -PseudocolorAtts.pointSizeVarEnabled = 0 -PseudocolorAtts.pointSizeVar = "default" -PseudocolorAtts.pointSizePixels = 2 -PseudocolorAtts.lineType = PseudocolorAtts.Line # Line, Tube, Ribbon -PseudocolorAtts.lineStyle = PseudocolorAtts.SOLID # SOLID, DASH, DOT, DOTDASH -PseudocolorAtts.lineWidth = 0 -PseudocolorAtts.tubeDisplayDensity = 10 -PseudocolorAtts.tubeRadiusSizeType = PseudocolorAtts.FractionOfBBox # Absolute, FractionOfBBox -PseudocolorAtts.tubeRadiusAbsolute = 0.125 -PseudocolorAtts.tubeRadiusBBox = 0.005 -PseudocolorAtts.varyTubeRadius = 0 -PseudocolorAtts.varyTubeRadiusVariable = "" -PseudocolorAtts.varyTubeRadiusFactor = 10 -PseudocolorAtts.endPointType = PseudocolorAtts.None # None, Tails, Heads, Both -PseudocolorAtts.endPointStyle = PseudocolorAtts.Spheres # Spheres, Cones -PseudocolorAtts.endPointRadiusSizeType = PseudocolorAtts.FractionOfBBox # Absolute, FractionOfBBox -PseudocolorAtts.endPointRadiusAbsolute = 1 -PseudocolorAtts.endPointRadiusBBox = 0.005 -PseudocolorAtts.endPointRatio = 2 -PseudocolorAtts.renderSurfaces = 1 -PseudocolorAtts.renderWireframe = 0 -PseudocolorAtts.renderPoints = 0 -PseudocolorAtts.smoothingLevel = 0 -PseudocolorAtts.legendFlag = 1 -PseudocolorAtts.lightingFlag = 1 -SetPlotOptions(PseudocolorAtts) -DrawPlots() -Query("MinMax", use_actual_data=1) diff --git a/tests/deprecated_tests/order_of_accuracy_tests/time_ooa_test/CMakeLists.txt b/tests/deprecated_tests/order_of_accuracy_tests/time_ooa_test/CMakeLists.txt deleted file mode 100644 index 0444f179d..000000000 --- a/tests/deprecated_tests/order_of_accuracy_tests/time_ooa_test/CMakeLists.txt +++ /dev/null @@ -1,32 +0,0 @@ -## -# CMake script for the phaseField applications: -## - - -# Set the name of the project and target: -SET(TARGET "main") - -# Declare all source files the target consists of: -SET(TARGET_SRC - ${TARGET}.cc - # You can specify additional files here! - ) - -# Usually, you will not need to modify anything beyond this point... - -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8) - -FIND_PACKAGE(deal.II 8.0 QUIET - HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} - ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" - "*** Could not locate deal.II. ***\n\n" - "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" - "or set an environment variable \"DEAL_II_DIR\" that contains this path." - ) -ENDIF() - -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() diff --git a/tests/deprecated_tests/order_of_accuracy_tests/time_ooa_test/ICs_and_BCs.h b/tests/deprecated_tests/order_of_accuracy_tests/time_ooa_test/ICs_and_BCs.h deleted file mode 100644 index 7129dffae..000000000 --- a/tests/deprecated_tests/order_of_accuracy_tests/time_ooa_test/ICs_and_BCs.h +++ /dev/null @@ -1,187 +0,0 @@ -// initial condition -template -class InitialCondition : public Function -{ -public: - unsigned int index; - Vector values; - - InitialCondition(const unsigned int _index) - : Function(1) - , index(_index) - { - std::srand(Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) + 1); - } - - double - value(const Point &p, const unsigned int component = 0) const - { - double scalar_IC = 0; - // ===================================================================== - // ENTER THE INITIAL CONDITIONS HERE FOR SCALAR FIELDS - // ===================================================================== - // Enter the function describing conditions for the fields at point "p". - // Use "if" statements to set the initial condition for each variable - // according to its variable index. - -#define x_denom 1.0 -#define y_denom 1.0 -#define z_denom 1.0 -#define initial_interface_coeff 1.0 -#define initial_radius 7.0 -#define avg_Nd 0.004 - - if (index == 0) - { - // return the value of the initial concentration field at point p - double dx = spanX / ((double) subdivisionsX) / std::pow(2.0, refineFactor); - double dy = spanY / ((double) subdivisionsY) / std::pow(2.0, refineFactor); - double dz = spanZ / ((double) subdivisionsZ) / std::pow(2.0, refineFactor); - double r = 0.0; - // return 0.02 + 1.0e-3*(2*(0.5 - (double)(std::rand() % 100 )/100.0)); -#if problemDIM == 1 - r = p.operator()(0); - return 0.5 * (0.12 - 0.00) * (1 - std::tanh((r - spanX / 16.0) / (0.1 * dx))); -#elif problemDIM == 2 - - r = sqrt((p.operator()(0)) * (p.operator()(0)) / x_denom + - (p.operator()(1)) * (p.operator()(1)) / y_denom); - return 0.5 * (0.12 - avg_Nd) * - (1.0 - std::tanh((r - initial_radius) / (initial_interface_coeff))) + - avg_Nd; - -#elif problemDIM == 3 - - r = sqrt((p.operator()(0)) * (p.operator()(0)) / x_denom + - (p.operator()(1)) * (p.operator()(1)) / y_denom + - (p.operator()(2)) * (p.operator()(2)) / z_denom); - return 0.5 * (0.12 - avg_Nd) * - (1.0 - std::tanh((r - initial_radius) / (initial_interface_coeff))) + - avg_Nd; - -#endif - } - else if (index == 1) - { - // set result equal to the structural order paramter initial condition - double dx = spanX / ((double) subdivisionsX) / std::pow(2.0, refineFactor); - double dy = spanY / ((double) subdivisionsY) / std::pow(2.0, refineFactor); - double dz = spanZ / ((double) subdivisionsZ) / std::pow(2.0, refineFactor); - double r = 0.0; -#if problemDIM == 1 - r = p.operator()(0); - return 0.5 * (1.0 - std::tanh((r - spanX / 16.0) / (0.1 * dx))); -#elif problemDIM == 2 - - r = sqrt((p.operator()(0)) * (p.operator()(0)) / x_denom + - (p.operator()(1)) * (p.operator()(1)) / y_denom); - return 0.5 * (1.0 - std::tanh((r - initial_radius) / (initial_interface_coeff))); - -#elif problemDIM == 3 - // r=p.distance(Point(spanX/2.0,spanY/2.0,spanZ/2.0)); - // return 0.5*(1.0-std::tanh((r-spanX/8.0)/(3*dx))); - - r = sqrt((p.operator()(0)) * (p.operator()(0)) / x_denom + - (p.operator()(1)) * (p.operator()(1)) / y_denom + - (p.operator()(2)) * (p.operator()(2)) / z_denom); - return 0.5 * (1.0 - std::tanh((r - initial_radius) / (initial_interface_coeff))); - - // planar interface - // r=sqrt((p.operator()(2)-spanZ/2.0)*(p.operator()(2)-spanZ/2.0)); - // return 0.5*(1.0-std::tanh((r)/(initial_interface_coeff))); - // return - // 0.5*(1.0-std::tanh((r-initial_radius)/(initial_interface_coeff))); -#endif - return 0.0; - } - else if (index == 2) - { - scalar_IC = 0.0; - } - else if (index == 3) - { - scalar_IC = 0.0; - } - - // ===================================================================== - return scalar_IC; - } -}; - -// initial condition -template -class InitialConditionVec : public Function -{ -public: - unsigned int index; - - // Vector values; - InitialConditionVec(const unsigned int _index) - : Function(dim) - , index(_index) - { - std::srand(Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) + 1); - } - - void - vector_value(const Point &p, Vector &vector_IC) const - { - // ===================================================================== - // ENTER THE INITIAL CONDITIONS HERE FOR VECTOR FIELDS - // ===================================================================== - // Enter the function describing conditions for the fields at point "p". - // Use "if" statements to set the initial condition for each variable - // according to its variable index. - - if (index == 4) - { - vector_IC(0) = 0.0; - vector_IC(1) = 0.0; - if (dim == 3) - { - vector_IC(2) = 0.0; - } - } - // ===================================================================== - } -}; - -template -void -generalizedProblem::setBCs() -{ - // ===================================================================== - // ENTER THE BOUNDARY CONDITIONS HERE - // ===================================================================== - // This function sets the BCs for the problem variables - // The function "inputBCs" should be called for each component of - // each variable and should be in numerical order. Four input arguments - // set the same BC on the entire boundary. Two plus two times the - // number of dimensions inputs sets separate BCs on each face of the domain. - // Inputs to "inputBCs": - // First input: variable number - // Second input: component number - // Third input: BC type (options are "ZERO_DERIVATIVE" and "DIRICHLET") - // Fourth input: BC value (ignored unless the BC type is "DIRICHLET") - // Odd inputs after the third: BC type - // Even inputs after the third: BC value - // Face numbering: starts at zero with the minimum of the first direction, one - // for the maximum of the first direction - // two for the minimum of the second direction, etc. - inputBCs(0, 0, "ZERO_DERIVATIVE", 0); - - inputBCs(1, 0, "ZERO_DERIVATIVE", 0); - - inputBCs(2, 0, "ZERO_DERIVATIVE", 0); - - inputBCs(3, 0, "ZERO_DERIVATIVE", 0); - - inputBCs(4, 0, "DIRICHLET", 0.0); - inputBCs(4, 1, "DIRICHLET", 0.0); - if (dim == 3) - { - inputBCs(4, 2, "DIRICHLET", 0.0); - } - - // ===================================================================== -} diff --git a/tests/deprecated_tests/order_of_accuracy_tests/time_ooa_test/error1.txt b/tests/deprecated_tests/order_of_accuracy_tests/time_ooa_test/error1.txt deleted file mode 100644 index e71583817..000000000 --- a/tests/deprecated_tests/order_of_accuracy_tests/time_ooa_test/error1.txt +++ /dev/null @@ -1 +0,0 @@ -1.26510858537e-05 \ No newline at end of file diff --git a/tests/deprecated_tests/order_of_accuracy_tests/time_ooa_test/error2.txt b/tests/deprecated_tests/order_of_accuracy_tests/time_ooa_test/error2.txt deleted file mode 100644 index 33c21f292..000000000 --- a/tests/deprecated_tests/order_of_accuracy_tests/time_ooa_test/error2.txt +++ /dev/null @@ -1 +0,0 @@ -5.89340925226e-06 \ No newline at end of file diff --git a/tests/deprecated_tests/order_of_accuracy_tests/time_ooa_test/error3.txt b/tests/deprecated_tests/order_of_accuracy_tests/time_ooa_test/error3.txt deleted file mode 100644 index 61364fb43..000000000 --- a/tests/deprecated_tests/order_of_accuracy_tests/time_ooa_test/error3.txt +++ /dev/null @@ -1 +0,0 @@ -2.52574682245e-06 \ No newline at end of file diff --git a/tests/deprecated_tests/order_of_accuracy_tests/time_ooa_test/getError1.py b/tests/deprecated_tests/order_of_accuracy_tests/time_ooa_test/getError1.py deleted file mode 100644 index 200a15971..000000000 --- a/tests/deprecated_tests/order_of_accuracy_tests/time_ooa_test/getError1.py +++ /dev/null @@ -1,61 +0,0 @@ -import sys - -variable_1 = 'c' -variable_2 = 'c' - -output_num_1 = "100" -output_num_2 = "01600" - -use_mesh_1 = True -apply_3slice = False -apply_box_crop = True - -directory_1 = "run_001/solution-"+output_num_1+".pvtu" -directory_2 = "run_004/solution-"+output_num_2+".pvtu" - -if use_mesh_1 == True: - OpenDatabase(directory_1) - DefineScalarExpression("diff","("+variable_1+"-pos_cmfe(<"+directory_2+":"+variable_2+">, mesh,0))") -else: - OpenDatabase(directory_2) - DefineScalarExpression("diff","("+variable_2+"-pos_cmfe(<"+directory_1+":"+variable_1+">, mesh,0))") - -#AddPlot("Contour","diff") -AddPlot("Pseudocolor","diff") - -PseudocolorAtts = PseudocolorAttributes() -PseudocolorAtts.limitsMode = PseudocolorAtts.CurrentPlot -SetPlotOptions(PseudocolorAtts) - -if apply_box_crop == True: - AddOperator("Box", 1) - BoxAtts = BoxAttributes() - BoxAtts.amount = BoxAtts.Some # Some, All - BoxAtts.minx = 2.0 - BoxAtts.maxx = 30.0 - BoxAtts.miny = 2.0 - BoxAtts.maxy = 30.0 - BoxAtts.minz = 2.0 - BoxAtts.maxz = 30.0 - BoxAtts.inverse = 0 - SetOperatorOptions(BoxAtts, 1) - -if apply_3slice == True: - AddOperator("ThreeSlice") - slice_atts = ThreeSliceAttributes() - slice_atts.x = 16 - slice_atts.y = 16 - slice_atts.z = 16 - SetOperatorOptions(slice_atts) - -DrawPlots() - -Query("MinMax", use_actual_data=1) -min_max_val = GetQueryOutputValue() -error = max(abs(min_max_val[0]),abs(min_max_val[1])) - -text_file = open("error1.txt","w") -text_file.write(str(error)) -text_file.close() - -sys.exit() \ No newline at end of file diff --git a/tests/deprecated_tests/order_of_accuracy_tests/time_ooa_test/getError2.py b/tests/deprecated_tests/order_of_accuracy_tests/time_ooa_test/getError2.py deleted file mode 100644 index 7f2b51d99..000000000 --- a/tests/deprecated_tests/order_of_accuracy_tests/time_ooa_test/getError2.py +++ /dev/null @@ -1,61 +0,0 @@ -import sys - -variable_1 = 'c' -variable_2 = 'c' - -output_num_1 = "0200" -output_num_2 = "01600" - -use_mesh_1 = True -apply_3slice = False -apply_box_crop = True - -directory_1 = "run_002/solution-"+output_num_1+".pvtu" -directory_2 = "run_004/solution-"+output_num_2+".pvtu" - -if use_mesh_1 == True: - OpenDatabase(directory_1) - DefineScalarExpression("diff","("+variable_1+"-pos_cmfe(<"+directory_2+":"+variable_2+">, mesh,0))") -else: - OpenDatabase(directory_2) - DefineScalarExpression("diff","("+variable_2+"-pos_cmfe(<"+directory_1+":"+variable_1+">, mesh,0))") - -#AddPlot("Contour","diff") -AddPlot("Pseudocolor","diff") - -PseudocolorAtts = PseudocolorAttributes() -PseudocolorAtts.limitsMode = PseudocolorAtts.CurrentPlot -SetPlotOptions(PseudocolorAtts) - -if apply_box_crop == True: - AddOperator("Box", 1) - BoxAtts = BoxAttributes() - BoxAtts.amount = BoxAtts.Some # Some, All - BoxAtts.minx = 2.0 - BoxAtts.maxx = 30.0 - BoxAtts.miny = 2.0 - BoxAtts.maxy = 30.0 - BoxAtts.minz = 2.0 - BoxAtts.maxz = 30.0 - BoxAtts.inverse = 0 - SetOperatorOptions(BoxAtts, 1) - -if apply_3slice == True: - AddOperator("ThreeSlice") - slice_atts = ThreeSliceAttributes() - slice_atts.x = 16 - slice_atts.y = 16 - slice_atts.z = 16 - SetOperatorOptions(slice_atts) - -DrawPlots() - -Query("MinMax", use_actual_data=1) -min_max_val = GetQueryOutputValue() -error = max(abs(min_max_val[0]),abs(min_max_val[1])) - -text_file = open("error2.txt","w") -text_file.write(str(error)) -text_file.close() - -sys.exit() \ No newline at end of file diff --git a/tests/deprecated_tests/order_of_accuracy_tests/time_ooa_test/getError3.py b/tests/deprecated_tests/order_of_accuracy_tests/time_ooa_test/getError3.py deleted file mode 100644 index 346ef5131..000000000 --- a/tests/deprecated_tests/order_of_accuracy_tests/time_ooa_test/getError3.py +++ /dev/null @@ -1,61 +0,0 @@ -import sys - -variable_1 = 'c' -variable_2 = 'c' - -output_num_1 = "0400" -output_num_2 = "01600" - -use_mesh_1 = True -apply_3slice = False -apply_box_crop = True - -directory_1 = "run_003/solution-"+output_num_1+".pvtu" -directory_2 = "run_004/solution-"+output_num_2+".pvtu" - -if use_mesh_1 == True: - OpenDatabase(directory_1) - DefineScalarExpression("diff","("+variable_1+"-pos_cmfe(<"+directory_2+":"+variable_2+">, mesh,0))") -else: - OpenDatabase(directory_2) - DefineScalarExpression("diff","("+variable_2+"-pos_cmfe(<"+directory_1+":"+variable_1+">, mesh,0))") - -#AddPlot("Contour","diff") -AddPlot("Pseudocolor","diff") - -PseudocolorAtts = PseudocolorAttributes() -PseudocolorAtts.limitsMode = PseudocolorAtts.CurrentPlot -SetPlotOptions(PseudocolorAtts) - -if apply_box_crop == True: - AddOperator("Box", 1) - BoxAtts = BoxAttributes() - BoxAtts.amount = BoxAtts.Some # Some, All - BoxAtts.minx = 2.0 - BoxAtts.maxx = 30.0 - BoxAtts.miny = 2.0 - BoxAtts.maxy = 30.0 - BoxAtts.minz = 2.0 - BoxAtts.maxz = 30.0 - BoxAtts.inverse = 0 - SetOperatorOptions(BoxAtts, 1) - -if apply_3slice == True: - AddOperator("ThreeSlice") - slice_atts = ThreeSliceAttributes() - slice_atts.x = 16 - slice_atts.y = 16 - slice_atts.z = 16 - SetOperatorOptions(slice_atts) - -DrawPlots() - -Query("MinMax", use_actual_data=1) -min_max_val = GetQueryOutputValue() -error = max(abs(min_max_val[0]),abs(min_max_val[1])) - -text_file = open("error3.txt","w") -text_file.write(str(error)) -text_file.close() - -sys.exit() \ No newline at end of file diff --git a/tests/deprecated_tests/order_of_accuracy_tests/time_ooa_test/main.cc b/tests/deprecated_tests/order_of_accuracy_tests/time_ooa_test/main.cc deleted file mode 100644 index 0a10676c0..000000000 --- a/tests/deprecated_tests/order_of_accuracy_tests/time_ooa_test/main.cc +++ /dev/null @@ -1,54 +0,0 @@ -// Coupled Cahn-Hilliard, Allen-Cahn and Mechanics problem -// general headers -#include "../../../include/dealIIheaders.h" - -// Coupled Cahn-Hilliard+Allen-Cahn+Mechanics problem headers -#include "ICs_and_BCs.h" -#include "parameters.h" -#include "residuals.h" -#include "time_parameters.h" - -#include "../../../src/models/coupled/generalized_model.h" -#include "../../../src/models/coupled/generalized_model_functions.h" - -// main -int -main(int argc, char **argv) -{ - Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, - argv, - numbers::invalid_unsigned_int); - try - { - deallog.depth_console(0); - generalizedProblem problem; - - problem.setBCs(); - problem.buildFields(); - problem.init(); - problem.solve(); - } - catch (std::exception &exc) - { - std::cerr << std::endl - << std::endl - << "----------------------------------------------------" << std::endl; - std::cerr << "Exception on processing: " << std::endl - << exc.what() << std::endl - << "Aborting!" << std::endl - << "----------------------------------------------------" << std::endl; - return 1; - } - catch (...) - { - std::cerr << std::endl - << std::endl - << "----------------------------------------------------" << std::endl; - std::cerr << "Unknown exception!" << std::endl - << "Aborting!" << std::endl - << "----------------------------------------------------" << std::endl; - return 1; - } - - return 0; -} diff --git a/tests/deprecated_tests/order_of_accuracy_tests/time_ooa_test/parameters.h b/tests/deprecated_tests/order_of_accuracy_tests/time_ooa_test/parameters.h deleted file mode 100644 index b2bc46490..000000000 --- a/tests/deprecated_tests/order_of_accuracy_tests/time_ooa_test/parameters.h +++ /dev/null @@ -1,104 +0,0 @@ -// Parameter list for the precipitate evolution example application -// All strictly numerical parameters should be set in this file - -// ================================================================================= -// Set the number of dimensions (1, 2, or 3 for a 1D, 2D, or 3D calculation) -// ================================================================================= -#define problemDIM 3 - -// ================================================================================= -// Set the length of the domain in all three dimensions -// ================================================================================= -// Each axes spans from zero to the specified length -#define spanX 32.0 -#define spanY 32.0 -#define spanZ 32.0 - -// ================================================================================= -// Set the element parameters -// ================================================================================= -// The number of elements in each direction is 2^(refineFactor) * subdivisions -// For optimal performance, use refineFactor primarily to determine the element -// size -#define subdivisionsX 1 -#define subdivisionsY 1 -#define subdivisionsZ 1 -#define refineFactor 4 - -// Set the polynomial degree of the element (suggested values: 1 or 2) -#define finiteElementDegree 1 - -// ================================================================================= -// Set the adaptive mesh refinement parameters -// ================================================================================= -// Set the flag determining if adaptive meshing is activated -#define hAdaptivity false - -// Set the maximum and minimum level of refinement -#define maxRefinementLevel (refineFactor) -#define minRefinementLevel (refineFactor - 2) - -// Set the fields used to determine the refinement. Fields determined by the -// order declared in "equations.h", starting at zero -#define refineCriterionFields \ - { \ - 1, 2, 3 \ - } - -// Set the maximum and minimum value of the fields where the mesh should be -// refined -#define refineWindowMax \ - { \ - 0.99, 0.99, 0.99 \ - } -#define refineWindowMin \ - { \ - 0.01, 0.01, 0.01 \ - } - -// Set the number of time steps between remeshing operations -#define skipRemeshingSteps 1000 - -// ================================================================================= -// Set the time step parameters -// ================================================================================= -// The size of the time step -// #define timeStep 9.0e-6 -// #define timeFinal 100000000 -// #define timeIncrements 10000 - -// ================================================================================= -// Set the elliptic solver parameters -// ================================================================================= -// The solver type (currently the only recommended option is conjugate gradient) -#define solverType SolverCG - -// The flag that determines whether the tolerance for solver convergence should -// be an absolute tolerance (absTol=true) or a relative tolerance (absTol=false) -#define absTol true - -// The tolerance for convergence (L2 norm of the residual) -#define solverTolerance 1.0e-4 - -// The maximum number of solver iterations per time step -#define maxSolverIterations 1000 - -// ================================================================================= -// Set the output parameters -// ================================================================================= -// Each field in the problem will be output is writeOutput is set to "true" -#define writeOutput true - -// Type of spacing between outputs ("EQUAL_SPACING", "LOG_SPACING", or -// "N_PER_DECADE") -#define outputCondition "EQUAL_SPACING" - -// Number of times the program outputs the fields (total number for -// "EQUAL_SPACING" and "LOG_SPACING", number per decade for "N_PER_DECADE") -#define numOutputs 1 - -// ================================================================================= -// Set the flag determining if the total free energy is calculated for each -// output -// ================================================================================= -#define calcEnergy false diff --git a/tests/deprecated_tests/order_of_accuracy_tests/time_ooa_test/residuals.h b/tests/deprecated_tests/order_of_accuracy_tests/time_ooa_test/residuals.h deleted file mode 100644 index 3c8190016..000000000 --- a/tests/deprecated_tests/order_of_accuracy_tests/time_ooa_test/residuals.h +++ /dev/null @@ -1,682 +0,0 @@ -// List of variables and residual equations for the Precipitate Evolution -// example application - -// ================================================================================= -// Define the variables in the model -// ================================================================================= -// The number of variables -#define num_var 5 - -// The names of the variables, whether they are scalars or vectors and whether -// the governing eqn for the variable is parabolic or elliptic -#define variable_name \ - { \ - "c", "n1", "n2", "n3", "u" \ - } -#define variable_type \ - { \ - "SCALAR", "SCALAR", "SCALAR", "SCALAR", "VECTOR" \ - } -#define variable_eq_type \ - { \ - "PARABOLIC", "PARABOLIC", "PARABOLIC", "PARABOLIC", "ELLIPTIC" \ - } - -// Flags for whether the value, gradient, and Hessian are needed in the residual -// eqns -#define need_val \ - { \ - true, true, true, true, false \ - } -#define need_grad \ - { \ - true, true, true, true, true \ - } -#define need_hess \ - { \ - false, false, false, false, false \ - } - -// Flags for whether the residual equation has a term multiplied by the test -// function (need_val_residual) and/or the gradient of the test function -// (need_grad_residual) -#define need_val_residual \ - { \ - true, true, true, true, false \ - } -#define need_grad_residual \ - { \ - true, true, true, true, true \ - } - -// Flags for whether the value, gradient, and Hessian are needed in the residual -// eqn for the left-hand-side of the iterative solver for elliptic equations -#define need_val_LHS \ - { \ - false, true, true, true, false \ - } -#define need_grad_LHS \ - { \ - false, false, false, false, true \ - } -#define need_hess_LHS \ - { \ - false, false, false, false, false \ - } - -// Flags for whether the residual equation for the left-hand-side of the -// iterative solver for elliptic equations has a term multiplied by the test -// function (need_val_residual) and/or the gradient of the test function -// (need_grad_residual) -#define need_val_residual_LHS \ - { \ - false, false, false, false, false \ - } -#define need_grad_residual_LHS \ - { \ - false, false, false, false, true \ - } - -// ================================================================================= -// Define the model parameters and the residual equations -// ================================================================================= -// Parameters in the residual equations and expressions for the residual -// equations can be set here. For simple cases, the entire residual equation can -// be written here. For more complex cases with loops or conditional statements, -// residual equations (or parts of residual equations) can be written below in -// "residualRHS". - -// Cahn-Hilliard mobility -#define McV 1.0 - -// Allen-Cahn mobilities -#define Mn1V 50.0 -#define Mn2V 50.0 -#define Mn3V 50.0 - -// Gradient energy coefficients -double Kn1[3][3] = { - {1.0, 0, 0 }, - {0, 0.5, 0 }, - {0, 0, 1.0} -}; -double Kn2[3][3] = { - {1.0, 0, 0 }, - {0, 0.5, 0 }, - {0, 0, 1.0} -}; -double Kn3[3][3] = { - {1.0, 0, 0 }, - {0, 0.5, 0 }, - {0, 0, 1.0} -}; - -// define energy barrier coefficient (used to tune the interfacial energy) -#define W -1.0 - -// Define mechanical properties -#define n_dependent_stiffness false -// Mechanical symmetry of the material and stiffness parameters -// If n_dependent_stiffness == false the first entry is used for all phases -#define MaterialModels \ - { \ - { \ - "ISOTROPIC" \ - } \ - } -#define MaterialConstants \ - { \ - { \ - 1.0, 0.3 \ - } \ - } - -// Stress-free transformation strains -// Linear fits for the stress-free transformation strains in for sfts = -// sfts_linear * c + sfts_const -double sfts_linear1[3][3] = { - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0} -}; -double sfts_const1[3][3] = { - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0} -}; - -double sfts_linear2[3][3] = { - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0} -}; -double sfts_const2[3][3] = { - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0} -}; - -double sfts_linear3[3][3] = { - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0} -}; -double sfts_const3[3][3] = { - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0} -}; - -// Free energy expressions -#define faV (24.7939 * c * c - 1.6752 * c - 1.9453e-06) -#define facV (49.5878 * c - 1.6752) -#define faccV (49.5878) -#define fbV (37.9316 * c * c - 10.7373 * c + 0.5401) -#define fbcV (75.8633 * c - 10.7373) -#define fbccV (75.8633) -#define h1V (3.0 * n1 * n1 - 2.0 * n1 * n1 * n1) -#define h2V (3.0 * n2 * n2 - 2.0 * n2 * n2 * n2) -#define h3V (3.0 * n3 * n3 - 2.0 * n3 * n3 * n3) -#define hn1V (6.0 * n1 - 6.0 * n1 * n1) -#define hn2V (6.0 * n2 - 6.0 * n2 * n2) -#define hn3V (6.0 * n3 - 6.0 * n3 * n3) - -// This double-well function can be used to tune the interfacial energy -#define fbarrierV (n1 * n1 - 2.0 * n1 * n1 * n1 + n1 * n1 * n1 * n1) -#define fbarriernV (2.0 * n1 - 6.0 * n1 * n1 + 4.0 * n1 * n1 * n1) - -// Residuals -#define rcV (c) -#define rcxTemp \ - (cx * ((1.0 - h1V - h2V - h3V) * faccV + (h1V + h2V + h3V) * fbccV) + \ - n1x * ((fbcV - facV) * hn1V) + n2x * ((fbcV - facV) * hn2V) + \ - n3x * ((fbcV - facV) * hn3V)) -#define rcxV (constV(-timeStep * McV) * rcxTemp) - -#define rn1V \ - (n1 - constV(timeStep * Mn1V) * \ - ((fbV - faV) * hn1V + W * fbarriernV + nDependentMisfitAC1)) -#define rn2V (n2 - constV(timeStep * Mn2V) * ((fbV - faV) * hn2V)) -#define rn3V (n3 - constV(timeStep * Mn3V) * ((fbV - faV) * hn3V)) -#define rn1xV (constV(-timeStep * Mn1V) * Knx1) -#define rn2xV (constV(-timeStep * Mn2V) * Knx2) -#define rn3xV (constV(-timeStep * Mn3V) * Knx3) - -// ================================================================================= -// residualRHS -// ================================================================================= -// This function calculates the residual equations for each variable. It takes -// "modelVariablesList" as an input, which is a list of the value and -// derivatives of each of the variables at a specific quadrature point. The -// (x,y,z) location of that quadrature point is given by "q_point_loc". The -// function outputs "modelResidualsList", a list of the value and gradient terms -// of the residual for each residual equation. The index for each variable in -// these lists corresponds to the order it is defined at the top of this file -// (starting at 0). -template -void -generalizedProblem::residualRHS( - const std::vector> &modelVariablesList, - std::vector> &modelResidualsList, - dealii::Point> q_point_loc) const -{ - // The concentration and its derivatives (names here should match those in the - // macros above) - scalarvalueType c = modelVariablesList[0].scalarValue; - scalargradType cx = modelVariablesList[0].scalarGrad; - - // The first order parameter and its derivatives (names here should match - // those in the macros above) - scalarvalueType n1 = modelVariablesList[1].scalarValue; - scalargradType n1x = modelVariablesList[1].scalarGrad; - - // The second order parameter and its derivatives (names here should match - // those in the macros above) - scalarvalueType n2 = modelVariablesList[2].scalarValue; - scalargradType n2x = modelVariablesList[2].scalarGrad; - - // The third order parameter and its derivatives (names here should match - // those in the macros above) - scalarvalueType n3 = modelVariablesList[3].scalarValue; - scalargradType n3x = modelVariablesList[3].scalarGrad; - - // The derivative of the displacement vector (names here should match those in - // the macros above) - vectorgradType ux = modelVariablesList[4].vectorGrad; - vectorgradType ruxV; - - vectorhessType uxx; - - if (c_dependent_misfit == true) - { - uxx = modelVariablesList[4].vectorHess; - } - - // Calculate the stress-free transformation strain and its derivatives at the - // quadrature point - dealii::Tensor<2, problemDIM, dealii::VectorizedArray> sfts1, sfts1c, sfts1cc, - sfts2, sfts2c, sfts2cc, sfts3, sfts3c, sfts3cc; - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - // Polynomial fits for the stress-free transformation strains, of the - // form: sfts = a_p * c + b_p - sfts1[i][j] = constV(sfts_linear1[i][j]) * c + constV(sfts_const1[i][j]); - sfts1c[i][j] = constV(sfts_linear1[i][j]); - sfts1cc[i][j] = constV(0.0); - - // Polynomial fits for the stress-free transformation strains, of the - // form: sfts = a_p * c + b_p - sfts2[i][j] = constV(sfts_linear2[i][j]) * c + constV(sfts_const2[i][j]); - sfts2c[i][j] = constV(sfts_linear1[i][j]); - sfts2cc[i][j] = constV(0.0); - - // Polynomial fits for the stress-free transformation strains, of the - // form: sfts = a_p * c + b_p - sfts3[i][j] = constV(sfts_linear3[i][j]) * c + constV(sfts_const3[i][j]); - sfts3c[i][j] = constV(sfts_linear3[i][j]); - sfts3cc[i][j] = constV(0.0); - } - } - - // compute E2=(E-E0) - dealii::VectorizedArray E2[dim][dim], S[dim][dim]; - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - E2[i][j] = constV(0.5) * (ux[i][j] + ux[j][i]) - - (sfts1[i][j] * h1V + sfts2[i][j] * h2V + sfts3[i][j] * h3V); - } - } - - // compute stress - // S=C*(E-E0) - // Compute stress tensor (which is equal to the residual, Rux) - dealii::VectorizedArray CIJ_combined[CIJ_tensor_size][CIJ_tensor_size]; - - if (n_dependent_stiffness == true) - { - dealii::VectorizedArray sum_hV; - sum_hV = h1V + h2V + h3V; - for (unsigned int i = 0; i < 2 * dim - 1 + dim / 3; i++) - { - for (unsigned int j = 0; j < 2 * dim - 1 + dim / 3; j++) - { - CIJ_combined[i][j] = - CIJ_list[0][i][j] * (constV(1.0) - sum_hV) + CIJ_list[1][i][j] * sum_hV; - } - } - computeStress(CIJ_combined, E2, S); - } - else - { - computeStress(CIJ_list[0], E2, S); - } - - // Fill residual corresponding to mechanics - // R=-C*(E-E0) - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - ruxV[i][j] = -S[i][j]; - } - } - - // Compute one of the stress terms in the order parameter chemical potential, - // nDependentMisfitACp = C*(E-E0)*(E0_p*Hn) - dealii::VectorizedArray nDependentMisfitAC1 = constV(0.0); - dealii::VectorizedArray nDependentMisfitAC2 = constV(0.0); - dealii::VectorizedArray nDependentMisfitAC3 = constV(0.0); - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - nDependentMisfitAC1 += S[i][j] * (sfts1[i][j]); - nDependentMisfitAC2 += S[i][j] * (sfts2[i][j]); - nDependentMisfitAC3 += S[i][j] * (sfts3[i][j]); - } - } - - nDependentMisfitAC1 *= -hn1V; - nDependentMisfitAC2 *= -hn2V; - nDependentMisfitAC3 *= -hn3V; - - // Compute the other stress term in the order parameter chemical potential, - // heterMechACp = 0.5*Hn*(C_beta-C_alpha)*(E-E0)*(E-E0) - dealii::VectorizedArray heterMechAC1 = constV(0.0); - dealii::VectorizedArray heterMechAC2 = constV(0.0); - dealii::VectorizedArray heterMechAC3 = constV(0.0); - dealii::VectorizedArray S2[dim][dim]; - - if (n_dependent_stiffness == true) - { - // computeStress(CIJ_diff, E2, S2); - computeStress(CIJ_list[1] - CIJ_list[0], E2, S2); - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - heterMechAC1 += S2[i][j] * E2[i][j]; - } - } - // Aside from HnpV, heterMechAC1, heterMechAC2, and heterMechAC3 are equal - heterMechAC2 = 0.5 * hn2V * heterMechAC1; - heterMechAC3 = 0.5 * hn3V * heterMechAC1; - - heterMechAC1 = 0.5 * hn1V * heterMechAC1; - } - - // compute the stress term in the gradient of the concentration chemical - // potential, grad_mu_el = [C*(E-E0)*E0c]x, must be a vector with length dim - scalargradType grad_mu_el; - - if (c_dependent_misfit == true) - { - dealii::VectorizedArray E3[dim][dim], S3[dim][dim]; - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - E3[i][j] = -(sfts1c[i][j] * h1V + sfts2c[i][j] * h2V + sfts3c[i][j] * h3V); - } - } - - if (n_dependent_stiffness == true) - { - computeStress(CIJ_combined, E3, S3); - } - else - { - computeStress(CIJ_list[0], E3, S3); - } - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - for (unsigned int k = 0; k < dim; k++) - { - grad_mu_el[k] += - S3[i][j] * - (constV(0.5) * (uxx[i][j][k] + uxx[j][i][k]) + E3[i][j] * cx[k] - - (sfts1[i][j] * hn1V * n1x[k] + sfts2[i][j] * hn2V * n2x[k] + - sfts3[i][j] * hn3V * n3x[k])); - - grad_mu_el[k] += - -S[i][j] * - (sfts1c[i][j] * hn1V * n1x[k] + sfts2c[i][j] * hn2V * n2x[k] + - sfts3c[i][j] * hn3V * n3x[k] + - (sfts1cc[i][j] * h1V + sfts2cc[i][j] * h2V + sfts3cc[i][j] * h3V) * - cx[k]); - - if (n_dependent_stiffness == true) - { - grad_mu_el[k] += -S2[i][j] * (sfts1c[i][j] * hn1V * n1x[k] + - sfts2c[i][j] * hn2V * n2x[k] + - sfts3c[i][j] * hn3V * n3x[k]); - } - } - } - } - } - - // compute K*nx - scalargradType Knx1, Knx2, Knx3; - for (unsigned int a = 0; a < dim; a++) - { - Knx1[a] = 0.0; - Knx2[a] = 0.0; - Knx3[a] = 0.0; - for (unsigned int b = 0; b < dim; b++) - { - Knx1[a] += constV(Kn1[a][b]) * n1x[b]; - Knx2[a] += constV(Kn2[a][b]) * n2x[b]; - Knx3[a] += constV(Kn3[a][b]) * n3x[b]; - } - } - - modelResidualsList[0].scalarValueResidual = rcV; - modelResidualsList[0].scalarGradResidual = rcxV; - - modelResidualsList[1].scalarValueResidual = rn1V; - modelResidualsList[1].scalarGradResidual = rn1xV; - - modelResidualsList[2].scalarValueResidual = rn2V; - modelResidualsList[2].scalarGradResidual = rn2xV; - - modelResidualsList[3].scalarValueResidual = rn3V; - modelResidualsList[3].scalarGradResidual = rn3xV; - - modelResidualsList[4].vectorGradResidual = ruxV; -} - -// ================================================================================= -// residualLHS (needed only if at least one equation is elliptic) -// ================================================================================= -// This function calculates the residual equations for the iterative solver for -// elliptic equations.for each variable. It takes "modelVariablesList" as an -// input, which is a list of the value and derivatives of each of the variables -// at a specific quadrature point. The (x,y,z) location of that quadrature point -// is given by "q_point_loc". The function outputs "modelRes", the value and -// gradient terms of for the left-hand-side of the residual equation for the -// iterative solver. The index for each variable in these lists corresponds to -// the order it is defined at the top of this file (starting at 0), not counting -// variables that have "need_val_LHS", "need_grad_LHS", and "need_hess_LHS" all -// set to "false". If there are multiple elliptic equations, conditional -// statements should be used to ensure that the correct residual is being -// submitted. The index of the field being solved can be accessed by -// "this->currentFieldIndex". -template -void -generalizedProblem::residualLHS( - const std::vector> &modelVariablesList, - modelResidual &modelRes, - dealii::Point> q_point_loc) const -{ - // n1 - scalarvalueType n1 = modelVariablesList[0].scalarValue; - - // n2 - scalarvalueType n2 = modelVariablesList[1].scalarValue; - - // n3 - scalarvalueType n3 = modelVariablesList[2].scalarValue; - - // u - vectorgradType ux = modelVariablesList[3].vectorGrad; - vectorgradType ruxV; - - // Take advantage of E being simply 0.5*(ux + transpose(ux)) and use the - // dealii "symmetrize" function - dealii::Tensor<2, dim, dealii::VectorizedArray> E; - E = symmetrize(ux); - - // Compute stress tensor (which is equal to the residual, Rux) - if (n_dependent_stiffness == true) - { - dealii::Tensor<2, CIJ_tensor_size, dealii::VectorizedArray> CIJ_combined; - CIJ_combined = - CIJ_list[0] * (constV(1.0) - h1V - h2V - h3V) + CIJ_list[1] * (h1V + h2V + h3V); - - computeStress(CIJ_combined, E, ruxV); - } - else - { - computeStress(CIJ_list[0], E, ruxV); - } - - modelRes.vectorGradResidual = ruxV; -} - -// ================================================================================= -// energyDensity (needed only if calcEnergy == true) -// ================================================================================= -// This function integrates the free energy density across the computational -// domain. It takes "modelVariablesList" as an input, which is a list of the -// value and derivatives of each of the variables at a specific quadrature -// point. It also takes the mapped quadrature weight, "JxW_value", as an input. -// The (x,y,z) location of the quadrature point is given by "q_point_loc". The -// weighted value of the energy density is added to "energy" variable and the -// components of the energy density are added to the "energy_components" -// variable (index 0: chemical energy, index 1: gradient energy, index 2: -// elastic energy). -template -void -generalizedProblem::energyDensity( - const std::vector> &modelVarList, - const dealii::VectorizedArray &JxW_value, - dealii::Point> q_point_loc) -{ - scalarvalueType total_energy_density = constV(0.0); - - // c - scalarvalueType c = modelVarList[0].scalarValue; - scalargradType cx = modelVarList[0].scalarGrad; - - // n1 - scalarvalueType n1 = modelVarList[1].scalarValue; - scalargradType n1x = modelVarList[1].scalarGrad; - - // n2 - scalarvalueType n2 = modelVarList[2].scalarValue; - scalargradType n2x = modelVarList[2].scalarGrad; - - // n3 - scalarvalueType n3 = modelVarList[3].scalarValue; - scalargradType n3x = modelVarList[3].scalarGrad; - - // u - vectorgradType ux = modelVarList[4].vectorGrad; - - scalarvalueType f_chem = - (constV(1.0) - (h1V + h2V + h3V)) * faV + (h1V + h2V + h3V) * fbV; - - scalarvalueType f_grad = constV(0.0); - - for (int i = 0; i < dim; i++) - { - for (int j = 0; j < dim; j++) - { - f_grad += constV(0.5 * Kn1[i][j]) * n1x[i] * n1x[j]; - } - } -#if num_sop > 1 - for (int i = 0; i < dim; i++) - { - for (int j = 0; j < dim; j++) - { - f_grad += constV(0.5 * Kn2[i][j]) * n2x[i] * n2x[j]; - } - } -#endif -#if num_sop > 2 - for (int i = 0; i < dim; i++) - { - for (int j = 0; j < dim; j++) - { - f_grad += constV(0.5 * Kn3[i][j]) * n3x[i] * n3x[j]; - } - } -#endif - - // Calculate the stress-free transformation strain and its derivatives at the - // quadrature point - dealii::Tensor<2, problemDIM, dealii::VectorizedArray> sfts1, sfts1c, sfts1cc, - sfts2, sfts2c, sfts2cc, sfts3, sfts3c, sfts3cc; - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - // Polynomial fits for the stress-free transformation strains, of the - // form: sfts = a_p * c + b_p - sfts1[i][j] = constV(sfts_linear1[i][j]) * c + constV(sfts_const1[i][j]); - sfts1c[i][j] = constV(sfts_linear1[i][j]); - sfts1cc[i][j] = constV(0.0); - - // Polynomial fits for the stress-free transformation strains, of the - // form: sfts = a_p * c + b_p - sfts2[i][j] = constV(sfts_linear2[i][j]) * c + constV(sfts_const2[i][j]); - sfts2c[i][j] = constV(sfts_linear1[i][j]); - sfts2cc[i][j] = constV(0.0); - - // Polynomial fits for the stress-free transformation strains, of the - // form: sfts = a_p * c + b_p - sfts3[i][j] = constV(sfts_linear3[i][j]) * c + constV(sfts_const3[i][j]); - sfts3c[i][j] = constV(sfts_linear3[i][j]); - sfts3cc[i][j] = constV(0.0); - } - } - - // compute E2=(E-E0) - dealii::VectorizedArray E2[dim][dim], S[dim][dim]; - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - // E2[i][j]= constV(0.5)*(ux[i][j]+ux[j][i])-( sfts1[i][j]*h1V + - // sfts2[i][j]*h2V + sfts3[i][j]*h3V); - E2[i][j] = constV(0.5) * (ux[i][j] + ux[j][i]) - - (sfts1[i][j] * h1V + sfts2[i][j] * h2V + sfts3[i][j] * h3V); - } - } - - // compute stress - // S=C*(E-E0) - dealii::VectorizedArray CIJ_combined[2 * dim - 1 + dim / 3] - [2 * dim - 1 + dim / 3]; - - if (n_dependent_stiffness == true) - { - dealii::VectorizedArray sum_hV; - sum_hV = h1V + h2V + h3V; - for (unsigned int i = 0; i < 2 * dim - 1 + dim / 3; i++) - { - for (unsigned int j = 0; j < 2 * dim - 1 + dim / 3; j++) - { - CIJ_combined[i][j] = - CIJ_list[0][i][j] * (constV(1.0) - sum_hV) + CIJ_list[1][i][j] * sum_hV; - } - } - computeStress(CIJ_combined, E2, S); - } - else - { - computeStress(CIJ_list[0], E2, S); - } - - scalarvalueType f_el = constV(0.0); - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - f_el += constV(0.5) * S[i][j] * E2[i][j]; - } - } - - total_energy_density = f_chem + f_grad + f_el; - - assembler_lock.acquire(); - for (unsigned i = 0; i < c.size(); i++) - { - // For some reason, some of the values in this loop - if (c[i] > 1.0e-10) - { - this->energy += total_energy_density[i] * JxW_value[i]; - this->energy_components[0] += f_chem[i] * JxW_value[i]; - this->energy_components[1] += f_grad[i] * JxW_value[i]; - this->energy_components[2] += f_el[i] * JxW_value[i]; - } - } - assembler_lock.release(); -} diff --git a/tests/deprecated_tests/order_of_accuracy_tests/time_ooa_test/run_time_ooa_test.py b/tests/deprecated_tests/order_of_accuracy_tests/time_ooa_test/run_time_ooa_test.py deleted file mode 100644 index 1b0a5df69..000000000 --- a/tests/deprecated_tests/order_of_accuracy_tests/time_ooa_test/run_time_ooa_test.py +++ /dev/null @@ -1,81 +0,0 @@ -import subprocess -import shutil -import glob -import math -import os.path - -# ---------------------------------------------------------------------------------------- -# Function that generates a header file for the simulation, compiles the PRISMS-PF code -# and runs the executable. -# ---------------------------------------------------------------------------------------- -def run_simulation(factor,run_name): - - timeIncrements = int(100*factor) - timeFinal = 100000000 - skipImplicitSolves = 10000000 - timeStep = 1.5e-4/factor - - text_file = open("time_parameters.h","w") - text_file.write("// Parameters list for the parameters involved in time stepping \n") - text_file.write("#define timeStep " + str(timeStep) + "\n") - text_file.write("#define timeIncrements " + str(timeIncrements) + "\n") - text_file.write("#define timeFinal " + str(timeFinal) + "\n") - text_file.write("#define skipImplicitSolves " + str(skipImplicitSolves) + "\n") - text_file.close() - - subprocess.call(["make", "release"]) - subprocess.call(["./main"]) - - subprocess.call(["mkdir",run_name]) - for output_files in glob.glob('*vtu'): - shutil.move(output_files,run_name) - -# ---------------------------------------------------------------------------------------- - -# If files exist from previous tests, delete them -if os.path.exists("run_001") == True: - shutil.rmtree("run_001") -if os.path.exists("run_002") == True: - shutil.rmtree("run_002") -if os.path.exists("run_003") == True: - shutil.rmtree("run_003") -if os.path.exists("run_004") == True: - shutil.rmtree("run_004") - -# Run simulations with a decreasing time step (and an corresponding increase in number of iterations) -run_simulation(1.0,'run_001') -run_simulation(2.0,'run_002') -run_simulation(4.0,'run_003') -run_simulation(16.0,'run_004') - -# Find the error for runs 1-3 (as compared to run 4) -subprocess.call(["visit", "-cli","-s","getError1.py"]) -subprocess.call(["visit", "-cli","-s","getError2.py"]) -subprocess.call(["visit", "-cli","-s","getError3.py"]) - -f = open('error1.txt','r') -error1 = float(f.read()) -f.close() - -f = open('error2.txt','r') -error2 = float(f.read()) -f.close() - -f = open('error3.txt','r') -error3 = float(f.read()) -f.close() - -# Calculate and output order of accuracy -ooa_1_to_2 = math.log10(error1/error2)/math.log10(2) -ooa_2_to_3 = math.log10(error2/error3)/math.log10(2) - -print "Order of accuracy results: \n" -print "Time step 1 to time step 2:", str(ooa_1_to_2), "\n" -print "Time step 2 to time step 3:", str(ooa_2_to_3), "\n" - -text_file = open("time_ooa_results.txt","w") -text_file.write("Results of standard temporal order of accuracy test: \n") -text_file.write("From time step 1 to time step 2: " + str(ooa_1_to_2) + "\n") -text_file.write("From time step 2 to time step 3: " + str(ooa_2_to_3) + "\n") -text_file.close() - diff --git a/tests/deprecated_tests/order_of_accuracy_tests/time_ooa_test/time_ooa_results.txt b/tests/deprecated_tests/order_of_accuracy_tests/time_ooa_test/time_ooa_results.txt deleted file mode 100644 index 6866d9f46..000000000 --- a/tests/deprecated_tests/order_of_accuracy_tests/time_ooa_test/time_ooa_results.txt +++ /dev/null @@ -1,3 +0,0 @@ -Results of standard temporal order of accuracy test: -From time step 1 to time step 2: 1.10208685907 -From time step 2 to time step 3: 1.22239242131 diff --git a/tests/deprecated_tests/order_of_accuracy_tests/time_ooa_test/time_parameters.h b/tests/deprecated_tests/order_of_accuracy_tests/time_ooa_test/time_parameters.h deleted file mode 100644 index c9408f5ec..000000000 --- a/tests/deprecated_tests/order_of_accuracy_tests/time_ooa_test/time_parameters.h +++ /dev/null @@ -1,5 +0,0 @@ -// Parameters list for the parameters involved in time stepping -#define timeStep 9.375e-06 -#define timeIncrements 1600 -#define timeFinal 100000000 -#define skipImplicitSolves 10000000 diff --git a/tests/deprecated_tests/order_of_accuracy_tests/time_ooa_test/visitlog.py b/tests/deprecated_tests/order_of_accuracy_tests/time_ooa_test/visitlog.py deleted file mode 100644 index 48c73e18f..000000000 --- a/tests/deprecated_tests/order_of_accuracy_tests/time_ooa_test/visitlog.py +++ /dev/null @@ -1,70 +0,0 @@ -# Visit 2.7.3 log file -ScriptVersion = "2.7.3" -if ScriptVersion != Version(): - print "This script is for VisIt %s. It may not work with version %s" % (ScriptVersion, Version()) -ShowAllWindows() -OpenDatabase("run_003/solution-0400.pvtu", 0) -# The UpdateDBPluginInfo RPC is not supported in the VisIt module so it will not be logged. -DefineScalarExpression("diff", "(c-pos_cmfe(, mesh,0))") -AddPlot("Pseudocolor", "diff", 1, 1) -PseudocolorAtts = PseudocolorAttributes() -PseudocolorAtts.scaling = PseudocolorAtts.Linear # Linear, Log, Skew -PseudocolorAtts.skewFactor = 1 -PseudocolorAtts.limitsMode = PseudocolorAtts.CurrentPlot # OriginalData, CurrentPlot -PseudocolorAtts.minFlag = 0 -PseudocolorAtts.min = 0 -PseudocolorAtts.maxFlag = 0 -PseudocolorAtts.max = 1 -PseudocolorAtts.centering = PseudocolorAtts.Natural # Natural, Nodal, Zonal -PseudocolorAtts.colorTableName = "hot" -PseudocolorAtts.invertColorTable = 0 -PseudocolorAtts.opacityType = PseudocolorAtts.FullyOpaque # ColorTable, FullyOpaque, Constant, Ramp, VariableRange -PseudocolorAtts.opacityVariable = "" -PseudocolorAtts.opacity = 1 -PseudocolorAtts.opacityVarMin = 0 -PseudocolorAtts.opacityVarMax = 1 -PseudocolorAtts.opacityVarMinFlag = 0 -PseudocolorAtts.opacityVarMaxFlag = 0 -PseudocolorAtts.pointSize = 0.05 -PseudocolorAtts.pointType = PseudocolorAtts.Point # Box, Axis, Icosahedron, Octahedron, Tetrahedron, SphereGeometry, Point, Sphere -PseudocolorAtts.pointSizeVarEnabled = 0 -PseudocolorAtts.pointSizeVar = "default" -PseudocolorAtts.pointSizePixels = 2 -PseudocolorAtts.lineType = PseudocolorAtts.Line # Line, Tube, Ribbon -PseudocolorAtts.lineStyle = PseudocolorAtts.SOLID # SOLID, DASH, DOT, DOTDASH -PseudocolorAtts.lineWidth = 0 -PseudocolorAtts.tubeDisplayDensity = 10 -PseudocolorAtts.tubeRadiusSizeType = PseudocolorAtts.FractionOfBBox # Absolute, FractionOfBBox -PseudocolorAtts.tubeRadiusAbsolute = 0.125 -PseudocolorAtts.tubeRadiusBBox = 0.005 -PseudocolorAtts.varyTubeRadius = 0 -PseudocolorAtts.varyTubeRadiusVariable = "" -PseudocolorAtts.varyTubeRadiusFactor = 10 -PseudocolorAtts.endPointType = PseudocolorAtts.None # None, Tails, Heads, Both -PseudocolorAtts.endPointStyle = PseudocolorAtts.Spheres # Spheres, Cones -PseudocolorAtts.endPointRadiusSizeType = PseudocolorAtts.FractionOfBBox # Absolute, FractionOfBBox -PseudocolorAtts.endPointRadiusAbsolute = 1 -PseudocolorAtts.endPointRadiusBBox = 0.005 -PseudocolorAtts.endPointRatio = 2 -PseudocolorAtts.renderSurfaces = 1 -PseudocolorAtts.renderWireframe = 0 -PseudocolorAtts.renderPoints = 0 -PseudocolorAtts.smoothingLevel = 0 -PseudocolorAtts.legendFlag = 1 -PseudocolorAtts.lightingFlag = 1 -SetPlotOptions(PseudocolorAtts) -AddOperator("Box", 1) -SetActivePlots(0) -BoxAtts = BoxAttributes() -BoxAtts.amount = BoxAtts.Some # Some, All -BoxAtts.minx = 0 -BoxAtts.maxx = 1 -BoxAtts.miny = 0 -BoxAtts.maxy = 1 -BoxAtts.minz = 0 -BoxAtts.maxz = 1 -BoxAtts.inverse = 0 -SetOperatorOptions(BoxAtts, 1) -SetActivePlots(0) -DrawPlots() -Query("MinMax", use_actual_data=1) diff --git a/tests/deprecated_tests/regression_tests/CMakeLists.txt b/tests/deprecated_tests/regression_tests/CMakeLists.txt deleted file mode 100644 index d123735f7..000000000 --- a/tests/deprecated_tests/regression_tests/CMakeLists.txt +++ /dev/null @@ -1,33 +0,0 @@ -## -# CMake script for the phaseField applications: -## - - -# Set the name of the project and target: -SET(TARGET "main") - -# Declare all source files the target consists of: -SET(TARGET_SRC - ${TARGET}.cc - # You can specify additional files here! - ) - -# Usually, you will not need to modify anything beyond this point... - -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8) - -FIND_PACKAGE(deal.II 8.0 QUIET - HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} - ) -IF(NOT ${deal.II_FOUND}) - MESSAGE(FATAL_ERROR "\n" - "*** Could not locate deal.II. ***\n\n" - "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n" - "or set an environment variable \"DEAL_II_DIR\" that contains this path." - ) -ENDIF() - - -DEAL_II_INITIALIZE_CACHED_VARIABLES() -PROJECT(${TARGET}) -DEAL_II_INVOKE_AUTOPILOT() diff --git a/tests/deprecated_tests/regression_tests/ICs_and_BCs.h b/tests/deprecated_tests/regression_tests/ICs_and_BCs.h deleted file mode 100644 index bd64a6f31..000000000 --- a/tests/deprecated_tests/regression_tests/ICs_and_BCs.h +++ /dev/null @@ -1,188 +0,0 @@ -// initial condition -template -class InitialCondition : public Function -{ -public: - unsigned int index; - Vector values; - - InitialCondition(const unsigned int _index) - : Function(1) - , index(_index) - { - std::srand(Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) + 1); - } - - double - value(const Point &p, const unsigned int component = 0) const - { - double scalar_IC = 0; - // ===================================================================== - // ENTER THE INITIAL CONDITIONS HERE FOR SCALAR FIELDS - // ===================================================================== - // Enter the function describing conditions for the fields at point "p". - // Use "if" statements to set the initial condition for each variable - // according to its variable index. - -#define x_denom 1.0 -#define y_denom 1.0 -#define z_denom 1.0 -#define initial_interface_coeff 1.0 -#define initial_radius 6.0 -#define avg_Nd 0.004 -#define c_matrix 0.004 - - if (index == 0) - { - // return the value of the initial concentration field at point p - double dx = spanX / ((double) subdivisionsX) / std::pow(2.0, refineFactor); - double dy = spanY / ((double) subdivisionsY) / std::pow(2.0, refineFactor); - double dz = spanZ / ((double) subdivisionsZ) / std::pow(2.0, refineFactor); - double r = 0.0; - // return 0.02 + 1.0e-3*(2*(0.5 - (double)(std::rand() % 100 )/100.0)); -#if problemDIM == 1 - r = p.operator()(0); - return 0.5 * (0.12 - 0.00) * (1 - std::tanh((r - spanX / 16.0) / (0.1 * dx))); -#elif problemDIM == 2 - - r = sqrt((p.operator()(0)) * (p.operator()(0)) / x_denom + - (p.operator()(1)) * (p.operator()(1)) / y_denom); - return 0.5 * (0.12 - avg_Nd) * - (1.0 - std::tanh((r - initial_radius) / (initial_interface_coeff))) + - avg_Nd; - -#elif problemDIM == 3 - - r = sqrt((p.operator()(0)) * (p.operator()(0)) / x_denom + - (p.operator()(1)) * (p.operator()(1)) / y_denom + - (p.operator()(2)) * (p.operator()(2)) / z_denom); - return 0.5 * (0.12 - avg_Nd) * - (1.0 - std::tanh((r - initial_radius) / (initial_interface_coeff))) + - avg_Nd; - -#endif - } - else if (index == 1) - { - // set result equal to the structural order paramter initial condition - double dx = spanX / ((double) subdivisionsX) / std::pow(2.0, refineFactor); - double dy = spanY / ((double) subdivisionsY) / std::pow(2.0, refineFactor); - double dz = spanZ / ((double) subdivisionsZ) / std::pow(2.0, refineFactor); - double r = 0.0; -#if problemDIM == 1 - r = p.operator()(0); - return 0.5 * (1.0 - std::tanh((r - spanX / 16.0) / (0.1 * dx))); -#elif problemDIM == 2 - - r = sqrt((p.operator()(0)) * (p.operator()(0)) / x_denom + - (p.operator()(1)) * (p.operator()(1)) / y_denom); - return 0.5 * (1.0 - std::tanh((r - initial_radius) / (initial_interface_coeff))); - -#elif problemDIM == 3 - // r=p.distance(Point(spanX/2.0,spanY/2.0,spanZ/2.0)); - // return 0.5*(1.0-std::tanh((r-spanX/8.0)/(3*dx))); - - r = sqrt((p.operator()(0)) * (p.operator()(0)) / x_denom + - (p.operator()(1)) * (p.operator()(1)) / y_denom + - (p.operator()(2)) * (p.operator()(2)) / z_denom); - return 0.5 * (1.0 - std::tanh((r - initial_radius) / (initial_interface_coeff))); - - // planar interface - // r=sqrt((p.operator()(2)-spanZ/2.0)*(p.operator()(2)-spanZ/2.0)); - // return 0.5*(1.0-std::tanh((r)/(initial_interface_coeff))); - // return - // 0.5*(1.0-std::tanh((r-initial_radius)/(initial_interface_coeff))); -#endif - return 0.0; - } - else if (index == 2) - { - scalar_IC = 0.0; - } - else if (index == 3) - { - scalar_IC = 0.0; - } - - // ===================================================================== - return scalar_IC; - } -}; - -// initial condition -template -class InitialConditionVec : public Function -{ -public: - unsigned int index; - - // Vector values; - InitialConditionVec(const unsigned int _index) - : Function(dim) - , index(_index) - { - std::srand(Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) + 1); - } - - void - vector_value(const Point &p, Vector &vector_IC) const - { - // ===================================================================== - // ENTER THE INITIAL CONDITIONS HERE FOR VECTOR FIELDS - // ===================================================================== - // Enter the function describing conditions for the fields at point "p". - // Use "if" statements to set the initial condition for each variable - // according to its variable index. - - if (index == 4) - { - vector_IC(0) = 0.0; - vector_IC(1) = 0.0; - if (dim == 3) - { - vector_IC(2) = 0.0; - } - } - // ===================================================================== - } -}; - -template -void -generalizedProblem::setBCs() -{ - // ===================================================================== - // ENTER THE BOUNDARY CONDITIONS HERE - // ===================================================================== - // This function sets the BCs for the problem variables - // The function "inputBCs" should be called for each component of - // each variable and should be in numerical order. Four input arguments - // set the same BC on the entire boundary. Two plus two times the - // number of dimensions inputs sets separate BCs on each face of the domain. - // Inputs to "inputBCs": - // First input: variable number - // Second input: component number - // Third input: BC type (options are "ZERO_DERIVATIVE" and "DIRICHLET") - // Fourth input: BC value (ignored unless the BC type is "DIRICHLET") - // Odd inputs after the third: BC type - // Even inputs after the third: BC value - // Face numbering: starts at zero with the minimum of the first direction, one - // for the maximum of the first direction - // two for the minimum of the second direction, etc. - inputBCs(0, 0, "ZERO_DERIVATIVE", 0); - - inputBCs(1, 0, "ZERO_DERIVATIVE", 0); - - inputBCs(2, 0, "ZERO_DERIVATIVE", 0); - - inputBCs(3, 0, "ZERO_DERIVATIVE", 0); - - inputBCs(4, 0, "DIRICHLET", 0.0); - inputBCs(4, 1, "DIRICHLET", 0.0); - if (dim == 3) - { - inputBCs(4, 2, "DIRICHLET", 0.0); - } - - // ===================================================================== -} diff --git a/tests/deprecated_tests/regression_tests/error.txt b/tests/deprecated_tests/regression_tests/error.txt deleted file mode 100644 index c8ea45f44..000000000 --- a/tests/deprecated_tests/regression_tests/error.txt +++ /dev/null @@ -1 +0,0 @@ -3.46944695195e-17 \ No newline at end of file diff --git a/tests/deprecated_tests/regression_tests/getError.py b/tests/deprecated_tests/regression_tests/getError.py deleted file mode 100644 index f3f2694f8..000000000 --- a/tests/deprecated_tests/regression_tests/getError.py +++ /dev/null @@ -1,35 +0,0 @@ -import sys - -variable_1 = 'c' -variable_2 = 'c' - -output_num_1 = "1000" -output_num_2 = "1000" - -directory_1 = "reference_solution/solution-"+output_num_1+".pvtu" -directory_2 = "run_001/solution-"+output_num_2+".pvtu" - - -OpenDatabase(directory_1) -DefineScalarExpression("diff","("+variable_1+"-pos_cmfe(<"+directory_2+":"+variable_2+">, mesh,0))") - - -#AddPlot("Contour","diff") -AddPlot("Pseudocolor","diff") - -PseudocolorAtts = PseudocolorAttributes() -PseudocolorAtts.limitsMode = PseudocolorAtts.CurrentPlot -SetPlotOptions(PseudocolorAtts) - - -DrawPlots() - -Query("MinMax", use_actual_data=1) -min_max_val = GetQueryOutputValue() -error = max(abs(min_max_val[0]),abs(min_max_val[1])) - -text_file = open("error.txt","w") -text_file.write(str(error)) -text_file.close() - -sys.exit() \ No newline at end of file diff --git a/tests/deprecated_tests/regression_tests/main.cc b/tests/deprecated_tests/regression_tests/main.cc deleted file mode 100644 index f9c3859e2..000000000 --- a/tests/deprecated_tests/regression_tests/main.cc +++ /dev/null @@ -1,53 +0,0 @@ -// Coupled Cahn-Hilliard, Allen-Cahn and Mechanics problem -// general headers -#include "../../include/dealIIheaders.h" - -// Coupled Cahn-Hilliard+Allen-Cahn+Mechanics problem headers -#include "ICs_and_BCs.h" -#include "parameters.h" -#include "residuals.h" - -#include "../../src/models/coupled/generalized_model.h" -#include "../../src/models/coupled/generalized_model_functions.h" - -// main -int -main(int argc, char **argv) -{ - Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, - argv, - numbers::invalid_unsigned_int); - try - { - deallog.depth_console(0); - generalizedProblem problem; - - problem.setBCs(); - problem.buildFields(); - problem.init(); - problem.solve(); - } - catch (std::exception &exc) - { - std::cerr << std::endl - << std::endl - << "----------------------------------------------------" << std::endl; - std::cerr << "Exception on processing: " << std::endl - << exc.what() << std::endl - << "Aborting!" << std::endl - << "----------------------------------------------------" << std::endl; - return 1; - } - catch (...) - { - std::cerr << std::endl - << std::endl - << "----------------------------------------------------" << std::endl; - std::cerr << "Unknown exception!" << std::endl - << "Aborting!" << std::endl - << "----------------------------------------------------" << std::endl; - return 1; - } - - return 0; -} diff --git a/tests/deprecated_tests/regression_tests/parameters.h b/tests/deprecated_tests/regression_tests/parameters.h deleted file mode 100644 index 4c4eb5531..000000000 --- a/tests/deprecated_tests/regression_tests/parameters.h +++ /dev/null @@ -1,104 +0,0 @@ -// Parameter list for the precipitate evolution example application -// All strictly numerical parameters should be set in this file - -// ================================================================================= -// Set the number of dimensions (1, 2, or 3 for a 1D, 2D, or 3D calculation) -// ================================================================================= -#define problemDIM 3 - -// ================================================================================= -// Set the length of the domain in all three dimensions -// ================================================================================= -// Each axes spans from zero to the specified length -#define spanX 8.0 -#define spanY 8.0 -#define spanZ 8.0 - -// ================================================================================= -// Set the element parameters -// ================================================================================= -// The number of elements in each direction is 2^(refineFactor) * subdivisions -// For optimal performance, use refineFactor primarily to determine the element -// size -#define subdivisionsX 1 -#define subdivisionsY 1 -#define subdivisionsZ 1 -#define refineFactor 4 - -// Set the polynomial degree of the element (suggested values: 1 or 2) -#define finiteElementDegree 1 - -// ================================================================================= -// Set the adaptive mesh refinement parameters -// ================================================================================= -// Set the flag determining if adaptive meshing is activated -#define hAdaptivity false - -// Set the maximum and minimum level of refinement -#define maxRefinementLevel (refineFactor) -#define minRefinementLevel (refineFactor - 2) - -// Set the fields used to determine the refinement. Fields determined by the -// order declared in "equations.h", starting at zero -#define refineCriterionFields \ - { \ - 1, 2, 3 \ - } - -// Set the maximum and minimum value of the fields where the mesh should be -// refined -#define refineWindowMax \ - { \ - 0.99, 0.99, 0.99 \ - } -#define refineWindowMin \ - { \ - 0.01, 0.01, 0.01 \ - } - -// Set the number of time steps between remeshing operations -#define skipRemeshingSteps 1000 - -// ================================================================================= -// Set the time step parameters -// ================================================================================= -// The size of the time step -#define timeStep 6.0e-4 -#define timeIncrements 1000 -#define timeFinal 100000000 - -// ================================================================================= -// Set the elliptic solver parameters -// ================================================================================= -// The solver type (currently the only recommended option is conjugate gradient) -#define solverType SolverCG - -// The flag that determines whether the tolerance for solver convergence should -// be an absolute tolerance (absTol=true) or a relative tolerance (absTol=false) -#define absTol false - -// The tolerance for convergence (L2 norm of the residual) -#define solverTolerance 1.0e-8 - -// The maximum number of solver iterations per time step -#define maxSolverIterations 10000 - -// ================================================================================= -// Set the output parameters -// ================================================================================= -// Each field in the problem will be output is writeOutput is set to "true" -#define writeOutput true - -// Type of spacing between outputs ("EQUAL_SPACING", "LOG_SPACING", or -// "N_PER_DECADE") -#define outputCondition "EQUAL_SPACING" - -// Number of times the program outputs the fields (total number for -// "EQUAL_SPACING" and "LOG_SPACING", number per decade for "N_PER_DECADE") -#define numOutputs 1 - -// ================================================================================= -// Set the flag determining if the total free energy is calculated for each -// output -// ================================================================================= -#define calcEnergy false diff --git a/tests/deprecated_tests/regression_tests/regress_test_results.txt b/tests/deprecated_tests/regression_tests/regress_test_results.txt deleted file mode 100644 index 0e783f293..000000000 --- a/tests/deprecated_tests/regression_tests/regress_test_results.txt +++ /dev/null @@ -1,177 +0,0 @@ -Results of the 3D regression test (2016-01-18 14:35): -Difference from reference: 3.46944695195e-17 -Result: Pass - -Results of the 3D regression test (2016-01-20 09:44): -Difference from reference: 3.46944695195e-17 -Result: Pass - -Results of the 3D regression test (2016-01-20 09:47): -Difference from reference: 3.46944695195e-17 -Result: Pass - -Results of the 3D regression test (2016-01-20 10:54): -Difference from reference: 3.46944695195e-17 -Result: Pass - -Results of the 3D regression test (2016-01-22 15:38): -Difference from reference: 3.46944695195e-17 -Result: Pass - -Results of the 3D regression test (2016-02-10 15:51): -Difference from reference: 3.46944695195e-17 -Result: Pass - -Results of the 3D regression test (2016-03-08 11:29): -Difference from reference: 7.4505806108e-09 -Result: Fail - -Results of the 3D regression test (2016-03-08 11:31): -Difference from reference: 3.46944695195e-17 -Result: Pass - -Results of the 3D regression test (2016-03-08 11:42): -Difference from reference: 7.4505806108e-09 -Result: Fail - -Results of the 3D regression test (2016-03-08 11:43): - -Difference from reference: 3.46944695195e-17 -Result: Pass - -Results of the 3D regression test (2016-03-22 14:28): -Difference from reference: 3.46944695195e-17 -Result: Pass - -Results of the 3D regression test (2016-04-04 08:05): -Difference from reference: 3.46944695195e-17 -Result: Pass - -Results of the 3D regression test (2016-04-04 08:21): -Difference from reference: 0.146397091448 -Result: Fail - -Results of the 3D regression test (2016-04-04 08:35): -Difference from reference: 0.146397091448 -Result: Fail - -Results of the 3D regression test (2016-04-04 08:37): -Difference from reference: 3.46944695195e-17 -Result: Pass - -Results of the 3D regression test (2016-04-12 11:39): -Difference from reference: 0.146397091448 -Result: Fail - -Results of the 3D regression test (2016-04-12 11:40): -Difference from reference: 3.46944695195e-17 -Result: Pass - -Results of the 3D regression test (2016-04-12 14:20): -Difference from reference: 3.46944695195e-17 -Result: Pass - -Results of the 3D regression test (2016-04-15 10:17): -Difference from reference: 0.146397091448 -Result: Fail - -Results of the 3D regression test (2016-04-15 10:19): -Difference from reference: 3.46944695195e-17 -Result: Pass - -Results of the 3D regression test (2016-04-15 10:22): -Difference from reference: 3.46944695195e-17 -Result: Pass - -Results of the 3D regression test (2016-04-15 10:23): -Difference from reference: 3.46944695195e-17 -Result: Pass - -Results of the 3D regression test (2016-06-07 10:36): -Difference from reference: 3.46944695195e-17 -Result: Pass - -Results of the 3D regression test (2016-06-07 10:55): -Difference from reference: 3.46944695195e-17 -Result: Pass - -Results of the 3D regression test (2016-06-28 11:43): -Difference from reference: 3.46944695195e-17 -Result: Pass - -Results of the 3D regression test (2016-08-13 19:07): -Difference from reference: 3.46944695195e-17 -Result: Pass - -Results of the 3D regression test (2016-09-29 10:29): -Difference from reference: 3.46944695195e-17 -Result: Pass - -Results of the 3D regression test (2016-10-10 16:18): -Difference from reference: 3.46944695195e-17 -Result: Pass - -Results of the 3D regression test (2016-10-12 12:51): -Difference from reference: 3.46944695195e-17 -Result: Pass - -Results of the 3D regression test (2017-01-11 11:36): -Difference from reference: 3.46944695195e-17 -Result: Pass - -Results of the 3D regression test (2017-01-13 16:15): -Difference from reference: 3.46944695195e-17 -Result: Pass - -Results of the 3D regression test (2017-01-16 14:59): -Difference from reference: 3.46944695195e-17 -Result: Pass - -Results of the 3D regression test (2017-01-24 12:45): -Difference from reference: 3.46944695195e-17 -Result: Pass - -Results of the 3D regression test (2017-01-27 13:46): -Difference from reference: 3.46944695195e-17 -Result: Pass - -Results of the 3D regression test (2017-01-27 13:47): -Difference from reference: 3.46944695195e-17 -Result: Pass - -Results of the 3D regression test (2017-01-27 14:02): -Difference from reference: 3.46944695195e-17 -Result: Pass - -Results of the 3D regression test (2017-01-27 14:15): -Difference from reference: 3.46944695195e-17 -Result: Pass - -Results of the 3D regression test (2017-01-27 14:29): -Difference from reference: 3.46944695195e-17 -Result: Pass - -Results of the 3D regression test (2017-01-27 16:22): -Difference from reference: 3.46944695195e-17 -Result: Pass - -Results of the 3D regression test (2017-01-30 08:54): -Difference from reference: 3.46944695195e-17 -Result: Pass - -Results of the 3D regression test (2017-01-30 11:33): -Difference from reference: 3.46944695195e-17 -Result: Pass - -Results of the 3D regression test (2017-01-30 11:54): -Difference from reference: 3.46944695195e-17 -Result: Pass - -Results of the 3D regression test (2017-01-30 12:54): -Difference from reference: 3.46944695195e-17 -Result: Pass - -Results of the 3D regression test (2017-01-30 13:46): -Difference from reference: 3.46944695195e-17 -Result: Pass - diff --git a/tests/deprecated_tests/regression_tests/residuals.h b/tests/deprecated_tests/regression_tests/residuals.h deleted file mode 100644 index ff76a2d3f..000000000 --- a/tests/deprecated_tests/regression_tests/residuals.h +++ /dev/null @@ -1,683 +0,0 @@ -// List of variables and residual equations for the Precipitate Evolution -// example application - -// ================================================================================= -// Define the variables in the model -// ================================================================================= -// The number of variables -#define num_var 5 - -// The names of the variables, whether they are scalars or vectors and whether -// the governing eqn for the variable is parabolic or elliptic -#define variable_name \ - { \ - "c", "n1", "n2", "n3", "u" \ - } -#define variable_type \ - { \ - "SCALAR", "SCALAR", "SCALAR", "SCALAR", "VECTOR" \ - } -#define variable_eq_type \ - { \ - "PARABOLIC", "PARABOLIC", "PARABOLIC", "PARABOLIC", "ELLIPTIC" \ - } - -// Flags for whether the value, gradient, and Hessian are needed in the residual -// eqns -#define need_val \ - { \ - true, true, true, true, false \ - } -#define need_grad \ - { \ - true, true, true, true, true \ - } -#define need_hess \ - { \ - false, false, false, false, false \ - } - -// Flags for whether the residual equation has a term multiplied by the test -// function (need_val_residual) and/or the gradient of the test function -// (need_grad_residual) -#define need_val_residual \ - { \ - true, true, true, true, false \ - } -#define need_grad_residual \ - { \ - true, true, true, true, true \ - } - -// Flags for whether the value, gradient, and Hessian are needed in the residual -// eqn for the left-hand-side of the iterative solver for elliptic equations -#define need_val_LHS \ - { \ - false, true, true, true, false \ - } -#define need_grad_LHS \ - { \ - false, false, false, false, true \ - } -#define need_hess_LHS \ - { \ - false, false, false, false, false \ - } - -// Flags for whether the residual equation for the left-hand-side of the -// iterative solver for elliptic equations has a term multiplied by the test -// function (need_val_residual) and/or the gradient of the test function -// (need_grad_residual) -#define need_val_residual_LHS \ - { \ - false, false, false, false, false \ - } -#define need_grad_residual_LHS \ - { \ - false, false, false, false, true \ - } - -// ================================================================================= -// Define the model parameters and the residual equations -// ================================================================================= -// Parameters in the residual equations and expressions for the residual -// equations can be set here. For simple cases, the entire residual equation can -// be written here. For more complex cases with loops or conditional statements, -// residual equations (or parts of residual equations) can be written below in -// "residualRHS". - -// Cahn-Hilliard mobility -#define McV 1.0 - -// Allen-Cahn mobilities -#define Mn1V 50.0 -#define Mn2V 50.0 -#define Mn3V 50.0 - -// Gradient energy coefficients -double Kn1[3][3] = { - {1.0, 0, 0 }, - {0, 0.5, 0 }, - {0, 0, 1.0} -}; -double Kn2[3][3] = { - {1.0, 0, 0 }, - {0, 0.5, 0 }, - {0, 0, 1.0} -}; -double Kn3[3][3] = { - {1.0, 0, 0 }, - {0, 0.5, 0 }, - {0, 0, 1.0} -}; - -// define energy barrier coefficient (used to tune the interfacial energy) -#define W -1.0 - -// Define mechanical properties -#define n_dependent_stiffness false -// Mechanical symmetry of the material and stiffness parameters -// If n_dependent_stiffness == false the first entry is used for all phases -#define MaterialModels \ - { \ - { \ - "ANISOTROPIC" \ - } \ - } -#define MaterialConstants \ - { \ - { \ - 31.3, 31.3, 32.45, 6.65, 6.65, 9.15, 13.0, 10.45, 0, 0, 0, 10.45, 0, 0, 0, 0, 0, \ - 0, 0, 0, 0 \ - } \ - } - -// Stress-free transformation strains -// Linear fits for the stress-free transformation strains in for sfts = -// sfts_linear * c + sfts_const -double sfts_linear1[3][3] = { - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0} -}; -double sfts_const1[3][3] = { - {0.1305, 0, 0 }, - {0, -0.0152, 0 }, - {0, 0, -0.014} -}; // Mg-Nd beta-prime - -double sfts_linear2[3][3] = { - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0} -}; -double sfts_const2[3][3] = { - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0} -}; - -double sfts_linear3[3][3] = { - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0} -}; -double sfts_const3[3][3] = { - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0} -}; - -// Free energy expressions -#define faV (24.7939 * c * c - 1.6752 * c - 1.9453e-06) -#define facV (49.5878 * c - 1.6752) -#define faccV (49.5878) -#define fbV (37.9316 * c * c - 10.7373 * c + 0.5401) -#define fbcV (75.8633 * c - 10.7373) -#define fbccV (75.8633) -#define h1V (3.0 * n1 * n1 - 2.0 * n1 * n1 * n1) -#define h2V (3.0 * n2 * n2 - 2.0 * n2 * n2 * n2) -#define h3V (3.0 * n3 * n3 - 2.0 * n3 * n3 * n3) -#define hn1V (6.0 * n1 - 6.0 * n1 * n1) -#define hn2V (6.0 * n2 - 6.0 * n2 * n2) -#define hn3V (6.0 * n3 - 6.0 * n3 * n3) - -// This double-well function can be used to tune the interfacial energy -#define fbarrierV (n1 * n1 - 2.0 * n1 * n1 * n1 + n1 * n1 * n1 * n1) -#define fbarriernV (2.0 * n1 - 6.0 * n1 * n1 + 4.0 * n1 * n1 * n1) - -// Residuals -#define rcV (c) -#define rcxTemp \ - (cx * ((1.0 - h1V - h2V - h3V) * faccV + (h1V + h2V + h3V) * fbccV) + \ - n1x * ((fbcV - facV) * hn1V) + n2x * ((fbcV - facV) * hn2V) + \ - n3x * ((fbcV - facV) * hn3V)) -#define rcxV (constV(-timeStep * McV) * rcxTemp) - -#define rn1V \ - (n1 - constV(timeStep * Mn1V) * \ - ((fbV - faV) * hn1V + W * fbarriernV + nDependentMisfitAC1)) -#define rn2V (n2 - constV(timeStep * Mn2V) * ((fbV - faV) * hn2V)) -#define rn3V (n3 - constV(timeStep * Mn3V) * ((fbV - faV) * hn3V)) -#define rn1xV (constV(-timeStep * Mn1V) * Knx1) -#define rn2xV (constV(-timeStep * Mn2V) * Knx2) -#define rn3xV (constV(-timeStep * Mn3V) * Knx3) - -// ================================================================================= -// residualRHS -// ================================================================================= -// This function calculates the residual equations for each variable. It takes -// "modelVariablesList" as an input, which is a list of the value and -// derivatives of each of the variables at a specific quadrature point. The -// (x,y,z) location of that quadrature point is given by "q_point_loc". The -// function outputs "modelResidualsList", a list of the value and gradient terms -// of the residual for each residual equation. The index for each variable in -// these lists corresponds to the order it is defined at the top of this file -// (starting at 0). -template -void -generalizedProblem::residualRHS( - const std::vector> &modelVariablesList, - std::vector> &modelResidualsList, - dealii::Point> q_point_loc) const -{ - // The concentration and its derivatives (names here should match those in the - // macros above) - scalarvalueType c = modelVariablesList[0].scalarValue; - scalargradType cx = modelVariablesList[0].scalarGrad; - - // The first order parameter and its derivatives (names here should match - // those in the macros above) - scalarvalueType n1 = modelVariablesList[1].scalarValue; - scalargradType n1x = modelVariablesList[1].scalarGrad; - - // The second order parameter and its derivatives (names here should match - // those in the macros above) - scalarvalueType n2 = modelVariablesList[2].scalarValue; - scalargradType n2x = modelVariablesList[2].scalarGrad; - - // The third order parameter and its derivatives (names here should match - // those in the macros above) - scalarvalueType n3 = modelVariablesList[3].scalarValue; - scalargradType n3x = modelVariablesList[3].scalarGrad; - - // The derivative of the displacement vector (names here should match those in - // the macros above) - vectorgradType ux = modelVariablesList[4].vectorGrad; - vectorgradType ruxV; - - vectorhessType uxx; - - if (c_dependent_misfit == true) - { - uxx = modelVariablesList[4].vectorHess; - } - - // Calculate the stress-free transformation strain and its derivatives at the - // quadrature point - dealii::Tensor<2, problemDIM, dealii::VectorizedArray> sfts1, sfts1c, sfts1cc, - sfts2, sfts2c, sfts2cc, sfts3, sfts3c, sfts3cc; - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - // Polynomial fits for the stress-free transformation strains, of the - // form: sfts = a_p * c + b_p - sfts1[i][j] = constV(sfts_linear1[i][j]) * c + constV(sfts_const1[i][j]); - sfts1c[i][j] = constV(sfts_linear1[i][j]); - sfts1cc[i][j] = constV(0.0); - - // Polynomial fits for the stress-free transformation strains, of the - // form: sfts = a_p * c + b_p - sfts2[i][j] = constV(sfts_linear2[i][j]) * c + constV(sfts_const2[i][j]); - sfts2c[i][j] = constV(sfts_linear1[i][j]); - sfts2cc[i][j] = constV(0.0); - - // Polynomial fits for the stress-free transformation strains, of the - // form: sfts = a_p * c + b_p - sfts3[i][j] = constV(sfts_linear3[i][j]) * c + constV(sfts_const3[i][j]); - sfts3c[i][j] = constV(sfts_linear3[i][j]); - sfts3cc[i][j] = constV(0.0); - } - } - - // compute E2=(E-E0) - dealii::VectorizedArray E2[dim][dim], S[dim][dim]; - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - E2[i][j] = constV(0.5) * (ux[i][j] + ux[j][i]) - - (sfts1[i][j] * h1V + sfts2[i][j] * h2V + sfts3[i][j] * h3V); - } - } - - // compute stress - // S=C*(E-E0) - // Compute stress tensor (which is equal to the residual, Rux) - dealii::VectorizedArray CIJ_combined[CIJ_tensor_size][CIJ_tensor_size]; - - if (n_dependent_stiffness == true) - { - dealii::VectorizedArray sum_hV; - sum_hV = h1V + h2V + h3V; - for (unsigned int i = 0; i < 2 * dim - 1 + dim / 3; i++) - { - for (unsigned int j = 0; j < 2 * dim - 1 + dim / 3; j++) - { - CIJ_combined[i][j] = - CIJ_list[0][i][j] * (constV(1.0) - sum_hV) + CIJ_list[1][i][j] * sum_hV; - } - } - computeStress(CIJ_combined, E2, S); - } - else - { - computeStress(CIJ_list[0], E2, S); - } - - // Fill residual corresponding to mechanics - // R=-C*(E-E0) - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - ruxV[i][j] = -S[i][j]; - } - } - - // Compute one of the stress terms in the order parameter chemical potential, - // nDependentMisfitACp = C*(E-E0)*(E0_p*Hn) - dealii::VectorizedArray nDependentMisfitAC1 = constV(0.0); - dealii::VectorizedArray nDependentMisfitAC2 = constV(0.0); - dealii::VectorizedArray nDependentMisfitAC3 = constV(0.0); - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - nDependentMisfitAC1 += S[i][j] * (sfts1[i][j]); - nDependentMisfitAC2 += S[i][j] * (sfts2[i][j]); - nDependentMisfitAC3 += S[i][j] * (sfts3[i][j]); - } - } - - nDependentMisfitAC1 *= -hn1V; - nDependentMisfitAC2 *= -hn2V; - nDependentMisfitAC3 *= -hn3V; - - // Compute the other stress term in the order parameter chemical potential, - // heterMechACp = 0.5*Hn*(C_beta-C_alpha)*(E-E0)*(E-E0) - dealii::VectorizedArray heterMechAC1 = constV(0.0); - dealii::VectorizedArray heterMechAC2 = constV(0.0); - dealii::VectorizedArray heterMechAC3 = constV(0.0); - dealii::VectorizedArray S2[dim][dim]; - - if (n_dependent_stiffness == true) - { - // computeStress(CIJ_diff, E2, S2); - computeStress(CIJ_list[1] - CIJ_list[0], E2, S2); - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - heterMechAC1 += S2[i][j] * E2[i][j]; - } - } - // Aside from HnpV, heterMechAC1, heterMechAC2, and heterMechAC3 are equal - heterMechAC2 = 0.5 * hn2V * heterMechAC1; - heterMechAC3 = 0.5 * hn3V * heterMechAC1; - - heterMechAC1 = 0.5 * hn1V * heterMechAC1; - } - - // compute the stress term in the gradient of the concentration chemical - // potential, grad_mu_el = [C*(E-E0)*E0c]x, must be a vector with length dim - scalargradType grad_mu_el; - - if (c_dependent_misfit == true) - { - dealii::VectorizedArray E3[dim][dim], S3[dim][dim]; - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - E3[i][j] = -(sfts1c[i][j] * h1V + sfts2c[i][j] * h2V + sfts3c[i][j] * h3V); - } - } - - if (n_dependent_stiffness == true) - { - computeStress(CIJ_combined, E3, S3); - } - else - { - computeStress(CIJ_list[0], E3, S3); - } - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - for (unsigned int k = 0; k < dim; k++) - { - grad_mu_el[k] += - S3[i][j] * - (constV(0.5) * (uxx[i][j][k] + uxx[j][i][k]) + E3[i][j] * cx[k] - - (sfts1[i][j] * hn1V * n1x[k] + sfts2[i][j] * hn2V * n2x[k] + - sfts3[i][j] * hn3V * n3x[k])); - - grad_mu_el[k] += - -S[i][j] * - (sfts1c[i][j] * hn1V * n1x[k] + sfts2c[i][j] * hn2V * n2x[k] + - sfts3c[i][j] * hn3V * n3x[k] + - (sfts1cc[i][j] * h1V + sfts2cc[i][j] * h2V + sfts3cc[i][j] * h3V) * - cx[k]); - - if (n_dependent_stiffness == true) - { - grad_mu_el[k] += -S2[i][j] * (sfts1c[i][j] * hn1V * n1x[k] + - sfts2c[i][j] * hn2V * n2x[k] + - sfts3c[i][j] * hn3V * n3x[k]); - } - } - } - } - } - - // compute K*nx - scalargradType Knx1, Knx2, Knx3; - for (unsigned int a = 0; a < dim; a++) - { - Knx1[a] = 0.0; - Knx2[a] = 0.0; - Knx3[a] = 0.0; - for (unsigned int b = 0; b < dim; b++) - { - Knx1[a] += constV(Kn1[a][b]) * n1x[b]; - Knx2[a] += constV(Kn2[a][b]) * n2x[b]; - Knx3[a] += constV(Kn3[a][b]) * n3x[b]; - } - } - - modelResidualsList[0].scalarValueResidual = rcV; - modelResidualsList[0].scalarGradResidual = rcxV; - - modelResidualsList[1].scalarValueResidual = rn1V; - modelResidualsList[1].scalarGradResidual = rn1xV; - - modelResidualsList[2].scalarValueResidual = rn2V; - modelResidualsList[2].scalarGradResidual = rn2xV; - - modelResidualsList[3].scalarValueResidual = rn3V; - modelResidualsList[3].scalarGradResidual = rn3xV; - - modelResidualsList[4].vectorGradResidual = ruxV; -} - -// ================================================================================= -// residualLHS (needed only if at least one equation is elliptic) -// ================================================================================= -// This function calculates the residual equations for the iterative solver for -// elliptic equations.for each variable. It takes "modelVariablesList" as an -// input, which is a list of the value and derivatives of each of the variables -// at a specific quadrature point. The (x,y,z) location of that quadrature point -// is given by "q_point_loc". The function outputs "modelRes", the value and -// gradient terms of for the left-hand-side of the residual equation for the -// iterative solver. The index for each variable in these lists corresponds to -// the order it is defined at the top of this file (starting at 0), not counting -// variables that have "need_val_LHS", "need_grad_LHS", and "need_hess_LHS" all -// set to "false". If there are multiple elliptic equations, conditional -// statements should be used to ensure that the correct residual is being -// submitted. The index of the field being solved can be accessed by -// "this->currentFieldIndex". -template -void -generalizedProblem::residualLHS( - const std::vector> &modelVariablesList, - modelResidual &modelRes, - dealii::Point> q_point_loc) const -{ - // n1 - scalarvalueType n1 = modelVariablesList[0].scalarValue; - - // n2 - scalarvalueType n2 = modelVariablesList[1].scalarValue; - - // n3 - scalarvalueType n3 = modelVariablesList[2].scalarValue; - - // u - vectorgradType ux = modelVariablesList[3].vectorGrad; - vectorgradType ruxV; - - // Take advantage of E being simply 0.5*(ux + transpose(ux)) and use the - // dealii "symmetrize" function - dealii::Tensor<2, dim, dealii::VectorizedArray> E; - E = symmetrize(ux); - - // Compute stress tensor (which is equal to the residual, Rux) - if (n_dependent_stiffness == true) - { - dealii::Tensor<2, CIJ_tensor_size, dealii::VectorizedArray> CIJ_combined; - CIJ_combined = - CIJ_list[0] * (constV(1.0) - h1V - h2V - h3V) + CIJ_list[1] * (h1V + h2V + h3V); - - computeStress(CIJ_combined, E, ruxV); - } - else - { - computeStress(CIJ_list[0], E, ruxV); - } - - modelRes.vectorGradResidual = ruxV; -} - -// ================================================================================= -// energyDensity (needed only if calcEnergy == true) -// ================================================================================= -// This function integrates the free energy density across the computational -// domain. It takes "modelVariablesList" as an input, which is a list of the -// value and derivatives of each of the variables at a specific quadrature -// point. It also takes the mapped quadrature weight, "JxW_value", as an input. -// The (x,y,z) location of the quadrature point is given by "q_point_loc". The -// weighted value of the energy density is added to "energy" variable and the -// components of the energy density are added to the "energy_components" -// variable (index 0: chemical energy, index 1: gradient energy, index 2: -// elastic energy). -template -void -generalizedProblem::energyDensity( - const std::vector> &modelVarList, - const dealii::VectorizedArray &JxW_value, - dealii::Point> q_point_loc) -{ - scalarvalueType total_energy_density = constV(0.0); - - // c - scalarvalueType c = modelVarList[0].scalarValue; - scalargradType cx = modelVarList[0].scalarGrad; - - // n1 - scalarvalueType n1 = modelVarList[1].scalarValue; - scalargradType n1x = modelVarList[1].scalarGrad; - - // n2 - scalarvalueType n2 = modelVarList[2].scalarValue; - scalargradType n2x = modelVarList[2].scalarGrad; - - // n3 - scalarvalueType n3 = modelVarList[3].scalarValue; - scalargradType n3x = modelVarList[3].scalarGrad; - - // u - vectorgradType ux = modelVarList[4].vectorGrad; - - scalarvalueType f_chem = - (constV(1.0) - (h1V + h2V + h3V)) * faV + (h1V + h2V + h3V) * fbV; - - scalarvalueType f_grad = constV(0.0); - - for (int i = 0; i < dim; i++) - { - for (int j = 0; j < dim; j++) - { - f_grad += constV(0.5 * Kn1[i][j]) * n1x[i] * n1x[j]; - } - } -#if num_sop > 1 - for (int i = 0; i < dim; i++) - { - for (int j = 0; j < dim; j++) - { - f_grad += constV(0.5 * Kn2[i][j]) * n2x[i] * n2x[j]; - } - } -#endif -#if num_sop > 2 - for (int i = 0; i < dim; i++) - { - for (int j = 0; j < dim; j++) - { - f_grad += constV(0.5 * Kn3[i][j]) * n3x[i] * n3x[j]; - } - } -#endif - - // Calculate the stress-free transformation strain and its derivatives at the - // quadrature point - dealii::Tensor<2, problemDIM, dealii::VectorizedArray> sfts1, sfts1c, sfts1cc, - sfts2, sfts2c, sfts2cc, sfts3, sfts3c, sfts3cc; - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - // Polynomial fits for the stress-free transformation strains, of the - // form: sfts = a_p * c + b_p - sfts1[i][j] = constV(sfts_linear1[i][j]) * c + constV(sfts_const1[i][j]); - sfts1c[i][j] = constV(sfts_linear1[i][j]); - sfts1cc[i][j] = constV(0.0); - - // Polynomial fits for the stress-free transformation strains, of the - // form: sfts = a_p * c + b_p - sfts2[i][j] = constV(sfts_linear2[i][j]) * c + constV(sfts_const2[i][j]); - sfts2c[i][j] = constV(sfts_linear1[i][j]); - sfts2cc[i][j] = constV(0.0); - - // Polynomial fits for the stress-free transformation strains, of the - // form: sfts = a_p * c + b_p - sfts3[i][j] = constV(sfts_linear3[i][j]) * c + constV(sfts_const3[i][j]); - sfts3c[i][j] = constV(sfts_linear3[i][j]); - sfts3cc[i][j] = constV(0.0); - } - } - - // compute E2=(E-E0) - dealii::VectorizedArray E2[dim][dim], S[dim][dim]; - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - // E2[i][j]= constV(0.5)*(ux[i][j]+ux[j][i])-( sfts1[i][j]*h1V + - // sfts2[i][j]*h2V + sfts3[i][j]*h3V); - E2[i][j] = constV(0.5) * (ux[i][j] + ux[j][i]) - - (sfts1[i][j] * h1V + sfts2[i][j] * h2V + sfts3[i][j] * h3V); - } - } - - // compute stress - // S=C*(E-E0) - dealii::VectorizedArray CIJ_combined[2 * dim - 1 + dim / 3] - [2 * dim - 1 + dim / 3]; - - if (n_dependent_stiffness == true) - { - dealii::VectorizedArray sum_hV; - sum_hV = h1V + h2V + h3V; - for (unsigned int i = 0; i < 2 * dim - 1 + dim / 3; i++) - { - for (unsigned int j = 0; j < 2 * dim - 1 + dim / 3; j++) - { - CIJ_combined[i][j] = - CIJ_list[0][i][j] * (constV(1.0) - sum_hV) + CIJ_list[1][i][j] * sum_hV; - } - } - computeStress(CIJ_combined, E2, S); - } - else - { - computeStress(CIJ_list[0], E2, S); - } - - scalarvalueType f_el = constV(0.0); - - for (unsigned int i = 0; i < dim; i++) - { - for (unsigned int j = 0; j < dim; j++) - { - f_el += constV(0.5) * S[i][j] * E2[i][j]; - } - } - - total_energy_density = f_chem + f_grad + f_el; - - assembler_lock.acquire(); - for (unsigned i = 0; i < c.size(); i++) - { - // For some reason, some of the values in this loop - if (c[i] > 1.0e-10) - { - this->energy += total_energy_density[i] * JxW_value[i]; - this->energy_components[0] += f_chem[i] * JxW_value[i]; - this->energy_components[1] += f_grad[i] * JxW_value[i]; - this->energy_components[2] += f_el[i] * JxW_value[i]; - } - } - assembler_lock.release(); -} diff --git a/tests/deprecated_tests/regression_tests/run_regression_test.py b/tests/deprecated_tests/regression_tests/run_regression_test.py deleted file mode 100644 index 0adbc1aa6..000000000 --- a/tests/deprecated_tests/regression_tests/run_regression_test.py +++ /dev/null @@ -1,50 +0,0 @@ -import subprocess -import shutil -import glob -import math -import os.path -import datetime - -# ---------------------------------------------------------------------------------------- -# Function that generates a header file for the simulation, compiles the PRISMS-PF code -# and runs the executable. -# ---------------------------------------------------------------------------------------- -def run_simulation(run_name): - - subprocess.call(["make", "release"]) - #subprocess.call(["./main"]) - subprocess.call(["mpirun", "-n", "4", "main"]) - - subprocess.call(["mkdir",run_name]) - for output_files in glob.glob('*vtu'): - shutil.move(output_files,run_name) - -# ---------------------------------------------------------------------------------------- - -# If files exist from previous tests, delete them -if os.path.exists("run_001") == True: - shutil.rmtree("run_001") - -# Run simulation comparison simulation -run_simulation('run_001') - -# Find the error for runs 1 compared to the reference solution -subprocess.call(["visit", "-cli","-s","getError.py"]) - -f = open('error.txt','r') -error = float(f.read()) -f.close() - -print "Regression test results: \n" -print "Difference between calculated result and reference result:", str(error), "\n" - -text_file = open("regress_test_results.txt","a") -now = datetime.datetime.now() -text_file.write("Results of the 3D regression test (" + now.strftime("%Y-%m-%d %H:%M") + "): \n") -text_file.write("Difference from reference: " + str(error) + "\n") -if error < 1e-10: - text_file.write("Result: Pass \n \n") -else: - text_file.write("Result: Fail \n \n") -text_file.close() - diff --git a/tests/deprecated_tests/regression_tests/visitlog.py b/tests/deprecated_tests/regression_tests/visitlog.py deleted file mode 100644 index 697b9ce29..000000000 --- a/tests/deprecated_tests/regression_tests/visitlog.py +++ /dev/null @@ -1,63 +0,0 @@ -# Visit 2.11.0 log file -ScriptVersion = "2.11.0" -if ScriptVersion != Version(): - print "This script is for VisIt %s. It may not work with version %s" % (ScriptVersion, Version()) -ShowAllWindows() -OpenDatabase("reference_solution/solution-1000.pvtu", 0) -# The UpdateDBPluginInfo RPC is not supported in the VisIt module so it will not be logged. -DefineScalarExpression("diff", "(c-pos_cmfe(, mesh,0))") -AddPlot("Pseudocolor", "diff", 1, 1) -PseudocolorAtts = PseudocolorAttributes() -PseudocolorAtts.scaling = PseudocolorAtts.Linear # Linear, Log, Skew -PseudocolorAtts.skewFactor = 1 -PseudocolorAtts.limitsMode = PseudocolorAtts.CurrentPlot # OriginalData, CurrentPlot -PseudocolorAtts.minFlag = 0 -PseudocolorAtts.min = 0 -PseudocolorAtts.maxFlag = 0 -PseudocolorAtts.max = 1 -PseudocolorAtts.centering = PseudocolorAtts.Natural # Natural, Nodal, Zonal -PseudocolorAtts.colorTableName = "hot" -PseudocolorAtts.invertColorTable = 0 -PseudocolorAtts.opacityType = PseudocolorAtts.FullyOpaque # ColorTable, FullyOpaque, Constant, Ramp, VariableRange -PseudocolorAtts.opacityVariable = "" -PseudocolorAtts.opacity = 1 -PseudocolorAtts.opacityVarMin = 0 -PseudocolorAtts.opacityVarMax = 1 -PseudocolorAtts.opacityVarMinFlag = 0 -PseudocolorAtts.opacityVarMaxFlag = 0 -PseudocolorAtts.pointSize = 0.05 -PseudocolorAtts.pointType = PseudocolorAtts.Point # Box, Axis, Icosahedron, Octahedron, Tetrahedron, SphereGeometry, Point, Sphere -PseudocolorAtts.pointSizeVarEnabled = 0 -PseudocolorAtts.pointSizeVar = "default" -PseudocolorAtts.pointSizePixels = 2 -PseudocolorAtts.lineStyle = PseudocolorAtts.SOLID # SOLID, DASH, DOT, DOTDASH -PseudocolorAtts.lineType = PseudocolorAtts.Line # Line, Tube, Ribbon -PseudocolorAtts.lineWidth = 0 -PseudocolorAtts.tubeResolution = 10 -PseudocolorAtts.tubeRadiusSizeType = PseudocolorAtts.FractionOfBBox # Absolute, FractionOfBBox -PseudocolorAtts.tubeRadiusAbsolute = 0.125 -PseudocolorAtts.tubeRadiusBBox = 0.005 -PseudocolorAtts.tubeRadiusVarEnabled = 0 -PseudocolorAtts.tubeRadiusVar = "" -PseudocolorAtts.tubeRadiusVarRatio = 10 -PseudocolorAtts.endPointType = PseudocolorAtts.None # None, Heads, Tails, Both -PseudocolorAtts.endPointStyle = PseudocolorAtts.Spheres # Spheres, Cones -PseudocolorAtts.endPointRadiusSizeType = PseudocolorAtts.FractionOfBBox # Absolute, FractionOfBBox -PseudocolorAtts.endPointRadiusAbsolute = 0.125 -PseudocolorAtts.endPointRadiusBBox = 0.05 -PseudocolorAtts.endPointResolution = 10 -PseudocolorAtts.endPointRatio = 5 -PseudocolorAtts.endPointRadiusVarEnabled = 0 -PseudocolorAtts.endPointRadiusVar = "" -PseudocolorAtts.endPointRadiusVarRatio = 10 -PseudocolorAtts.renderSurfaces = 1 -PseudocolorAtts.renderWireframe = 0 -PseudocolorAtts.renderPoints = 0 -PseudocolorAtts.smoothingLevel = 0 -PseudocolorAtts.legendFlag = 1 -PseudocolorAtts.lightingFlag = 1 -PseudocolorAtts.wireframeColor = (0, 0, 0, 0) -PseudocolorAtts.pointColor = (0, 0, 0, 0) -SetPlotOptions(PseudocolorAtts) -DrawPlots() -Query("MinMax", use_actual_data=1) diff --git a/tests/unit_tests/CMakeLists.txt b/tests/unit_tests/CMakeLists.txt index e8ae8456c..7f7cd242a 100644 --- a/tests/unit_tests/CMakeLists.txt +++ b/tests/unit_tests/CMakeLists.txt @@ -16,7 +16,7 @@ SET(TARGET_SRC CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8) -FIND_PACKAGE(deal.II 8.0 QUIET +FIND_PACKAGE(deal.II 9.2.0 QUIET HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) IF(NOT ${deal.II_FOUND})