simudo.io package¶
Submodules¶
simudo.io.csv module¶
simudo.io.h5yaml module¶
-
class
simudo.io.h5yaml.
BaseDolfinMeshFunctionTag
(dolfin_h5_manager, key, **kwargs)[source]¶ Bases:
simudo.io.h5yaml.DolfinObjectTag
-
property
yaml_tag
¶ classmethod(function) -> method
Convert a function to be a class method.
A class method receives the class as implicit first argument, just like an instance method receives the instance. To declare a class method, use this idiom:
- class C:
@classmethod def f(cls, arg1, arg2, …):
…
It can be called either on the class (e.g. C.f()) or on an instance (e.g. C().f()). The instance is ignored except for its class. If a class method is called for a derived class, the derived class object is passed as the implied first argument.
Class methods are different than C++ or Java static methods. If you want those, see the staticmethod builtin.
-
property
-
class
simudo.io.h5yaml.
ClassProperty
(fget=None, fset=None, fdel=None, doc=None)[source]¶ Bases:
property
-
class
simudo.io.h5yaml.
DolfinFunctionTag
(scale=1.0, **kwargs)[source]¶ Bases:
simudo.io.h5yaml.ScaleDolfinObjectTag
-
yaml_classes
= (<class 'dolfin.function.function.Function'>,)¶
-
yaml_tag
= '!dolfin/function'¶
-
-
class
simudo.io.h5yaml.
DolfinMeshFunctionBoolTag
(dolfin_h5_manager, key, **kwargs)[source]¶ Bases:
simudo.io.h5yaml.BaseDolfinMeshFunctionTag
-
meshfunction_type_name
= 'bool'¶
-
yaml_classes
= (<class 'dolfin.cpp.mesh.MeshFunctionBool'>,)¶
-
-
class
simudo.io.h5yaml.
DolfinMeshFunctionDoubleTag
(scale=1.0, **kwargs)[source]¶ Bases:
simudo.io.h5yaml.ScaleMixin
,simudo.io.h5yaml.BaseDolfinMeshFunctionTag
-
meshfunction_type_name
= 'double'¶
-
yaml_classes
= (<class 'dolfin.cpp.mesh.MeshFunctionDouble'>,)¶
-
-
class
simudo.io.h5yaml.
DolfinMeshFunctionIntTag
(dolfin_h5_manager, key, **kwargs)[source]¶ Bases:
simudo.io.h5yaml.BaseDolfinMeshFunctionTag
-
meshfunction_type_name
= 'int'¶
-
yaml_classes
= (<class 'dolfin.cpp.mesh.MeshFunctionInt'>,)¶
-
-
class
simudo.io.h5yaml.
DolfinMeshFunctionSizetTag
(dolfin_h5_manager, key, **kwargs)[source]¶ Bases:
simudo.io.h5yaml.BaseDolfinMeshFunctionTag
-
meshfunction_type_name
= 'size_t'¶
-
yaml_classes
= (<class 'dolfin.cpp.mesh.MeshFunctionSizet'>,)¶
-
-
class
simudo.io.h5yaml.
DolfinMeshTag
(dolfin_h5_manager, key, **kwargs)[source]¶ Bases:
simudo.io.h5yaml.DolfinObjectTag
-
load_pass
= -10¶
-
yaml_classes
= (<class 'dolfin.cpp.mesh.Mesh'>,)¶
-
yaml_tag
= '!dolfin/mesh'¶
-
-
class
simudo.io.h5yaml.
DolfinObjectTag
(dolfin_h5_manager, key, **kwargs)[source]¶ Bases:
simudo.io.h5yaml.BaseCustomTag
-
load_pass
= 0¶
-
needs_load_into
= True¶
-
-
class
simudo.io.h5yaml.
FrozenSetTag
[source]¶ Bases:
simudo.io.h5yaml.BaseCustomTag
-
yaml_classes
= (<class 'frozenset'>,)¶
-
yaml_tag
= '!frozenset'¶
-
-
class
simudo.io.h5yaml.
PintQTag
[source]¶ Bases:
simudo.io.h5yaml.BaseCustomTag
-
yaml_classes
= (<class 'pint.quantity.Quantity'>,)¶
-
yaml_tag
= '!pintq'¶
-
-
class
simudo.io.h5yaml.
ScaleDolfinObjectTag
(scale=1.0, **kwargs)[source]¶ Bases:
simudo.io.h5yaml.ScaleMixin
,simudo.io.h5yaml.DolfinObjectTag
-
class
simudo.io.h5yaml.
XDumper
(*args, **kwargs)[source]¶ Bases:
yaml.dumper.Dumper
-
yaml_multi_representers
= {<class 'object'>: <function Representer.represent_object>, <class 'dolfin.cpp.mesh.Mesh'>: <bound method DolfinObjectTag.to_yaml of <class 'simudo.io.h5yaml.DolfinMeshTag'>>, <class 'dolfin.function.function.Function'>: <bound method DolfinObjectTag.to_yaml of <class 'simudo.io.h5yaml.DolfinFunctionTag'>>, <class 'dolfin.cpp.mesh.MeshFunctionSizet'>: <bound method DolfinObjectTag.to_yaml of <class 'simudo.io.h5yaml.DolfinMeshFunctionSizetTag'>>, <class 'dolfin.cpp.mesh.MeshFunctionInt'>: <bound method DolfinObjectTag.to_yaml of <class 'simudo.io.h5yaml.DolfinMeshFunctionIntTag'>>, <class 'dolfin.cpp.mesh.MeshFunctionDouble'>: <bound method DolfinObjectTag.to_yaml of <class 'simudo.io.h5yaml.DolfinMeshFunctionDoubleTag'>>, <class 'dolfin.cpp.mesh.MeshFunctionBool'>: <bound method DolfinObjectTag.to_yaml of <class 'simudo.io.h5yaml.DolfinMeshFunctionBoolTag'>>, <class 'frozenset'>: <bound method FrozenSetTag.to_yaml of <class 'simudo.io.h5yaml.FrozenSetTag'>>, <class 'pint.quantity.Quantity'>: <bound method PintQTag.to_yaml of <class 'simudo.io.h5yaml.PintQTag'>>}¶
-
-
class
simudo.io.h5yaml.
XLoader
(*args, **kwargs)[source]¶ Bases:
yaml.loader.Loader
-
yaml_constructors
= {'tag:yaml.org,2002:null': <function SafeConstructor.construct_yaml_null>, 'tag:yaml.org,2002:bool': <function SafeConstructor.construct_yaml_bool>, 'tag:yaml.org,2002:int': <function SafeConstructor.construct_yaml_int>, 'tag:yaml.org,2002:float': <function SafeConstructor.construct_yaml_float>, 'tag:yaml.org,2002:binary': <function SafeConstructor.construct_yaml_binary>, 'tag:yaml.org,2002:timestamp': <function SafeConstructor.construct_yaml_timestamp>, 'tag:yaml.org,2002:omap': <function SafeConstructor.construct_yaml_omap>, 'tag:yaml.org,2002:pairs': <function SafeConstructor.construct_yaml_pairs>, 'tag:yaml.org,2002:set': <function SafeConstructor.construct_yaml_set>, 'tag:yaml.org,2002:str': <function SafeConstructor.construct_yaml_str>, 'tag:yaml.org,2002:seq': <function SafeConstructor.construct_yaml_seq>, 'tag:yaml.org,2002:map': <function SafeConstructor.construct_yaml_map>, None: <function SafeConstructor.construct_undefined>, 'tag:yaml.org,2002:python/none': <function SafeConstructor.construct_yaml_null>, 'tag:yaml.org,2002:python/bool': <function SafeConstructor.construct_yaml_bool>, 'tag:yaml.org,2002:python/str': <function FullConstructor.construct_python_str>, 'tag:yaml.org,2002:python/unicode': <function FullConstructor.construct_python_unicode>, 'tag:yaml.org,2002:python/bytes': <function FullConstructor.construct_python_bytes>, 'tag:yaml.org,2002:python/int': <function SafeConstructor.construct_yaml_int>, 'tag:yaml.org,2002:python/long': <function FullConstructor.construct_python_long>, 'tag:yaml.org,2002:python/float': <function SafeConstructor.construct_yaml_float>, 'tag:yaml.org,2002:python/complex': <function FullConstructor.construct_python_complex>, 'tag:yaml.org,2002:python/list': <function SafeConstructor.construct_yaml_seq>, 'tag:yaml.org,2002:python/tuple': <function FullConstructor.construct_python_tuple>, 'tag:yaml.org,2002:python/dict': <function SafeConstructor.construct_yaml_map>, '!dolfin/mesh': <bound method DolfinObjectTag.from_yaml of <class 'simudo.io.h5yaml.DolfinMeshTag'>>, '!dolfin/function': <bound method DolfinObjectTag.from_yaml of <class 'simudo.io.h5yaml.DolfinFunctionTag'>>, '!dolfin/meshfunction/size_t': <bound method DolfinObjectTag.from_yaml of <class 'simudo.io.h5yaml.DolfinMeshFunctionSizetTag'>>, '!dolfin/meshfunction/int': <bound method DolfinObjectTag.from_yaml of <class 'simudo.io.h5yaml.DolfinMeshFunctionIntTag'>>, '!dolfin/meshfunction/double': <bound method DolfinObjectTag.from_yaml of <class 'simudo.io.h5yaml.DolfinMeshFunctionDoubleTag'>>, '!dolfin/meshfunction/bool': <bound method DolfinObjectTag.from_yaml of <class 'simudo.io.h5yaml.DolfinMeshFunctionBoolTag'>>, '!frozenset': <bound method FrozenSetTag.from_yaml of <class 'simudo.io.h5yaml.FrozenSetTag'>>, '!pintq': <bound method PintQTag.from_yaml of <class 'simudo.io.h5yaml.PintQTag'>>}¶
-
-
simudo.io.h5yaml.
dump
(data, stream=None, Dumper=None, x_attr_dict=None, pint_unit_registry=None, **kwargs)[source]¶
-
simudo.io.h5yaml.
kl
¶ alias of
simudo.io.h5yaml.PintQTag
simudo.io.output_writer module¶
-
class
simudo.io.output_writer.
MetaExtractorBandInfo
(**kwargs)[source]¶ Bases:
simudo.util.setattr_init_mixin.SetattrInitMixin
-
prefix
= 'band_info:'¶
-
-
class
simudo.io.output_writer.
MetaExtractorIntegrals
(**kwargs)[source]¶ Bases:
simudo.util.setattr_init_mixin.SetattrInitMixin
-
prefix
¶ String to add to quantites.
- Type
str
-
facets
¶ Facet regions where to extract quantities.
- Type
dict
-
cells
¶ Cell regions where to extract quantities.
- Type
dict
-
solution
¶ Solution object.
-
parameter_value
¶ Parameter value.
-
meta
¶ Metadata dictionary to write to.
-
add_surface_total
(k, expr_ds, expr_dS, internal=True, external=True, average=False, units=None)[source]¶
-
pdd
¶
-
prefix
= ''¶
-
-
class
simudo.io.output_writer.
OutputWriter
(**kwargs)[source]¶ Bases:
simudo.util.setattr_init_mixin.SetattrInitMixin
Write output data extracted from a solution object.
The output can be any of a plot on a mesh, on a 1D linecut, or in a csv file containing data from multiple solutions during a parameter sweep.
parameter_name: label for the parameter being swept
filename_prefix: a prefix to any filenames that will be saved.
plot_mesh – Save data on the original mesh. (default: False)
plot_1d – Extract data along a 1D line cut and save to a csv file. (default: False)
plot_iv – Save a csv file with terminal voltages, currents and other extracted data. (default: True)
stepper – (optional) give access to the stepper. Allows plotting quantities related to solution such as error metric (du).
-
line_cut_resolution
= 5001¶
-
meta_extractors
¶
-
parameter_name
= 'parameter'¶
-
plot_1d
= False¶
-
plot_iv
= True¶
-
plot_mesh
= False¶
-
stepper
= None¶
-
simudo.io.xdmf module¶
-
class
simudo.io.xdmf.
XdmfPlot
(filename, function_subspace_registry=None, checkpoint=False)[source]¶ Bases:
simudo.io.xdmf.PlotAddMixin
-
timestamp
= 0.0¶
-