Skip to content

Catalogue

pynumgeo.catalogue

What numgeo accepts: keywords, options, element types, constitutive models, messages.

The catalogue is generated from the numgeo source; every entry cites the source line it was read from (file, line, routine, and an anchor hash of that line, which reveals when the source has moved on). Where the numgeo documentation and the source disagree, the source wins.

Examples:

>>> from pynumgeo import catalogue as cat
>>> cat.keyword("*Step").display
'*Step'
>>> [o.name for o in cat.keyword("step").options][:3]
['NAME', 'INC', 'NLGEOM']
>>> m = cat.material_model("Mohr-Coulomb")
>>> m.nprops, [p.name for p in m.parameters]
(6, ['E', 'nu', 'c', 'phi', 'psi', 'theta'])
>>> cat.element_type("u8p4-sat").nnodes
8
>>> cat.suggest("*Bounday")[0]
'*Boundary'

OptionSpec(name, value_type, values, required, default, match, notes, source) dataclass

An option of a keyword as numgeo reads it.

DataLineSpec(description, fields, count_rule, repeat) dataclass

A data line of a keyword: its fields, count rule and repetition.

KeywordSpec(keyword, display, area, context, parent, match_forms, options, data_lines, doc, notes, raw) dataclass

A keyword in one context (the same keyword can mean different things in different contexts).

contexts property

Contexts in which the keyword is read (model, part, step, material, ...).

option(name)

Option by name (case-insensitive).

ParameterSpec(index, name, symbol, unit, meaning, default, required) dataclass

A parameter of a constitutive model (position in the data lines is index).

MaterialModelSpec(name, nprops, parameters, nstatev, optional_parameters, public, doc, notes, raw) dataclass

A constitutive model of numgeo's material library (*Mechanical = <name>).

parameters_known property

True if the meaning of every parameter is established.

ElementTypeSpec(name, nnodes, ndim, axisymmetric, dofs, family, shape, interpolation, face_topology, vtk_type, status, raw) dataclass

An element type of numgeo's element library (*Element, type=<name>).

usable property

False for library entries without a formulation (numgeo stops when they are used).

Catalogue(data, messages=None)

The loaded catalogue. Use :func:load (cached) rather than constructing it.

keywords property

All keyword entries (one per keyword and context).

element_types property

All element types of the library (without aliases).

material_models property

All constitutive models in this catalogue.

keyword_entries(name)

All entries of a keyword (it may exist in several contexts).

keyword(name, context=None)

A keyword entry, optionally for a context (model, step, material, output-print...).

Raises:

Type Description
KeyError

if the keyword (in that context) is unknown; the message suggests similar names.

element_type(name)

An element type by library name or alias (case-insensitive).

Raises:

Type Description
KeyError

if numgeo has no such element type.

material_model(name)

A constitutive model by library name (case-insensitive).

Raises:

Type Description
KeyError

if the model is not in this catalogue (the public catalogue omits some models).

is_private_name(name)

True for a model/contact/embedded name that numgeo knows but the public catalogue omits.

section(area, name)

Raw access to a catalogue section, e.g. section("loads", "dof_names").

messages()

The message inventory (every error/warning/stop site of the solver).

suggest(name, n=3)

Keywords (display spelling) similar to name.

doc_page(page)

Text of a bundled documentation page (docs/reference/...md), if bundled.

describe(name, *, with_docs=True)

Human/agent readable description of a keyword, material:<model> or element:<type>.

normalise_keyword(name)

Solver spelling of a keyword: upper case, no blanks, leading *.

normalise_keyword("initial conditions") '*INITIALCONDITIONS'

normalise_name(name)

Library spelling of a model or element name (upper case, no blanks).

load() cached

The catalogue (cached). PYNUMGEO_CATALOGUE may point to a complete (private) catalogue file.

keyword(name, context=None)

Shortcut for load().keyword(...).

element_type(name)

Shortcut for load().element_type(...).

material_model(name)

Shortcut for load().material_model(...).

suggest(name, n=3)

Shortcut for load().suggest(...).

describe(name, *, with_docs=True)

Shortcut for load().describe(...).