Skip to content

Deck

pynumgeo.deck

Semantic model of a numgeo input deck.

Amplitude

Bases: BaseModel

*Amplitude, name=..., type=... with its data lines (type in lower case, e.g. tabular).

Deck

Bases: BaseModel

A numgeo input deck (see module docstring).

assign(elset, material)

Assign a material to an element set (*Solid section).

material(name)

Material by name (case-insensitive).

step(name)

Step by name (case-insensitive).

rename(old, new)

Rename a set, surface, material or amplitude and every reference to it (see :func:pynumgeo.deck.names.rename); returns the number of places changed.

safe_names()

Rename every name numgeo would read as an option (FindFix, BodenInstance.All, ...) and return {old: new} (see :func:pynumgeo.deck.names.safe_names).

defined_names()

Upper-case names of everything the deck defines (sets, surfaces, materials, amplitudes, ...).

summary()

Short description for agents and logs.

Material

Bases: BaseModel

*Material with its sub-keywords (*Mechanical, *Density, *Permeability, ...).

phases is written only when given (numgeo's default is 1).

add(keyword, value=None, options=(), data=(), comment=None)

Append a material sub-keyword, e.g. add("*Density", data=[[2.0]]).

property(keyword)

First sub-keyword of that kind (*Mechanical, *Density, ...).

set_mechanical(model, parameters)

Set *Mechanical = <model> with parameters in library order (list) or by name (dict).

Named parameters are mapped with the catalogue; a dict must name every parameter.

Raises:

Type Description
KeyError

unknown model or parameter name.

ValueError

wrong number of parameters.

Section

Bases: BaseModel

Material assignment *Solid section, elset=..., material=... (*Assign material is the same).

Step

Bases: BaseModel

*Step ... *End step: header options, the procedure keyword and the step's keywords in order.

Header defaults are the solver's (inc 1 000 000, maxiter 24, miniter 1); None means "not written".

add(keyword, value=None, options=(), data=(), children=(), comment=None)

Append a step keyword (*Boundary, *Cload, *Output, *Solver, ...) and return it.

keywords(keyword)

All step keywords of one kind, in order.

Keyword

Bases: BaseModel

A keyword block in generic form.

Attributes:

Name Type Description
keyword str

solver spelling (upper case, no blanks), e.g. *BOUNDARY.

value str | None

text after = in the keyword itself (*MECHANICAL=...), as given.

options list[tuple[str, str | None]]

(KEY, value) pairs in order; KEY upper case, value as given or None for a flag.

data list[list[Token]]

data lines, one list of tokens per line.

children list[Keyword]

child keywords (material sub-keywords, output cards, *Normal/*Friction, ...).

source str | None

where the keyword was read from (file:line), not part of comparisons.

comment str | None

text the writer puts above the keyword as ** lines (not read by numgeo, not part of comparisons; the reader does not fill it).

make(keyword, value=None, options=(), data=(), children=(), comment=None) classmethod

Convenience constructor (see the module example).

option(key)

Value of the first option whose key equals key (case-insensitive); None if absent.

has_option(key)

True if an option with this key is present (flag or with value).

diff(a, b, *, rtol=0.0)

Where b differs from a, one line per difference (empty: the decks mean the same).

Parameters:

Name Type Description Default
rtol float

relative tolerance of reals (node coordinates: relative to the largest coordinate).

0.0