int intNumMaille, Degre;
int ValElement;
- int ValDegre;
int NoeudsMaille[20];
int NoeudMaille;
- bool ok;
-
MESSAGE("in DriverDAT_R_SMDS_Mesh::Read()");
/****************************************************************************
* OUVERTURE DU FICHIER EN LECTURE *
for (i = 0; i < nbNodes; i++){
fscanf(aFileId, "%d %e %e %e\n", &intNumPoint, &coordX, &coordY, &coordZ);
- ok = myMesh->AddNodeWithID(coordX, coordY, coordZ, intNumPoint);
+ myMesh->AddNodeWithID(coordX, coordY, coordZ, intNumPoint);
}
fprintf(stdout, "%d noeuds\n", myMesh->NbNodes());
switch (ValElement) {
case 102:
case 103:
- ValDegre = 3;
nbNoeuds = 2;
- ok = myMesh->AddEdgeWithID(NoeudsMaille[0], NoeudsMaille[1],
+ myMesh->AddEdgeWithID(NoeudsMaille[0], NoeudsMaille[1],
intNumMaille);
break;
case 204:
case 208:
- ValDegre = 9;
nbNoeuds = 4;
- ok = myMesh->AddFaceWithID(NoeudsMaille[0], NoeudsMaille[1],
+ myMesh->AddFaceWithID(NoeudsMaille[0], NoeudsMaille[1],
NoeudsMaille[2], NoeudsMaille[3],
intNumMaille);
break;
case 203:
case 206:
- ValDegre = 5;
nbNoeuds = 3;
- ok = myMesh->AddFaceWithID(NoeudsMaille[0], NoeudsMaille[1],
+ myMesh->AddFaceWithID(NoeudsMaille[0], NoeudsMaille[1],
NoeudsMaille[2], intNumMaille);
break;
case 308:
case 320:
- ValDegre = 12;
nbNoeuds = 8;
if (ValElement == 320){
//A voir, correspondance VTK
NoeudsMaille[6] = NoeudsMaille[10];
NoeudsMaille[7] = NoeudsMaille[11];
}
- ok = myMesh->AddVolumeWithID(NoeudsMaille[0], NoeudsMaille[1],
+ myMesh->AddVolumeWithID(NoeudsMaille[0], NoeudsMaille[1],
NoeudsMaille[2], NoeudsMaille[3],
NoeudsMaille[4], NoeudsMaille[5],
NoeudsMaille[6], NoeudsMaille[7],
break;
case 304:
case 310:
- ValDegre = 10;
nbNoeuds = 4;
if (ValElement == 310)
NoeudsMaille[3] = NoeudsMaille[6];
- ok = myMesh->AddVolumeWithID(NoeudsMaille[0], NoeudsMaille[1],
+ myMesh->AddVolumeWithID(NoeudsMaille[0], NoeudsMaille[1],
NoeudsMaille[2], NoeudsMaille[3],
intNumMaille);
break;
case 306:
case 315:
- ValDegre = 12;
nbNoeuds = 8;
if (ValElement == 315) {
NoeudsMaille[3] = NoeudsMaille[6];
NoeudsMaille[5] = NoeudsMaille[4];
NoeudsMaille[4] = NoeudsMaille[3];
NoeudsMaille[3] = NoeudsMaille[2];
- ok = myMesh->AddVolumeWithID(NoeudsMaille[0], NoeudsMaille[1],
+ myMesh->AddVolumeWithID(NoeudsMaille[0], NoeudsMaille[1],
NoeudsMaille[2], NoeudsMaille[3],
NoeudsMaille[4], NoeudsMaille[5],
intNumMaille);
}
}
- // if(!anElement)
- // MESSAGE("DriverUNV_R_SMDS_Mesh::Perform - can not add element with ID = "<<aLabel<<" and type = "<<aRec.fe_descriptor_id);
+ if(!anElement)
+ MESSAGE("DriverUNV_R_SMDS_Mesh::Perform - can not add element with ID = "<<aLabel<<" and type = "<<aRec.fe_descriptor_id);
}
}
{
//no st1, st2, st3, 0 (non quadrangle)
R d, tcpu=0;
- R3 direction=R3(0,0,0); //direction pour areteideale() inactive ici!
+// R3 direction=R3(0,0,0); //direction pour areteideale() inactive ici!
Z nbarfr=nudslf[nblf]; //nombre total d'aretes des lignes fermees
Z mxtrou = Max( 1024, nblf ); //nombre maximal de trous dans la surface
#include <vtkXMLUnstructuredGridWriter.h>
#include <vtkUnstructuredGridWriter.h>
-#ifdef _DEBUG_
-static int MYDEBUG = 1;
-#else
-static int MYDEBUG = 0;
-#endif
+//#ifdef _DEBUG_
+//static int MYDEBUG = 1;
+//#else
+//static int MYDEBUG = 0;
+//#endif
namespace SMESH
{
using namespace std;
-#ifdef _DEBUG_
-static int MYDEBUG = 0;
-#else
-static int MYDEBUG = 0;
-#endif
+//#ifdef _DEBUG_
+//static int MYDEBUG = 0;
+//#else
+//static int MYDEBUG = 0;
+//#endif
#if defined __GNUC__
#if __GNUC__ == 2
int SMDS_Down3D::FindFaceByNodes(int cellId, ElemByNodesType& faceByNodes)
{
int *faces = &_cellIds[_nbDownCells * cellId];
- int faceNodeSet[10];
int npoints = 0;
for (int i = 0; i < _nbDownCells; i++)
if ((faces[i] >= 0) && (faceByNodes.vtkType == _cellTypes[i]))
{
if (npoints == 0)
- {
- for (int j = 0; j < faceByNodes.nbNodes; j++)
- faceNodeSet[j] = faceByNodes.nodeIds[j];
- npoints = faceByNodes.nbNodes;
- }
+ npoints = faceByNodes.nbNodes;
int nodeSet[10];
int npts = this->_grid->getDownArray(faceByNodes.vtkType)->getNodeSet(faces[i], nodeSet);
int vtkType = this->GetCellType(vtkId);
int dim = SMDS_Downward::getCellDimension(vtkType);
int nbFaces = 0;
- int faces[1000];
unsigned char cellTypes[1000];
int downCellId[1000];
if (dim == 1)
const unsigned char* upTypes = _downArray[vtkType]->getUpTypes(downId);
for (int i=0; i< nbFaces; i++)
{
- faces[i] = _downArray[upTypes[i]]->getVtkCellId(upCells[i]);
cellTypes[i] = upTypes[i];
downCellId[i] = upCells[i];
}
else if (dim == 2)
{
nbFaces = 1;
- faces[0] = vtkId;
cellTypes[0] = this->GetCellType(vtkId);
int downId = this->CellIdToDownId(vtkId);
if (downId < 0)
int vtkType = downType;
int dim = SMDS_Downward::getCellDimension(vtkType);
int nbFaces = 0;
- int faces[1000];
unsigned char cellTypes[1000];
int downCellId[1000];
if (dim == 1)
const unsigned char* upTypes = _downArray[vtkType]->getUpTypes(downId);
for (int i=0; i< nbFaces; i++)
{
- faces[i] = _downArray[upTypes[i]]->getVtkCellId(upCells[i]);
cellTypes[i] = upTypes[i];
downCellId[i] = upCells[i];
}
if ( minInd >= firstMediumInd )
return false; // medium nodes are not linked
if ( maxInd < firstMediumInd ) // both nodes are corners
+ {
if ( theIgnoreMediumNodes )
type = SMDSAbs_EntityType( int(type)-1 ); // check linkage of corner nodes
else
return false; // corner nodes are not linked directly in a quadratic cell
+ }
}
switch ( type ) {
myLastCreatedNodes.Append(newN);
// create a new element
- const SMDS_MeshNode* N[6];
if ( aBadRate1 <= aBadRate2 ) {
- N[0] = aNodes[0];
- N[1] = aNodes[1];
- N[2] = aNodes[2];
- N[3] = aNodes[4];
- N[4] = aNodes[5];
- N[5] = newN;
newElem1 = aMesh->AddFace(aNodes[2], aNodes[3], aNodes[0],
aNodes[6], aNodes[7], newN );
newElem2 = aMesh->AddFace(aNodes[2], aNodes[0], aNodes[1],
newN, aNodes[4], aNodes[5] );
}
else {
- N[0] = aNodes[1];
- N[1] = aNodes[2];
- N[2] = aNodes[3];
- N[3] = aNodes[5];
- N[4] = aNodes[6];
- N[5] = newN;
newElem1 = aMesh->AddFace(aNodes[3], aNodes[0], aNodes[1],
aNodes[7], aNodes[4], newN );
newElem2 = aMesh->AddFace(aNodes[3], aNodes[1], aNodes[2],
// create a new element
const SMDS_MeshElement* newElem1 = 0;
const SMDS_MeshElement* newElem2 = 0;
- const SMDS_MeshNode* N[6];
if ( the13Diag ) {
- N[0] = aNodes[0];
- N[1] = aNodes[1];
- N[2] = aNodes[2];
- N[3] = aNodes[4];
- N[4] = aNodes[5];
- N[5] = newN;
newElem1 = aMesh->AddFace(aNodes[2], aNodes[3], aNodes[0],
aNodes[6], aNodes[7], newN );
newElem2 = aMesh->AddFace(aNodes[2], aNodes[0], aNodes[1],
newN, aNodes[4], aNodes[5] );
}
else {
- N[0] = aNodes[1];
- N[1] = aNodes[2];
- N[2] = aNodes[3];
- N[3] = aNodes[5];
- N[4] = aNodes[6];
- N[5] = newN;
newElem1 = aMesh->AddFace(aNodes[3], aNodes[0], aNodes[1],
aNodes[7], aNodes[4], newN );
newElem2 = aMesh->AddFace(aNodes[3], aNodes[1], aNodes[2],
Handle(Geom_Surface) surface;
SMESHDS_SubMesh* faceSubMesh = 0;
TopoDS_Face face;
- double fToler2 = 0, vPeriod = 0., uPeriod = 0., f,l;
+ double fToler2 = 0, f,l;
double u1 = 0, u2 = 0, v1 = 0, v2 = 0;
bool isUPeriodic = false, isVPeriodic = false;
if ( *fId ) {
fToler2 *= fToler2 * 10.;
isUPeriodic = surface->IsUPeriodic();
if ( isUPeriodic )
- vPeriod = surface->UPeriod();
+ surface->UPeriod();
isVPeriodic = surface->IsVPeriodic();
if ( isVPeriodic )
- uPeriod = surface->VPeriod();
+ surface->VPeriod();
surface->Bounds( u1, u2, v1, v2 );
}
// ---------------------------------------------------------
list<SMESH_MeshEditor_PathPoint> currList = *itLLPP;
itPP = currList.begin();
SMESH_MeshEditor_PathPoint PP2 = currList.front();
- gp_Pnt P1 = PP1.Pnt();
- //cout<<" PP1: Pnt("<<P1.X()<<","<<P1.Y()<<","<<P1.Z()<<")"<<endl;
- gp_Pnt P2 = PP2.Pnt();
gp_Dir D1 = PP1.Tangent();
gp_Dir D2 = PP2.Tangent();
gp_Dir Dnew( gp_Vec( (D1.X()+D2.X())/2, (D1.Y()+D2.Y())/2,
PGroupIDs newGroupIDs;
- if ( theMakeGroups && theCopy ||
- theMakeGroups && theTargetMesh )
+ if ( ( theMakeGroups && theCopy ) ||
+ ( theMakeGroups && theTargetMesh ) )
newGroupIDs = generateGroups( srcNodes, srcElems, groupPostfix, theTargetMesh );
return newGroupIDs;
}
// check similarity of elements of the sides
- if (aResult == SEW_OK && ( face[0] && !face[1] ) || ( !face[0] && face[1] )) {
+ if (aResult == SEW_OK && (( face[0] && !face[1] ) || ( !face[0] && face[1] ))) {
MESSAGE("Correspondent face not found on side " << ( face[0] ? 1 : 0 ));
if ( nReplaceMap.size() == 2 ) { // faces on input nodes not found
aResult = ( face[0] ? SEW_BAD_SIDE2_NODES : SEW_BAD_SIDE1_NODES );
faces.Add( f.Current() ); // in not meshed solid
}
else { // fix nodes in the solid and its faces
+#ifdef _DEBUG_
MSG("FIX SOLID " << nbSolids-- << " #" << GetMeshDS()->ShapeToIndex(s.Current()));
+#endif
SMESH_MesherHelper h(*myMesh);
h.SetSubShape( s.Current() );
h.FixQuadraticElements(false);
for ( nIt = startNodes.begin(); nIt != startNodes.end(); nIt++ )
{
- TIsoNode* prevN[2], *node = *nIt;
+ TIsoNode *node = *nIt;
if ( node->IsUVComputed() || !node->IsMovable() )
continue;
gp_XY newUV( 0, 0 ), sumDir( 0, 0 );
newUV += prevNode1->myUV + dir * step[ iDir ];
}
sumDir += dir;
- prevN[ iDir ] = prevNode1;
nbComp++;
}
}
}
// define ratio
bool ok = true; // <- stupid fix TO AVOID PB OF NODES WITH NULL BND NODES
- double locR[2] = { 0, 0 };
+// double locR[2] = { 0, 0 };
for ( iDir = 0; iDir < 2; iDir++ )
{
const int iCoord = 2 - iDir; // coord changing along an isoline
double par3 = bndNode2->myInitUV.Coord( iCoord );
double r = ( par2 - par1 ) / ( par3 - par1 );
r = Abs ( r - 0.5 ) * 2.0; // [0,1] - distance from the middle
- locR[ iDir ] = ( 1 - r * r ) * 0.25;
+// locR[ iDir ] = ( 1 - r * r ) * 0.25;
}
//locR[0] = locR[1] = 0.25;
// intersect the 2 lines and move a node
{theBounds[0],theBounds[3],theBounds[5]},
{theBounds[1],theBounds[3],theBounds[5]}};
- int aMaxId = 0, aMinId = aMaxId;
+ int aMaxId = 0;
theMaxBoundPrj = vtkMath::Dot(theDirection,aBoundPoints[aMaxId]);
theMinBoundPrj = theMaxBoundPrj;
for(int i = 1; i < 8; i++){
}
if(theMinBoundPrj > aTmp){
theMinBoundPrj = aTmp;
- aMinId = i;
}
}
vtkFloatingPointType *aMinPnt = aBoundPoints[aMaxId];
int nb1 = nb;
int nr1 = nr;
int nt1 = nt;
- int nl1 = nl;
if (nr == nl) {
if (nb < nt) {
}
}
else if (nb == nt) {
- nl1 = nb; // and == nt
nr1 = nb; // and == nt
if (nl < nr) {
nt1 = nl;
}
// number of rows and columns
- int nrows = nr1 - 1; // and also == nl1 - 1
+ int nrows = nr1 - 1;
int ncol_top = nt1 - 1;
int ncol_bot = nb1 - 1;
// maximum number of bottom elements for "tree" simple reduce 3->1
distToIntersection = Precision::Infinite();
double dist;
const SMDS_MeshElement* intFace = 0, *closestFace = 0;
+#ifdef __myDEBUG
+ const SMDS_MeshElement* *closestFace = 0;
int iLE = 0;
+#endif
for ( unsigned i = 0; i < data._edges.size(); ++i )
{
if ( data._edges[i]->FindIntersection( *searcher, dist, data._epsilon, &intFace ))
return false;
if ( distToIntersection > dist )
- distToIntersection = dist, closestFace = intFace, iLE = i;
+ {
+ distToIntersection = dist;
+#ifdef __myDEBUG
+ iLE = i;
+ closestFace = intFace;
+#endif
+ }
}
#ifdef __myDEBUG
if ( closestFace )
// Find out orientation and type of face to create
- bool reverse = false, tria = false, isOnFace;
+ bool reverse = false, isOnFace;
map< TGeomID, TopoDS_Shape >::iterator e2f =
data._shrinkShape2Shape.find( getMeshDS()->ShapeToIndex( E ));
!_ignoreShapeIds.count( e2f->first ))
F = *pF;
}
-
- tria = true;
}
// Find the sub-mesh to add new faces
SMESHDS_SubMesh* sm = 0;
{
if( cachedSizeHint().isValid() )
return cachedSizeHint();
-
+ return QTableWidget::sizeHint();
// QSize sh = QTableWidget::sizeHint();
// if( sh.width() < 400 )
// sh.setWidth( 400 );
break;
}
if ( hasConv )
+ {
if ( data.myConv )
valStr += "; " + tr("SMESH_CUT_NEG_MODE");
else
valStr += "; " + tr("SMESH_EXP_MODE");
+ }
return valStr;
}
int V[6];
int S[4]; // Signature du T4 courant
- int NG[4]; // Num. globaux des sommets
+ //int NG[4]; // Num. globaux des sommets
// Acquisition maillage initial
//cout << chrono() << " - Acquisition du maillage initial" << endl;
for (int is = 0; is < 4; is++)
{
int ng = *(MAILLAGE1->CNX[TETRA4] + 4 * it4 + is);
- NG[is] = ng;
+ //NG[is] = ng;
S[is] = *(POSN + ng - 1);
}