Skip to content

Commit

Permalink
Add serialization for Device and BrandtSolution
Browse files Browse the repository at this point in the history
  • Loading branch information
loganbvh committed Jun 30, 2021
1 parent cfc8f2b commit f37a7e5
Show file tree
Hide file tree
Showing 10 changed files with 436 additions and 57 deletions.
6 changes: 5 additions & 1 deletion docs/api/brandt.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


******
Brandt
Solver
******

The ``superscreen.brandt`` module contains the actual implementation
Expand All @@ -23,6 +23,10 @@ Brandt Solution
.. autoclass:: superscreen.solution.BrandtSolution
:members:

.. autofunction:: superscreen.io.save_solutions

.. autofunction:: superscreen.io.load_solutions

Supporting Functions
--------------------

Expand Down
45 changes: 26 additions & 19 deletions docs/api/device.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,53 +14,60 @@ and ``superscreen.parameters`` are used to set up the inputs to a
- The geometry and penetration depth of all superconducting films
- The spatial distribution of the applied magnetic field

Geometry
--------

.. autofunction:: superscreen.geometry.rotate

.. autofunction:: superscreen.geometry.ellipse

.. autofunction:: superscreen.geometry.circle
Devices
-------

.. autofunction:: superscreen.geometry.rectangle
Device
======

.. autofunction:: superscreen.geometry.square
.. autoclass:: superscreen.device.Device
:members:

Layer
-----
=====

.. autoclass:: superscreen.device.Layer
:members:

Polygon
-------
=======

.. autoclass:: superscreen.device.Polygon
:members:

Device
------

.. autoclass:: superscreen.device.Device
:members:
Geometry
--------

.. autofunction:: superscreen.geometry.rotate

.. autofunction:: superscreen.geometry.ellipse

.. autofunction:: superscreen.geometry.circle

.. autofunction:: superscreen.geometry.rectangle

.. autofunction:: superscreen.geometry.square

Parameters
----------

Parameter
---------
=========

.. autoclass:: superscreen.parameter.Parameter
:members:

CompositeParameter
------------------
==================

.. autoclass:: superscreen.parameter.CompositeParameter
:members:
:show-inheritance:
:inherited-members:

Constant
--------
========

.. autoclass:: superscreen.parameter.Constant
:members:
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ Better yet, click the badge below to try ``SuperScreen`` interactively online vi
:caption: API Reference

api/device.rst
api/fem.rst
api/brandt.rst
api/fem.rst
api/visualization.rst

.. toctree::
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
dill
jupyter
matplotlib
meshpy
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
PYTHON_VERSION = ">=3.6"

INSTALL_REQUIRES = [
"dill",
"jupyter",
"matplotlib",
"meshpy",
Expand Down
3 changes: 2 additions & 1 deletion superscreen/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
# LICENSE file in the root directory of this source tree.

from .brandt import convert_field, solve
from .solution import BrandtSolution
from .device import Layer, Polygon, Device
from .io import save_solutions, load_solutions
from .parameter import Parameter, Constant
from .solution import BrandtSolution
from .visualization import (
auto_grid,
grids_to_vecs,
Expand Down
11 changes: 6 additions & 5 deletions superscreen/brandt.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,13 +262,14 @@ def brandt_layer(

if check_lambda:
if isinstance(london_lambda, (int, float)) and london_lambda <= d:
length_units = device.ureg(device.length_units).units
logger.warn(
f"Layer '{layer}': The film thickness, d = {d:.4f} {device.length_units}"
f", is greater than or equal to the London penetration depth "
f"({lambda_str} = {london_lambda:.4f} {device.length_units}), resulting "
f"Layer '{layer}': The film thickness, d = {d:.4f} {length_units:~P}"
f", is greater than or equal to the London penetration depth, resulting "
f"in an effective penetration depth {Lambda_str} = {Lambda:.4f} "
f"{device.length_units} <= {lambda_str}. The assumption that the current density "
f"is nearly constant over the thickness of the film may not be valid. "
f"{length_units:~P} <= {lambda_str} = {london_lambda:.4f} {length_units:~P}. "
f"The assumption that the current density is nearly constant over the "
f"thickness of the film may not be valid. "
)

film_names = [name for name, film in device.films.items() if film.layer == layer]
Expand Down
Loading

0 comments on commit f37a7e5

Please sign in to comment.