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".
Keyword
¶
Bases: BaseModel
A keyword block in generic form.
Attributes:
| Name | Type | Description |
|---|---|---|
keyword |
str
|
solver spelling (upper case, no blanks), e.g. |
value |
str | None
|
text after |
options |
list[tuple[str, str | None]]
|
|
data |
list[list[Token]]
|
data lines, one list of tokens per line. |
children |
list[Keyword]
|
child keywords (material sub-keywords, output cards, |
source |
str | None
|
where the keyword was read from ( |
comment |
str | None
|
text the writer puts above the keyword as |
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
|