Closed dreamer2368 closed 4 months ago
@dreamer2368 This looks great. Can you add in README file the instruction of running the new codes?
@xiaolong7 and @TranApril if you can also keep track of this re-factoring of GPLaSDI code, that would be wonderful.
@dreamer2368 This looks great. Can you add in README file the instruction of running the new codes?
README is now updated.
@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 , 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.
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
classFOM simulation solver is now modularized into
Physics
class. Currently onlyBurgers1d
class is provided as a derived class.Main member variables:
dim
: physical space dimensionqdim
: solution (denoted as q) dimensiongrid_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:(grid_size[0], )
(2, grid_size[0], grid_size[1])
(3, grid_size[0], grid_size[1], grid_size[2])
nt
: number of time stepsdt
: time step sizet_grid
: time grid in numpy 1d arrayoffline
: boolean to indicate whether the class is for offline simulationMain member functions:
initial_condition(self, param)
: returns the initial condition according to the parameterparam
solve(self, param)
: returns the time history of solution according to the parameterparam
export(self)
: returns adict
that stores the class information.generate_solutions(self, params)
: generates a list of solution time histories, given the list of parametersparams
Refactoring physics from other classes
BayesianGLaSDI
is now initialized with thePhysics
class and owns it. All physics-relevant information is delegated to thePhysics
class.Autoencoder
class now does not take FOM dimension as input, rather queries from thePhysics
class.Autoencoder.encoder
andAutoencoder.decoder
now respects the shape of the FOM solution shapeqgrid_size
, in their input/output.InputParser
classInputParser
parses adict
, 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
andsoftplus
are available. By default it takesigmoid
.