Rewriting CheckTimestep-->BoundCr #56
Merged
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.
msh.BoundCr is a generalization of msh.CheckTimestep which now supports min. and max. Courant bounds.
-Default bounding of the maximum Courant number is preserved (will not try to refine to achieve min. Courant bound if the user does not ask).
For example to edit a mesh to support a 100 s timestep with a max. courant number of 6...
mnew = BoundCr(m,100,6);
If you also want to bound the minimum Courant number to 0.5 for a 100 second timestep, then
mnew = BoundCr(m,100,6,0.5);
You can also specify the number of iterations to perform..For instance here I set maxIT to 10.
mnew = BoundCr(m,100,6,0.5,10);
The approach to bound the maximum Courant number is the same as CheckTimestep.
The approach to bound the minimum Courant number is based on using an octree refinement strategy that splits the edges of triangles that need refinement at their midpoint while leaving the rest alone.
Note it is recommended to use this function (BoundCr) after building a mesh size function with a similar set of bounds as bounding the Courant in the mesh size function only approximately ensures it will be obeyed.