Skip to content

Commit

Permalink
update solution to accept ints and floats, update scitech25
Browse files Browse the repository at this point in the history
  • Loading branch information
ACea15 committed Dec 1, 2024
1 parent 2356990 commit e3ec6c0
Show file tree
Hide file tree
Showing 11 changed files with 227 additions and 112 deletions.
Binary file added docs/reports/scitech25/figs_ext/DiscreteL0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/reports/scitech25/figs_ext/DiscreteL2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/reports/scitech25/figs_ext/DiscreteL4.pdf
Binary file not shown.
Binary file added docs/reports/scitech25/figs_ext/MC1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reports/scitech25/figs_ext/bug_gust3d.pdf
Binary file not shown.
Binary file modified docs/reports/scitech25/figs_ext/bug_model3.pdf
Binary file not shown.
Binary file added docs/reports/scitech25/figs_ext/bug_model7.pdf
Binary file not shown.
Binary file added docs/reports/scitech25/figs_ext/monoeuvre3D.pdf
Binary file not shown.
321 changes: 212 additions & 109 deletions docs/reports/scitech25/main.org

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions docs/schemas/draft2.org
Original file line number Diff line number Diff line change
Expand Up @@ -279,10 +279,15 @@ Systems with labels:
[[file:UML_software1.png]]

* Algorithms
Extensive work carried out into a software architecture that complies with good design principles.


#+NAME: alg:componentss
$N_N$ Number of discretisation condensed nodes in the model
$N_m$ Number of modal shapes in the solution
$N_t$ Number of time-steps in the integration scheme.
$N_c$ Number of cases to be run in parallel


#+NAME: alg:process
\begin{algorithm}[h!]
\DontPrintSemicolon
\SetKwInOut{Input}{input}
Expand Down
9 changes: 8 additions & 1 deletion feniax/preprocessor/solution.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ def save_container(path, container):
attr_path = path / attr_name
if isinstance(attr, jnp.ndarray):
jnp.save(attr_path, attr)
elif isinstance(attr, int) or isinstance(attr, float):
jnp.save(attr_path, jnp.array(attr))
elif isinstance(attr, np.ndarray):
jnp.save(attr_path, attr)
elif isinstance(attr, (list, dict, tuple)):
Expand All @@ -102,7 +104,12 @@ def load_container(path: pathlib.Path, Container):
if Container.__annotations__[attr_name].__name__ == "Array":
kwargs[attr_name] = jnp.load(attr_path.with_suffix(".npy"))
elif Container.__annotations__[attr_name].__name__ == "ndarray":
kwargs[attr_name] = np.load(attr_path.with_suffix(".npy"))
kwargs[attr_name] = jnp.load(attr_path.with_suffix(".npy"))
elif (Container.__annotations__[attr_name].__name__ == "int"):
kwargs[attr_name] = int(jnp.load(attr_path.with_suffix(".npy")))
elif (Container.__annotations__[attr_name].__name__ == "float"):
kwargs[attr_name] = float(jnp.load(attr_path.with_suffix(".npy")))

elif (
(Container.__annotations__[attr_name].__name__ == "dict")
or (Container.__annotations__[attr_name].__name__ == "list")
Expand Down

0 comments on commit e3ec6c0

Please sign in to comment.