When using the FDTD solver in Ansys Lumerical FDTD™, the software has an advanced option to re-use the mesh to speed up certain simulations.
This article details the requirements for simulations to use this functionality, and methods to use this functionality. This functionality is supported in both CPU and GPU simulations.
|
[[WARNING]] This is an advanced functionality, and while guidance is provided here on when it should be used, you must take responsibility in ensuring that this approach is suitable for your use case and that your simulation meets the conditions to use this feature. |
Re-using the mesh allows you to speed up simulations when the geometry is very complex, and you want to adjust the position, polarization, or injection direction of source(s) and/or monitor(s) in the simulation.
The simulations you intend to re-use the mesh between mush also meet the following conditions:
- The simulation geometry must be identical.
- The simulation bandwidth must be identical.
- All materials in the simulation must be identical.
- The FDTD simulation grid must be identical.
- The FDTD timestep must be identical.
- All boundary conditions must be identical.
Using the functionality
To re-use the mesh, use the -inmaterialfile and -outmaterialfile command line flags with the FDTD engine. For further information on running the engine, see the knowledge base articles Running simulations using the Windows command prompt and Running simulations using the terminal on Linux.
-outmaterialfile
The -outmaterialfile flag outputs simulation mesh as one or more files containing the mesh data.
The syntax to use this flag is as follows. In this case, myProject.fsp is run with the GPU, and the mesh is saved into path/to/keep/as a series of files that has the prefix myProjectTempData.
fdtd-engine -gpu -outmaterialfile path/to/keep/myProjectTempData myProject.fsp-inmaterialfile
The -inmaterialfile flag attempts to read data from a given path. If the load is successful, the simulation skips the meshing step and directly proceeds to running the simulation. If the load is unsuccessful, the simulation exits with an error.
Warning: Except for the FDTD grid, the software does not validate whether your simulation meets the conditions stated above when loading the mesh. You must manually ensure that other conditions are met. If you encounter repeated unexpected validation errors, you can use the User specified mesh settings in the FDTD solver object.
The syntax to use this flag is as follows. In this case, the command attempts to read data from path/to/keep/myProjectTempData[...], and runs the simulation in myProject.fsp.
fdtd-engine -gpu -inmaterialfile path/to/keep/myProjectTempData myProject.fsp