snek5000.operators#
Operators#
Information regarding mesh, mathematical operators, and domain decomposition.
Functions
|
Compute the perfect power of |
Classes
- snek5000.operators.next_power(value, base=2)[source]#
Compute the perfect power of
basegreater than or equal tovalue.
- class snek5000.operators.Operators(sim=None, params=None)[source]#
- Container for parameters and writing box and
SIZE files.
Note
Some values are not available as parameters and instead automatically computed for generating the SIZE file.
SIZE
properties
Comment
lelgMax. number of elements globally
leltMax. number of elements per processor (should be not smallerthanlelg/lpmin, i.e.lelxAutomatically computed. Max. number of elements along xdirection for the global tensor product solver / dimensions.lelySame as above for
ydirection.lelzSame as above for
zdirection.lorderMax. temporal orderAutomatically computed basedparams.nek.general.time_stepperlbeltAutomatically computed asleltif"MHD" in params.nek.problem_type.equation.lpeltAutomatically computed asleltif"linear" in params.nek.problem_type.equation.lcveltAutomatically computed asleltifparams.nek.cvode._enabled is Truelx1mp-order for mesh solver. Automatically computed basedparams.nek.general.stress_formulationand whetherArbitrary Lagrangian-Eulerian (ALE) methods are used or not.
Note
We deliberately try not to use the variable names used in Nek5000, as those are ambiguously named.
Documentation for params.oper
Parameters for mesh description:
nx,ny,nz: intNumber of elements in each directions
origin_x,origin_y,origin_z: floatStarting coordinate of the mesh (default: 0.0)
ratio_x,ratio_y,ratio_z: floatMesh stretching ratio (default: 1.0)
Lx,Ly,Lz: floatLength of the domain
Parameters for boundary conditions:
boundary: list[str]
boundary_scalars: list[str]
The following table matches counterpart of mandatory SIZE variables.
SIZE
params.oper
Comment
ldimdimDomain dimensions (2 or 3)
lpminnproc_minMin MPI ranks
lpmaxnproc_maxMax MPI ranks
ldimtscalarsNumber of auxilary fields (minimum 1).
Documentation for params.oper.max
The following table matches counterpart of optional SIZE variables. These refer to upper bound number of something. The parameters are considered “optional” and would be ignored with the default values.
SIZE
params.oper.max
Comment
mxprevdim_projMax. dimension of projection space
lgmresdim_krylovMax. dimension of Krylov space for GMRES
lhishistMax. number of history (i.e. monitoring) points.
maxobjobjMax. number of objects?
lpertperturbMax. number of perturbations
toteqscalars_consMax. conserved scalars
ldimt_projscalars_projMax. scalars for residual projection
nsessmaxsessionsMax. sessions to NEKNEK
Documentation for params.oper.elem
The following table relate to element configuration for certain operations. The parameters are considered “optional” (except for
lx1/orderandlxd/coef_dealiasingwhich are mandatory) and would be ignored with the default values.SIZE
params.oper.elem
Comment
lxdcoef_dealiasingp-order 1 for over-integration. Automatically computed from floatcoef_dealiasing. Seeorder_dealiasinglx1orderp-order (avoid uneven and values <6).
lxoorder_outMax. p-order on output (should be
>= order. Seeorder_out)lx2staggeredp-order for pressure. Automatically computed. Seeorder_pressure- 1
Polynomial order which means the number of GLL / GL points per element.
Documentation for params.oper.misc
Other miscellaneous parameters:
SIZE
params.oper.misc
Comment
lfdmfast_diagEquals to True for global tensor product solver (that uses fastdiagonalization method).Falseotherwise.- property max_n_seq#
Equivalent to
lelg.
- property max_n_loc#
Equivalent to
lelt. The next integer greater than or equalsmax_n_seq / params.oper.nproc_min.
- property max_nx#
Equivalent to
lelx.
- property max_ny#
Equivalent to
lely.
- property max_nz#
Equivalent to
lelz.
- property max_order_time#
Equivalent to
lorder.
- property nb_fields#
Used in .box file.
- property order#
Equivalent to
lx1. Controls the polynomial order of the velocity field.Note
True polynomial order of the element is given by \(\mathbb{P}_N\) =
lx1- 1 =order- 1
- property order_out#
Equivalent to
lxo.
- property order_dealiasing#
Equivalent to
lxd.
- property order_pressure#
Equivalent to
lx2. Controls the order for the pressure field.Note
The property
order_pressureis determined by the value ofparams.oper.elem.staggered.If staggered == “auto”:
If “lin” in problemtype_equation \(\implies \mathbb{P}_{N-2}\)
Else \(\implies \mathbb{P}_N\)
If staggered is True \(\implies \mathbb{P}_{N-2}\)
If staggered is False \(\implies \mathbb{P}_N\)
- property order_mesh_solver#
Equivalent to
lx1m.Todo
Must include a condition to check if ALE methods are used or not.
- property order_mhd#
Equivalent to
lbelt.
- property order_linear#
Equivalent to
lpelt.
- property order_cvode#
Equivalent to
lcvelt.
- memory_required()[source]#
According to Nek5000 FAQ the following estimate is made
lx1*ly1*lz1*lelt * 3000byte + lelg * 12byte + MPI + optional libraries (e.g. CVODE)
- Returns
memory_required – in bytes
- Return type
- produce_str_describing_oper()[source]#
Produce a string describing the mesh volume and number of elements.
- produce_long_str_describing_oper(oper_method='Base')[source]#
Produce a multi-line string describing the mesh volume and number of elements.
- write_box(template, fp=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>, comments='', **template_vars)[source]#
Write the .box file which is input for the
genboxmeshing tool.- Parameters
template (jinja2.environment.Template) – Template instance loaded from something like
box.j2fp (io.TextIOWrapper) – File handler to write to
comments (str) – Comments on top of the box file
template_vars (dict) – Keyword arguments passed while rendering the Jinja templates
- write_size(template, fp=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>, comments='', **template_vars)[source]#
Write the SIZE file which is required for compilation.
- Parameters
template (jinja2.environment.Template) – Template instance loaded from something like
SIZE.j2fp (io.TextIOWrapper) – File handler to write to
comments (str) – Comments on top of the SIZE file
template_vars (dict) – Keyword arguments passed while rendering the Jinja templates