-
Notifications
You must be signed in to change notification settings - Fork 77
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
Add protocols for forcing convergence of the solver #89
Open
ilario
wants to merge
13
commits into
barnesgroupICL:master
Choose a base branch
from
ilario:solve_in_trunks
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
The code to be merged here is evolving in parallel as I am preparing a whole branch including it. Let me know when you are going to review this and I will update. |
Ops, I used "trunks" instead of "chunks". Sorry for my poor English XD |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Here there are some files I wrote for solving some extreme parameters sets in which the PDEPE solver could not reach completion (here I refer to broken solutions as solutions that does not contain data for all the time points requested).
The simulation could break for example when trying to simulate too large times or too thick layers (in these cases it's important to tune the xmesh_coeff parameter in the input_file) or too large applied voltages/illuminations.
What the files do is trying to run a simulation splitting the time mesh in four trunks, and if the simulation breaks during one of these sub-simulations the time span is further split in 4 trunks, recursively.
Surely this is not the proper way to fix the issue, but sometimes it works.
The same result should be possible to obtain decreasing the par.MaxStepFactor but this way should be faster.
Beware that in some really extreme cases Matlab's PDEPE could enter an infinite loop and never fail nor advance.
Here a description of all the modified files:
Protocols/runDfFourTrunks.m
runs DF recursively decreasing the simulated time span until when DF succeeds. It has been designed only for working with logarithmic time meshes.Helper/mergeSolutions.m
is a new helper for concatenating different solutions along their time evolution.Protocols/equilibrate.m
now usesrunDfFourTrunks
but only when running directly DF fails.Protocols/jumptoV_fourTrunksSolver.m
is a version ofProtocols/jumptoV.m
that usesrunDfFourTrunks
instead of executing directly DF.unit_test.m
added the unit testing for the new functions.Analysis/compare_rec_flux.m
has been adapted to not throw an error when a broken solution is provided in input. (I can move this to a separate pull request if you prefer)Libraries/Index_of_Refraction_library.xls
the columns for chromium and platinum has been added as found on https://www.filmetrics.com/refractive-index-database (thanks to Osbel Almora for this). (I can move this to a separate pull request if you prefer)