##### Page tree
Go to start of banner

# Grid Appendix

In this section, you will learn about:

• Concept of creating a grid in EMPro.
• How to choose a cell size to optimize your EMPro project calculation.
• Methods for varying the EMPro grid.
• How to debug the EMPro grid.

## Grid Concepts Overview

The grid consists of three sets of points, one set for each axis: X, Y and Z. At each point is a plane. For example, consider the point at X = 3, which defines a plane in Y and Z. The point Y = 4 defines a plane in X and Z. The point Z = 5 defines a plane in X and Y. Where two planes intersect is a line. Planes from the remaining axis cut that line into edges. These edges are called "cell edges". Building the grid consists of defining the appropriate set of plane-defining points for each axis. (Meshing, which occurs after gridding, is the act of assigning materials to each cell edge.)

The figure below displays intersecting planes in 3-D with lines and cell edges highlighted. The intersecting planes with lines (in yellow) and sample cell edges in the upper-left corner of the XY-plane (in red) are displayed.

Except for some special features associated with components, which are discussed below, the grid is made up of the following elements:

• Fixed points
• Grid regions
• Target cell sizes
• Automatic fixed point merge distances

A fixed point is a point on an axis at which a plane, in the other two axes, exists. Edge-on, that plane is seen as a line. That is what is meant by a "grid line". A grid region is a bounded part of the grid. Grid lines are placed at the grid region boundaries. Within a grid region the target cell size and the fixed point merge distance can be different from the project's default target cell size and/or merge distance. One fixed point is placed at the beginning of each grid region and another fixed point is placed at the end of each region.

The figure below displays intersecting planes in 3-D with fixed points, grid lines and a grid region highlighted.

###### Intersecting planes with fixed points (in red), grid lines (in blue) and a grid region (in green)

Manual fixed points and manual grid regions are specified in the Grid Tools dialog. Other grid regions and fixed points, associated with individual parts, may be specified using the Gridding Properties Editor. Grid regions associated with a part are called part grid regions. Fixed points associated with parts are called automatic fixed points, because they are automatically extracted from the geometry of the part.

Taking these elements together, the grid is made up of manual fixed points, automatic fixed points, manual grid regions and part grid regions. Each kind of grid region contains a target cell size and an automatic fixed point merge distance. Those values are used when creating the grid.

Note

It is important when building a grid to control the size of the smallest cell in the grid. The project's timestep is derived from the smallest grid cell's edge length. Smaller timesteps result in longer runs and larger timesteps result in faster runs. For that reason it is important to prevent the grid from having a cell edge smaller than what is necessary to get the desired results.

Automatic fixed points and part grid regions are extracted from geometry and may result in points so close that the timestep is smaller than desired. The fixed point merge distance is used to merge automatic fixed points in order to provide control of the timestep. Automatic fixed points are merged so that they are no closer than the merge distance. If a grid region start or end boundary is too close to another grid point, the grid region may be expanded to prevent the too-small timestep. The grid region is always expanded, never contracted, in these situations.

The grid is created in the following steps. Each axis, X, Y and Z, is considered separately. Note that when considering only a single axis, a cell size is really just an edge size.

• Create a set containing manual and automatic fixed points and the fixed points from the borders of manual and part grid regions. If the Specify Padding option is chosen, then fixed points for overall bounds of the geometry are added to the set.
###### Editing the grid with the Specify Padding option chosen

• Automatic fixed points are merged according to the merge distance. The fixed point merge distance can have different values at different points on the grid. There is a "main grid" fixed point merge distance that is specified on the Size tab (see the figure above). Each grid region, including both manual and part grid regions, has its own fixed point merge distance. The smallest fixed point merge distance for a given point on the grid is chosen from all manual and/or part grid regions covering the given point. If no grid region covers the given point, the main grid fixed point merge distance is chosen. Note that this allows grid regions to specify a merge distance greater than the main grid fixed point merge distance. Notice that in the figure below a smaller merge distance is specified in the grid region than that of the main grid.
###### Adding a grid region with a smaller cell size than the main grid

• The movable points, for example automatic fixed points and grid region start/end boundaries, are moved away from unmovable points. Unmovable points include manual fixed points and some entries associated with components, as described below. Remember that grid regions never shrink in order to ensure that regions needing improved accuracy get it.
• The set of grid points is examined. Transition regions are added to prevent adjacent cell size ratios from violating the maximum cell step factor specified on the Limits tab. For example, a transition region is generated if the maximum cell step factor is 2, and 2 adjacent cells have sizes 5 mm and 1 mm. A transition region contains the fewest number of cells required to reach the desired cell size. Each cell in the transition region has a progressively larger size. In the following figure, the Maximum Cell Step Factor shown is never exceeded by adjacent cell size ratios.

• The set of grid points, including the transition regions, is examined. Gaps greater than the target cell size at the given point are filled evenly with the fewest number of cells required such that the cell size is less than or equal to the target. For example, consider a gap of 9.7 mm with a target cell size of 1 mm. In this case, 8 new points must be added to the 2 points surrounding the gap. The distance is , bridged by 9 cell edges. Each cell edge will be per edge.

That completes the calculation of grid points. There are some key facts to note:

No matter what the fixed point merge distance may be, it is always possible for there to be two fixed points a distance of apart after the merging has been completed. If the target cell size at the given point is less than , then this distance must be subdivided into two or more cell edges.

Consider a 0.7 mm merge distance with a .2 mm target size. Given that  remainder  , there must be 3 grid lines in the 0.7 mm gap. Those 3 grid lines create 4 spaces in the gap. The gaps are each. The formula is:

The target cell size may be greater than the automatic fixed point merge distance. Consider a merge distance of 0.7 mm and a target distance of 1 mm. If the automatic fixed points are dense then every gap is exactly 0.7 mm. No gaps are greater than 1 mm, so the work is done. If there was at least one region of sparse automatic fixed points then there may be a gap greater than 1 mm. That gap must be bridged using one or more extra grid lines. The smallest such gap is , or 0.5 mm in our example.

The smallest cell in the grid will be the smaller of and . Any given grid may not encounter one or both of those situations, so that grid's smallest cell size may be larger.

## Choosing an Appropriate Cell Size

Since smaller cells require longer calculation time, it may be advantageous to also define the lower limit of the cell size in the Size tab of the Gridding Properties Editor window. The minimum cell size can be defined as a Merge distance (i.e., a specific distance with units), or as a ratio of the Merge value to the Target base cell size (i.e., a Merge value of 0.8 would restrict the minimum cell size from dropping to a value below 80% of the Target base cell size.)

Note

To learn about the factors that affect the smallest cell size the equations at the end of the previous section, refer to Grid Concepts Overview.

When defining the Target base cell size, ensure that the cell size is much less than the smallest wavelength for which accurate results are desired. A commonly applied constraint is ten cells per wavelength , meaning that the side of each cell should be less than one-tenth of the wavelength of the highest frequency (shortest wavelength) of interest. If the cell size is much larger than this, the Nyquist sampling limit is approached too closely for reasonable results to be obtained. Significant aliasing is possible for signal components above the Nyquist limit.

Choosing a cell size of one-tenth of a wavelength is a good starting point, but other factors may require a smaller cell size to be chosen, such as small geometry features and material characteristics.

Grid definitions can be customized for specific objects in the Gridding Properties Editor window, so that smaller features are considered, without having to apply smaller, memory-intensive cells to the whole grid.

Note

Material characteristics will also influence cell characteristics since EMPro is a volumetric computational method. If some portion of the computational space is filled with penetrable material, the wavelength in the material must be used to determine the maximum cell size. Geometries containing electrically dense materials require smaller cells than geometries that contain only free space and perfect conductors. For this reason, a material definition must be applied to Parts objects to generate a valid mesh. An error message will appear in the case that a material is not assigned to an object.

Note

For information on applying material definitions to objects Material Editor.

## Grid Regions vs. Fixed Points

There are two primary means of varying the grid in EMPro. A grid region is a region within the grid that is assigned its own target cell size, which is different from the default grid size defined in the main Size tab of the Grid Tools button. A fixed point is a point on an axis where a grid line will be placed. Cell sizes are adjusted to flow smoothly between fixed points, never exceeding the Target cell size.

The target cell size can vary within different grid regions along a given axis. The main grid's target cell size applies everywhere except within grid regions. A grid region has start and end boundaries on an axis. Grid regions can have target cell sizes and automatic fixed point merge distances that differ from the main grid and from other grid regions. Grid regions can overlap. When they do, the smallest target cell size and the smallest automatic fixed point merge distance are chosen from all of the overlapping grid regions at the given point.

Grid regions, like fixed points, can be manual or automatic. Manual grid regions are defined on tabs associated with the main grid editor. Automatic grid regions are associated with parts and so are also called part grid regions. Part grid regions are defined by right-clicking on a part in the tree and choosing Gridding Properties.

Any grid region includes fixed points for the grid region boundaries. Between the bounds, the target cell size and automatic fixed point merge distances can be different than their values outside the grid region bounds.

The grid flows as evenly as possible between fixed points, using at each point the appropriate target cell size and automatic fixed point merge distance for that point.

The figure below shows a simple shape that has a uniform grid size of 1 m.

###### Simple extrusion with uniform grid

The following figure applies an automatic grid region to this simple shape. Note that the edges of the rectangle are now aligned with the edges of the grid. Also note that, because the height of the rectangle was not evenly divided by 1 m, the main grid spacing adjusted slightly to accommodate for this.

###### Simple extrusion with applied grid regions

The following figure applies automatic fixed points to the shape (all default settings in the Gridding Properties Editor are applied). Note that the edges, like in the case of the applied grid regions, are aligned with the rectangle's edges. The cells within the shape, however, are auto-generated, and therefore vary from the default target cell size as little as possible.

###### Simple extrusion with applied fixed points

The next illustration applies a user-defined grid region to cover the area of the shape, with cell sizes significantly smaller than the main grid. Note the transition region of cells surrounding the shape. This region contains cells of non-uniform size, which vary from the Cell Size defined for the specific grid region to the Cell Size defined for the entire grid, at a rate which is limited by the Maximum Cell Size Step Factor defined in the Limit tab of the Edit Grid dialog in Grid Tools.

## Debugging the Grid

There may be times when one does not understand how certain EMPro grid features in a given grid came to exist. The individual grid features may be turned off so that the grid becomes, in essence, a blank slate. Individual grid features can then be turned back on one at a time. Seeing how the grid changes in this step-by-step fashion makes it possible to locate the cause of any given grid feature.

The following steps outline how to turn off individual grid features.

• Be sure to save a copy of the project and open the copy for use in the debugging process.
• View the mesh and use the MEASURE tool to measure the geometry's largest extent.
• Open the GRID TOOLS dialog:
• Under the SIZE tab, set the X, Y, and Z TARGET sizes to something just larger than the geometry's largest extent.
• Set the MERGE sizes for each axis to e.g. 1e-12 mm (not a ratio).
• Set the Free Space Padding cell values to zero or possibly one.
• Delete all entries under Fixed Points and Grid Regions.
• If your project includes any Circuit Components, ensure that the box labeled Evenly Spaced In Orthogonal Directions is unchecked in the Circuit Component Properties: Properties tab.

Be sure to turn this property back on (where applicable) later in the debugging process, as accurate results in many cases depend on even component spacing.

• Right-click on a part under Project Tree: Parts and choose View Flat Parts List
• Click on the GR (Grid Region) column heading to bring check-marked parts to the top of the list.
• Right-click on the part in the flat parts list and select Gridding Properties. Turn off the part's Automatic Grid Regions and/or Fixed Points.
• Click the FP (Fixed Points) column heading to bring check-marked parts to the top of the list.
• As was done for parts with grid regions above, turn off any remaining parts with automatic fixed points chosen.
• Under the Grid Tools: Limits tab, set the Maximum Cell Step Factor to something large, e.g. 20000. Set the Minimum Cell Size to something very small, (e.g., 1e-12 mm).

After performing those steps the grid should be relatively bare, consisting only of the geometry bounds and padding cells, if any were retained.

Now begin turning on grid features one at a time.

• Choose an important part and turn on its fixed points (in its Gridding Properties editor). Turn off all Automatic Discovery Options except one, and click Apply. Turn off that extraction type and turn on the next one, examining each type in turn.
• As you examine the fixed points for the part, experiment with its automatic grid region. Turn it on and initially set its Target value to the same value as the main grid's target (under Grid Tools). Experiment with different Merge distances, clicking apply each time. At first, leave the part grid region's target cell size the same as the main grid's target cell size.
• Choose the best combination of fixed point extraction types and merge distances for the part.
• Go to another important part, in turn, until all parts for which automatic fixed points have been examined. Ensure that automatic fixed points are turned on for those parts and that an appropriate merge distance was chosen for each.
• Review each important part. Experiment with the target cell sizes for each part, setting the target cell size to the value desired for the final grid.

At this point the grid probably contains adjacent cells whose widths vary by more than is allowed by FDTD theory. Go to the Grid Tools: Limits tab and change the Maximum Cell Step Factor to 2.0, being sure to tab out of the field to make the new setting take effect. Transition regions will appear. You may wish to experiment with values lower than 2.0, although the value must be greater than 1.0. If the Maximum Cell Step Factor is too low, the grid will report that a grid could not be created. Choose a higher step factor that is not greater than 2.0.

The grid probably will contain large gaps even after the transition regions have been added. Change the main grid's target cell size to its final desired value to see the remaining gaps filled with grid lines spaced appropriately.

• No labels