Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parametric DMD for heat conduction example #6

Merged
merged 12 commits into from
Aug 24, 2023
Merged

Parametric DMD for heat conduction example #6

merged 12 commits into from
Aug 24, 2023

Conversation

dreamer2368
Copy link
Collaborator

@dreamer2368 dreamer2368 commented Aug 17, 2023

Parametric DMD for heat conduction example

  • Example command (at examples/dmd directory):
rm -rf parameters.txt
python3 parametric_heat_conduction.py -r 0.1 -cx 0.1 -cy 0.1 -o 4 -visit -offline -rdim 16
python3 parametric_heat_conduction.py -r 0.1 -cx 0.1 -cy 0.5 -o 4 -visit -offline -rdim 16
python3 parametric_heat_conduction.py -r 0.1 -cx 0.5 -cy 0.1 -o 4 -visit -offline -rdim 16
python3 parametric_heat_conduction.py -r 0.1 -cx 0.5 -cy 0.5 -o 4 -visit -offline -rdim 16
python3 parametric_heat_conduction.py -r 0.5 -cx 0.1 -cy 0.1 -o 4 -visit -offline -rdim 16
python3 parametric_heat_conduction.py -r 0.25 -cx 0.2 -cy 0.4 -o 4 -online -predict
python3 parametric_heat_conduction.py -r 0.4 -cx 0.2 -cy 0.3 -o 4 -online -predict
  • Offline phase output:
step 50, t = 0.500000
Creating DMD with rdim: 16
Elapsed time for training DMD: 9.828897e-01 second
Elapsed time for solving FOM: 1.608722e+01 second
  • Online phase output ( -r 0.25 -cx 0.2 -cy 0.4 -o 4 case):
Predicting temperature using DMD at: 0.500000
Relative error of DMD temperature (u) at t_final: 0.500000 is 0.002553
Elapsed time for predicting DMD: 2.413442e-01 second
Elapsed time for training DMD: 1.537206e+00 second
Elapsed time for solving FOM: 1.624711e+01 second
  • Online phase output (-r 0.4 -cx 0.2 -cy 0.3 -o 4 case):
Predicting temperature using DMD at: 0.500000
Relative error of DMD temperature (u) at t_final: 0.500000 is 0.069653
Elapsed time for predicting DMD: 2.130713e-01 second
Elapsed time for training DMD: 1.341296e+00 second
Elapsed time for solving FOM: 1.333549e+01 second

new pylibROM bindings

  • Bindings for CSVDatabase and HDFDatabase. Only minimal member functions are binded now.
  • Binding for getParametricDMD:
    • c++ getParametricDMD passes a pointer reference as output parameter, which format cannot be supported in python.
    • In python, a newly created pointer is returned from the function.
    • In c++, the pointer reference determines the derived class type of DMD. In python, we pass the class method itself instead. For example, note the first argument in the following snippet:
import pylibROM.algo as algo
dmd_u = algo.getParametricDMD(algo.DMD, param_vectors, dmd_paths, desired_param)
  • python_utils.StopWatch module added in place of mfem::StopWatch class, which is not supported by PyMFEM.
  • Re-wrote PointwiseSnapshot class in python. However, this is currently not supported:
    • PointwiseSnapshot class requires FindPointsGSLIB::GetCode() function which is supposed to return mfem::Array<unsigned int>. However, this is currently not working properly on PyMFEM side. See the issue.

Miscellaneous PyMFEM issue:

The latest version (v4.5.2.1) of PyMFEM has an installation issue with gslib. To install PyMFEM with gslib, PyMFEM must be v.4.5.2.0. The following command will install PyMFEM with parallel mfem and gslib:

python3 setup.py install --with-parallel --with-gslib

Add --user flag if this is installed on LC quartz.

@dreamer2368 dreamer2368 marked this pull request as ready for review August 17, 2023 21:17
@dreamer2368 dreamer2368 added the RFR Ready for review label Aug 17, 2023
@dreamer2368 dreamer2368 changed the title Pdmd Parametric DMD for heat conduction example Aug 17, 2023
@chldkdtn
Copy link
Collaborator

@ebchin Please check out this parametric DMD examples in pylibROM. Will this be helpful?

@dreamer2368 dreamer2368 merged commit b9581d4 into main Aug 24, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFR Ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants