Compare commits
58
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
79378f7412 | ||
|
|
91893ef7a4 | ||
|
|
ad67be026b | ||
|
|
96c939f480 | ||
|
|
ab07141b39 | ||
|
|
099b6bd69f | ||
|
|
050bc663b7 | ||
|
|
5c7b8a80ad | ||
|
|
470d694648 | ||
|
|
66fa40436a | ||
|
|
80cecfca3c | ||
|
|
6dfbcff293 | ||
|
|
3600e11a7e | ||
|
|
a6030c27ec | ||
|
|
8ce443953a | ||
|
|
190f755813 | ||
|
|
cefb7c4528 | ||
|
|
9f623e948e | ||
|
|
21d67b35bc | ||
|
|
6149caa551 | ||
|
|
9206d7cbcd | ||
|
|
1a2c9bb1f4 | ||
|
|
3aaf0f519f | ||
|
|
9ea51d8455 | ||
|
|
7bfe51870d | ||
|
|
04204afa71 | ||
|
|
1969eb5934 | ||
|
|
6d22e4c6fc | ||
|
|
f9a53fd7ba | ||
|
|
c362e572d5 | ||
|
|
c2683b746b | ||
|
|
4b57b95860 | ||
|
|
e2fafa7ebf | ||
|
|
27700aaea6 | ||
|
|
fea83dcbe6 | ||
|
|
62f08152f6 | ||
|
|
9a16d4dd37 | ||
|
|
287a827fe2 | ||
|
|
b87705a84f | ||
|
|
8e883640ab | ||
|
|
8f3a999c70 | ||
|
|
84627af245 | ||
|
|
bb3433ce3b | ||
|
|
548624b1e3 | ||
|
|
e2043082f1 | ||
|
|
5671c6f5e0 | ||
|
|
190580ce89 | ||
|
|
706d625d3c | ||
|
|
d6e5ed463d | ||
|
|
ec6c067e45 | ||
|
|
d4199f386c | ||
|
|
7eecfc4162 | ||
|
|
683500a0f1 | ||
|
|
898f5974cd | ||
|
|
dc21922ce6 | ||
|
|
1cf6076c3c | ||
|
|
9647d381e1 | ||
|
|
2835afe636 |
+35
@@ -33,6 +33,19 @@ doc/CodeDocumentation
|
||||
doc/undoc.log
|
||||
doc/warnings.log
|
||||
|
||||
# vscode directory
|
||||
.vscode
|
||||
|
||||
# Build directory
|
||||
build
|
||||
|
||||
# Output directory
|
||||
output
|
||||
|
||||
# qt files
|
||||
mfem-qt
|
||||
mfem.code-workspace
|
||||
|
||||
# Temporary files created by the tests.
|
||||
*.stderr
|
||||
|
||||
@@ -47,6 +60,7 @@ doc/warnings.log
|
||||
|
||||
examples/ex[0-9]
|
||||
examples/ex[0-9]p
|
||||
examples/ex9p-continuous
|
||||
examples/ex1[04-9]
|
||||
examples/ex1[0-9]p
|
||||
examples/ex2[0-9]
|
||||
@@ -74,6 +88,10 @@ examples/ex9.mesh
|
||||
examples/ex9-mesh.*
|
||||
examples/ex9-init.*
|
||||
examples/ex9-final.*
|
||||
examples/ex9p-continuous-final.*
|
||||
examples/ex9p-continuous-final-exact.*
|
||||
examples/ex9p-continuous-init.*
|
||||
examples/ex9p-continuous-mesh.*
|
||||
examples/deformed.*
|
||||
examples/velocity.*
|
||||
examples/elastic_energy.*
|
||||
@@ -178,6 +196,20 @@ examples/superlu/ex1p
|
||||
examples/superlu/mesh.*
|
||||
examples/superlu/sol.*
|
||||
|
||||
# Saved output
|
||||
examples/ex9p-analysis/saved_output/
|
||||
examples/ex9p-analysis/temp_output/
|
||||
examples/ex9p-analysis/*.out
|
||||
examples/ex9p-analysis/*.txt
|
||||
examples/ex9p-analysis/scripts/*.sh
|
||||
|
||||
# Discontinuous check
|
||||
examples/ex9p-discontinuous
|
||||
examples/ex9p-discontinuous-final.*
|
||||
examples/ex9p-discontinuous-final-exact.*
|
||||
examples/ex9p-discontinuous-init.*
|
||||
examples/ex9p-discontinuous-mesh.*
|
||||
|
||||
miniapps/adjoint/cvsRoberts_ASAi_dns
|
||||
miniapps/adjoint/adjoint_advection_diffusion
|
||||
|
||||
@@ -345,3 +377,6 @@ pkg.gitcommit
|
||||
|
||||
# Jupyter Notebook Checkpoints
|
||||
.ipynb_checkpoints
|
||||
|
||||
# test meshes
|
||||
data/periodic-segment2.mesh
|
||||
|
||||
@@ -0,0 +1,268 @@
|
||||
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
|
||||
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
|
||||
# LICENSE and NOTICE for details. LLNL-CODE-806117.
|
||||
#
|
||||
# This file is part of the MFEM library. For more information and source code
|
||||
# availability visit https://mfem.org.
|
||||
#
|
||||
# MFEM is free software; you can redistribute it and/or modify it under the
|
||||
# terms of the BSD-3 license. We welcome feedback and contributions, see file
|
||||
# CONTRIBUTING.md for details.
|
||||
|
||||
# See the file INSTALL for description of the configuration options.
|
||||
|
||||
# Default options. To replace these, copy this file to user.cmake and modify it.
|
||||
|
||||
if (NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE "Release" CACHE STRING
|
||||
"Build type: Debug, Release, RelWithDebInfo, or MinSizeRel." FORCE)
|
||||
endif()
|
||||
|
||||
# MFEM options. Set to mimic the default "defaults.mk" file.
|
||||
option(MFEM_USE_MPI "Enable MPI parallel build" OFF)
|
||||
option(MFEM_USE_METIS "Enable METIS usage" ${MFEM_USE_MPI})
|
||||
option(MFEM_USE_EXCEPTIONS "Enable the use of exceptions" OFF)
|
||||
option(MFEM_USE_ZLIB "Enable zlib for compressed data streams." OFF)
|
||||
option(MFEM_USE_LIBUNWIND "Enable backtrace for errors." OFF)
|
||||
option(MFEM_USE_LAPACK "Enable LAPACK usage" OFF)
|
||||
option(MFEM_THREAD_SAFE "Enable thread safety" OFF)
|
||||
option(MFEM_USE_OPENMP "Enable the OpenMP backend" OFF)
|
||||
option(MFEM_USE_LEGACY_OPENMP "Enable legacy OpenMP usage" OFF)
|
||||
option(MFEM_USE_MEMALLOC "Enable the internal MEMALLOC option." ON)
|
||||
option(MFEM_USE_SUNDIALS "Enable SUNDIALS usage" OFF)
|
||||
option(MFEM_USE_MESQUITE "Enable MESQUITE usage" OFF)
|
||||
option(MFEM_USE_SUITESPARSE "Enable SuiteSparse usage" OFF)
|
||||
option(MFEM_USE_SUPERLU "Enable SuperLU_DIST usage" OFF)
|
||||
option(MFEM_USE_SUPERLU5 "Use the old SuperLU_DIST 5.1 version" OFF)
|
||||
option(MFEM_USE_MUMPS "Enable MUMPS usage" OFF)
|
||||
option(MFEM_USE_STRUMPACK "Enable STRUMPACK usage" OFF)
|
||||
option(MFEM_USE_GINKGO "Enable Ginkgo usage" OFF)
|
||||
option(MFEM_USE_AMGX "Enable AmgX usage" OFF)
|
||||
option(MFEM_USE_GNUTLS "Enable GNUTLS usage" OFF)
|
||||
option(MFEM_USE_GSLIB "Enable GSLIB usage" OFF)
|
||||
option(MFEM_USE_NETCDF "Enable NETCDF usage" OFF)
|
||||
option(MFEM_USE_PETSC "Enable PETSc support." OFF)
|
||||
option(MFEM_USE_SLEPC "Enable SLEPc support." OFF)
|
||||
option(MFEM_USE_MPFR "Enable MPFR usage." OFF)
|
||||
option(MFEM_USE_SIDRE "Enable Axom/Sidre usage" OFF)
|
||||
option(MFEM_USE_FMS "Enable FMS usage" OFF)
|
||||
option(MFEM_USE_CONDUIT "Enable Conduit usage" OFF)
|
||||
option(MFEM_USE_PUMI "Enable PUMI" OFF)
|
||||
option(MFEM_USE_HIOP "Enable HiOp" OFF)
|
||||
option(MFEM_USE_CUDA "Enable CUDA" OFF)
|
||||
option(MFEM_USE_HIP "Enable HIP" OFF)
|
||||
option(MFEM_USE_OCCA "Enable OCCA" OFF)
|
||||
option(MFEM_USE_RAJA "Enable RAJA" OFF)
|
||||
option(MFEM_USE_CEED "Enable CEED" OFF)
|
||||
option(MFEM_USE_UMPIRE "Enable Umpire" OFF)
|
||||
option(MFEM_USE_SIMD "Enable use of SIMD intrinsics" OFF)
|
||||
option(MFEM_USE_ADIOS2 "Enable ADIOS2" OFF)
|
||||
option(MFEM_USE_CALIPER "Enable Caliper support" OFF)
|
||||
option(MFEM_USE_ALGOIM "Enable Algoim support" OFF)
|
||||
option(MFEM_USE_MKL_CPARDISO "Enable MKL CPardiso" OFF)
|
||||
option(MFEM_USE_ADFORWARD "Enable forward mode for AD" OFF)
|
||||
option(MFEM_USE_CODIPACK "Enable automatic differentiation (AD) using CoDiPack" OFF)
|
||||
option(MFEM_USE_BENCHMARK "Enable Google Benchmark" OFF)
|
||||
option(MFEM_USE_PARELAG "Enable ParELAG" OFF)
|
||||
|
||||
# Optional overrides for autodetected MPIEXEC and MPIEXEC_NUMPROC_FLAG
|
||||
# set(MFEM_MPIEXEC "mpirun" CACHE STRING "Command for running MPI tests")
|
||||
# set(MFEM_MPIEXEC_NP "-np" CACHE STRING
|
||||
# "Flag for setting the number of MPI tasks")
|
||||
|
||||
set(MFEM_MPI_NP 4 CACHE STRING "Number of processes used for MPI tests")
|
||||
|
||||
# Allow a user to disable testing, examples, and/or miniapps at CONFIGURE TIME
|
||||
# if they don't want/need them (e.g. if MFEM is "just a dependency" and all they
|
||||
# need is the library, building all that stuff adds unnecessary overhead). Note
|
||||
# that the examples or miniapps can always be built using the targets 'examples'
|
||||
# or 'miniapps', respectively.
|
||||
option(MFEM_ENABLE_TESTING "Enable the ctest framework for testing" ON)
|
||||
option(MFEM_ENABLE_EXAMPLES "Build all of the examples" OFF)
|
||||
option(MFEM_ENABLE_MINIAPPS "Build all of the miniapps" OFF)
|
||||
option(MFEM_ENABLE_GOOGLE_BENCHMARKS "Build all of the Google benchmarks" OFF)
|
||||
|
||||
# Setting CXX/MPICXX on the command line or in user.cmake will overwrite the
|
||||
# autodetected C++ compiler.
|
||||
# set(CXX g++)
|
||||
# set(MPICXX mpicxx)
|
||||
|
||||
# Set the target CUDA architecture
|
||||
set(CUDA_ARCH "sm_60" CACHE STRING "Target CUDA architecture.")
|
||||
|
||||
# Set the target HIP architecture
|
||||
set(HIP_ARCH "gfx900" CACHE STRING "Target HIP architecture.")
|
||||
|
||||
set(MFEM_DIR ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
# The *_DIR paths below will be the first place searched for the corresponding
|
||||
# headers and library. If these fail, then standard cmake search is performed.
|
||||
# Note: if the variables are already in the cache, they are not overwritten.
|
||||
|
||||
set(HYPRE_DIR "${MFEM_DIR}/../hypre/src/hypre" CACHE PATH
|
||||
"Path to the hypre library.")
|
||||
# If hypre was compiled to depend on BLAS and LAPACK:
|
||||
# set(HYPRE_REQUIRED_PACKAGES "BLAS" "LAPACK" CACHE STRING
|
||||
# "Packages that HYPRE depends on.")
|
||||
if (MFEM_USE_CUDA)
|
||||
# This is only necessary when hypre is built with cuda:
|
||||
set(HYPRE_REQUIRED_LIBRARIES "-lcusparse" "-lcurand" CACHE STRING
|
||||
"Libraries that HYPRE depends on.")
|
||||
endif()
|
||||
# HIP dependency for HYPRE is handled in FindHYPRE.cmake.
|
||||
|
||||
set(METIS_DIR "${MFEM_DIR}/../metis-4.0" CACHE PATH "Path to the METIS library.")
|
||||
|
||||
set(LIBUNWIND_DIR "" CACHE PATH "Path to Libunwind.")
|
||||
|
||||
# For sundials_nvecmpiplusx and nvecparallel remember to build with MPI_ENABLE=ON
|
||||
# and modify cmake variables for hypre for sundials
|
||||
set(SUNDIALS_DIR "${MFEM_DIR}/../sundials-5.0.0/instdir" CACHE PATH
|
||||
"Path to the SUNDIALS library.")
|
||||
# The following may be necessary, if SUNDIALS was built with KLU:
|
||||
# set(SUNDIALS_REQUIRED_PACKAGES "SuiteSparse/KLU/AMD/BTF/COLAMD/config"
|
||||
# CACHE STRING "Additional packages required by SUNDIALS.")
|
||||
|
||||
set(MESQUITE_DIR "${MFEM_DIR}/../mesquite-2.99" CACHE PATH
|
||||
"Path to the Mesquite library.")
|
||||
|
||||
set(SuiteSparse_DIR "${MFEM_DIR}/../SuiteSparse" CACHE PATH
|
||||
"Path to the SuiteSparse library.")
|
||||
set(SuiteSparse_REQUIRED_PACKAGES "BLAS" "METIS"
|
||||
CACHE STRING "Additional packages required by SuiteSparse.")
|
||||
|
||||
set(ParMETIS_DIR "${MFEM_DIR}/../parmetis-4.0.3" CACHE PATH
|
||||
"Path to the ParMETIS library.")
|
||||
set(ParMETIS_REQUIRED_PACKAGES "METIS" CACHE STRING
|
||||
"Additional packages required by ParMETIS.")
|
||||
|
||||
set(SuperLUDist_DIR "${MFEM_DIR}/../SuperLU_DIST_6.3.1" CACHE PATH
|
||||
"Path to the SuperLU_DIST library.")
|
||||
# SuperLU_DIST may also depend on "OpenMP", depending on how it was compiled.
|
||||
set(SuperLUDist_REQUIRED_PACKAGES "MPI" "BLAS" "ParMETIS" CACHE STRING
|
||||
"Additional packages required by SuperLU_DIST.")
|
||||
|
||||
set(MUMPS_DIR "${MFEM_DIR}/../MUMPS_5.2.0" CACHE PATH
|
||||
"Path to the MUMPS library.")
|
||||
# Packages required by MUMPS, depending on how it was compiled.
|
||||
set(MUMPS_REQUIRED_PACKAGES "MPI" "BLAS" "METIS" "ScaLAPACK" CACHE STRING
|
||||
"Additional packages required by MUMPS.")
|
||||
# If the MPI package does not find all required Fortran libraries:
|
||||
# set(MUMPS_REQUIRED_LIBRARIES "gfortran" "mpi_mpifh" CACHE STRING
|
||||
# "Additional libraries required by MUMPS.")
|
||||
|
||||
set(STRUMPACK_DIR "${MFEM_DIR}/../STRUMPACK-build" CACHE PATH
|
||||
"Path to the STRUMPACK library.")
|
||||
# STRUMPACK may also depend on "OpenMP", depending on how it was compiled.
|
||||
# Starting with v2.2.0 of STRUMPACK, ParMETIS and Scotch are optional.
|
||||
set(STRUMPACK_REQUIRED_PACKAGES "MPI" "MPI_Fortran" "ParMETIS" "METIS"
|
||||
"ScaLAPACK" "Scotch/ptscotch/ptscotcherr/scotch/scotcherr" CACHE STRING
|
||||
"Additional packages required by STRUMPACK.")
|
||||
# If the MPI package does not find all required Fortran libraries:
|
||||
# set(STRUMPACK_REQUIRED_LIBRARIES "gfortran" "mpi_mpifh" CACHE STRING
|
||||
# "Additional libraries required by STRUMPACK.")
|
||||
|
||||
# The Scotch library, required by STRUMPACK <= v2.1.0, optional in STRUMPACK >=
|
||||
# v2.2.0.
|
||||
set(Scotch_DIR "${MFEM_DIR}/../scotch_6.0.4" CACHE PATH
|
||||
"Path to the Scotch and PT-Scotch libraries.")
|
||||
set(Scotch_REQUIRED_PACKAGES "Threads" CACHE STRING
|
||||
"Additional packages required by Scotch.")
|
||||
# Tell the "Threads" package/module to prefer pthreads.
|
||||
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
|
||||
set(Threads_LIB_VARS CMAKE_THREAD_LIBS_INIT)
|
||||
|
||||
# The ScaLAPACK library, required by STRUMPACK
|
||||
set(ScaLAPACK_DIR "${MFEM_DIR}/../scalapack-2.0.2/lib/cmake/scalapack-2.0.2"
|
||||
CACHE PATH "Path to the configuration file scalapack-config.cmake")
|
||||
set(ScaLAPACK_TARGET_NAMES scalapack)
|
||||
# set(ScaLAPACK_TARGET_FORCE)
|
||||
# set(ScaLAPACK_IMPORT_CONFIG DEBUG)
|
||||
|
||||
set(Ginkgo_DIR "${MFEM_DIR}/../ginkgo" CACHE PATH "Path to the Ginkgo library.")
|
||||
|
||||
set(AMGX_DIR "${MFEM_DIR}/../amgx" CACHE PATH "Path to AmgX")
|
||||
|
||||
set(GNUTLS_DIR "" CACHE PATH "Path to the GnuTLS library.")
|
||||
|
||||
set(GSLIB_DIR "" CACHE PATH "Path to the GSLIB library.")
|
||||
|
||||
set(NETCDF_DIR "" CACHE PATH "Path to the NetCDF library.")
|
||||
set(NetCDF_REQUIRED_PACKAGES "HDF5/C/HL" CACHE STRING
|
||||
"Additional packages required by NetCDF.")
|
||||
|
||||
set(PETSC_DIR "${MFEM_DIR}/../petsc" CACHE PATH
|
||||
"Path to the PETSc main directory.")
|
||||
set(PETSC_ARCH "arch-linux2-c-debug" CACHE STRING "PETSc build architecture.")
|
||||
|
||||
set(SLEPC_DIR "${MFEM_DIR}/../slepc" CACHE PATH
|
||||
"Path to the SLEPc main directory.")
|
||||
set(SLEPC_ARCH "arch-linux2-c-debug" CACHE STRING "SLEPC build architecture.")
|
||||
|
||||
set(MPFR_DIR "" CACHE PATH "Path to the MPFR library.")
|
||||
|
||||
set(FMS_DIR "${MFEM_DIR}/../fms" CACHE PATH
|
||||
"Path to the FMS library.")
|
||||
# If FMS is built with Conduit:
|
||||
# set(FMS_REQUIRED_PACKAGES "Conduit/relay" CACHE STRING
|
||||
# "Additional packages required by FMS.")
|
||||
|
||||
set(CONDUIT_DIR "${MFEM_DIR}/../conduit" CACHE PATH
|
||||
"Path to the Conduit library.")
|
||||
|
||||
set(AXOM_DIR "${MFEM_DIR}/../axom" CACHE PATH "Path to the Axom library.")
|
||||
# May need to add "Boost" as requirement.
|
||||
set(Axom_REQUIRED_PACKAGES "Conduit/relay/blueprint" CACHE STRING
|
||||
"Additional packages required by Axom.")
|
||||
|
||||
set(PUMI_DIR "${MFEM_DIR}/../pumi-2.1.0" CACHE STRING
|
||||
"Directory where PUMI is installed")
|
||||
|
||||
set(HIOP_DIR "${MFEM_DIR}/../hiop/install" CACHE STRING
|
||||
"Directory where HiOp is installed")
|
||||
set(HIOP_REQUIRED_PACKAGES "BLAS" "LAPACK" CACHE STRING
|
||||
"Packages that HiOp depends on.")
|
||||
|
||||
set(MKL_CPARDISO_DIR "" CACHE STRING "MKL installation path.")
|
||||
set(MKL_MPI_WRAPPER_LIB "mkl_blacs_mpich_lp64" CACHE STRING "MKL MPI wrapper library")
|
||||
set(MKL_LIBRARY_DIR "" CACHE STRING "Custom library subdirectory")
|
||||
|
||||
set(OCCA_DIR "${MFEM_DIR}/../occa" CACHE PATH "Path to OCCA")
|
||||
set(RAJA_DIR "${MFEM_DIR}/../raja" CACHE PATH "Path to RAJA")
|
||||
# If RAJA is built with external CAMP:
|
||||
# set(RAJA_REQUIRED_PACKAGES "camp"
|
||||
# CACHE STRING "Packages that RAJA depends on.")
|
||||
# set(camp_DIR "${MFEM_DIR}/../camp/lib/cmake/camp"
|
||||
# CACHE PATH "Path to CAMP CMake files.")
|
||||
set(CEED_DIR "${MFEM_DIR}/../libCEED" CACHE PATH "Path to libCEED")
|
||||
set(UMPIRE_DIR "${MFEM_DIR}/../umpire" CACHE PATH "Path to Umpire")
|
||||
set(CALIPER_DIR "${MFEM_DIR}/../caliper" CACHE PATH "Path to Caliper")
|
||||
set(BLITZ_DIR "${MFEM_DIR}/../blitz" CACHE PATH "Path to Blitz")
|
||||
set(ALGOIM_DIR "${MFEM_DIR}/../algoim" CACHE PATH "Path to Algoim")
|
||||
set(ALGOIM_REQUIRED_PACKAGES "BLITZ" CACHE STRING
|
||||
"Packages that ALGOIM depends on.")
|
||||
|
||||
set(BENCHMARK_DIR "${MFEM_DIR}/../google-benchmark" CACHE PATH
|
||||
"Path to Google Benchmark")
|
||||
|
||||
# Provide paths, since ParELAG is dependent on MFEM and MFEM needs to be
|
||||
# compiled (or at least cmake needs to succeed) before compiling ParELAG.
|
||||
set(PARELAG_DIR "${MFEM_DIR}/../parelag" CACHE PATH "Path to ParELAG")
|
||||
set(PARELAG_INCLUDE_DIRS "${PARELAG_DIR}/src;${PARELAG_DIR}/build/src" CACHE
|
||||
STRING "Path to ParELAG headers.")
|
||||
set(PARELAG_LIBRARIES "${PARELAG_DIR}/build/src/libParELAG.a" CACHE STRING
|
||||
"The ParELAG library.")
|
||||
|
||||
set(BLAS_INCLUDE_DIRS "" CACHE STRING "Path to BLAS headers.")
|
||||
set(BLAS_LIBRARIES "" CACHE STRING "The BLAS library.")
|
||||
set(LAPACK_INCLUDE_DIRS "" CACHE STRING "Path to LAPACK headers.")
|
||||
set(LAPACK_LIBRARIES "" CACHE STRING "The LAPACK library.")
|
||||
|
||||
set(CODIPACK_INCLUDE_DIRS "${MFEM_DIR}/../CoDiPack/include" CACHE STRING
|
||||
"Path to CoDiPack headers.")
|
||||
set(CODIPACK_LIBRARIES "")
|
||||
|
||||
# Some useful variables:
|
||||
set(CMAKE_SKIP_PREPROCESSED_SOURCE_RULES ON) # Skip *.i rules
|
||||
set(CMAKE_SKIP_ASSEMBLY_SOURCE_RULES ON) # Skip *.s rules
|
||||
# set(CMAKE_VERBOSE_MAKEFILE ON CACHE BOOL "Verbose makefiles.")
|
||||
@@ -34,7 +34,7 @@ FiniteElementCollection: L2_T1_1D_P1
|
||||
VDim: 1
|
||||
Ordering: 1
|
||||
|
||||
0 0.25
|
||||
0.25 0.5
|
||||
0.5 0.75
|
||||
0.75 1
|
||||
-1. -0.5
|
||||
-0.5 0.
|
||||
0. 0.5
|
||||
0.5 1
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
MFEM mesh v1.0
|
||||
|
||||
#
|
||||
# MFEM Geometry Types (see mesh/geom.hpp):
|
||||
#
|
||||
# POINT = 0
|
||||
# SEGMENT = 1
|
||||
# TRIANGLE = 2
|
||||
# SQUARE = 3
|
||||
# TETRAHEDRON = 4
|
||||
# CUBE = 5
|
||||
#
|
||||
|
||||
dimension
|
||||
2
|
||||
|
||||
# format: <attribute> <geometry type> <vertex 0> <vertex 1> ...
|
||||
elements
|
||||
9
|
||||
1 3 0 1 4 3
|
||||
2 3 1 2 5 4
|
||||
3 3 2 0 3 5
|
||||
4 3 3 4 7 6
|
||||
5 3 4 5 8 7
|
||||
6 3 5 3 6 8
|
||||
7 3 6 7 1 0
|
||||
8 3 7 8 2 1
|
||||
9 3 8 6 0 2
|
||||
|
||||
boundary
|
||||
0
|
||||
|
||||
vertices
|
||||
9
|
||||
|
||||
nodes
|
||||
FiniteElementSpace
|
||||
FiniteElementCollection: H1_2D_P1
|
||||
VDim: 2
|
||||
Ordering: 1
|
||||
|
||||
-1 -1
|
||||
-0.333333333 -1
|
||||
0.333333333 -1
|
||||
-1 -0.333333333
|
||||
-0.333333333 -0.333333333
|
||||
0.333333333 -0.333333333
|
||||
-1 0.333333333
|
||||
-0.333333333 0.333333333
|
||||
0.333333333 0.333333333
|
||||
@@ -0,0 +1,43 @@
|
||||
MFEM mesh v1.0
|
||||
|
||||
#
|
||||
# MFEM Geometry Types (see mesh/geom.hpp):
|
||||
#
|
||||
# POINT = 0
|
||||
# SEGMENT = 1
|
||||
# TRIANGLE = 2
|
||||
# SQUARE = 3
|
||||
# TETRAHEDRON = 4
|
||||
# CUBE = 5
|
||||
#
|
||||
|
||||
dimension
|
||||
2
|
||||
|
||||
# format: <attribute> <geometry type> <vertex 0> <vertex 1> ...
|
||||
elements
|
||||
2
|
||||
1 3 0 1 3 2
|
||||
2 3 1 0 2 3
|
||||
|
||||
boundary
|
||||
0
|
||||
|
||||
vertices
|
||||
6
|
||||
|
||||
nodes
|
||||
FiniteElementSpace
|
||||
FiniteElementCollection: L2_T1_2D_P1
|
||||
VDim: 2
|
||||
Ordering: 1
|
||||
|
||||
-1 -0.5
|
||||
0 -0.5
|
||||
-1 0.5
|
||||
0 0.5
|
||||
|
||||
0 -0.5
|
||||
1 -0.5
|
||||
0 0.5
|
||||
1 0.5
|
||||
@@ -0,0 +1,94 @@
|
||||
"""
|
||||
This python script file performs a convergence rates analsyis by running
|
||||
a reading output files and composing a table from those values.
|
||||
|
||||
Example:
|
||||
> python create_convergence_table.py "/Users/sheridan7/Workspace/mfem/examples/ex9p-analysis/temp_output/"
|
||||
"""
|
||||
|
||||
import numpy as np
|
||||
import re
|
||||
import os
|
||||
import sys
|
||||
import matplotlib.pyplot as plt
|
||||
from tabulate import tabulate
|
||||
|
||||
|
||||
# check command line inputs
|
||||
assert len(sys.argv) == 2, "This file needs 1 input argument: directory, but " + str(len(sys.argv)) + " were given."
|
||||
directory = str(sys.argv[1])
|
||||
# iterations = int(sys.argv[2])
|
||||
# increment = int(sys.argv[3])
|
||||
# plot_organization = False
|
||||
|
||||
# now we define the main function to be called at the end
|
||||
def main():
|
||||
# comment out "run_simuations" if you only want to compute the errors
|
||||
vals = gather_vals()
|
||||
compute_rates(vals)
|
||||
plot_1(vals)
|
||||
|
||||
|
||||
def gather_vals():
|
||||
vals = {'Processor_Runtime': [],
|
||||
'n_processes': [],
|
||||
'n_refinements': [],
|
||||
'n_Dofs': [],
|
||||
'h': [],
|
||||
'L1_Error': [],
|
||||
'L1_Rates': [],
|
||||
'L2_Error': [],
|
||||
'L2_Rates': [],
|
||||
'Linf_Error': [],
|
||||
'Linf_Rates': [],
|
||||
'dt': [],
|
||||
'Endtime': []}
|
||||
for filename in sorted(os.listdir(directory)):
|
||||
f = os.path.join(directory, filename)
|
||||
with open(f) as fp:
|
||||
for cnt, ln in enumerate(fp):
|
||||
l = ln.strip().split()
|
||||
vals[l[0]].append(float(l[1]))
|
||||
|
||||
return vals
|
||||
|
||||
##
|
||||
# Function to plot the L2 error with respect to space discretization.
|
||||
##
|
||||
def plot_1(vals):
|
||||
plt.plot(vals['n_refinements'], vals['L1_Error'], label='$L_1$ Error')
|
||||
plt.plot(vals['n_refinements'], vals['L2_Error'], label='$L_2$ Error')
|
||||
plt.plot(vals['n_refinements'], vals['Linf_Error'], label='$L_{\infty}$ Error')
|
||||
plt.xlabel('# Refinements', fontsize=16)
|
||||
plt.ylabel('Error', fontsize=16)
|
||||
plt.title('Approximation Error', fontsize=20)
|
||||
plt.legend()
|
||||
plt.yscale('log')
|
||||
plt.show()
|
||||
|
||||
plt.plot(vals['n_refinements'], vals['L1_Rates'], label='$L_1$')
|
||||
plt.plot(vals['n_refinements'], vals['L2_Rates'], label='$L_2$')
|
||||
plt.plot(vals['n_refinements'], vals['Linf_Rates'], label='$L_{\infty}$')
|
||||
plt.xlabel('# Refinements', fontsize=16)
|
||||
plt.ylabel('Convergence Rate', fontsize=16)
|
||||
plt.title('Convergence Rates', fontsize=20)
|
||||
plt.legend()
|
||||
plt.show()
|
||||
|
||||
def compute_rates(vals):
|
||||
for i in range(len(vals['h'])):
|
||||
if i == 0:
|
||||
L1_rate = 0.
|
||||
L2_rate = 0.
|
||||
Linf_rate = 0.
|
||||
else:
|
||||
L1_rate = np.log(vals['L1_Error'][i]/vals['L1_Error'][i-1]) / np.log(vals['h'][i]/vals['h'][i-1])
|
||||
L2_rate = np.log(vals['L2_Error'][i]/vals['L2_Error'][i-1]) / np.log(vals['h'][i]/vals['h'][i-1])
|
||||
Linf_rate = np.log(vals['Linf_Error'][i]/vals['Linf_Error'][i-1]) / np.log(vals['h'][i]/vals['h'][i-1])
|
||||
|
||||
vals['L1_Rates'].append(L1_rate)
|
||||
vals['L2_Rates'].append(L2_rate)
|
||||
vals['Linf_Rates'].append(Linf_rate)
|
||||
|
||||
# then we put main at the bottom to run everything
|
||||
main()
|
||||
@@ -0,0 +1,85 @@
|
||||
"""
|
||||
This python script file performs a convergence rates analsyis by running
|
||||
a reading output files and composing a table from those values.
|
||||
|
||||
Example:
|
||||
> python create_convergence_table.py "/Users/sheridan7/Workspace/mfem/examples/ex9p-analysis/temp_output/"
|
||||
"""
|
||||
|
||||
import numpy as np
|
||||
import re
|
||||
import os
|
||||
import sys
|
||||
from tabulate import tabulate
|
||||
|
||||
|
||||
# check command line inputs
|
||||
assert len(sys.argv) == 2, "This file needs 1 input argument: directory, but " + str(len(sys.argv)) + " were given."
|
||||
directory = str(sys.argv[1])
|
||||
rate_precision = 6
|
||||
# iterations = int(sys.argv[2])
|
||||
# increment = int(sys.argv[3])
|
||||
# plot_organization = False
|
||||
|
||||
# now we define the main function to be called at the end
|
||||
def main():
|
||||
# comment out "run_simuations" if you only want to compute the errors
|
||||
vals = gather_vals()
|
||||
compute_rates(vals)
|
||||
|
||||
|
||||
def gather_vals():
|
||||
vals = {'Processor_Runtime': [],
|
||||
'n_processes': [],
|
||||
'n_refinements': [],
|
||||
'n_Dofs': [],
|
||||
'h': [],
|
||||
'L1_Error': [],
|
||||
'L1_Rates': [],
|
||||
'L2_Error': [],
|
||||
'L2_Rates': [],
|
||||
'Linf_Error': [],
|
||||
'Linf_Rates': [],
|
||||
'dt': [],
|
||||
'Endtime': []}
|
||||
for filename in sorted(os.listdir(directory)):
|
||||
f = os.path.join(directory, filename)
|
||||
with open(f) as fp:
|
||||
for cnt, ln in enumerate(fp):
|
||||
l = ln.strip().split()
|
||||
vals[l[0]].append(float(l[1]))
|
||||
|
||||
return vals
|
||||
|
||||
def compute_rates(vals):
|
||||
|
||||
# Use tabulate to create a formatted table
|
||||
table = []
|
||||
for i in range(len(vals['h'])):
|
||||
if i == 0:
|
||||
table.append([vals['n_Dofs'][i], vals['L1_Error'][i], "---", vals['L2_Error'][i], "---",
|
||||
vals['Linf_Error'][i], "---"])
|
||||
else:
|
||||
L1_rate = np.around(np.log(vals['L1_Error'][i]/vals['L1_Error'][i-1]) / np.log(vals['h'][i]/vals['h'][i-1]), decimals=rate_precision)
|
||||
L2_rate = np.around(np.log(vals['L2_Error'][i]/vals['L2_Error'][i-1]) / np.log(vals['h'][i]/vals['h'][i-1]), decimals=rate_precision)
|
||||
Linf_rate = np.around(np.log(vals['Linf_Error'][i]/vals['Linf_Error'][i-1]) / np.log(vals['h'][i]/vals['h'][i-1]), decimals=rate_precision)
|
||||
table.append([vals['n_Dofs'][i], vals['L1_Error'][i], L1_rate,
|
||||
vals['L2_Error'][i], L2_rate,
|
||||
vals['Linf_Error'][i], Linf_rate])
|
||||
|
||||
s_table = tabulate(table,
|
||||
headers=["# dof", "L1 Error", "Rate", "L2 Error",
|
||||
"Rate", "L-Inf Error", "Rate"],
|
||||
tablefmt="latex")
|
||||
|
||||
# Output table to console
|
||||
print(" ")
|
||||
print(s_table)
|
||||
|
||||
# Output table to txt file
|
||||
f = open("../convergence_rates.txt", "w+")
|
||||
f.write(s_table)
|
||||
f.close()
|
||||
|
||||
# then we put main at the bottom to run everything
|
||||
main()
|
||||
@@ -0,0 +1,107 @@
|
||||
"""
|
||||
This python script file performs a parallelization analsyis by running
|
||||
a reading output files and composing a table from those values.
|
||||
|
||||
Example:
|
||||
> python create_parallelization_table.py "/Users/sheridan7/Workspace/mfem/examples/ex9p-analysis/temp_output/"
|
||||
"""
|
||||
|
||||
import numpy as np
|
||||
import re
|
||||
import os
|
||||
import sys
|
||||
from tabulate import tabulate
|
||||
|
||||
|
||||
# check command line inputs
|
||||
assert len(sys.argv) == 2, "This file needs 1 input argument: directory, but " + str(len(sys.argv)) + " were given."
|
||||
directory = str(sys.argv[1])
|
||||
# iterations = int(sys.argv[2])
|
||||
# increment = int(sys.argv[3])
|
||||
# plot_organization = False
|
||||
|
||||
# now we define the main function to be called at the end
|
||||
def main():
|
||||
# comment out "run_simuations" if you only want to compute the errors
|
||||
vals = gather_vals()
|
||||
compute_rates(vals)
|
||||
|
||||
|
||||
def gather_vals():
|
||||
vals = {'Processor_Runtime': [],
|
||||
'Speedup': [],
|
||||
'n_processes': [],
|
||||
'n_refinements': [],
|
||||
'n_Dofs': [],
|
||||
'h': [],
|
||||
'L1_Error': [],
|
||||
'L1_Rates': [],
|
||||
'L2_Error': [],
|
||||
'L2_Rates': [],
|
||||
'Linf_Error': [],
|
||||
'Linf_Rates': [],
|
||||
'dt': [],
|
||||
'Endtime': []}
|
||||
for filename in sorted(os.listdir(directory)):
|
||||
f = os.path.join(directory, filename)
|
||||
with open(f) as fp:
|
||||
for cnt, ln in enumerate(fp):
|
||||
l = ln.strip().split()
|
||||
vals[l[0]].append(float(l[1]))
|
||||
|
||||
return vals
|
||||
|
||||
def compute_rates(vals):
|
||||
|
||||
# Use tabulate to create a formatted table
|
||||
p_table = []
|
||||
s_table = []
|
||||
serial_time = 0
|
||||
for i in range(len(vals['h'])):
|
||||
if i == 0:
|
||||
serial_time = vals['Processor_Runtime'][i]
|
||||
vals['Speedup'].append(0.)
|
||||
else:
|
||||
_time = vals['Processor_Runtime'][i]
|
||||
# assert(_time != 0, "Division by Zero.")
|
||||
|
||||
vals['Speedup'].append(serial_time / _time)
|
||||
print('_time = ', _time)
|
||||
print('speedup: ', serial_time / _time)
|
||||
|
||||
p_table.append([vals['n_processes'][i], vals['Endtime'][i], vals['n_Dofs'][i],
|
||||
vals['L1_Error'][i], vals['L2_Error'][i], vals['Linf_Error'][i]])
|
||||
|
||||
s_table.append([vals['n_processes'][i],
|
||||
vals['Processor_Runtime'][i],
|
||||
vals['Speedup'][i]])
|
||||
|
||||
p_table_tab = tabulate(p_table,
|
||||
floatfmt=(".0f", ".3f", ".0f", ".12f", ".12f", ".12f"),
|
||||
headers=["# processors",
|
||||
"Endtime", "# Dofs", "L1 Error",
|
||||
"L2 Error", "L-Inf Error"],
|
||||
tablefmt="latex")
|
||||
|
||||
s_table_tab = tabulate(s_table,
|
||||
floatfmt=(".0f", ".3f", ".3f"),
|
||||
headers=["# processors", "Wall-clock time", "Speedup"],
|
||||
tablefmt="latex")
|
||||
|
||||
# Output table to console
|
||||
print(" ")
|
||||
print(p_table_tab)
|
||||
print(" ")
|
||||
print(s_table_tab)
|
||||
|
||||
# Output table to txt file
|
||||
f = open("../parallelization_table.txt", "w+")
|
||||
f.write(p_table_tab)
|
||||
f.close()
|
||||
|
||||
g = open("../speedup_table.txt", "w+")
|
||||
g.write(s_table_tab)
|
||||
g.close()
|
||||
|
||||
# then we put main at the bottom to run everything
|
||||
main()
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+2
-1
@@ -24,7 +24,8 @@ MFEM_LIB_FILE = mfem_is_not_built
|
||||
SEQ_EXAMPLES = ex0 ex1 ex2 ex3 ex4 ex5 ex6 ex7 ex8 ex9 ex10 ex14 ex15 ex16 \
|
||||
ex17 ex18 ex19 ex20 ex21 ex22 ex23 ex24 ex25 ex26 ex27 ex28 ex29 ex30 \
|
||||
ex31 ex33
|
||||
PAR_EXAMPLES = ex0p ex1p ex2p ex3p ex4p ex5p ex6p ex7p ex8p ex9p ex10p ex11p \
|
||||
PAR_EXAMPLES = ex0p ex1p ex2p ex3p ex4p ex5p ex6p ex7p ex8p ex9p \
|
||||
ex9p-continuous ex9p-discontinuous ex10p ex11p \
|
||||
ex12p ex13p ex14p ex15p ex16p ex17p ex18p ex19p ex20p ex21p ex22p ex24p \
|
||||
ex25p ex26p ex27p ex28p ex29p ex30p ex31p ex32p ex33p
|
||||
SEQ_DEVICE_EXAMPLES = ex1 ex3 ex4 ex5 ex6 ex9 ex22 ex24 ex25 ex26
|
||||
|
||||
Reference in New Issue
Block a user