-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: allow solve_fe docs without sfepy
Allow solve_fe to display its documentation without having to import sfepy.
- Loading branch information
Showing
5 changed files
with
39 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
"""Functions for generating data | ||
""" | ||
from ..func import curry | ||
|
||
|
||
@curry | ||
def solve_fe(x_data, elastic_modulus, poissons_ratio, macro_strain=1.0, delta_x=1.0): | ||
"""Solve the elasticity problem | ||
Args: | ||
x_data: microstructure with shape (n_samples, n_x, ...) | ||
elastic_modulus: the elastic modulus in each phase | ||
poissons_ration: the poissons ratio for each phase | ||
macro_strain: the macro strain | ||
delta_x: the grid spacing | ||
Returns: | ||
a dictionary of strain, displacement and stress with stress and | ||
strain of shape (n_samples, n_x, ..., 3) and displacement shape | ||
of (n_samples, n_x + 1, ..., 2) | ||
""" | ||
from .elastic_fe import _solve_fe # pylint: disable=import-outside-toplevel | ||
|
||
return _solve_fe( | ||
x_data, | ||
elastic_modulus, | ||
poissons_ratio, | ||
macro_strain=macro_strain, | ||
delta_x=delta_x, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters