mechanoChemML.workflows.pde_solver.pde_workflow_steady_state¶
Module Contents¶
Classes¶
PDEWorkflowSteadyState |
General Weak PDE constrained workflow. |
-
class
mechanoChemML.workflows.pde_solver.pde_workflow_steady_state.PDEWorkflowSteadyState[source]¶ General Weak PDE constrained workflow.
Workflow for any specific physical system should inherit from this general workflow.
-
_bulk_residual(self)[source]¶ Dummy _bulk_residual function. The actual residual should be implemented in each physical problem.
Todo
- Please implement the residual in each related physical systems (PDEs).
Error
- Not implemented.
-
_compute_residual(self, features, y_pred, only_y_pred=False)[source]¶ Compute different residuals, and apply the Dirichlet BCs to the NN predicted solutions.
Parameters: - features (tensor) – size of [None, :, :, 2*dof]
- y_pred (tensor) – size of [None, :, :, dof]
Returns: - different residuals and the y_pred with applied Dirichlet BCs.
-
_loss_probabilistic(self)[source]¶ General probabilistic loss functions. The _compute_residual() has to be specified in each problem.
-
_loss_deterministic(self)[source]¶ General deterministic loss functions. The _compute_residual() has to be specified in each problem.
-
_load_saved_cnn_model(self)[source]¶ Use saved optimized CNN parameters to initialize the mean of BNN parameters.
-
test(self, test_folder='', plot_png=True, output_reaction_force=False)[source]¶ Make prediction with the surrogate model
Parameters: test_folder (str) – folder name under relative to the DataPath in the config.ini file. Note
- If test_folder is not specified, this subroutine will make prediction based on test_seq that is split from the training dataset.
- If test_folder is specified, this subroutine will load all the data from the folder to test_seq to make prediction.
- For deterministic model, the MonteCarloNum from config.ini is over written to 1.
-
test_residual_gaussian(self, noise_std=0.001, sample_num=10000)[source]¶ Test the residual noise distribution based on a Gaussian perturbation to inputs.
Parameters: Note: It is preferred to use the DNS label data to make the test as the actually residual (mean) from such data is very small. By default, it will load data from DataPath/DNS. Only the first data point will be used.
-