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

Support for 2D cylindrical and 1D spherical #410

Merged
merged 21 commits into from
Apr 1, 2022
Merged

Conversation

RemDelaporteMathurin
Copy link
Collaborator

@RemDelaporteMathurin RemDelaporteMathurin commented Mar 31, 2022

Proposed changes

This PR adds the possibility to run simulations in cylindrical and spherical coordinates.

Usage:

    my_materials = FESTIM.Materials(
        [
            FESTIM.Material(id=1, D_0=1, E_D=0)
        ]
    )

    my_mesh = FESTIM.MeshFromVertices(np.linspace(1, 2, 500), type="cylindrical")

    my_bcs = [
        FESTIM.DirichletBC(surfaces=1, value=1),
        FESTIM.DirichletBC(surfaces=2, value=0),
    ]

    my_temp = FESTIM.Temperature(100)

    my_sources = [
        FESTIM.Source(f, 1, "0"),
    ]

    my_settings = FESTIM.Settings(
        absolute_tolerance=1e-10,
        relative_tolerance=1e-9,
        maximum_iterations=50,
        transient=False
    )


    my_sim = FESTIM.Simulation(
        mesh=my_mesh, materials=my_materials,
        boundary_conditions=my_bcs,
        temperature=my_temp, sources=my_sources, settings=my_settings)

    my_sim.initialise()
    my_sim.run()

Todo:

  • Add feature to heat transfer

Types of changes

What types of changes does your code introduce to FESTIM?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Code refactoring
  • Documentation Update (if none of the other choices apply)
  • New tests

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • Pep8 applied
  • Unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Further comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...

@codecov
Copy link

codecov bot commented Mar 31, 2022

Codecov Report

Merging #410 (3c3f63b) into dev (a52452b) will increase coverage by 0.01%.
The diff coverage is 98.47%.

@@            Coverage Diff             @@
##              dev     #410      +/-   ##
==========================================
+ Coverage   98.85%   98.86%   +0.01%     
==========================================
  Files          49       49              
  Lines        1923     1943      +20     
==========================================
+ Hits         1901     1921      +20     
  Misses         22       22              
Impacted Files Coverage Δ
FESTIM/temperature/temperature_solver.py 97.91% <97.91%> (+0.16%) ⬆️
FESTIM/concentration/mobile.py 100.00% <100.00%> (ø)
FESTIM/h_transport_problem.py 100.00% <100.00%> (ø)
FESTIM/meshing/mesh.py 100.00% <100.00%> (ø)
FESTIM/meshing/mesh_1d.py 100.00% <100.00%> (ø)
FESTIM/meshing/mesh_from_refinements.py 100.00% <100.00%> (ø)
FESTIM/meshing/mesh_from_vertices.py 100.00% <100.00%> (ø)
FESTIM/meshing/mesh_from_xdmf.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a52452b...3c3f63b. Read the comment docs.

@RemDelaporteMathurin
Copy link
Collaborator Author

The failing patch coverage is due to a vsc bug which stagged the whole temperature_solver.py file as changed...

@RemDelaporteMathurin RemDelaporteMathurin merged commit cd53d61 into dev Apr 1, 2022
@RemDelaporteMathurin RemDelaporteMathurin linked an issue Apr 1, 2022 that may be closed by this pull request
@RemDelaporteMathurin RemDelaporteMathurin deleted the cylindrical branch April 6, 2022 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for cylindrical (2D) and spherical (1D)
1 participant