From 1df85a636b947a6f848d4490100d64d802ef4ea9 Mon Sep 17 00:00:00 2001 From: Seung Whan Chung Date: Thu, 21 Sep 2023 19:04:24 -0700 Subject: [PATCH] example command and results update. --- README.md | 4 +- examples/data/beam-hex-nurbs.mesh | 143 ++++++++++++++++++ .../prom/nonlinear_elasticity_global_rom.py | 47 +++--- extern/libROM | 2 +- 4 files changed, 165 insertions(+), 31 deletions(-) create mode 100644 examples/data/beam-hex-nurbs.mesh diff --git a/README.md b/README.md index b29a4e4..bd4c8e5 100644 --- a/README.md +++ b/README.md @@ -38,11 +38,11 @@ For parallel version, a manual installation is required: ``` git clone https://github.com/mfem/PyMFEM.git cd PyMFEM -python3 setup.py install --with-parallel +python3 setup.py install --with-parallel --with-gslib ``` On LC quartz, use `--user` flag: ``` -python3 setup.py install --with-parallel --user +python3 setup.py install --with-parallel --with-gslib --user ``` Make sure [`swig`](https://pypi.org/project/swig) is installed first. Also, the binary file must be located in `PATH` environment variable. diff --git a/examples/data/beam-hex-nurbs.mesh b/examples/data/beam-hex-nurbs.mesh new file mode 100644 index 0000000..f64a6da --- /dev/null +++ b/examples/data/beam-hex-nurbs.mesh @@ -0,0 +1,143 @@ +MFEM NURBS mesh v1.0 + +# +# MFEM Geometry Types (see mesh/geom.hpp): +# +# SEGMENT = 1 +# SQUARE = 3 +# CUBE = 5 +# + +dimension +3 + +elements +2 +1 5 0 1 4 5 6 7 10 11 +2 5 1 2 3 4 7 8 9 10 + +boundary +10 +3 3 5 4 1 0 +3 3 0 1 7 6 +3 3 4 5 11 10 +1 3 5 0 6 11 +3 3 6 7 10 11 +3 3 4 3 2 1 +3 3 1 2 8 7 +2 3 2 3 9 8 +3 3 3 4 10 9 +3 3 7 8 9 10 + +edges +20 +0 0 1 +0 5 4 +0 6 7 +0 11 10 +1 1 2 +1 4 3 +1 7 8 +1 10 9 +2 0 5 +2 1 4 +2 2 3 +2 6 11 +2 7 10 +2 8 9 +3 0 6 +3 1 7 +3 2 8 +3 3 9 +3 4 10 +3 5 11 + +vertices +12 + +knotvectors +4 +1 5 0 0 1 2 3 4 4 +1 5 0 0 1 2 3 4 4 +1 2 0 0 1 1 +1 2 0 0 1 1 + +weights +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 + +FiniteElementSpace +FiniteElementCollection: NURBS1 +VDim: 3 +Ordering: 1 + +0 0 0 +4 0 0 +8 0 0 +8 1 0 +4 1 0 +0 1 0 +0 0 1 +4 0 1 +8 0 1 +8 1 1 +4 1 1 +0 1 1 +1 0 0 +2 0 0 +3 0 0 +3 1 0 +2 1 0 +1 1 0 +1 0 1 +2 0 1 +3 0 1 +3 1 1 +2 1 1 +1 1 1 +5 0 0 +6 0 0 +7 0 0 +7 1 0 +6 1 0 +5 1 0 +5 0 1 +6 0 1 +7 0 1 +7 1 1 +6 1 1 +5 1 1 diff --git a/examples/prom/nonlinear_elasticity_global_rom.py b/examples/prom/nonlinear_elasticity_global_rom.py index ceef24c..f12152c 100644 --- a/examples/prom/nonlinear_elasticity_global_rom.py +++ b/examples/prom/nonlinear_elasticity_global_rom.py @@ -43,44 +43,36 @@ # // Online phase with full sampling: # // python3 nonlinear_elasticity_global_rom.py -online -dt 0.01 -tf 5.0 -s 14 -vs 100 -hyp -rvdim 40 -rxdim 10 -hdim 71 -nsr 1170 -sc 1.00 # // Output message: -# // Elapsed time for time integration loop 1.80759 -# // Relative error of ROM position (x) at t_final: 5 is 0.000231698 -# // Relative error of ROM velocity (v) at t_final: 5 is 0.466941 -# // -# // Online phase with strong hyper-reduction: -# // python3 nonlinear_elasticity_global_rom.py -online -dt 0.01 -tf 5.0 -s 14 -vs 100 -hyp -rvdim 40 -rxdim 10 -hdim 71 -nsr 100 -sc 1.00 -# // Output message: -# // Elapsed time for time integration loop 1.08048 -# // Relative error of ROM position (x) at t_final: 5 is 0.00209877 -# // Relative error of ROM velocity (v) at t_final: 5 is 1.39472 +# Elapsed time for time integration loop 5.87029e+00 +# Relative error of ROM position (x) at t_final: 5.000000 is 2.31698489e-04 +# Relative error of ROM velocity (v) at t_final: 5.000000 is 4.66941161e-01 +# Elapsed time for entire simulation 9.86927e+00 # // # // ================================================================================= # // -# // Sample runs and results for parametric ROM using only displacement basis -# // and nonlinear term basis: +# // Sample runs and results for parametric ROM using displacement basis, velocity basis +# // and nonlinear term basis, with velocity initial condition: (3d case in librom.net) +# // # // Offline phase: -# // ./nonlinear_elasticity_global_rom -offline -dt 0.01 -tf 5.0 -s 14 -vs 100 -sc 0.90 -xbo -def-ic -id 0 -# // ./nonlinear_elasticity_global_rom -offline -dt 0.01 -tf 5.0 -s 14 -vs 100 -sc 1.10 -xbo -def-ic -id 1 +# // python3 nonlinear_elasticity_global_rom.py --mesh ../data/beam-hex-nurbs.mesh -offline -dt 0.01 -tf 5.0 -s 14 -vs 10 -sc 3.90 -id 0 +# // +# // python3 nonlinear_elasticity_global_rom.py --mesh ../data/beam-hex-nurbs.mesh -offline -dt 0.01 -tf 5.0 -s 14 -vs 10 -sc 4.10 -id 1 # // # // Merge phase: -# // ./nonlinear_elasticity_global_rom -merge -ns 2 -dt 0.01 -tf 5.0 -xbo +# // python3 nonlinear_elasticity_global_rom.py --mesh ../data/beam-hex-nurbs.mesh -merge -ns 2 -dt 0.01 -tf 5.0 # // # // Create FOM comparison data: -# // ./nonlinear_elasticity_global_rom -offline -dt 0.01 -tf 5.0 -s 14 -vs 100 -sc 1.00 -xbo -def-ic -id 2 +# // python3 nonlinear_elasticity_global_rom.py --mesh ../data/beam-hex-nurbs.mesh -offline -dt 0.01 -tf 5.0 -s 14 -vs 5 -sc 3.92 -id 2 # // # // Online phase with full sampling: -# // ./nonlinear_elasticity_global_rom -online -dt 0.01 -tf 5.0 -s 14 -vs 100 -hyp -rxdim 57 -hdim 183 -nsr 1170 -sc 1.00 -xbo -def-ic +# // python3 nonlinear_elasticity_global_rom.py --mesh ../data/beam-hex-nurbs.mesh -online -dt 0.01 -tf 5.0 -s 14 -vs 5 -hyp -rvdim 40 -rxdim 10 -hdim 71 -nsr 200 -sc 3.92 # // Output message: -# // Elapsed time for time integration loop 18.9874 -# // Relative error of ROM position (x) at t_final: 5 is 7.08272e-05 -# // Relative error of ROM velocity (v) at t_final: 5 is 0.00387647 +# Elapsed time for time integration loop 3.47888e+01 +# Relative error of ROM position (x) at t_final: 5.000000 is 5.08981700e-03 +# Relative error of ROM velocity (v) at t_final: 5.000000 is 9.11743695e+00 +# Elapsed time for entire simulation 6.63521e+01 # // -# // Online phase with strong hyper reduction: -# // ./nonlinear_elasticity_global_rom -online -dt 0.01 -tf 5.0 -s 14 -vs 100 -hyp -rxdim 2 -hdim 4 -nsr 10 -sc 1.00 -xbo -def-ic -# // Output message: -# // Elapsed time for time integration loop 1.01136 -# // Relative error of ROM position (x) at t_final: 5 is 0.0130818 -# // Relative error of ROM velocity (v) at t_final: 5 is 0.979978 +# // ================================================================================= # // # // This example runs in parallel with MPI, by using the same number of MPI ranks # // in all phases (offline, merge, online). @@ -1039,7 +1031,6 @@ def run(): spfespace[0] = fespace # ParFiniteElementSpace* sp_XV_space; - smm = mfem_support.SampleMeshManager(spfespace) # vector sample_dofs_empty; @@ -1377,4 +1368,4 @@ def run(): return if __name__ == "__main__": - run() \ No newline at end of file + run() diff --git a/extern/libROM b/extern/libROM index e6b798b..4509741 160000 --- a/extern/libROM +++ b/extern/libROM @@ -1 +1 @@ -Subproject commit e6b798b0d08f04106c2dfc382af4afbd327bd015 +Subproject commit 4509741f3c30275d49c4f9431acc6fa7c007efa3