krober10nd / SeismicMesh

2D/3D serial and parallel triangular mesh generation tool for finite element methods.
https://seismicmesh.readthedocs.io/
GNU General Public License v3.0
127 stars 33 forks source link

still too verbose #80

Closed nschloe closed 3 years ago

nschloe commented 4 years ago

Even though I set verbose=False, I'm still getting

Commencing mesh generation with 4 vertices on rank 0.
Termination reached...maximum number of iterations reached.
nschloe commented 4 years ago

There are more print()s in sliver_removal, too. Best grep your codebase for print.

krober10nd commented 4 years ago

Yea I left this on purpose because I wanted some feedback to the user to see something was working.

nschloe commented 4 years ago

Alright. It should be possible to turn off entirely though. Perhaps, instead of 'verbose', you could use a 'verbosity' integer level.

krober10nd commented 4 years ago

Yea that's reasonable.

krober10nd commented 4 years ago

so, verbose = 0 (default) which tells you it's starting and finishing, verbose=-1 (nothing), verbose > 0 (prints intermediate output every iterations%verbose steps.

nschloe commented 4 years ago

verbosity would typically be a nonnegative integer where 0 means "nothing".

krober10nd commented 4 years ago

I just need to reinsert the 'flush' in the prints for visibility in parallel.

nschloe commented 3 years ago

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.

krober10nd commented 3 years ago

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.

krober10nd commented 3 years ago

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

krober10nd commented 3 years ago

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...

nschloe commented 3 years ago

Thanks for the investigation. You were right, I missed a verbose=0. Fixed now.

krober10nd commented 3 years ago

Cool. Looks like the additional Laplacian smooth at the end really helps boost the minimum element qualities in 2d.