Closed nschloe closed 3 years ago
There are more print()
s in sliver_removal
, too. Best grep your codebase for print
.
Yea I left this on purpose because I wanted some feedback to the user to see something was working.
Alright. It should be possible to turn off entirely though. Perhaps, instead of 'verbose', you could use a 'verbosity' integer level.
Yea that's reasonable.
so, verbose = 0 (default) which tells you it's starting and finishing, verbose=-1 (nothing), verbose > 0 (prints intermediate output every iterations%verbose steps.
verbosity
would typically be a nonnegative integer where 0
means "nothing".
I just need to reinsert the 'flush' in the prints for visibility in parallel.
I'm getting
Termination reached...maximum number of iterations reached.
Deleting 0 poor quality boundary entities...
Movement tolerance reached after 6 iterations..exiting
Constraining 4 fixed points..
Commencing mesh generation with 1839 vertices on rank 0.
Termination reached...maximum number of iterations reached.
Deleting 0 poor quality boundary entities...
Movement tolerance reached after 6 iterations..exiting
Constraining 4 fixed points..
Commencing mesh generation with 2423 vertices on rank 0.
Termination reached...maximum number of iterations reached.
Deleting 1 poor quality boundary entities...
Movement tolerance reached after 6 iterations..exiting
Constraining 4 fixed points..
Commencing mesh generation with 3278 vertices on rank 0.
Termination reached...maximum number of iterations reached.
Deleting 0 poor quality boundary entities...
Movement tolerance reached after 9 iterations..exiting
Constraining 4 fixed points..
Commencing mesh generation with 4479 vertices on rank 0.
Termination reached...maximum number of iterations reached.
Deleting 2 poor quality boundary entities...
Movement tolerance reached after 8 iterations..exiting
again with verbosity=0
.
Hm. I get the corner constraint message. I forgot to put the verbose in there. But the other ones I don't get these messages. I actually tried to anticipate this and make both those functions take the verbose integer (delete_boundary_entities) and (laplacian2) in geometry.utils
Maybe verbose == 0 doesn't evaluate to False on some versions of Python?
Anyway I'll make a test for this so it doesn't happen again.
python 3.6.8 on Linux build by sdist import SeismicMesh SeismicMesh.version '3.1.4'
disk = SeismicMesh.Disk([0.0, 0.0], 1.0)
points, cells = SeismicMesh.generate_mesh(domain=disk, edge_length=0.1, verbose=0)
(base) keiths-MacBook-Pro:SeismicMesh Keith$ python disk.py (base) keiths-MacBook-Pro:SeismicMesh Keith$
points, cells = SeismicMesh.generate_mesh(domain=disk, edge_length=0.1, verbose=1)
(base) keiths-MacBook-Pro:SeismicMesh Keith$ python disk.py Constraining 0 fixed points.. Commencing mesh generation with 327 vertices on rank 0. Termination reached...maximum number of iterations reached. Deleting 0 poor quality boundary entities... Movement tolerance reached after 5 iterations..exiting (base) keiths-MacBook-Pro:SeismicMesh Keith$
points, cells = SeismicMesh.generate_mesh(domain=disk, edge_length=0.1, verbose=2)
... Iteration #48, max movement is 0.016383, there are 327 vertices and 596 cells Elapsed wall-clock time 0.002237 : Iteration #49, max movement is 0.016350, there are 327 vertices and 596 cells Elapsed wall-clock time 0.002149 : Termination reached...maximum number of iterations reached. Deleting 0 poor quality boundary entities... Movement tolerance reached after 5 iterations..exiting
Well, I put in a unit test for this and it passed. The test directs all stdout to a file and then measures the size of that file for different verbosity levels.
Not sure how you're calling the program that's creating these messages...
Thanks for the investigation. You were right, I missed a verbose=0
. Fixed now.
Cool. Looks like the additional Laplacian smooth at the end really helps boost the minimum element qualities in 2d.
Even though I set
verbose=False
, I'm still getting