Parallel worlds by default do not have materials assigned. As a result, when you export a parallel world geometry to GDML, the writer crashes in the GenerateName function when it is called with a null material. [The easy fix; return a placeholder name when the input to GenerateName is null.]
Hi, sorry for the delay in handling it. I have modified G4GDMLWriteStructure to handle the null pointer to material. Could you please test the diff below? Cheers, Witek Index: src/G4GDMLWriteStructure.cc =================================================================== --- src/G4GDMLWriteStructure.cc (revision 106330) +++ src/G4GDMLWriteStructure.cc (working copy) @@ -448,12 +448,18 @@ const G4String name = GenerateName(tmplv->GetName(), tmplv); - const G4String materialref - = GenerateName(volumePtr->GetMaterial()->GetName(), - volumePtr->GetMaterial()); + + G4String materialref = "NULL"; + + if(volumePtr->GetMaterial()) + { + materialref = GenerateName(volumePtr->GetMaterial()->GetName(), + volumePtr->GetMaterial()); + } + const G4String solidref - = GenerateName(solidPtr->GetName(),solidPtr); - + = GenerateName(solidPtr->GetName(),solidPtr); + xercesc::DOMElement* volumeElement = NewElement("volume"); volumeElement->setAttributeNode(NewAttribute("name",name)); xercesc::DOMElement* materialrefElement = NewElement("materialref");