{
int oldId = *itn;
//MESSAGE(" node " << oldId);
- std::set<int> cells;
- cells.clear();
vtkCellLinks::Link l = grid->GetCellLinks()->GetLink(oldId);
for (int i=0; i<l.ncells; i++)
{
//no cells created after BuildDownWardConnectivity
}
DownIdType aCell(downId, vtkType);
- if (celldom.count(vtkId))
- continue;
+ if (!cellDomains.count(aCell))
+ cellDomains[aCell] = emptyMap; // create an empty entry for cell
cellDomains[aCell][idomain] = vtkId;
celldom[vtkId] = idomain;
//MESSAGE(" cell " << vtkId << " domain " << idomain);
std::set<int> oldNodes;
oldNodes.clear();
grid->GetNodeIds(oldNodes, face.cellId, face.cellType);
-// bool isMultipleDetected = false;
std::set<int>::iterator itn = oldNodes.begin();
for (; itn != oldNodes.end(); ++itn)
{
int oldId = *itn;
- //MESSAGE(" node " << oldId);
+ //MESSAGE("-+-+-a node " << oldId);
if (!nodeDomains.count(oldId))
nodeDomains[oldId] = emptyMap; // create an empty entry for node
if (nodeDomains[oldId].empty())
- nodeDomains[oldId][idomain] = oldId; // keep the old node in the first domain
+ {
+ nodeDomains[oldId][idomain] = oldId; // keep the old node in the first domain
+ //MESSAGE("-+-+-b oldNode " << oldId << " domain " << idomain);
+ }
std::map<int, int>::iterator itdom = domvol.begin();
for (; itdom != domvol.end(); ++itdom)
{
{
vector<int> orderedDoms;
//MESSAGE("multiple node " << oldId);
-// isMultipleDetected =true;
if (mutipleNodes.count(oldId))
orderedDoms = mutipleNodes[oldId];
else
SMDS_MeshNode *newNode = meshDS->AddNode(coords[0], coords[1], coords[2]);
int newId = newNode->getVtkId();
nodeDomains[oldId][idom] = newId; // cloned node for other domains
- //MESSAGE(" newNode " << newId << " oldNode " << oldId << " size=" <<nodeDomains[oldId].size());
+ //MESSAGE("-+-+-c oldNode " << oldId << " domain " << idomain << " newNode " << newId << " domain " << idom << " size=" <<nodeDomains[oldId].size());
}
-// if (nodeDomains[oldId].size() >= 3)
-// {
-// //MESSAGE("confirm multiple node " << oldId);
-// isMultipleDetected =true;
-// }
}
}
}
if (createJointElems)
{
+ int idg;
+ string joints2DName = "joints2D";
+ mapOfJunctionGroups[joints2DName] = this->myMesh->AddGroup(SMDSAbs_Face, joints2DName.c_str(), idg);
+ SMESHDS_Group *joints2DGrp = dynamic_cast<SMESHDS_Group*>(mapOfJunctionGroups[joints2DName]->GetGroupDS());
+ string joints3DName = "joints3D";
+ mapOfJunctionGroups[joints3DName] = this->myMesh->AddGroup(SMDSAbs_Volume, joints3DName.c_str(), idg);
+ SMESHDS_Group *joints3DGrp = dynamic_cast<SMESHDS_Group*>(mapOfJunctionGroups[joints3DName]->GetGroupDS());
+
itface = faceDomains.begin();
for (; itface != faceDomains.end(); ++itface)
{
grpname << dom1 << "_" << dom2;
else
grpname << dom2 << "_" << dom1;
- int idg;
string namegrp = grpname.str();
if (!mapOfJunctionGroups.count(namegrp))
mapOfJunctionGroups[namegrp] = this->myMesh->AddGroup(vol->GetType(), namegrp.c_str(), idg);
SMESHDS_Group *sgrp = dynamic_cast<SMESHDS_Group*>(mapOfJunctionGroups[namegrp]->GetGroupDS());
if (sgrp)
sgrp->Add(vol->GetID());
+ if (vol->GetType() == SMDSAbs_Volume)
+ joints3DGrp->Add(vol->GetID());
+ else if (vol->GetType() == SMDSAbs_Face)
+ joints2DGrp->Add(vol->GetID());
}
}
orderedNodes.push_back( nodeDomains[nodes[ino]][orderDom[idom]] );
SMDS_MeshVolume* vol = this->GetMeshDS()->AddVolumeFromVtkIds(orderedNodes);
- stringstream grpname;
- grpname << "mj_";
- grpname << 0 << "_" << 0;
int idg;
- string namegrp = grpname.str();
+ string namegrp = "jointsMultiples";
if (!mapOfJunctionGroups.count(namegrp))
mapOfJunctionGroups[namegrp] = this->myMesh->AddGroup(SMDSAbs_Volume, namegrp.c_str(), idg);
SMESHDS_Group *sgrp = dynamic_cast<SMESHDS_Group*>(mapOfJunctionGroups[namegrp]->GetGroupDS());
}
else
{
- MESSAGE("Quadratic multiple joints not implemented");
+ INFOS("Quadratic multiple joints not implemented");
// TODO quadratic nodes
}
}