+ MESSAGE(".. Number of domains :"<<theElems.size());
+
+ // Check if the domains do not share an element
+ for (int idom = 0; idom < theElems.size()-1; idom++)
+ {
+// MESSAGE("... Check of domain #" << idom);
+ const TIDSortedElemSet& domain = theElems[idom];
+ TIDSortedElemSet::const_iterator elemItr = domain.begin();
+ for (; elemItr != domain.end(); ++elemItr)
+ {
+ SMDS_MeshElement* anElem = (SMDS_MeshElement*) *elemItr;
+ int idombisdeb = idom + 1 ;
+ for (int idombis = idombisdeb; idombis < theElems.size(); idombis++) // check if the element belongs to a domain further in the list
+ {
+ const TIDSortedElemSet& domainbis = theElems[idombis];
+ if ( domainbis.count(anElem) )
+ {
+ MESSAGE(".... Domain #" << idom);
+ MESSAGE(".... Domain #" << idombis);
+ throw SALOME_Exception("The domains are not disjoint.");
+ return false ;
+ }
+ }
+ }
+ }
+