Help on class EngineeringConstants in module salvus.material.elastic.hexagonal:
class EngineeringConstants(_Hexagonal)
| EngineeringConstants(RHO: '_pd.FC', E1: '_pd.FC', E3: '_pd.FC', G13: '_pd.FC', V12: '_pd.FC', V13: '_pd.FC') -> None
|
| An hexagonal material parametrized with engineering constants.
|
| An hexagonal material has two planes of symmetry and therefore 6
| independent parameters plus the density.
|
| The shear moduli here are assumed to be in the engineering convention:
| twice the normal shear moduli.
|
| The following equalities hold compared to the full orthotropic case:
| - `E2 = E1`
| - `V32 = V31`
| - `V23 = V13`
| - `V31 / E3 = V13 / E1`
| - `V21 = V12`
| - `G21 = E2 / (2 * (1 + V21))`
|
| The normal and reverse Poisson's ratios are also named the major and minor
| Poisson's ratio, depending on which has the larger magnitude. However, this
| material always defines it by first and second axes, i.e. `v12` and `v13`.
|
| This material is rotationally symmetric around its vertical, the dimensions
| described in these constants by the index 3. This means that:
| - the Young's modulus in the 1 and 2 dimensions are equal.
| - The two Poisson's ratio between the third and the two other dimensions
| are equal, as are their reverse Poisson's ratio.
| - The Poisson's ratio between dimension 1 and dimension 2 is the same as
| its reverse.
|
| Args:
| RHO: The density in kg / m^3.
| E1: Young's modulus in Pa.
| E3: Young's modulus in Pa.
| G13: Shear modulus in Pa, engineering convention.
| V12: Poisson's ratio.
| V13: Poisson's ratio.
|
| Method resolution order:
| EngineeringConstants
| _Hexagonal
| salvus.material.base_materials.AllowsOrientation
| salvus.material.elastic._ElasticMaterial
| salvus.material.base_materials.PhysicalMaterial
| salvus.material.base_materials.Material
| salvus.flow.utils.serialization_helpers.SerializationMixin
| salvus.utils.dataclass_utils.MappableDataclass
| salvus.material.base_materials.AllowsAttenuation
| salvus.utils.dataclass_utils.DataclassInstance
| typing_extensions.Protocol
| typing.Protocol
| abc.ABC
| typing.Generic
| builtins.object
|
| Methods defined here:
|
| __delattr__(self, name)
| Implement delattr(self, name).
|
| __eq__(self, other)
| Return self==value.
|
| __hash__(self)
| Return hash(self).
|
| __init__(self, RHO: '_pd.FC', E1: '_pd.FC', E3: '_pd.FC', G13: '_pd.FC', V12: '_pd.FC', V13: '_pd.FC') -> None
| Initialize self. See help(type(self)) for accurate signature.
|
| __setattr__(self, name, value)
| Implement setattr(self, name, value).
|
| __subclasshook__ = _proto_hook(other) from typing.Protocol.__init_subclass__.<locals>
| # Set (or override) the protocol subclass hook.
|
| ----------------------------------------------------------------------
| Class methods defined here:
|
| from_params(*, rho: '_pd.R', e1: '_pd.R', e3: '_pd.R', g13: '_pd.R', v12: '_pd.R', v13: '_pd.R') -> '_H'
| Construct an hexagonal material from its engineering constants.
|
| The shear moduli here are assumed to be in the engineering convention:
| twice the normal shear moduli.
|
| Args:
| rho: The density in kg / m^3.
| e1: Young's modulus in Pa.
| e3: Young's modulus in Pa.
| g13: Shear modulus in Pa, engineering convention.
| v12: Poisson's ratio.
| v13: Poisson's ratio.
|
| from_tensor_components(m: 'GenericTensorComponents[_pd.F]', *, reduction_method: "typing.Literal['remove-components', 'force'] | None" = None) -> '_H'
| Create material from tensor components acoustic parameter material.
|
| Overwrite this method if your material can not be constructed from
| acoustic constants.
|
| A class method to create a anisotropic material of a desired symmetry
| class from a canonical TC material. The method will automatically check
| if the canonical material that is passed meets the symmetry
| requirements of the desired materials. If it does not, a TypeError will
| be raised.
|
| Args:
| m: The material in tensor components parametrization to be used to
| construct the new material.
| reduction_method: Method to move between incompatible symmetry
| classes. None will only move to symmetries that are equal or
| more permissive, while `remove-components` will drop components
| that are found to match the new material's constraints as
| necessary, and thus leading to loss of free parameters but not
| of information. The option "force" will take all information
| necessary to construct the new parameter set without
| verification, leading to loss of information.
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| __abstractmethods__ = frozenset()
|
| __annotations__ = {'E1': '_pd.FC', 'E3': '_pd.FC', 'G13': '_pd.FC', 'R...
|
| __dataclass_fields__ = {'E1': Field(name='E1',type='_pd.FC',default=<d...
|
| __dataclass_params__ = _DataclassParams(init=True,repr=False,eq=True,o...
|
| __match_args__ = ('RHO', 'E1', 'E3', 'G13', 'V12', 'V13')
|
| __orig_bases__ = (salvus.material.elastic.hexagonal._Hexagonal[~F],)
|
| __parameters__ = (~F,)
|
| ----------------------------------------------------------------------
| Class methods inherited from _Hexagonal:
|
| from_material(m: 'Material', *, reduction_method: "typing.Literal['remove-components', 'force'] | None" = None) -> '_Hexagonal'
| Construct this material from another within the same physical system.
|
| Args:
| m: Material to transform.
| reduction_method: Method to move between incompatible symmetry
| classes. None will only move to symmetries that are equal or
| more permissive, while `remove-components` will drop components
| that are found to match the new material's constraints as
| necessary, and thus leading to loss of free parameters but not
| of information. The option "force" will take all information
| necessary to construct the new parameter set without
| verification, leading to loss of information.
|
| Returns:
| The transformed material.
|
| ----------------------------------------------------------------------
| Methods inherited from salvus.material.base_materials.AllowsOrientation:
|
| with_orientation(self, orientation: 'Material | None') -> 'Material'
| Experimental way to add orientation to a material.
|
| Args:
| orientation: The orientation.
|
| Returns:
| The object with an orientation material attached.
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from salvus.material.base_materials.AllowsOrientation:
|
| __protocol_attrs__ = {'__dataclass_fields__', 'orientation', 'with_ori...
|
| orientation = None
|
| ----------------------------------------------------------------------
| Class methods inherited from salvus.material.elastic._ElasticMaterial:
|
| material_system() -> 'type[PhysicalMaterial]'
| Get the material system of the material.
|
| ----------------------------------------------------------------------
| Methods inherited from salvus.material.base_materials.PhysicalMaterial:
|
| to_tensor_components(self, *, expand_symmetries: 'bool' = False) -> 'MaterialDict | GenericTensorComponents'
| Generate a tensor component representation of the material.
|
| This method ensures compatibility with solver and other symmetries.
|
| Args:
| expand_symmetries: boolean determining if to return a expanded
| canonical parameters instead of the TensorComponents object in
| the relevant symmetry system. Defaults to False.
|
| Returns:
| The material in tensor component form.
|
| ----------------------------------------------------------------------
| Methods inherited from salvus.material.base_materials.Material:
|
| __getattribute__(self, name)
| Allow for direct access to a materials parameters.
|
| __post_init__(self)
| Try to fix type errors by casting to a parameter type.
|
| __repr__(self) -> 'str'
|
| __str__(self) -> 'str'
| Return a string representation of the material.
|
| map_realized_parameters(self, *, f_constant: 'typing.Callable[[str, _pd.RealizedConstantParameter], _pd.RealizedConstantParameter]' = <cyfunction _map_realized_default at 0x70efff046bc0>, f_discrete: 'typing.Callable[[str, _pd.RealizedDiscreteParameter], _pd.RealizedDiscreteParameter]' = <cyfunction _map_realized_default at 0x70efff046bc0>, f_analytic: 'typing.Callable[[str, _pd.RealizedAnalyticParameter], _pd.RealizedAnalyticParameter]' = <cyfunction _map_realized_default at 0x70efff046bc0>) -> 'Self'
| Apply functions to each parameter individually, distinguishing _pd.
|
| Useful when one wants to transform each parameter type separately. For
| instance, transformations of discrete parameters often require more
| associated logic than their constant equivalents. This function
| abstracts away the boilerplate of check for each parameter type, and
| subsequently transforming it with some function, as well as ensuring
| that the parameters are indeed of the correct realized type.
|
| The signatures of each transformation function should take the
| parameter's name and value as two distinct inputs, and return the
| (potentially modified) parameter value.
|
| Args:
| f_constant: The function to apply to constant parameters. Defaults
| to returning the parameter as-is.
| f_discrete: The function to apply to discrete parameters. Defaults
| to returning the parameter as-is.
| f_analytic: The function to apply to analytic parameters. Defaults
| to returning the parameter as-is.
|
| to_wavelength_oracle(self, n_dim: 'typing.Literal[2, 3] | None' = None) -> '_pd.FC'
| The wavelength oracle.
|
| Args:
| n_dim: Dimension to return the oracle for, deprecated.
|
| ----------------------------------------------------------------------
| Class methods inherited from salvus.material.base_materials.Material:
|
| from_dataset(ds: 'xr.Dataset') -> 'Material[_pd.F]'
| Construct a material from an xarray Dataset.
|
| Args:
| ds: The dataset to construct the material from.
|
| ----------------------------------------------------------------------
| Readonly properties inherited from salvus.material.base_materials.Material:
|
| ds
| Material's xarray representation.
|
| flatten
| Get all parameters as a dict.
|
| ----------------------------------------------------------------------
| Methods inherited from salvus.flow.utils.serialization_helpers.SerializationMixin:
|
| __ne__(self, other) -> 'bool'
|
| to_json(self, external_file_hash: 'typing.Optional[str]' = None) -> 'dict'
| Serialize the object to dictionary that can be written to JSON.
|
| Args:
| external_file_hash: Hash of any external files associated with
| this object. Can be passed here in which case it will be
| stored in a centralized location in the JSON file.
|
| ----------------------------------------------------------------------
| Class methods inherited from salvus.flow.utils.serialization_helpers.SerializationMixin:
|
| from_json(d: 'dict') -> 'typing.Any'
| Recreate the object from a dictionary serialization of its
| initialization parameters.
|
| Args:
| d: Dictionary containing its init parameters and a few other
| things.
|
| ----------------------------------------------------------------------
| Static methods inherited from salvus.flow.utils.serialization_helpers.SerializationMixin:
|
| __new__(cls, *args, **kwargs)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from salvus.flow.utils.serialization_helpers.SerializationMixin:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Methods inherited from salvus.utils.dataclass_utils.MappableDataclass:
|
| map(self: 'typing_extensions.Self', f: 'typing.Callable[[str, typing.Any], tuple[str, typing.Any]]') -> 'typing_extensions.Self'
| Generic map for dataclass instances.
|
| `f` should be a function taking two parameters: the name of the
| dataclass member and its value, and it should return a tuple containing
| the same quantities. If a member is not to be transformed, `f` should
| just return a tuple of the input member name and value, unchanged. Both
| names and values can be transformed, with the semantics following those
| of `dataclasses.replace`.
|
| In Salvus we primarily treat dataclasses as containers offering
| semantics similar to typed dictionaries. Deriving from this protocol
| allows any relevant dataclass to additionally be treated functorially.
| This allows for the generic un- and re-wrapping of value held in
| dataclasses, and essentially replaces the following imperative code:
|
| ```python
| @dataclass
| class A:
| member: int
|
| # Before
| my_a = A(member=1)
| my_a_new = dataclasses.replace(my_a, member=2 * my_a.member)
|
| # After
| my_a_new = A(val=1).map(lambda key, val: (key, 2 * val))
| ```
|
| As with many functional patterns, the perceived benefits for simple
| demonstrative purposes is minimal. The scalability of this pattern
| becomes apparent, however, when parsing deeply nested abstractions, as
| the transformation logic can be factored out into independent
| functions. This is used extensively, for example, in the realization
| logic of the layered mesher, where generic materials can have generic
| parameters, etc.
|
| Args:
| f: The function to map over the dataclass.
|
| Returns:
| A new, potentially transformed, dataclass.
|
| ----------------------------------------------------------------------
| Methods inherited from salvus.material.base_materials.AllowsAttenuation:
|
| with_attenuation(self, attenuation: 'Material | None') -> 'Self'
| Add attenuation to an object.
|
| Args:
| attenuation: The attenuation material.
|
| Returns:
| The object with an attenuation material attached.
|
| ----------------------------------------------------------------------
| Readonly properties inherited from salvus.material.base_materials.AllowsAttenuation:
|
| viscosity
| Get the optional attenuation.
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from salvus.material.base_materials.AllowsAttenuation:
|
| attenuation = None
|
| ----------------------------------------------------------------------
| Class methods inherited from typing_extensions.Protocol:
|
| __init_subclass__(*args, **kwargs)
| This method is called when a class is subclassed.
|
| The default implementation does nothing. It may be
| overridden to extend subclasses.
|
| ----------------------------------------------------------------------
| Class methods inherited from typing.Generic:
|
| __class_getitem__(params)
| Parameterizes a generic class.
|
| At least, parameterizing a generic class is the *main* thing this method
| does. For example, for some generic class `Foo`, this is called when we
| do `Foo[int]` - there, with `cls=Foo` and `params=int`.
|
| However, note that this method is also called when defining generic
| classes in the first place with `class Foo(Generic[T]): ...`.