core icon indicating copy to clipboard operation
core copied to clipboard

simmetrix-to-pumi convert failure with 'no mesh' attribute on model entities

Open KennethEJansen opened this issue 6 years ago • 4 comments

Convert fails in the following way:

MeshAdapt: worst element quality is 1.232585e-16

MeshAdapt: mesh adapted in 645.436791 seconds number of tet 140547941 hex 0 prism 0 pyramid 0 mesh entity counts: v 23698418 e 164416865 f 281266370 r 140547941 APF FAILED: apf::Verify: vertex with 2 adjacent edges centroid: (-0.20828, 0.49276, 0.570547) based on the following:

  • vertex is classified on a model edge which is adjacent to 2 model faces and is a manifold boundary edge making the vertex "exposed" at the geometric boundary we would expect the adjacent edge count to be at least 3

[viz003:33454] *** Process received signal *** [viz003:33454] Signal: Aborted (6) [viz003:33454] Signal code: (-6)

When I draw a sphere at this location and take a clip plane through it, I see that it is on some model regions internal to the solid in the geometric model that I had put a SImmetrix No Mesh feature on while meshing. Screen Shot 2019-06-16 at 7 37 54 AM

Here is a picture proving there is no mesh at the offending point.

I am unclear if the verify is confused by unused model information. There is no mesh at this location

Screen Shot 2019-06-16 at 7 21 35 AM Screen Shot 2019-06-16 at 7 26 43 AM Screen Shot 2019-06-16 at 7 24 48 AM

The planes clearly show there are no mesh vertices anywhere near the reported point. Is the point somehow reported wrong?

KennethEJansen avatar Jun 16 '19 13:06 KennethEJansen

I was able to make this go away by deleting those two model regions.

However, I found a new error soon after that:

APF FAILED: apf::Verify: triangle with 1 adjacent regions
centroid: (-0.437144, -0.39661, -0.425082)
based on the following:
 - triangle is classified on a model face
   which is adjacent to 2 model regions
   and is a non-manifold face
we would expect the adjacent region count to be exactly 2

I think the issue here is that there are model regions in my parasolid (and I suppose the geomsim translated model) that I am not meshing (e.g., Simmetrix-> Meshing Attribute-> No Mesh). So the message echoed is correct but, this was the intent/plan and I don't want the code to crash here.

I have hacked my version of APF to not abort when faced with this situation. I am not sure I did it right but this is what I did

diff --git a/apf/apfMesh.h b/apf/apfMesh.h
index bdba056a..ce62796d 100644
--- a/apf/apfMesh.h
+++ b/apf/apfMesh.h
@@ -399,7 +399,7 @@ class Mesh
 /** \brief run consistency checks on an apf::Mesh structure
   \details this can be used to implement apf::Mesh::verify.
   Other implementations may define their own. */
-void verify(Mesh* m, bool abort_on_error=true);
+void verify(Mesh* m, bool abort_on_error=false);
 long verifyVolumes(Mesh* m, bool printVolumes = true);

I hope someone can confirm that this is the best way to make this sort of warning non-abort. I guess I expected that this change would still result in something being written to stdout but Nothing was written during this repeat of that exercise with the code change above. Does this mean it did not do a verify?

KennethEJansen avatar Jun 17 '19 04:06 KennethEJansen

Hi Ken, what you did is right. I added the boolean argument "abort_on_error" to serve the cases as yours.

seegyoung avatar Jun 17 '19 14:06 seegyoung

Thanks Seegyoung. I am curous though as to whether I should have expected to see any message from verify. Convert worked with now messages whatsoever after the above code change.

Here is a before and after log

kjansen@viz003: /projects/tools/Models/JF_TunnelDasha/FullRoom/FromSimmetrix/ConvertTest $ ./simMeshToMdsMesh.sh 
fix_pyramids 1 attach_order 0 enable_log 2
native-model './geom.xmt_txt' model 'geom.smd' simmetrix mesh 'geom.sms' output mesh 'mdsMesh/'
read and created the simmetrix mesh in 0.318702 seconds
created the apf_sim mesh in 0.005100 seconds
created the apf_mds mesh in 0.416177 seconds
number of tet 100824 hex 0 prism 0 pyramid 0
mesh entity counts: v 20783 e 129298 f 209341 r 100824

MeshAdapt: version 2.0 !

MeshAdapt: worst element quality is 1.810409e-08

MeshAdapt: mesh adapted in 0.458420 seconds
number of tet 100824 hex 0 prism 0 pyramid 0
mesh entity counts: v 20783 e 129298 f 209341 r 100824
APF FAILED: apf::Verify: triangle with 1 adjacent regions
centroid: (-0.437144, -0.39661, -0.425082)
based on the following:
 - triangle is classified on a model face
   which is adjacent to 2 model regions
   and is a non-manifold face
we would expect the adjacent region count to be exactly 2

[viz003:19774] *** Process received signal ***
[viz003:19774] Signal: Aborted (6)
[viz003:19774] Signal code:  (-6)
[viz003:19774] [ 0] /lib/x86_64-linux-gnu/libpthread.so.0(+0xf890)[0x7f062aaa7890]
[viz003:19774] [ 1] /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x37)[0x7f062a722067]
[viz003:19774] [ 2] /lib/x86_64-linux-gnu/libc.so.6(abort+0x148)[0x7f062a723448]
[viz003:19774] [ 3] /projects/tools/SCOREC-core/build-14-190604dev_omp110/test/convert[0x124d50d]
[viz003:19774] [ 4] /projects/tools/SCOREC-core/build-14-190604dev_omp110/test/convert[0x1286e13]
[viz003:19774] [ 5] /projects/tools/SCOREC-core/build-14-190604dev_omp110/test/convert(_ZN3apf6verifyEPNS_4MeshEb+0x8c8)[0x12878f8]
[viz003:19774] [ 6] /projects/tools/SCOREC-core/build-14-190604dev_omp110/test/convert(main+0x196)[0x6b9196]
[viz003:19774] [ 7] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5)[0x7f062a70eb45]
[viz003:19774] [ 8] /projects/tools/SCOREC-core/build-14-190604dev_omp110/test/convert[0x6ba1cf]
[viz003:19774] *** End of error message ***
--------------------------------------------------------------------------
mpirun noticed that process rank 0 with PID 19774 on node viz003 exited on signal 6 (Aborted).
--------------------------------------------------------------------------
kjansen@viz003: /projects/tools/Models/JF_TunnelDasha/FullRoom/FromSimmetrix/ConvertTest $ ./simMeshToMdsMesh.sh 
fix_pyramids 1 attach_order 0 enable_log 2
native-model './geom.xmt_txt' model 'geom.smd' simmetrix mesh 'geom.sms' output mesh 'mdsMesh/'
read and created the simmetrix mesh in 0.279905 seconds
created the apf_sim mesh in 0.005035 seconds
created the apf_mds mesh in 0.417003 seconds
number of tet 100824 hex 0 prism 0 pyramid 0
mesh entity counts: v 20783 e 129298 f 209341 r 100824

MeshAdapt: version 2.0 !

MeshAdapt: worst element quality is 1.810409e-08

MeshAdapt: mesh adapted in 0.461673 seconds
number of tet 100824 hex 0 prism 0 pyramid 0
mesh entity counts: v 20783 e 129298 f 209341 r 100824
mesh verified in 0.250675 seconds
mesh mdsMesh/ written in 0.080296 seconds

So it seems it did run verify but no message of the issue. I am assuming this is a global flag for all things verified. If nothing is going to be reported then I am not sure what the value of running verify is? To be clear, I would not want every a warning written for every entity (real case has 140M elements) but it might be good to report the first one of a given type and then set a flag to not report repeats? I realize this is a non-trivial request but something to think about.

Cameron, if the above is not going to happen anytime soon, maybe we should just set a flag to skip verify in such situations since, if I am understanding it right, with the boolean set, verify runs, consumes time checking all sorts of issues but then silently returns control to the code.

KennethEJansen avatar Jun 17 '19 15:06 KennethEJansen

I think we could look for geometric model regions on a given process without any mesh elements classified on them and mark them as 'inactive'. The check for partition model boundaries looks like it will take precedence over the (non)manifold boundary checks:

https://github.com/SCOREC/core/blob/59d03165714ac2c2069f4de6a3d08bd3ba041d20/apf/apfVerify.cc#L97-L131

Assuming a 3D mesh, for a mesh face classified on the part boundary the variables in verifyUp should be set as follows:

upwardCount 1 // mesh elements on this process bound by the face
meshDimension 3
entityDimension 2
difference 1
modelDimension 2
modelUpwardCount 1 // with one of the adjacent model regions marked as inactive
isOnNonManifoldFace 0
isOnManifoldBoundary 1
isShared 1
isMatched 0 // assuming it isn't a matched mesh face
isExposedByModel 1
isExposedByMesh 1
isExposed 1
isOnEqualOrder 1
expected 1
okay 1

Do you see any other obvious concerns/problems with this approach?

cwsmith avatar Oct 31 '19 13:10 cwsmith