GSvit documentation

open source FDTD solver with GPU support

User Tools

Site Tools


Tetrahedral meshes

To create more complex meshes one can use also tetrahedral mesh, which can be obtained (with one intermediate step) from 3D modeling software, like Blender. Software tools for 3D modeling usually do not provide mesh itself, however they can save some files, e.g. in STL format that can be directly used for mesh generation. Then, a mesh generating software is used, like Tetgen. This outputs .node and .ele files that GSvit can read.

Sample parameter file: cow.
A 300x300x300 computational domain with cow model, hit by total/scattered field source. The original model used for creating the mesh was provided courtesy of Yutaka Ohtake by the AIM@SHAPE Shape Repository.

Note that the mesh creation, namely the conversion from your favorite 3D modeler via Tetgen can be sometimes complicated process. In general it is good to start with simple objects and if the whole toolchain works, increase the complexity.

Here is an example of the procedure step-by-step, for much simpler object than a cow. We will use Blender for this. There are many manuals available for Blender so we won't repeate them (and we are not experts on Blender modeling anyway), so there are just few points what we can do to create a particle:

  • Open Blender, we can see the default cube on the screen.
  • Delete the cube: hit delete key and confirm deleting it (you might need to select it before, but it seems to be selected by default)
  • Add a sphere (Add→Mesh→Icosphere). In left panel you can select number of face subdivisions to make it smoother, change it e.g. from 2 to 4.
  • Switch to Edit mode on the bottom panel. All the faces are selected now (yellow).
  • Enable proportional editing on the bottom panel (Mesh→Proportional Editing→Enable).
  • Click on any sphere face by right mouse button and drag it somewhere, sphere should get distorted. Click on the left button to release the mouse. You can repeat this to create shape you like. There are also many other modeling tools if you want to do something really nice. This is how your particle could look like in Blender, after all this editing.

  • Then run File→Export→Stanford (.ply) to save your object into format that can be used further.
  • Install Tetgen if you haven't done so before. Assuming that you named your object file “particle.ply”, call tetgen -p particle.ply
  • If everything went well (which is not always the case), you should obtain files “particle.1.node” and “particle.1.ele”, plus some more similar files that we won't use. This is our tetrahedral mesh. We could use it e.g. within many Finite Element Method software packages and we can use it also for GSvit.

Once we have tetrahedral mesh prepared, we can add this to vector material objects file. Remove spherical particle that we used before and write

21 particle.1 0 0 90 100 100 30 30 30 0 3 1 0 0

This means adding mesh (type of object = 21), written in particle.1.ele and particle.1.node, using no material attributes, magnifying it by factor of 30,30,30 (in x,y,z direction) and shifting to 90, 100, 100. It will be filled with dielectric material with relative permittivity of 3. Note that particle needs to be within the force evaluation box. This is how it might look after setting it up, if you open the files in XSvit:

Sample parameter file: Blender particle.
A 300x300x300 computational domain with a tetrahedral mesh based particle model, hit by total/scattered field source. A force acting on particle is calculated as well.

fdtd/tetrahedral_meshes.txt · Last modified: 2018/02/02 09:36 by pklapetek