Generate Digital Twin From 2D
The Generate Digital Twin From 2D uses the Generate Structure app to generate a digital twin of a 2D reference structure, combined with an optimization algorithm to iterate the twin to the target.

|
Know how! The Nelder–Mead method is a direct search method (based on function comparison) to find the minimum of an objective function in a multidimensional space. The method approximates a local optimum of a problem with n variables when the objective function varies smoothly and is unimodal. The method uses the concept of a simplex, which is a special polytope of n + 1 vertices in n dimensions. In each iteration, it extrapolates the behavior of the objective function measured at each test point in order to find a new test point and to replace one of the old test points with the new one. See the Wikipedia page and Brownlee, 2021 for further details.
In each iteration step of the optimization method, a structure is generated based on the optimization parameters and a scalar-valued error function is evaluated. For this, the generated structure is analyzed, and the results are compared with reference values from the reference structure.
|

|
Modules needed to run this GeoApp:
GrainGeo, PoroDict+MatDict, GeoApp-2Dto3D
|
Clicking Edit... opens the Generate Digital Twin From 2D dialog. At the top, define a Result File Name for the result file and the result folder containing the generated structure.
Initial Parameter Values
Overlay Grains and Gauss Field Settings
In this panel you setup the initial structure for the local optimization.
The Overlay Strength is the field overlay strength in percentage. At 100% overlay strength the result will only show the grain package, while at 0% overlay strength the result will show only the Gaussian random field. If no Random Field is used, this value is automatically set to 100%. If no Grain Generator is used, this value is automatically set to 0%.
|
Grain Generator
Select the basic shape used to generate the 3D structure. Select None as Grain Generator to use only the Gaussian random field for the structure generation. The app uses the GrainGeo - Create command to create the grain structure. Be aware that all lengths are given in the unit voxel.
The values entered for diameters, standard deviations and aspect ratios define the initial structure for the local optimization. They are only used if UseManual was selected for Initial Parameter Values.
For the Sphere shape, the diameters are Gaussian distributed. Select the mean diameter and the standard deviation.
For the Ellipsoid shape, the first diameter is Gaussian distributed. Select the mean diameter and the standard deviation. For the other two diameters, fixed aspect ratios are used.
For the Convex Polyhedron shape, an ellipsoid is used as enclosing object. Select the mean diameter and the standard deviation. For the other two diameters, fixed aspect ratios are used.
|
Random Field
Criteria to Match
Optimization Components
Select the sets of parameters to be used as optimization variables for fitting the reference structure. If not selected, the according parameters from the Digital Twin Setup will stay constant during the optimization.

Select Optimize Overlay Strength to vary the Overlay Strength.
Select Optimize Grain Generator Parameters to vary the diameter, standard deviation and aspect ratio parameters of the Grain Generator. Note that the optimizer does not optimize the generator type, i.e. does not vary between Sphere, Ellipsoid and ConvexPolyhedron shapes.
Select Optimize Random Field Parameters to vary the correlation length(s) and the relative influence parameters of the Random Field. Note that the optimizer does not vary between the OneIsotropicGauss and TwoIsotropicGauss models.
You must select at least one of these options, otherwise the optimizer will fail with an error message
|
Optimization Stopping Criterion
Set the stopping criterion by choosing a maximal number of iterations or set a tolerance accuracy to reach. Note that choosing none or setting the Maximal Number of Optimization Iterations to 0 will perform one single iteration step only.
The selected tolerance applies to the structure generation parameters varied in each iteration step. If the change in these parameters becomes smaller than the selected tolerance, the optimizer stops. The tolerance does not set a limit value for the resulting error function of the found digital twin.

|
Set Geometry Size
Check the box to set the size of the generated 3D structure model.

If the box is not checked, the size of the reference structure is used.
|
Clean up after completion
If checked, all intermediate results are deleted.
|
Set Expert Structure Generation Settings
Activating the check box enables to set one additional parameter.

Check Invert Grains for Overlay to switch pore and solid material. In this case, the grain generator creates the pore space, and the background becomes the solid material.
|
Results
Click OK to input the entered parameters, and then click Run in the GeoApp section to start the app. The results are immediately shown in the opening Result Viewer after the process is finished.
Report tab
In the Structure Details table reports the grid size, voxel length and solid volume percentage of the reference structure and the digital twin.
The Structure Generation Parameters table shows the found optimal structure generation parameters. You can use these parameters as input in the Generate Structure app to create multiple digital twin models.
The Structure Comparison table compares the computed measures of the reference structure and the digital twin and states the error in the respective measure.
The Optimization table report the number of iterations and function evaluations needed. Below, the total runtime of the optimization is reported.
Plots tab
The Parameters by Evaluation and Parameters by Iteration plots show the evolution and convergence of the structure generation parameters in each step.
The Target Errors by Evaluation / Iteration plots show the results of the structure comparison in each step.
Data Visualization

In this tab, you can load the reference structure and the realized digital twin.