Compare commits

...
Author SHA1 Message Date
Madison Sheridan 79378f7412 Adjusted entropy residual computation check for nonzero denominator. 2022-08-18 09:29:27 -07:00
Madison Sheridan 91893ef7a4 Implementing high order IDP method as described in the 2017 paper, validated for 1D and on a single processor. 2022-08-16 15:03:26 -07:00
Madison Sheridan ad67be026b Added step function to exact_sol. 2022-08-16 15:00:53 -07:00
Madison Sheridan 96c939f480 Added -gif option. 2022-08-12 14:33:15 -07:00
Madison Sheridan ab07141b39 Fixed case 6, added case 7 from Tadmoor paper, added -gif option. 2022-08-12 14:32:28 -07:00
Madison Sheridan 099b6bd69f Updating .gitignore to ignore output directory and my copy of periodic segment. 2022-08-11 16:05:30 -07:00
Madison Sheridan 050bc663b7 Added flux option, changed parameters that build dij matrix requires to apply to multiple fluxes, added test case for Burgers equation, modifief optimal timestep calculation. 2022-08-11 12:50:59 -07:00
Madison Sheridan 5c7b8a80ad Updating decimal precision for convergence rates to 6 places. 2022-08-11 08:40:33 -07:00
Madison Sheridan 470d694648 Changed how lumpedM is retrieved. Simulation in 3d working. 2022-08-01 14:32:07 -07:00
Madison Sheridan 66fa40436a Corrected calculation of convergence rates. 2022-07-27 09:53:10 -07:00
Madison Sheridan 80cecfca3c Adding optionn to optimize timestep based on CFL. 2022-07-27 09:51:37 -07:00
Madison Sheridan 6dfbcff293 Updated periodic segment to be on [-1,1] rather than [0,1]. 2022-07-27 09:50:18 -07:00
Madison Sheridan 3600e11a7e Using single coefficient in exact_sol for all dimensions. 2022-07-26 10:40:32 -07:00
Madison Sheridan a6030c27ec Untracking bash scripts in ex9p-analysis/scripts directory. 2022-07-22 16:25:01 -07:00
Madison Sheridan 8ce443953a Corrected cfl condition calculation, minor implementation of conditionally optimizing timestep. 2022-07-22 16:22:47 -07:00
Madison Sheridan 190f755813 Removing tracking of bash scripts in ex9p-analysis. 2022-07-22 16:14:33 -07:00
Madison Sheridan cefb7c4528 Adding python script to create error and convergence plots. 2022-07-22 16:12:03 -07:00
Madison Sheridan 9f623e948e Ensure each entry in lumped mass matrix is positive with simple assert. 2022-07-19 23:49:02 -07:00
Madison Sheridan 21d67b35bc Testing on 1-9 processors. 2022-07-19 14:26:24 -07:00
Madison Sheridan 6149caa551 Code cleanup, CFL constrained timestep MPI sync. 2022-07-19 14:24:11 -07:00
Madison Sheridan 9206d7cbcd Clearing diagonal entries of sparse matrix and using a vector dot product implementation due to sparsity pattern problems. 2022-07-18 16:21:52 -07:00
Madison Sheridan 1a2c9bb1f4 Updating files to test convergence and parallelization. 2022-07-15 16:17:36 -07:00
Madison Sheridan 3aaf0f519f SparseMatrix implementation for dij, still giving inconsistent errors across parallelization. 2022-07-15 16:17:12 -07:00
Madison Sheridan 9ea51d8455 Broken DenseMatrix-SparseMatrix code. 2022-07-15 15:07:38 -07:00
Madison Sheridan 7bfe51870d Revising dij assembly and have proper test of Hypre mat-vec multiplication thanks to Dr. Tomov's help. 2022-07-13 14:59:00 -07:00
Madison Sheridan 04204afa71 Testing SparseMatrix multiplication with HypreParMatrix. 2022-07-13 08:20:16 -07:00
Madison Sheridan 1969eb5934 Testing mfem mesh files with continuous mesh. 2022-07-08 13:38:58 -07:00
Madison Sheridan 6d22e4c6fc Testing KeepNbrBlock with simple 2 cell mesh. 2022-07-08 13:38:04 -07:00
Madison Sheridan f9a53fd7ba Parallel Assemble and extract local sparse matrix from K to make sure each element's contribution is counted. Resulting in 'bumps' at processor boundaries. 2022-07-06 15:04:01 -07:00
Madison Sheridan c362e572d5 Still having processor issues, lots of comments, made modified dij assemble function to test DiagOffD spmat. 2022-06-30 15:29:57 -07:00
Madison Sheridan c2683b746b Input ParGridFunction into Step but giving bad errors. 2022-06-27 14:09:30 -07:00
Madison Sheridan 4b57b95860 Ignore qt generated files. 2022-06-27 14:08:46 -07:00
Madison Sheridan e2fafa7ebf Added 3d implementation to problem 4 for testing. 2022-06-23 16:31:45 -07:00
Madison Sheridan 27700aaea6 Validating periodic-square mesh. 2022-06-22 15:33:23 -07:00
Madison Sheridan fea83dcbe6 Added implementation of global cfl timestep calculation and verification. 2022-06-22 15:32:57 -07:00
Madison Sheridan 62f08152f6 Added speedup computation and table output to process. 2022-06-22 10:48:31 -07:00
Madison Sheridan 9a16d4dd37 Updating bash scripts for convergence and parallelization analysis. 2022-06-21 16:01:03 -07:00
Madison Sheridan 287a827fe2 Resolved parallelization error issue in construction of dij_mmatrix. 2022-06-21 15:58:19 -07:00
Madison Sheridan b87705a84f Ignore VScode specific directories. 2022-06-21 15:57:31 -07:00
Madison Sheridan 8e883640ab Using diagonal HypreParMatrix with a RAP function, but still incurring same issue with errors. 2022-06-17 16:32:28 -07:00
Madison Sheridan 8f3a999c70 Added verification that dij_matrix is symmetric. 2022-06-17 13:51:38 -07:00
Madison Sheridan 84627af245 Testing parallelization for periodic-square mesh and getting same errors on np1 and np2 but different errors on np4. 2022-06-16 15:47:35 -07:00
Madison Sheridan bb3433ce3b No time dependence on dij_matrix yet, so construct once. 2022-06-16 15:06:50 -07:00
Madison Sheridan 548624b1e3 Reverting to vector implementation of mass matrix to test convergence and parallelization. 2022-06-16 15:03:18 -07:00
Madison Sheridan e2043082f1 Testing convergence and parallelization of ex9p in dg with custom test case (problem = 4) 2022-06-16 15:02:47 -07:00
Madison Sheridan 5671c6f5e0 Updated exact solution problem=0 to test for convergence. 2022-06-15 08:09:30 -07:00
Madison Sheridan 190580ce89 Adding python and bash scripts to run convergence and parallelization tests. 2022-06-15 08:09:03 -07:00
Madison Sheridan 706d625d3c Updating .gitignore to track output files from ex9p-continuous as well as saved output folders in examples/ex9p-analysis. 2022-06-15 08:06:45 -07:00
Madison Sheridan d6e5ed463d Using HyprePCG solver, system is ParallelAssembled, but seeing minor inconsistencies with 4 processors. 2022-06-10 14:33:55 -07:00
Madison Sheridan ec6c067e45 Working parallelization for 2 processors, but not 4. Think there is an issue with the preconditioner. 2022-06-10 12:15:36 -07:00
Madison Sheridan d4199f386c Form M_lumped in FE_Evolution constructor. 2022-06-08 11:58:47 -07:00
Madison Sheridan 7eecfc4162 Removed AIR_prec class and prec_type implementation that was carried over from ex9p. 2022-06-08 11:07:35 -07:00
Madison Sheridan 683500a0f1 Working parallel implementation using ParallelAssemble(). 2022-06-08 09:48:38 -07:00
Madison Sheridan 898f5974cd Ignore output files ex9p-continuous-final.* 2022-06-07 07:40:54 -07:00
Madison Sheridan dc21922ce6 Copied defaults.cmake to user.cmake in prep for future cmake implementation with ex9p-continuous. 2022-06-06 11:41:01 -07:00
Madison Sheridan 1cf6076c3c Updated to ignore misc output files from ex9p-continuous. 2022-06-06 11:40:24 -07:00
Madison Sheridan 9647d381e1 Adding serialized version of ex9p with continuous elements, along with corresponding compile options in makefile. 2022-06-06 10:08:14 -07:00
Madison Sheridan 2835afe636 Updating .gitignore to ignore exp9-continuous executable. 2022-06-06 10:07:08 -07:00
11 changed files with 3281 additions and 5 deletions
+35
View File
@@ -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
+268
View File
@@ -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.")
+4 -4
View File
@@ -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
+50
View File
@@ -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
+43
View File
@@ -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
View File
@@ -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