MStaticSolver Object

This object is used to define the magnetostatic solver settings.

Methods

Reset

 Resets all internal settings to their default values.

 

Accuracy (double  accuracy)

Specifies the accuracy of the solver, that is, in general, the accuracy of the linear system of equations. In case of the hexahedral mesh type and nonlinear materials, the accuracy specifies the material accuracy (outer cycle).

 

ApparentInductanceMatrix (bool  calcInductance)

IncrementalInductanceMatrix (bool  calcInductance)

 

Switches the calculation of the inductance matrix  between all defined current coils and current paths on or off. Please note that each current sources definition increases the inductance matrix dimension N by one.

For the hexahedral solver, the number of solver runs necessary to compute the inductance matrix can be estimated in advance: If coils are defined the full inductance matrix requires at most  (0.5*N*(N-1)) additional solver runs. For the special case that no coils are defined at most N additional solver runs are sufficient. When only one current source has been defined, only one single run is necessary to compute the self inductance.

The apparent inductance matrix relates the currents to the flux linkages. The incremental inductance matrix (currently available only for the tetrahedral solver) relates the time derivative of the currents to the induced voltages.

Please note: Both, the apparent and the incremental inductance matrices are symmetric. In case of a pure linear computation (no nonlinear materials defined), they coincide with the inductance matrix.

 

EnableDivergenceCheck (bool  flag)

If current sources are defined, the magnetostatic solver requires them to form closed current loops or that they end at perfect electric conductors (PEC) or electric boundary conditions. The same condition has to be fulfilled if conductive domains are defined and a stationary current field is used as source for the magnetostatic solver. (This can be enabled with the PrecomputeStationaryCurrentSource command.)

Otherwise the problem is not solvable by the magnetostatic solver, since Ampere's Law is violated. If such a situation is detected by the solver, an error will be printed saying that the model is not divergence-free or that currents are appearing or disappearing within the calculation domain. The solver will abort in this case.

This detection method is called divergence check. A divergence check might fail even for valid model setups, if the source field could not be computed with sufficient accuracy. Typical reasons are low mesh quality, high ratios (jumps) in material coefficients or insufficient accuracy settings. In particular, when a stationary current field is used as source for the magnetostatic solver, it is recommended to use a high accuracy for the linear solver. Furthermore, you can consider to refine the mesh or to relax high ratios of the material coefficients by replacing materials with very high electric conductivities by PEC material or materials with very low conductivities by normal material.

If you do not want the solver to abort in case of a detected divergence error, you should relax the divergence check by setting the flag to False. Mind that this might lead to convergence problems or inaccurate results. Please check your results carefully in this case.

Please note: The divergence check will be performed anyway. But if you relax the check, only a warning will be printed informing you about potential problems.

 

GridLocation (enum gridlocation)

Specifies whether the dual grid based (default) or the normal grid based magnetostatic solver is used for the field calculation.

key (string)

meaning

"normal"

The magnetic field H is allocated on the edges of the normal grid.

"dual"

The magnetic field H is allocated on the edges of the dual grid.

 

This setting is considered only for the hexahedral mesh type and will be ignored by the tetrahedral solver.

 

IgnorePECMaterial (bool  ignorePEC)

Enables or disables the consideration of pec materials. Usually pec materials need not to be ignored (default). If set "True", all pec materials will be treated like normal material with a Mue value to be specified.

This setting is considered only for the hexahedral mesh type and will be ignored by the tetrahedral solver.

 

LSESolverType (enum solvertype)

Specifies which solver is used to solve linear systems of equations.

solvertype (enum )

meaning

"Auto"

choose direct or iterative solver automatically depending on the problem size

"Iterative"

use the iterative solver

"Direct"

use the direct solver

 

The default setting is "Auto". The solvertype setting is of interest only for the tetrahedral solver method and will be ignored otherwise.

 

MaxLinIter (int  value)

The number of iterations performed by the linear solver is automatically limited by a number depending on the desired solver accuracy. This is equivalent to setting the value to "0". If you would like to prescribe a fixed upper limit for number of linear iterations, then specify the corresponding value here.

 

MeshAdaption (bool  enableAdaption)

Enables or disables the adaptive mesh refinement for the hexahedral mesh method.

 

Method (enum solvermethod)

Specifies the method used by the magnetostatic solver for discretization and solution.

solvermethod(enum )

meaning

"Hexahedral Mesh"

structured grid consisting of hexahedral elements.

"Tetrahedral Mesh"

unstructured grid consisting of tetrahedral elements.

"Planar Mesh"

unstructured planar grid consisting of triangular elements.

 

NlinCycles (int  value)

Specifies the maximum number of nonlinear iteration cycles when nonlinear materials are defined.

 

NlinAccuracy (double  accuracy)

Specifies the accuracy of the nonlinear solver. For backward compatibility reasons a value of zero is accepted, but not recognized by the solver.

 

NlinCylceAccuracy(double  accuracy)

This value sets the accuracy of the linear solver for each defect iteration step (inner cycle). If not specified or if set zero (default) an automatic control will be activated.

Recommended for experienced users only.

This setting is considered only for the hexahedral mesh type and will be ignored by the tetrahedral solver.

 

NlinCycleAccuFactor (double  accuracy)

This is a control factor used for the automatic determination of the linear solver accuracy of the defect iteration. This inner cycle accuracy is obtained from the product of the control factor and the current material accuracy.

Recommended for experienced users only.

This setting is considered only for the hexahedral mesh type and will be ignored by the tetrahedral solver.

 

NlinFinalCycleAccuracy (double  accuracy)

This value controls the accuracy of the linear solver run in the last nonlinear cycle. If not specified or if set zero (default) an automatic control will be activated.

Recommended for experienced users only.

This setting is considered only for the hexahedral mesh type and will be ignored by the tetrahedral solver.

 

PrecomputeStationaryCurrentSource (bool  precomputeJfield)

Set precomputeJfield to True if the stationary current solver should run before the magnetostatic calculation. The current distribution inside conductive materials will be used as current source for the magnetostatic problem.

Please note: If the stationary current problem is not well defined the whole computation will fail.

 

StoreResultsInCache (bool  storeResults)

Activate to store calculation results in the result data cache.

 

TetAdaption(bool  enableAdaption)

Enables or disables the adaptive mesh refinement for the tetrahedral mesh method.

 

TetAdaptionAccuracy(double  accuracy)

If the relative deviation of the energy between two passes is smaller than this error limit the mesh adaptation will terminate.

 

TetAdaptionMaxCycles(int maxcycles)

Specifies the maximum number of passes to be performed for the mesh adaption, even if the results have not sufficiently converged so far. This setting is useful to limit the total calculation time to reasonable amounts.

This setting is considered only for the tetrahedral mesh method and ignored otherwise. For specification of hexahedral mesh adaption properties see MeshAdaption3D.

 

TetAdaptionMinCycles(int mincycles)

Sets the minimum number of passes which will be performed during the mesh adaption, even if the results do not change significantly. Sometimes the adaptive mesh refinement needs a couple of passes to figure out the location of the most important regions. Thus it might happen that the results change only marginally during the first few passes but afterwards change in order to converge to the final solution.

This setting is considered only for the tetrahedral mesh method and ignored otherwise. For specification of hexahedral mesh adaption properties see MeshAdaption3D.

 

TetAdaptionRefinementPercentage (double percent)

Sets the maximum percentage of mesh elements to be refined during a tetrahedral adaptation pass. The higher the specified percentage is, the stronger will the number of elements and therefore the numerical effort increase.

 

SnapToGeometry(bool  snapping)

When snapping is True, new nodes that are generated on the surface mesh during the mesh adaption will be projected to the original geometry, so that the approximation of curved surfaces is improved after each adaptation step.

If this option is disabled, the geometry will be approximated by the initial mesh. The geometric discretization error produced by this approximation will therefore not decrease, but the adaptation process might be faster.

 

TetSolverOrder (int tetorder)

This option allows to specify whether the tetrahedral solver uses first- or second-order accuracy. Second-order (tetorder = "2") is the default due to its higher accuracy. However, if the structure is geometrically complex and therefore comes along with huge memory requirements, first-order (tetorder = "1") is an adequate alternative.

This setting is considered only for the tetrahedral mesh method and ignored otherwise. For specification of hexahedral mesh adaption properties see MeshAdaption3D.

 

UseDistributedComputing(bool  useDC)

Enables or disables distributed computing.

 

UseMaxNumberOfThreads(bool  useMaxThreads)

By default (useMaxThreads = False), the solver is forced to employ a particular number of threads that is defined on the basis of the current processor’s architecture and the number of the available parallel licenses. If activated (useMaxThreads = True), the solver can be forced to use less than all available threads (see MaxNumberOfThreads).

 

MaxNumberOfThreads (int nThreads)

If the solver is to use less than all available threads (cf. UseMaxNumberOfThreads), the desired number can be specified here. The default value ”r;8” reflects the possibility of the modern processors architecture.

 

Start long

Starts the magnetostatic solver with the prescribed settings and the currently active mesh. If no mesh is available, a new mesh will be generated. Returns 0 if the solver run was successful, an error code >0 otherwise.

 

ContinueAdaption long

Starts the magnetostatic solver with the prescribed settings and the currently active mesh. In case of the tetrahedral solver with adaptive mesh refinement, this command will continue the previous adaption run if the corresponding results are available. Otherwise this command is similar to the Start command. Returns 0 if the solver run was successful, an error code >0 otherwise.

Functions

GetEnergy double

Returns  the total magnetostatic energy in the computational domain, computed with the differential energy density definition H*dB in Joule.

 

GetCoEnergy double

Returns  the total magnetostatic co-energy in the computational domain, computed with the differential energy density definition B*dH in Joule.

 

GetInductanceValue  (name source1, name source2) double

Retrieves the couple incuctance between given magnetostatic source definitions. The return value represents an element of the inductance matrix in Henry.

Default Values

GridLocation "dual"

Accuracy "1e-6"

Preconditioner "ILU"

NlinCycles "50"

NlinAccuracy  "1e-2"

NlinCycleAccuracy "0"

NlinCycleAccuFactor "1e-3"

NlinFinalCycleAccuracy "0"

CalcInductanceMatrix "False"

MeshAdaption "False"

SavePotentialChargeData  "False"

StoreResultsInCache "False"

UseMaxNumberOfThreads "False"

MaxNumberOfThreads "8"

PrecomputeStationaryCurrentSource "False"

EnableDivergenceCheck "True"

Examples

With MStaticSolver

     .Reset

     .Accuracy "1e-6"

     .Preconditioner "ILU"

     .NlinCycles  "50"

     .NlinAccuracy  "0"

     .CalcInductanceMatrix "False"

     .StoreResultsInCache "False"

     .MeshAdaption "False"

     .GridLocation "Dual"

End With