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

Physics class + Lassen compatibility #2

Merged
merged 6 commits into from
Jul 3, 2024
Merged

Physics class + Lassen compatibility #2

merged 6 commits into from
Jul 3, 2024

Conversation

dreamer2368
Copy link
Collaborator

@dreamer2368 dreamer2368 commented Jun 17, 2024

Lassen compatibility

Some prerequisites are down-graded to be compatible with Lassen OpenCE-1.9.1.
The burgers 1d equation example is working on LC Lassen. Installation procedure is added in README.

Physics class

FOM simulation solver is now modularized into Physics class. Currently only Burgers1d class is provided as a derived class.

Main member variables:

  • dim: physical space dimension
  • qdim: solution (denoted as q) dimension
  • grid_size: the shape of the grid nd-array.
  • qgrid_size: the shape of the solution nd-array.
  • x_grid: spatial coordinates in numpy nd-array, assuming the shape of:
    • 1d: (grid_size[0], )
    • 2d: (2, grid_size[0], grid_size[1])
    • 3d: (3, grid_size[0], grid_size[1], grid_size[2])
    • higher dimension...
  • nt: number of time steps
  • dt: time step size
  • t_grid: time grid in numpy 1d array
  • offline: boolean to indicate whether the class is for offline simulation

Main member functions:

  • initial_condition(self, param): returns the initial condition according to the parameter param
  • solve(self, param): returns the time history of solution according to the parameter param
  • export(self): returns a dict that stores the class information.
  • generate_solutions(self, params): generates a list of solution time histories, given the list of parameters params

Refactoring physics from other classes

  • BayesianGLaSDI is now initialized with the Physics class and owns it. All physics-relevant information is delegated to the Physics class.
  • Autoencoder class now does not take FOM dimension as input, rather queries from the Physics class.
    • Autoencoder.encoder and Autoencoder.decoder now respects the shape of the FOM solution shape qgrid_size, in their input/output.

InputParser class

InputParser parses a dict, and provides a convenient interface to search multi-level keys, with a capability of default value and data type enforcement.

Activation function input for Autoencoder

At its initialization, autoencoder now looks for the option for activation function. Currently sigmoid and softplus are available. By default it take sigmoid.

@dreamer2368 dreamer2368 marked this pull request as ready for review June 17, 2024 21:57
@dreamer2368 dreamer2368 changed the title physics class Physics class Jun 17, 2024
@chldkdtn
Copy link
Collaborator

@dreamer2368 This looks great. Can you add in README file the instruction of running the new codes?

@chldkdtn
Copy link
Collaborator

chldkdtn commented Jun 24, 2024

@xiaolong7 and @TranApril if you can also keep track of this re-factoring of GPLaSDI code, that would be wonderful.

@dreamer2368
Copy link
Collaborator Author

@dreamer2368 This looks great. Can you add in README file the instruction of running the new codes?

README is now updated.

@dreamer2368 dreamer2368 changed the title Physics class Physics class + Lassen compatibility Jun 26, 2024
@dreamer2368
Copy link
Collaborator Author

@chldkdtn , Zoe was also able to run this branch on Lassen using opence 1.9.1 and visualize the results. Should we merge this branch now?

@chldkdtn
Copy link
Collaborator

chldkdtn commented Jul 3, 2024

@chldkdtn , Zoe was also able to run this branch on Lassen using opence 1.9.1 and visualize the results. Should we merge this branch now?

Okay, let's merge it now. @andersonw1 can catch up on this later.

@dreamer2368 dreamer2368 merged commit 9b4cb93 into main Jul 3, 2024
@dreamer2368 dreamer2368 deleted the physics branch October 23, 2024 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants