[MOAB-dev] AdaptiveKDTree and ElemEvaluator - problem with MBHEX

Lukasz Kaczmarczyk Lukasz.Kaczmarczyk at glasgow.ac.uk
Sat May 13 11:18:49 CDT 2017


Hello,

In principle is not issue that you have not implemented point search for some HO elements, this can be done at some point.  The problem is that code should return an error in that case, but instead, it returns segmentation fault. 

I apologise for a late response; I am involved with another work. This is how I define my ho HEX; I have the only one HO node in the volume. This is working well with tets, but not hex. 

  const char *option;
  option = "";
  rval = mwlsMoab.load_file(file_name.c_str(),0,option); CHKERRQ_MOAB(rval);
  rval = mwlsMoab.get_entities_by_dimension(0,3,levelTets); CHKERRQ_MOAB(rval);
  if(levelTets.empty()) {
    SETERRQ(mField.get_comm(),MOFEM_DATA_INCONSISTENCY,"No 3d element in MWLS mesh");
  }

  rval = mwlsMoab.get_adjacencies(levelTets,1,true,levelEdges,moab::Interface::UNION); CHKERRQ_MOAB(rval);

  // Create HO node on elements
  EntityHandle meshset;
  rval = mwlsMoab.create_meshset(MESHSET_SET,meshset); CHKERRQ_MOAB(rval);
  rval = mwlsMoab.add_entities(meshset,levelTets); CHKERRQ_MOAB(rval);
  rval = mwlsMoab.convert_entities(meshset,false,false,true); CHKERRQ_MOAB(rval);
  rval = mwlsMoab.delete_entities(&meshset,1); CHKERRQ_MOAB(rval);



rval = myTree->build_tree(level3D,&treeRoot); CHKERRQ_MOAB(rval);
boost::shared_ptr<ElemEvaluator> elemEval(myTree,new ElemEvaluator(&mwlsMoab));
 myTree->set_eval(elemEval.get());


CartVect params(material_coords);
EntityHandle leaf_out;
     rval = myTree->point_search(
       material_coords,leaf_out,maxEdgeL*1e-5,maxEdgeL*1e-3,NULL,NULL,&params
); CHKERRQ_MOAB(rval);


I need more time, I will try to pin point error exactly. 

Kind regards,
Lukasz



> On 13 May 2017, at 04:39, Grindeanu, Iulian R. <iulian at mcs.anl.gov> wrote:
> 
> Hi Lukasz,
> So how do you define your hex element? How many nodes does it have? mid-edge nodes, mid-face nodes or just an extra center node? 
> The hex27 is tested, but other combinations (or serendipity elements, like hex20) we do not test, I think
> 
> Iulian
> ________________________________________
> From: moab-dev-bounces at mcs.anl.gov [moab-dev-bounces at mcs.anl.gov] on behalf of Lukasz Kaczmarczyk [Lukasz.Kaczmarczyk at glasgow.ac.uk]
> Sent: Thursday, May 11, 2017 7:07 AM
> To: moab-dev at mcs.anl.gov
> Subject: [MOAB-dev] AdaptiveKDTree and ElemEvaluator - problem with MBHEX
> 
> Hello,
> 
> I working with AdaptiveKDTree and ElemEvaluator it works ok for MBTET, however, I get a segmentation fault for MBHEX.
> 
> The error is not critical for me I can work with the leaf, however, it will be good to know if you aware of this. In some time I can look for a fix in moab assuming that I do nothing wrong.
> 
> It could be a problem that I have hex with HO node in the middle of volume? Although, It works for tetrahedrons.
> 
> My code is,
> 
> rval = myTree->build_tree(level3D,&treeRoot); CHKERRQ_MOAB(rval);
> boost::shared_ptr<ElemEvaluator> elemEval(myTree,new ElemEvaluator(&mwlsMoab));
>  myTree->set_eval(elemEval.get());
> 
> and then
> 
> CartVect params(material_coords);
> EntityHandle leaf_out;
>      rval = myTree->point_search(
>        material_coords,leaf_out,maxEdgeL*1e-5,maxEdgeL*1e-3,NULL,NULL,&params
> ); CHKERRQ_MOAB(rval);
> 
> Trace of error is here,
> libMOAB.0.dylib`moab::ElemEvaluator::find_containing_entity:
>    0x104b1b2b0 <+320>: testl  %eax, %eax
>    0x104b1b2b2 <+322>: je     0x104b1b1e0               ; <+112>
>    0x104b1b2b8 <+328>: jmp    0x104b1b2e1               ; <+369>
>    0x104b1b2ba <+330>: xorl   %eax, %eax
> 
> error: libMOAB.0.dylib debug map object file '/Users/likask/MyBuild/moab-bitbucket/src/.libs/Range.o' has changed (actual time is 0x585d90e8, debug map time is 0x585d2e31) since this executable was linked, file will be ignored
> frame #2: 0x000000010473bba1 libMOAB.0.dylib`moab::AdaptiveKDTree::point_search(double const*, unsigned long&, double, double, bool*, unsigned long*, moab::CartVect*) + 785
> libMOAB.0.dylib`moab::AdaptiveKDTree::point_search:
>    0x10473bba1 <+785>: movl   %eax, %r13d
>    0x10473bba4 <+788>: leaq   -0x70(%rbp), %rdi
>    0x10473bba8 <+792>: callq  0x10481e590               ; moab::Range::clear()
>    0x10473bbad <+797>: testl  %r13d, %r13d
> 
> frame #3: 0x00000001000f3692 mwls`CrackPropagation::MWLSApprox::getInfluenceNodes(this=0x00007fff5fbfc138, material_coords=0x00007fff5fbfb890, search_point=true) + 946 at CrackPropagation.cpp:4173
>   4170       // Find 3DENT clase to location
>   4171       CartVect params(material_coords);
>   4172       EntityHandle leaf_out;
> -> 4173       rval = myTree->point_search(
>   4174         material_coords,leaf_out,maxEdgeL*1e-5,maxEdgeL*1e-3,NULL,NULL,&params
>   4175       ); CHKERRQ_MOAB(rval);
> 
> 
> Kind regards,
> Lukasz
> 
> 
> 



More information about the moab-dev mailing list