You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The set of functional tests provides setups for working with manufactured solutions. Central components of a typical workflow are
Define an analytical solution to a given model problem. Derive the right hand side by passing the solution through the governing equations (heavily relying on sympy. For an example, see here
Evaluate the right hand side so that it can be fed into the relevant PorePy model. This typically requires a wrapper and an evaluation step.
Evaluate the analytical solution (primary and secondary variables) at cells and faces for error computation.
Define a data structure for specifying and storing quantities of interest, see here and here
NOTE: There may be other relevant points that I have missed.
Problem statement
The current formulation requires a lot of tailoring for each model problem, and only partly facilitates sharing of common functionality. For an illustration, see the extension between 2d and 3d, and towards more (complex physics)[https://github.com/pmgbergen/porepy/blob/develop/tests/functional/setups/manu_thermoporomech_nofrac_2d.py].
Also, there is a lot of almost duplication of code, see examples here and from here and below. Taken together, this makes for code that is too long, too complex, and difficult to extend, as is well illustrated by the THM setup in 2d and 3d
Room for improvements
Suggested ideas:
Build a library for working with analytical expressions (e.g., define the stress function once). It should be possible both to get a common implementation for 2d and 3d and, hopefully, shared functionality between related physics (conservation of momentum is common, but the definition of the stress will change).
Unify the data storage. I have sketches of how this can be done, though these are most easily shared in other channels.
Simplify the implementation for evalutation of source terms and primary/secondary variables.
There is surely room for a point 4. here.
The text was updated successfully, but these errors were encountered:
Currently, the convergence analysis is invoked by the following steps:
Instantiate the Class: Create an instance of the ConvergenceAnalysis class by providing the required parameters such as the model class, model parameters, number of refinement levels, spatial refinement rate, and temporal refinement rate.
Run Analysis: Use the run_analysis method to perform the convergence analysis. This method runs a batch of simulations with successively refined mesh sizes and/or time steps and collects the results during call to save_data_time_step(). The stored results attribute is an extended dataclass (e.g. MandelSaveData) with whatever data is needed. This is a crucial and unclear contract for the between ConvergenceAnalysis class and the model it operates on. A lot of the heavy lifting is delegated to collect_data(), which is implemented ad hoc in the SaveData class.
Export Errors: After running the simulations, use the export_errors_to_txt method to export the errors into a text file. This method takes the list of results from the run_analysis method and writes the errors into a specified text file.
Compute Order of Convergence: Use the order_of_convergence method to compute the observed order of convergence for a given set of variables. This method performs a linear regression on the log-transformed errors and mesh sizes/time steps to estimate the convergence rate.
Background
The set of functional tests provides setups for working with manufactured solutions. Central components of a typical workflow are
NOTE: There may be other relevant points that I have missed.
Problem statement
The current formulation requires a lot of tailoring for each model problem, and only partly facilitates sharing of common functionality. For an illustration, see the extension between 2d and 3d, and towards more (complex physics)[https://github.com/pmgbergen/porepy/blob/develop/tests/functional/setups/manu_thermoporomech_nofrac_2d.py].
Also, there is a lot of almost duplication of code, see examples here and from here and below. Taken together, this makes for code that is too long, too complex, and difficult to extend, as is well illustrated by the THM setup in 2d and 3d
Room for improvements
Suggested ideas:
There is surely room for a point 4. here.
The text was updated successfully, but these errors were encountered: