Boundary and Initial data

First, we initialize the new worksheet; Note:

  1. This tutorial can be found in the source code repository as as BoundaryAndInitialData.ipynb. One can directly load this into Jupyter to interactively work with the following code examples.
  2. In the following line, the reference to BoSSSpad.dll is required. You must either set #r "BoSSSpad.dll" to something which is appropirate for your computer (e.g. C:\Program Files (x86)\FDY\BoSSS\bin\Release\net5.0\BoSSSpad.dll if you installed the binary distribution), or, if you are working with the source code, you must compile BoSSSpad and put it side-by-side to this worksheet file (from the original location in the repository, you can use the scripts getbossspad.sh, resp. getbossspad.bat).

This tutorial demostrates the definition, resp. the import of data for boundary and initial values.

In order to demonstrate the usage, we employ the exemplaric Poisson solver.

We use the following helper function to create a template for the multiple solver runs.

Again, we are using the workflow management

Textual and Embedded formulas

Provide initial data as a text:

Finally, all initial data is stored in the AppControl.InitialValues dictionary and all boundary data is stored in the AppControl.BoundaryValues dictionary.

The common interface for all varinats to specify boundary and initial data is IBoundaryAndInitialData

The snippet above is only a shortcut to add a Formula object, which implements the IBoundaryAndInitialData interface.

In BoSSSpad, such objects can also be extracted from static methods of classes; note that these should not depend on any other object in the worksheet.

Creates a Job named J1 and runs it

The next line prints the Status of the Job J1.

We can print the Status of the Job J1.

We can also check via a method if the Job J1 is truly finished

1D Splines

Splines can be used to interpolate nodal data onto a DG field; currently, only 1D is supported.

Interpolating values from other Calculations

For demonstrational purposes, we use the result (i.e. the last time-step) of a previous calculation as a right-hand-side for the next calculation.

We encapsulate the value T in the ForeignGridValue object, which allows interpolation between different meshes:

Since the quadrilateral mesh used for the original right-hand-side is geometrically embedded in the triangular mesh the interpolation error should be zero (up to machine precision).

Restart from Dummy-Sessions

Dummy sessions are kind of fake siolver runs, with the only purpose of using them for a restart.

We save the DG field RHSforRestart in the database; This automatically creates a timestep and a session which host the DG field:

This time step can be used as a restart value.:

Note

Since no mesh interpolation is performed for the restart, it is much faster than ForeignGridValue but less flexible (a restart is always performed on the same mesh).

To avoid multiple mesh interpolations (e.g. when multiple runs are required) one coudl therefore speed up the process by doing the mesh interpolation once use ProjectFromForeignGrid in BoSSSpad and save the interpolation in a dummy session.