Skip to content

Commit

Permalink
example command and results update.
Browse files Browse the repository at this point in the history
  • Loading branch information
dreamer2368 committed Sep 22, 2023
1 parent 5cc707a commit 1df85a6
Show file tree
Hide file tree
Showing 4 changed files with 165 additions and 31 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
143 changes: 143 additions & 0 deletions examples/data/beam-hex-nurbs.mesh
Original file line number Diff line number Diff line change
@@ -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
47 changes: 19 additions & 28 deletions examples/prom/nonlinear_elasticity_global_rom.py
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down Expand Up @@ -1039,7 +1031,6 @@ def run():
spfespace[0] = fespace

# ParFiniteElementSpace* sp_XV_space;

smm = mfem_support.SampleMeshManager(spfespace)

# vector<int> sample_dofs_empty;
Expand Down Expand Up @@ -1377,4 +1368,4 @@ def run():
return

if __name__ == "__main__":
run()
run()
2 changes: 1 addition & 1 deletion extern/libROM

0 comments on commit 1df85a6

Please sign in to comment.