To add a new permanent magnet source group to a project, right-click on "Permanent Magnets" on the Navigation Tree, and select "Insert New Permanent Magnet Source..." From the Permanent Magnet Source Dialog, you can change the default purple color of the source group or set the values of the relative permeability, Magnetization magnitude and unit direction vector components. The default direction vector is z-directed.
== EM.Ferma's Computational Domain and Discretization==
===The Domain Box===
</table>
[[Image:Qsource4.png|thumb|350px|EM.Ferma's Mesh Settings dialog.]]===The Static Mesh=== The Finite Difference technique discretizes the computational domain using a 3D rectangular grid. EM.Ferma generates a fixed-cell mesh. This means that the extents of the mesh cells along the principal axes are fixed: Δx, Δy, Δz. By default, the mesh cell size is set to one unit project along all the three directions (Working with Δx = Δy = Δz). To modify the cell size, click the Mesh Settings button of the Simulate Toolbar or right-click on "Static Mesh" in the Navigation Tree, and select "Mesh Settings..." from the contextual menu to open the Mesh Settings Dialog. {{Note|To obtain accurate results, it is highly recommended to use a square mesh as much as possible.}} <table><tr> <td> [[Image:Qsource2.png|thumb|360px|Geometry of a spherical charge source and the enclosing domain box.]] </td><td> [[Image:Qsource3.png|thumb|360px|Fixed-cel mesh of the spherical charge object.]] </td></tr></table> == Running Static Simulations in EM.Ferma == [[Image:Qsource6.png|thumb|400px|EM.Ferma's Simulation Run dialog.]] ===Two Simulation Engines=== EM.Ferma has two independent but functionally similar static simulation engines: Electrostatic and Magnetostatic. The electrostatic engine solves the electric form of Poisson's equation for electric scalar potential subject to electric field boundary conditions, in the presence of electric sources (volume charges and fixed-potential PEC blocks) and dielectric material media. The magnetostatic engine solves the magnetic form of Poisson's equation for magnetic vector potential subject to magnetic field boundary conditions, in the presence of magnetic sources (wire and volume currents and permanent magnetic blocks) and magnetic material media. In EM.Ferma you don't have to select any specific simulation engine. The program looks at the types sources and material objects present in your project workspace and then it determines whether an electrostatic analysis or a magnetostatic analysis or possibly both should be performed. When there are only electric sources present, you will get nonzero electric fields and zero magnetic fields. When there are only magnetic sources present, you will get nonzero magnetic fields and zero electric fields. To run a static simulation, first you have to open the Run Dialog. This is done by clicking the "Run" button of the Simulate Toolbar, or by selecting the "Run" item of the Simulate Menu, or simply using the keyboard shortcut "Ctrl+R". The only available simulation engine is "Static". Clicking the Run button of this dialog starts a static analysis. A separate window pops up which reports the progress of the current simulation. === Simulation Modes === EM.Ferma currently offers three different simulation modes: Analysis, Parametric Sweep and Optimization. An "Analysis" is a single-shot finite difference solution of your static structure. The structure is first discretized using a fixed-cell mesh and the Poisson equation is solved numerically everywhere in your computational domain. The field and potential values at each mesh node are computed and the specified observables are written into data files. In a "Parametric Sweep", one ore more variables are varied at the specified steps(s). This means that you must first define one or more variables in your projects. [[Variables]] can be associated with CAD object properties like dimensions, coordinates, rotation angles, etc. or with material properties or source properties. For each single variable sample or each combination of variable samples, first all the associated CAD object properties, material properties or source properties are updated in the project workspace. Then is a finite difference solution of your updated static structure is computed and parametric sweep proceeds to the next variable sample or combination. The optimization mode requires definition of one or more objectives based on the standard output quantities. At the present time, the optimization mode is only available for the 2D Quasi-Static Mode of the EM.Ferma, which will be discussed separately later. [[Image:Qsource7.png|thumb|400px|EM.Ferma's Static Engine Settings dialog.]] ===Static Simulation Engine Settings=== EM.Ferma currently uses a single iterative linear system solver based on the stabilized Bi-Conjugate Gradient (BiCG) method to solve the matrix equations which result from the discretization of Poisson's equation. You can specify some numerical [[parameters]] related to the Bi-CG solver. To do that, you need to open the Simulation Engine Settings Dialog by clicking the "Settings" button located next to the "Select Engine" drop-down list. From this dialog you can set the maximum number of BiCG iterations, which has a default value of 10,000. You can also set a value for "Convergence Error". The default value for electrostatic analysis is 0.001. For magnetostatic analysis, the specified value of convergence error is reduced by a factor 1000 automatically. Therefore, the default convergence error in this case is 1e-6. {{Note|The value of convergence error affect the accuracy of your simulation results. For most practical scenarios, the default values are adequate. You can reduce the convergence error for better accuracy at the expense of longer computation time.}} == Working with Static Simulation Data ==
At the end of an electrostatic simulation, the electric field and electric scalar potential values are computed at all the mesh grid points of the entire computational domain. At the end of an magnetostatic simulation, the magnetic field and magnetic vector potential values are computed at all the grid nodes. The field and potential values are written into output data files and can be visualized on the screen only if you define a field sensor observable. In the absence of a defined observable, the static simulation will be carried out and completed, but to action will take place.
</tr>
</table>
== Discretizing the Physical Structure in EM.Ferma ==
===The Static Mesh===
The Finite Difference technique discretizes the computational domain using a 3D rectangular grid. EM.Ferma generates a fixed-cell mesh. This means that the extents of the mesh cells along the principal axes are fixed: Δx, Δy, Δz. By default, the mesh cell size is set to one unit project along all the three directions (with Δx = Δy = Δz). To modify the cell size, click the Mesh Settings button of the Simulate Toolbar or right-click on "Static Mesh" in the Navigation Tree, and select "Mesh Settings..." from the contextual menu to open the Mesh Settings Dialog.
{{Note|To obtain accurate results, it is highly recommended to use a square mesh as much as possible.}}
<table>
<tr>
<td> [[Image:Qsource4.png|thumb|350px|EM.Ferma's Mesh Settings dialog.]] </td>
</tr>
</table>
<table>
<tr>
<td> [[Image:Qsource2.png|thumb|360px|Geometry of a spherical charge source and the enclosing domain box.]] </td>
<td> [[Image:Qsource3.png|thumb|360px|Fixed-cel mesh of the spherical charge object.]] </td>
</tr>
</table>
== Running Static Simulations in EM.Ferma ==
[[Image:Qsource6.png|thumb|400px|EM.Ferma's Simulation Run dialog.]]
===Two Simulation Engines===
EM.Ferma has two independent but functionally similar static simulation engines: Electrostatic and Magnetostatic. The electrostatic engine solves the electric form of Poisson's equation for electric scalar potential subject to electric field boundary conditions, in the presence of electric sources (volume charges and fixed-potential PEC blocks) and dielectric material media. The magnetostatic engine solves the magnetic form of Poisson's equation for magnetic vector potential subject to magnetic field boundary conditions, in the presence of magnetic sources (wire and volume currents and permanent magnetic blocks) and magnetic material media.
In EM.Ferma you don't have to select any specific simulation engine. The program looks at the types sources and material objects present in your project workspace and then it determines whether an electrostatic analysis or a magnetostatic analysis or possibly both should be performed. When there are only electric sources present, you will get nonzero electric fields and zero magnetic fields. When there are only magnetic sources present, you will get nonzero magnetic fields and zero electric fields.
To run a static simulation, first you have to open the Run Dialog. This is done by clicking the "Run" button of the Simulate Toolbar, or by selecting the "Run" item of the Simulate Menu, or simply using the keyboard shortcut "Ctrl+R". The only available simulation engine is "Static". Clicking the Run button of this dialog starts a static analysis. A separate window pops up which reports the progress of the current simulation.
=== Simulation Modes ===
EM.Ferma currently offers three different simulation modes: Analysis, Parametric Sweep and Optimization. An "Analysis" is a single-shot finite difference solution of your static structure. The structure is first discretized using a fixed-cell mesh and the Poisson equation is solved numerically everywhere in your computational domain. The field and potential values at each mesh node are computed and the specified observables are written into data files.
In a "Parametric Sweep", one ore more variables are varied at the specified steps(s). This means that you must first define one or more variables in your projects. [[Variables]] can be associated with CAD object properties like dimensions, coordinates, rotation angles, etc. or with material properties or source properties. For each single variable sample or each combination of variable samples, first all the associated CAD object properties, material properties or source properties are updated in the project workspace. Then is a finite difference solution of your updated static structure is computed and parametric sweep proceeds to the next variable sample or combination.
The optimization mode requires definition of one or more objectives based on the standard output quantities. At the present time, the optimization mode is only available for the 2D Quasi-Static Mode of the EM.Ferma, which will be discussed separately later.
[[Image:Qsource7.png|thumb|400px|EM.Ferma's Static Engine Settings dialog.]]
===Static Simulation Engine Settings===
EM.Ferma currently uses a single iterative linear system solver based on the stabilized Bi-Conjugate Gradient (BiCG) method to solve the matrix equations which result from the discretization of Poisson's equation. You can specify some numerical [[parameters]] related to the Bi-CG solver. To do that, you need to open the Simulation Engine Settings Dialog by clicking the "Settings" button located next to the "Select Engine" drop-down list. From this dialog you can set the maximum number of BiCG iterations, which has a default value of 10,000. You can also set a value for "Convergence Error". The default value for electrostatic analysis is 0.001. For magnetostatic analysis, the specified value of convergence error is reduced by a factor 1000 automatically. Therefore, the default convergence error in this case is 1e-6.
{{Note|The value of convergence error affect the accuracy of your simulation results. For most practical scenarios, the default values are adequate. You can reduce the convergence error for better accuracy at the expense of longer computation time.}}
== The 2D Electrostatic Simulation Mode==