Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the visibility of the helpers in the mechanics-module from private to public #818

Merged
merged 1 commit into from
Aug 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ All notable changes to this project will be documented in this file. The format
- Change the internal initialization of `field = Field(region, values=1, dtype=None)` values from `field.values = np.ones(shape) * values` to `field = np.full(shape, fill_value=values, dtype=dtype)`. This enforces `field = Field(region, values=1)` to return the gradient array with data-type `int` which was of type `float` before.
- Initialize empty matrices of `SolidBodyForce`, `SolidBodyGravity` and `PointLoad` with `dtype=float`.
- Don't multiply the assembled vectors of `SolidBodyForce`, `SolidBodyGravity` and `PointLoad` by `-1.0`.
- Change the visibility of the internal helpers `Assemble`, `Evaluate` and `Results` of the mechanics-module `felupe.mechanics` from private to public.

### Deprecated
- Deprecate `SolidBodyGravity`, `SolidBodyForce` should be used instead.
Expand Down
40 changes: 29 additions & 11 deletions docs/felupe/mechanics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@ Mechanics
SolidBodyPressure
SolidBodyForce

**State Variables**

.. autosummary::

StateNearlyIncompressible

**Steps and Jobs**

.. autosummary::
Expand All @@ -35,6 +29,15 @@ Mechanics
PointLoad
MultiPointConstraint
MultiPointContact

**Helpers for Custom Items and State Variables**

.. autosummary::

StateNearlyIncompressible
mechanics.Assemble
mechanics.Evaluate
mechanics.Results

**Detailed API Reference**

Expand All @@ -48,11 +51,6 @@ Mechanics
:undoc-members:
:show-inheritance:

.. autoclass:: felupe.StateNearlyIncompressible
:members:
:undoc-members:
:show-inheritance:

.. autoclass:: felupe.SolidBodyForce
:members:
:undoc-members:
Expand Down Expand Up @@ -92,3 +90,23 @@ Mechanics
:members:
:undoc-members:
:inherited-members:

.. autoclass:: felupe.StateNearlyIncompressible
:members:
:undoc-members:
:inherited-members:

.. autoclass:: felupe.mechanics.Assemble
:members:
:undoc-members:
:inherited-members:

.. autoclass:: felupe.mechanics.Evaluate
:members:
:undoc-members:
:inherited-members:

.. autoclass:: felupe.mechanics.Results
:members:
:undoc-members:
:inherited-members:
5 changes: 4 additions & 1 deletion src/felupe/mechanics/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from ._curve import CharacteristicCurve
from ._helpers import StateNearlyIncompressible
from ._helpers import Assemble, Evaluate, Results, StateNearlyIncompressible
from ._item import FormItem
from ._job import Job
from ._multipoint import MultiPointConstraint, MultiPointContact
Expand All @@ -12,11 +12,14 @@
from ._step import Step

__all__ = [
"Assemble",
"CharacteristicCurve",
"Evaluate",
"FormItem",
"StateNearlyIncompressible",
"Job",
"PointLoad",
"Results",
"SolidBody",
"SolidBodyGravity",
"SolidBodyForce",
Expand Down
6 changes: 3 additions & 3 deletions src/felupe/mechanics/_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@


class Assemble:
"A class with methods for assembling vectors and matrices of a SolidBody."
"A class with methods for assembling vectors and matrices of an Item."

def __init__(self, vector, matrix, multiplier=None):
self.vector = vector
Expand All @@ -33,7 +33,7 @@ def __init__(self, vector, matrix, multiplier=None):


class Evaluate:
"A class with evaluate methods of a SolidBody."
"A class with evaluate methods of an Item."

def __init__(self, gradient, hessian, cauchy_stress=None, kirchhoff_stress=None):
self.gradient = gradient
Expand All @@ -45,7 +45,7 @@ def __init__(self, gradient, hessian, cauchy_stress=None, kirchhoff_stress=None)


class Results:
"A class with intermediate results of a SolidBody."
"A class with intermediate results of an Item."

def __init__(self, stress=False, elasticity=False):
self.force = None
Expand Down
Loading