Skip to content

Conversation

@jhdark
Copy link
Collaborator

@jhdark jhdark commented Jan 13, 2025

Proposed changes

Fix for #846

With this change users can define the dt simply by an int or float such as:

import festim as F

my_model = F.Simulation()

my_model.mesh = F.MeshFromVertices([1, 2, 3, 4])

my_model.materials = F.Material(id=1, D_0=1, E_D=0)
my_model.T = 300
my_model.settings = F.Settings(
    absolute_tolerance=1e-10,
    relative_tolerance=1e-10,
    transient=True,
    final_time=10,
)

my_model.dt = 1    # <------- provide stepsize as int or float


my_model.initialise()
my_model.run()

Types of changes

What types of changes does your code introduce to FESTIM?

  • 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

  • Black formatted
  • 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...

@jhdark jhdark added the enhancement New feature or request label Jan 13, 2025
@codecov
Copy link

codecov bot commented Jan 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.26%. Comparing base (8d6857b) to head (59c2eb4).
Report is 67 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #936      +/-   ##
==========================================
- Coverage   99.27%   99.26%   -0.02%     
==========================================
  Files          60       60              
  Lines        2753     2713      -40     
==========================================
- Hits         2733     2693      -40     
  Misses         20       20              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@RemDelaporteMathurin RemDelaporteMathurin linked an issue Jan 14, 2025 that may be closed by this pull request
Co-authored-by: Rémi Delaporte-Mathurin <40028739+RemDelaporteMathurin@users.noreply.github.com>
@RemDelaporteMathurin
Copy link
Collaborator

@jhdark can you format the code and then feel free to merge

@jhdark jhdark merged commit af3b3c3 into festim-dev:main Jan 14, 2025
5 of 6 checks passed
@jhdark jhdark deleted the stepsize_float branch January 14, 2025 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

QoL: provide stepsize as float

2 participants