STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC)
SET(${PROJECT_NAME_UC}_MAJOR_VERSION 9)
-SET(${PROJECT_NAME_UC}_MINOR_VERSION 6)
+SET(${PROJECT_NAME_UC}_MINOR_VERSION 7)
SET(${PROJECT_NAME_UC}_PATCH_VERSION 0)
SET(${PROJECT_NAME_UC}_VERSION
${${PROJECT_NAME_UC}_MAJOR_VERSION}.${${PROJECT_NAME_UC}_MINOR_VERSION}.${${PROJECT_NAME_UC}_PATCH_VERSION})
smesh.SetName(NETGEN_1D_2D_3D.GetAlgorithm(), 'NETGEN 1D-2D-3D')
smesh.SetName(Mesh_1.GetMesh(), 'Mesh_1')
-assert(Mesh_1.GetMesh().NbTetras()>=5)
+nbOfTetraExp = 5
+
+assert(Mesh_1.GetMesh().NbTetras()>=nbOfTetraExp)
+
+#Mesh_1.ExportMED("toto.med")
+
+import medcoupling as mc
+
+mv_mm = Mesh_1.ExportMEDCoupling()
+assert(mc.MEDCoupling1SGTUMesh(mv_mm[0]).getNumberOfCells()>=nbOfTetraExp)
--- /dev/null
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+"""Tests de blocFissure ; en standalone
+
+Cas tests basés sur les matériels :
+. cubeAngle
+. cubeFin
+
+Copyright 2021 EDF
+Gérald NICOLAS
++33.1.78.19.43.52
+"""
+
+__revision__ = "V02.04"
+
+import os
+import sys
+
+# Lancement des cas-tests
+import salome
+salome.standalone()
+salome.salome_init()
+
+from blocFissure.CasTests.blocFissureTest import blocFissureTest
+BLOCFISSURE_TEST = blocFissureTest(["cubeAngle", "cubeAngle_2","cubeCoin", "cubeMilieu", "cubeTransverse"])
+MESSAGE_ERREUR = BLOCFISSURE_TEST.lancement()
+#sys.stdout.write(MESSAGE_ERREUR)
+del BLOCFISSURE_TEST
+
+# Diagnostic
+if MESSAGE_ERREUR:
+ if ( "NOOK" in MESSAGE_ERREUR ):
+ LAUX = MESSAGE_ERREUR.split()
+ ERREUR = int(LAUX[LAUX.index("NOOK")+2])
+ else:
+ ERREUR = 0
+else:
+ MESSAGE_ERREUR = "Impossible de trouver le diagnostic de la procédure de tests."
+ ERREUR = -1
+
+if ERREUR:
+ sys.stderr.write(MESSAGE_ERREUR)
+ #raise Exception(MESSAGE_ERREUR)
+ assert(False)
+
--- /dev/null
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+"""Tests de blocFissure ; en standalone
+
+Cas tests basés sur les matériels :
+. decoupeCylindre
+. disque_perce
+. fissureGauche
+. fissureGauche_2
++ ellipse, ellipse_disque, ellipse_probleme
+
+Copyright 2021 EDF
+Gérald NICOLAS
++33.1.78.19.43.52
+"""
+
+__revision__ = "V02.04"
+
+import os
+import sys
+
+# Lancement des cas-tests
+import salome
+salome.standalone()
+salome.salome_init()
+
+from blocFissure.CasTests.blocFissureTest import blocFissureTest
+BLOCFISSURE_TEST = blocFissureTest(["cylindre", "cylindre_2", "disquePerce", "faceGauche","ellipse_1", "ellipse_2"])
+#BLOCFISSURE_TEST = blocFissureTest(["cylindre", "cylindre_2", "disquePerce", "faceGauche","ellipse_1", "ellipse_2", "faceGauche_2"])
+MESSAGE_ERREUR = BLOCFISSURE_TEST.lancement()
+#sys.stdout.write(MESSAGE_ERREUR)
+del BLOCFISSURE_TEST
+
+# Diagnostic
+if MESSAGE_ERREUR:
+ if ( "NOOK" in MESSAGE_ERREUR ):
+ LAUX = MESSAGE_ERREUR.split()
+ ERREUR = int(LAUX[LAUX.index("NOOK")+2])
+ else:
+ ERREUR = 0
+else:
+ MESSAGE_ERREUR = "Impossible de trouver le diagnostic de la procédure de tests."
+ ERREUR = -1
+
+if ERREUR:
+ sys.stderr.write(MESSAGE_ERREUR)
+ #raise Exception(MESSAGE_ERREUR)
+ assert(False)
+
--- /dev/null
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+"""Tests de blocFissure ; en standalone
+
+Cas tests basés sur les matériels :
+. eprouvetteCourbe
+. eprouvetteDroite
+
+Copyright 2021 EDF
+Gérald NICOLAS
++33.1.78.19.43.52
+"""
+
+__revision__ = "V02.03"
+
+import os
+import sys
+
+# Lancement des cas-tests
+import salome
+salome.standalone()
+salome.salome_init()
+
+from blocFissure.CasTests.blocFissureTest import blocFissureTest
+BLOCFISSURE_TEST = blocFissureTest(["eprouvetteCourbe", "eprouvetteDroite", "eprouvetteDroite_2"])
+MESSAGE_ERREUR = BLOCFISSURE_TEST.lancement()
+#sys.stdout.write(MESSAGE_ERREUR)
+del BLOCFISSURE_TEST
+
+# Diagnostic
+if MESSAGE_ERREUR:
+ if ( "NOOK" in MESSAGE_ERREUR ):
+ LAUX = MESSAGE_ERREUR.split()
+ ERREUR = int(LAUX[LAUX.index("NOOK")+2])
+ else:
+ ERREUR = 0
+else:
+ MESSAGE_ERREUR = "Impossible de trouver le diagnostic de la procédure de tests."
+ ERREUR = -1
+
+if ERREUR:
+ sys.stderr.write(MESSAGE_ERREUR)
+ #raise Exception(MESSAGE_ERREUR)
+ assert(False)
+
--- /dev/null
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+"""Tests de blocFissure ; en standalone
+
+Cas tests basés sans matériels (1/3)
+
+Copyright 2021 EDF
+Gérald NICOLAS
++33.1.78.19.43.52
+"""
+
+__revision__ = "V02.03"
+
+import os
+import sys
+
+# Lancement des cas-tests
+import salome
+salome.standalone()
+salome.salome_init()
+
+from blocFissure.CasTests.blocFissureTest import blocFissureTest
+BLOCFISSURE_TEST = blocFissureTest(["fissureCoude_1", "fissureCoude_2", "fissureCoude_3", "fissureCoude_4", "fissureCoude_5"])
+MESSAGE_ERREUR = BLOCFISSURE_TEST.lancement()
+#sys.stdout.write(MESSAGE_ERREUR)
+del BLOCFISSURE_TEST
+
+# Diagnostic
+if MESSAGE_ERREUR:
+ if ( "NOOK" in MESSAGE_ERREUR ):
+ LAUX = MESSAGE_ERREUR.split()
+ ERREUR = int(LAUX[LAUX.index("NOOK")+2])
+ else:
+ ERREUR = 0
+else:
+ MESSAGE_ERREUR = "Impossible de trouver le diagnostic de la procédure de tests."
+ ERREUR = -1
+
+if ERREUR:
+ sys.stderr.write(MESSAGE_ERREUR)
+ #raise Exception(MESSAGE_ERREUR)
+ assert(False)
+
--- /dev/null
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+"""Tests de blocFissure ; en standalone
+
+Cas tests basés sans matériels (1/3)
+
+Copyright 2021 EDF
+Gérald NICOLAS
++33.1.78.19.43.52
+"""
+
+__revision__ = "V02.03"
+
+import os
+import sys
+
+# Lancement des cas-tests
+import salome
+salome.standalone()
+salome.salome_init()
+
+from blocFissure.CasTests.blocFissureTest import blocFissureTest
+BLOCFISSURE_TEST = blocFissureTest(["fissureCoude_6", "fissureCoude_7", "fissureCoude_8", "fissureCoude_9", "fissureCoude_10"])
+MESSAGE_ERREUR = BLOCFISSURE_TEST.lancement()
+#sys.stdout.write(MESSAGE_ERREUR)
+del BLOCFISSURE_TEST
+
+# Diagnostic
+if MESSAGE_ERREUR:
+ if ( "NOOK" in MESSAGE_ERREUR ):
+ LAUX = MESSAGE_ERREUR.split()
+ ERREUR = int(LAUX[LAUX.index("NOOK")+2])
+ else:
+ ERREUR = 0
+else:
+ MESSAGE_ERREUR = "Impossible de trouver le diagnostic de la procédure de tests."
+ ERREUR = -1
+
+if ERREUR:
+ sys.stderr.write(MESSAGE_ERREUR)
+ #raise Exception(MESSAGE_ERREUR)
+ assert(False)
+
--- /dev/null
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+"""Tests de blocFissure ; en standalone
+
+Cas tests basés sans matériels (1/3)
+
+Copyright 2021 EDF
+Gérald NICOLAS
++33.1.78.19.43.52
+"""
+
+__revision__ = "V02.03"
+
+import os
+import sys
+
+# Lancement des cas-tests
+import salome
+salome.standalone()
+salome.salome_init()
+
+from blocFissure.CasTests.blocFissureTest import blocFissureTest
+BLOCFISSURE_TEST = blocFissureTest(["fissure_Coude", "fissure_Coude_4"])
+MESSAGE_ERREUR = BLOCFISSURE_TEST.lancement()
+#sys.stdout.write(MESSAGE_ERREUR)
+del BLOCFISSURE_TEST
+
+# Diagnostic
+if MESSAGE_ERREUR:
+ if ( "NOOK" in MESSAGE_ERREUR ):
+ LAUX = MESSAGE_ERREUR.split()
+ ERREUR = int(LAUX[LAUX.index("NOOK")+2])
+ else:
+ ERREUR = 0
+else:
+ MESSAGE_ERREUR = "Impossible de trouver le diagnostic de la procédure de tests."
+ ERREUR = -1
+
+if ERREUR:
+ sys.stderr.write(MESSAGE_ERREUR)
+ #raise Exception(MESSAGE_ERREUR)
+ assert(False)
+
--- /dev/null
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+"""Tests de blocFissure ; en standalone
+
+Cas tests basés sur les matériels :
+. vis
+. tube
+
+Copyright 2021 EDF
+Gérald NICOLAS
++33.1.78.19.43.52
+"""
+
+__revision__ = "V02.04"
+
+import os
+import sys
+
+# Lancement des cas-tests
+import salome
+salome.standalone()
+salome.salome_init()
+
+from blocFissure.CasTests.blocFissureTest import blocFissureTest
+BLOCFISSURE_TEST = blocFissureTest(["vis_1"])
+#BLOCFISSURE_TEST = blocFissureTest(["vis_1", "tube"])
+MESSAGE_ERREUR = BLOCFISSURE_TEST.lancement()
+#sys.stdout.write(MESSAGE_ERREUR)
+del BLOCFISSURE_TEST
+
+# Diagnostic
+if MESSAGE_ERREUR:
+ if ( "NOOK" in MESSAGE_ERREUR ):
+ LAUX = MESSAGE_ERREUR.split()
+ ERREUR = int(LAUX[LAUX.index("NOOK")+2])
+ else:
+ ERREUR = 0
+else:
+ MESSAGE_ERREUR = "Impossible de trouver le diagnostic de la procédure de tests."
+ ERREUR = -1
+
+if ERREUR:
+ sys.stderr.write(MESSAGE_ERREUR)
+ #raise Exception(MESSAGE_ERREUR)
+ assert(False)
+
+++ /dev/null
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-"""Tests de blocFissure ; en standalone
-
-Copyright 2021 EDF
-Gérald NICOLAS
-+33.1.78.19.43.52
-"""
-
-__revision__ = "V02.01"
-
-import os
-import tempfile
-import sys
-
-# Fichier de diagnostic
-LOGFILE = os.path.join(tempfile.gettempdir(),"blocFissure.log")
-if os.path.isfile(LOGFILE):
- os.remove(LOGFILE)
-
-# Lancement des cas-tests
-import salome
-salome.standalone()
-salome.salome_init()
-
-from blocFissure.materielCasTests import genereMateriel
-
-from blocFissure.CasTests import execution_Cas
-
-# Diagnostic
-ERREUR = 0
-if os.path.isfile(LOGFILE):
- with open(LOGFILE, 'r') as FICHIER:
- LES_LIGNES = FICHIER.readlines()
- for LIGNE in LES_LIGNES:
- #print (LIGNE[:-1])
- if ( "NOOK" in LIGNE ):
- MESSAGE_ERREUR = LIGNE
- ERREUR = int(LIGNE.split()[-1])
- break
-else:
- MESSAGE_ERREUR = "Impossible de trouver le fichier de diagnostic {}".format(LOGFILE)
- ERREUR = -1
-
-if ERREUR:
- sys.stderr.write(MESSAGE_ERREUR)
- #raise Exception(MESSAGE_ERREUR)
- assert(False)
test_smeshplugin_mg_tetra_parallele.py
test_smeshplugins.py
MGAdaptTests_without_session.py
- blocFissure_without_session.py
+ blocFissure_01_without_session.py
+ blocFissure_02_without_session.py
+ blocFissure_03_without_session.py
+ blocFissure_04_without_session.py
+ blocFissure_05_without_session.py
+ blocFissure_06_without_session.py
+ blocFissure_07_without_session.py
)
SET(GOOD_TESTS
in boolean overwrite,
in boolean autoDimension) raises (SALOME::SALOME_Exception);
+ long long ExportMEDCoupling(in boolean auto_groups,
+ in boolean autoDimension
+ ) raises (SALOME::SALOME_Exception);
+
/*!
* Export a [part of] Mesh into a MED file
* @params
in string geomAssocFields,
in double ZTolerance) raises (SALOME::SALOME_Exception);
+ long long ExportPartToMEDCoupling( in SMESH_IDSource meshPart,
+ in boolean auto_groups,
+ in boolean autoDimension,
+ in GEOM::ListOfFields fields,
+ in string geomAssocFields,
+ in double ZTolerance) raises (SALOME::SALOME_Exception);
+
/*!
* Export Mesh to SAUV formatted file
* Write a temporary med file and use med2sauv
# --- options ---
# additional include directories
INCLUDE_DIRECTORIES(
+ ${MEDCOUPLING_INCLUDE_DIRS}
${MEDFILE_INCLUDE_DIRS}
${HDF5_INCLUDE_DIRS}
${KERNEL_INCLUDE_DIRS}
// Module : SMESH
//
#include "DriverMED_Family.h"
-#include "MED_Factory.hxx"
#include <sstream>
return aFamilies;
}
-//=============================================================================
-/*!
- * Create TFamilyInfo for this family
- */
-//=============================================================================
-MED::PFamilyInfo
-DriverMED_Family::GetFamilyInfo(const MED::PWrapper& theWrapper,
- const MED::PMeshInfo& theMeshInfo) const
-{
- ostringstream aStr;
- aStr << "FAM_" << myId;
- set<string>::const_iterator aGrIter = myGroupNames.begin();
- for(; aGrIter != myGroupNames.end(); aGrIter++){
- aStr << "_" << *aGrIter;
- }
- string aValue = aStr.str();
- // PAL19785,0019867 - med forbids whitespace to be the last char in the name
- int maxSize = MED::GetNOMLength();
- int lastCharPos = min( maxSize, (int) aValue.size() ) - 1;
- while ( isspace( aValue[ lastCharPos ] ))
- aValue.resize( lastCharPos-- );
-
- MED::PFamilyInfo anInfo;
- if(myId == 0 || myGroupAttributVal == 0){
- anInfo = theWrapper->CrFamilyInfo(theMeshInfo,
- aValue,
- myId,
- myGroupNames);
- }else{
- MED::TStringVector anAttrDescs (1, ""); // 1 attribute with empty description,
- MED::TIntVector anAttrIds (1, myId); // Id=0,
- MED::TIntVector anAttrVals (1, myGroupAttributVal);
- anInfo = theWrapper->CrFamilyInfo(theMeshInfo,
- aValue,
- myId,
- myGroupNames,
- anAttrDescs,
- anAttrIds,
- anAttrVals);
- }
-
-// cout << endl;
-// cout << "Groups: ";
-// set<string>::iterator aGrIter = myGroupNames.begin();
-// for (; aGrIter != myGroupNames.end(); aGrIter++)
-// {
-// cout << " " << *aGrIter;
-// }
-// cout << endl;
-//
-// cout << "Elements: ";
-// set<const SMDS_MeshElement *>::iterator anIter = myElements.begin();
-// for (; anIter != myElements.end(); anIter++)
-// {
-// cout << " " << (*anIter)->GetID();
-// }
-// cout << endl;
-
- return anInfo;
-}
-
//=============================================================================
/*!
* Initialize the tool by SMESHDS_GroupBase
const bool doAllInGroups);
//! Create TFamilyInfo for this family
+ template<class LowLevelWriter>
MED::PFamilyInfo
- GetFamilyInfo (const MED::PWrapper& theWrapper,
- const MED::PMeshInfo& theMeshInfo) const;
+ GetFamilyInfo(const LowLevelWriter& theWrapper,
+ const MED::PMeshInfo& theMeshInfo) const;
//! Returns elements of this family
const ElementsSet& GetElements () const;
ElemTypeSet myTypes; // Issue 0020576
};
+#include "MED_Factory.hxx"
+
+#include <set>
+#include <string>
+//=============================================================================
+/*!
+ * Create TFamilyInfo for this family
+ */
+//=============================================================================
+template<class LowLevelWriter>
+MED::PFamilyInfo
+DriverMED_Family::GetFamilyInfo(const LowLevelWriter& theWrapper,
+ const MED::PMeshInfo& theMeshInfo) const
+{
+ std::ostringstream aStr;
+ aStr << "FAM_" << myId;
+ std::set<std::string>::const_iterator aGrIter = myGroupNames.begin();
+ for(; aGrIter != myGroupNames.end(); aGrIter++){
+ aStr << "_" << *aGrIter;
+ }
+ std::string aValue = aStr.str();
+ // PAL19785,0019867 - med forbids whitespace to be the last char in the name
+ int maxSize = MED::GetNOMLength();
+ int lastCharPos = std::min( maxSize, (int) aValue.size() ) - 1;
+ while ( isspace( aValue[ lastCharPos ] ))
+ aValue.resize( lastCharPos-- );
+
+ MED::PFamilyInfo anInfo;
+ if(myId == 0 || myGroupAttributVal == 0){
+ anInfo = theWrapper->CrFamilyInfo(theMeshInfo,
+ aValue,
+ myId,
+ myGroupNames);
+ }else{
+ MED::TStringVector anAttrDescs (1, ""); // 1 attribute with empty description,
+ MED::TIntVector anAttrIds (1, myId); // Id=0,
+ MED::TIntVector anAttrVals (1, myGroupAttributVal);
+ anInfo = theWrapper->CrFamilyInfo(theMeshInfo,
+ aValue,
+ myId,
+ myGroupNames,
+ anAttrDescs,
+ anAttrIds,
+ anAttrVals);
+ }
+
+// cout << endl;
+// cout << "Groups: ";
+// set<string>::iterator aGrIter = myGroupNames.begin();
+// for (; aGrIter != myGroupNames.end(); aGrIter++)
+// {
+// cout << " " << *aGrIter;
+// }
+// cout << endl;
+//
+// cout << "Elements: ";
+// set<const SMDS_MeshElement *>::iterator anIter = myElements.begin();
+// for (; anIter != myElements.end(); anIter++)
+// {
+// cout << " " << (*anIter)->GetID();
+// }
+// cout << endl;
+
+ return anInfo;
+}
+
#endif
#include "SMDS_SetIterator.hxx"
#include "SMESHDS_Mesh.hxx"
#include "MED_Common.hxx"
+#include "MED_TFile.hxx"
#include <med.h>
}
}
+Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
+{
+ MED::PWrapper myMed = CrWrapperW(myFile, myVersion);
+ return this->PerformInternal<MED::PWrapper>(myMed);
+}
+
+Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh_Mem::Perform()
+{
+ void *ptr(nullptr);
+ std::size_t sz(0);
+ Driver_Mesh::Status status = Driver_Mesh::DRS_OK;
+ bool isClosed(false);
+ TMemFile *tfileInst = nullptr;
+ {// let braces to flush (call of MED::PWrapper myMed destructor)
+ tfileInst = new TMemFile(&isClosed);
+ MED::PWrapper myMed = CrWrapperW(myFile, -1, tfileInst);
+ status = this->PerformInternal<MED::PWrapper>(myMed);
+ }
+ if(tfileInst)
+ {
+ ptr = tfileInst->getData(); sz = tfileInst->getSize();
+ }
+ _data = MEDCoupling::DataArrayByte::New();
+ _data->useArray(reinterpret_cast<char *>(ptr),true,MEDCoupling::DeallocType::C_DEALLOC,sz,1);
+ if(!isClosed)
+ THROW_SALOME_EXCEPTION("DriverMED_W_SMESHDS_Mesh_Mem::Perform - MED memory file id is supposed to be closed !");
+ return status;
+}
+
//================================================================================
/*!
* \brief Write my mesh
*/
//================================================================================
-Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
+template<class LowLevelWriter>
+Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::PerformInternal(LowLevelWriter myMed)
{
Status aResult = DRS_OK;
try {
}
}
- MED::PWrapper myMed = CrWrapperW(myFile, myVersion);
PMeshInfo aMeshInfo = myMed->CrMeshInfo(aMeshDimension,aSpaceDimension,aMeshName);
//MESSAGE("Add - aMeshName : "<<aMeshName<<"; "<<aMeshInfo->GetName());
myMed->SetMeshInfo(aMeshInfo);
list<DriverMED_FamilyPtr>::iterator aFamsIter;
for (aFamsIter = aFamilies.begin(); aFamsIter != aFamilies.end(); aFamsIter++)
{
- PFamilyInfo aFamilyInfo = (*aFamsIter)->GetFamilyInfo(myMed,aMeshInfo);
+ PFamilyInfo aFamilyInfo = (*aFamsIter)->GetFamilyInfo<LowLevelWriter>(myMed,aMeshInfo);
myMed->SetFamilyInfo(aFamilyInfo);
}
/*! add one mesh
*/
- virtual Status Perform();
+ Status Perform() override;
+
+ template<class LowLevelWriter>
+ Driver_Mesh::Status PerformInternal(LowLevelWriter myMed);
private:
double myZTolerance;
};
+#include "MEDCouplingMemArray.hxx"
+
+class MESHDRIVERMED_EXPORT DriverMED_W_SMESHDS_Mesh_Mem : public DriverMED_W_SMESHDS_Mesh
+{
+public:
+ Status Perform() override;
+ MEDCoupling::MCAuto<MEDCoupling::DataArrayByte> getData() { return _data; }
+private:
+ MEDCoupling::MCAuto<MEDCoupling::DataArrayByte> _data;
+};
+
#endif
${HDF5_INCLUDE_DIRS}
${MEDFILE_INCLUDE_DIRS}
${KERNEL_INCLUDE_DIRS}
+ ${MEDCOUPLING_INCLUDE_DIRS}
)
# additional preprocessor / compiler flags
${HDF5_LIBS}
${MEDFILE_C_LIBRARIES}
${KERNEL_SALOMELocalTrace}
+ ${MEDCoupling_medloader}
)
# --- headers ---
if (!CheckCompatibility(fileName)) {
EXCEPTION(std::runtime_error, "Cannot open file '"<<fileName<<"'.");
}
- return new MED::TWrapper(fileName, false);
+ return new MED::TWrapper(fileName, false, nullptr);
}
- PWrapper CrWrapperW(const std::string& fileName, int theVersion)
+ PWrapper CrWrapperW(const std::string& fileName, int theVersion, TFileInternal *tfileInst)
{
bool isCreated = false;
if (!CheckCompatibility(fileName, true))
wantedMajor = theVersion/10;
wantedMinor = theVersion%10;
}
- return new MED::TWrapper(fileName, true, wantedMajor, wantedMinor);
+ return new MED::TWrapper(fileName, true, tfileInst, wantedMajor, wantedMinor);
}
}
PWrapper CrWrapperR( const std::string& );
MEDWRAPPER_EXPORT
- PWrapper CrWrapperW( const std::string&, int theVersion=-1 );
+ PWrapper CrWrapperW( const std::string&, int theVersion=-1 , TFileInternal *tfileInst=nullptr );
}
#endif // MED_Factory_HeaderFile
--- /dev/null
+// Copyright (C) 2021 CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#pragma once
+
+#include "MED_Wrapper.hxx"
+
+namespace MED
+{
+ class TFileInternal
+ {
+ public:
+ virtual ~TFileInternal() = default;
+ virtual void Open(EModeAcces theMode, TErr* theErr = nullptr) = 0;
+ virtual void Close() = 0;
+ virtual const TIdt& Id() const = 0;
+ };
+
+ class MEDIDTHoder : public TFileInternal
+ {
+ protected:
+ MEDIDTHoder(bool *isClosedStatus = nullptr):_isClosedStatus(isClosedStatus) { }
+ void UnRefFid()
+ {
+ if (--myCount == 0)
+ {
+ MEDfileClose(myFid);
+ myIsClosed = true;
+ if(_isClosedStatus)
+ *_isClosedStatus = true;
+ }
+ }
+ public:
+ const TIdt& Id() const override;
+ ~MEDIDTHoder() { this->UnRefFid(); }
+ void Close() override { this->UnRefFid(); }
+ protected:
+ TInt myCount = 0;
+ TIdt myFid = 0;
+ bool myIsClosed = false;
+ bool *_isClosedStatus = nullptr;
+ };
+
+ class TFileDecorator : public TFileInternal
+ {
+ public:
+ TFileDecorator(TFileInternal *effective):_effective(effective) { }
+ void Open(EModeAcces theMode, TErr* theErr = nullptr) override { if(_effective) _effective->Open(theMode,theErr); }
+ void Close() override { if(_effective) _effective->Close(); }
+ const TIdt& Id() const override { if(_effective) return _effective->Id(); EXCEPTION(std::runtime_error, "TFileDecorator - GetFid() : no effective TFile !"); }
+ ~TFileDecorator() { delete _effective; }
+ private:
+ TFileInternal *_effective = nullptr;
+ };
+
+ class TMemFile : public MEDIDTHoder
+ {
+ public:
+ TMemFile(bool* isClosedStatus = nullptr):MEDIDTHoder(isClosedStatus) { }
+ void Open(EModeAcces theMode, TErr* theErr = nullptr) override;
+ void *getData() const { return memfile.app_image_ptr; }
+ std::size_t getSize() const { return memfile.app_image_size; }
+ private:
+ med_memfile memfile = MED_MEMFILE_INIT;
+ };
+
+ class TFile : public MEDIDTHoder
+ {
+ public:
+ TFile(const std::string& theFileName, TInt theMajor=-1, TInt theMinor=-1);
+ void Open(EModeAcces theMode, TErr* theErr = nullptr) override;
+ protected:
+ std::string myFileName;
+ TInt myMajor;
+ TInt myMinor;
+ };
+}
#include "MED_Wrapper.hxx"
#include "MED_TStructures.hxx"
#include "MED_Utilities.hxx"
+#include "MED_TFile.hxx"
+#include "MEDFileUtilities.hxx"
#include <med.h>
#include <med_err.h>
#include <med_proto.h>
}
//---------------------------------------------------------------
- class TFile
+ const TIdt& MEDIDTHoder::Id() const
{
- TFile();
- TFile(const TFile&);
+ if (myFid < 0)
+ EXCEPTION(std::runtime_error, "TFile - GetFid() < 0");
+ return myFid;
+ }
- public:
- TFile(const std::string& theFileName, TInt theMajor=-1, TInt theMinor=-1):
- myCount(0),
- myFid(0),
- myFileName(theFileName),
- myMajor(theMajor),
- myMinor(theMinor)
+ void TMemFile::Open(EModeAcces theMode, TErr* theErr)
+ {
+ if (this->myCount++ == 0)
{
- if ((myMajor < 0) || (myMajor > MED_MAJOR_NUM)) myMajor = MED_MAJOR_NUM;
- if ((myMinor < 0) || (myMajor == MED_MAJOR_NUM && myMinor > MED_MINOR_NUM)) myMinor = MED_MINOR_NUM;
+ std::string dftFileName = MEDCoupling::MEDFileWritableStandAlone::GenerateUniqueDftFileNameInMem();
+ memfile = MED_MEMFILE_INIT;
+ memfile.app_image_ptr=0;
+ memfile.app_image_size=0;
+ myFid = MEDmemFileOpen(dftFileName.c_str(),&memfile,MED_FALSE,MED_ACC_CREAT);
}
+ if (theErr)
+ *theErr = TErr(myFid);
+ else if (myFid < 0)
+ EXCEPTION(std::runtime_error,"TMemFile - MEDmemFileOpen");
+ }
- ~TFile()
- {
- Close();
- }
+ TFile::TFile(const std::string& theFileName, TInt theMajor, TInt theMinor):
+ myFileName(theFileName),
+ myMajor(theMajor),
+ myMinor(theMinor)
+ {
+ if ((myMajor < 0) || (myMajor > MED_MAJOR_NUM)) myMajor = MED_MAJOR_NUM;
+ if ((myMinor < 0) || (myMajor == MED_MAJOR_NUM && myMinor > MED_MINOR_NUM)) myMinor = MED_MINOR_NUM;
+ }
- void
- Open(EModeAcces theMode,
- TErr* theErr = NULL)
- {
- if (myCount++ == 0) {
- const char* aFileName = myFileName.c_str();
+ void TFile::Open(EModeAcces theMode, TErr* theErr)
+ {
+ if (myCount++ == 0) {
+ const char* aFileName = myFileName.c_str();
#ifdef WIN32
- if (med_access_mode(theMode) == MED_ACC_RDWR) {
- // Force removing readonly attribute from a file under Windows, because of a bug in the HDF5
- std::string aReadOlnyRmCmd = "attrib -r \"" + myFileName + "\"> nul 2>&1";
+ if (med_access_mode(theMode) == MED_ACC_RDWR) {
+ // Force removing readonly attribute from a file under Windows, because of a bug in the HDF5
+ std::string aReadOlnyRmCmd = "attrib -r \"" + myFileName + "\"> nul 2>&1";
#ifdef UNICODE
- const char* to_decode = aReadOlnyRmCmd.c_str();
- int size_needed = MultiByteToWideChar(CP_UTF8, 0, to_decode, strlen(to_decode), NULL, 0);
- wchar_t* awReadOlnyRmCmd = new wchar_t[size_needed + 1];
- MultiByteToWideChar(CP_UTF8, 0, to_decode, strlen(to_decode), awReadOlnyRmCmd, size_needed);
- awReadOlnyRmCmd[size_needed] = '\0';
- _wsystem(awReadOlnyRmCmd);
- delete[] awReadOlnyRmCmd;
+ const char* to_decode = aReadOlnyRmCmd.c_str();
+ int size_needed = MultiByteToWideChar(CP_UTF8, 0, to_decode, strlen(to_decode), NULL, 0);
+ wchar_t* awReadOlnyRmCmd = new wchar_t[size_needed + 1];
+ MultiByteToWideChar(CP_UTF8, 0, to_decode, strlen(to_decode), awReadOlnyRmCmd, size_needed);
+ awReadOlnyRmCmd[size_needed] = '\0';
+ _wsystem(awReadOlnyRmCmd);
+ delete[] awReadOlnyRmCmd;
#else
- system(aReadOlnyRmCmd.c_str());
-#endif
- }
+ system(aReadOlnyRmCmd.c_str());
#endif
- myFid = MEDfileVersionOpen(aFileName,med_access_mode(theMode), myMajor, myMinor, MED_RELEASE_NUM);
}
- if (theErr)
- *theErr = TErr(myFid);
- else if (myFid < 0)
- EXCEPTION(std::runtime_error,"TFile - MEDfileVersionOpen('"<<myFileName<<"',"<<theMode<<"',"<< myMajor <<"',"<< myMinor<<"',"<< MED_RELEASE_NUM<<")");
- }
-
- const TIdt&
- Id() const
- {
- if (myFid < 0)
- EXCEPTION(std::runtime_error, "TFile - GetFid() < 0");
- return myFid;
- }
-
- void
- Close()
- {
- if (--myCount == 0)
- MEDfileClose(myFid);
+#endif
+ myFid = MEDfileVersionOpen(aFileName,med_access_mode(theMode), myMajor, myMinor, MED_RELEASE_NUM);
}
-
- protected:
- TInt myCount;
- TIdt myFid;
- std::string myFileName;
- TInt myMajor;
- TInt myMinor;
- };
+ if (theErr)
+ *theErr = TErr(myFid);
+ else if (myFid < 0)
+ EXCEPTION(std::runtime_error,"TFile - MEDfileVersionOpen('"<<myFileName<<"',"<<theMode<<"',"<< myMajor <<"',"<< myMinor<<"',"<< MED_RELEASE_NUM<<")");
+ }
//---------------------------------------------------------------
class TFileWrapper
{
- PFile myFile;
+ PFileInternal myFile;
TInt myMinor;
public:
- TFileWrapper(const PFile& theFile,
+ TFileWrapper(const PFileInternal& theFile,
EModeAcces theMode,
TErr* theErr = NULL,
TInt theMinor=-1):
//---------------------------------------------------------------
TWrapper
- ::TWrapper(const std::string& theFileName, bool write, TInt theMajor, TInt theMinor):
- myFile(new TFile(theFileName, theMajor, theMinor)),
+ ::TWrapper(const std::string& theFileName, bool write, TFileInternal *tfileInst, TInt theMajor, TInt theMinor):
myMajor(theMajor),
myMinor(theMinor)
{
+ if(!tfileInst)
+ myFile.reset(new TFile(theFileName, theMajor, theMinor) );
+ else
+ myFile.reset(new TFileDecorator(tfileInst) );
+
TErr aRet;
if ( write ) {
myFile->Open(eLECTURE_ECRITURE, &aRet);
namespace MED
{
//----------------------------------------------------------------------------
- class TFile;
- typedef boost::shared_ptr<TFile> PFile;
+ class TFileInternal;
+ typedef std::shared_ptr<TFileInternal> PFileInternal;
typedef enum {eLECTURE, eLECTURE_ECRITURE, eLECTURE_AJOUT, eCREATION} EModeAcces;
TWrapper& operator=(const TWrapper&);
public:
- TWrapper(const std::string& theFileName, bool write, TInt theMajor=-1, TInt theVersion=-1);
+ TWrapper(const std::string& theFileName, bool write, TFileInternal *tfileInst = nullptr, TInt theMajor=-1, TInt theVersion=-1);
virtual
~TWrapper();
TErr* theErr = NULL);
protected:
- PFile myFile;
+ PFileInternal myFile;
TInt myMajor;
TInt myMinor;
};
//----------------------------------------------------------------------------
//! Specialization of SharedPtr for TWrapper
template<>
- class MEDWRAPPER_EXPORT SharedPtr<TWrapper>: public boost::shared_ptr<TWrapper>
+ class MEDWRAPPER_EXPORT SharedPtr<TWrapper>: public std::shared_ptr<TWrapper>
{
public:
SharedPtr() {}
SharedPtr(TWrapper* p):
- boost::shared_ptr<TWrapper>(p)
+ std::shared_ptr<TWrapper>(p)
{}
template<class Y>
explicit SharedPtr(Y* p):
- boost::shared_ptr<TWrapper>(p)
+ std::shared_ptr<TWrapper>(p)
{}
template<class Y>
SharedPtr(const SharedPtr<Y>& r):
- boost::shared_ptr<TWrapper>(boost::dynamic_pointer_cast<TWrapper,Y>(r))
+ std::shared_ptr<TWrapper>(boost::dynamic_pointer_cast<TWrapper,Y>(r))
{}
template<class Y>
TWrapper*
get() const // never throws
{
- return boost::shared_ptr<TWrapper>::get();
+ return std::shared_ptr<TWrapper>::get();
}
};
}
return false;
}
-//================================================================================
-/*!
- * \brief Export the mesh to a med file
- * \param [in] file - name of the MED file
- * \param [in] theMeshName - name of this mesh
- * \param [in] theAutoGroups - boolean parameter for creating/not creating
- * the groups Group_On_All_Nodes, Group_On_All_Faces, ... ;
- * the typical use is auto_groups=false.
- * \param [in] theVersion - define the minor (xy, where version is x.y.z) of MED file format.
- * If theVersion is equal to -1, the minor version is not changed (default).
- * \param [in] meshPart - mesh data to export
- * \param [in] theAutoDimension - if \c true, a space dimension of a MED mesh can be either
- * - 1D if all mesh nodes lie on OX coordinate axis, or
- * - 2D if all mesh nodes lie on XOY coordinate plane, or
- * - 3D in the rest cases.
- * If \a theAutoDimension is \c false, the space dimension is always 3.
- * \param [in] theAddODOnVertices - to create 0D elements on all vertices
- * \param [in] theAllElemsToGroup - to make every element to belong to any group (PAL23413)
- * \param [in] ZTolerance - tolerance in Z direction. If Z coordinate of a node is close to zero
- * within a given tolerance, the coordinate is set to zero.
- * If \a ZTolerance is negative, the node coordinates are kept as is.
- * \return int - mesh index in the file
- */
-//================================================================================
-
-void SMESH_Mesh::ExportMED(const char * file,
+void SMESH_Mesh::ExportMEDCommmon(DriverMED_W_SMESHDS_Mesh& myWriter,
const char* theMeshName,
bool theAutoGroups,
- int theVersion,
const SMESHDS_Mesh* meshPart,
bool theAutoDimension,
bool theAddODOnVertices,
double theZTolerance,
bool theAllElemsToGroup)
{
- MESSAGE("MED_VERSION:"<< theVersion);
-
- Driver_Mesh::Status status;
+ Driver_Mesh::Status status = Driver_Mesh::DRS_OK;
SMESH_TRY;
-
- DriverMED_W_SMESHDS_Mesh myWriter;
- myWriter.SetFile ( file , theVersion);
myWriter.SetMesh ( meshPart ? (SMESHDS_Mesh*) meshPart : _myMeshDS );
myWriter.SetAutoDimension( theAutoDimension );
myWriter.AddODOnVertices ( theAddODOnVertices );
throw TooLargeForExport("MED");
}
+/*!
+ * Same as SMESH_Mesh::ExportMED except for \a file and \a theVersion
+ */
+MEDCoupling::MCAuto<MEDCoupling::DataArrayByte> SMESH_Mesh::ExportMEDCoupling(
+ const char* theMeshName,
+ bool theAutoGroups,
+ const SMESHDS_Mesh* meshPart,
+ bool theAutoDimension,
+ bool theAddODOnVertices,
+ double theZTolerance,
+ bool theAllElemsToGroup)
+{
+ DriverMED_W_SMESHDS_Mesh_Mem myWriter;
+ this->ExportMEDCommmon(myWriter,theMeshName,theAutoGroups,meshPart,theAutoDimension,theAddODOnVertices,theZTolerance,theAllElemsToGroup);
+ return myWriter.getData();
+}
+
+//================================================================================
+/*!
+ * \brief Export the mesh to a med file
+ * \param [in] file - name of the MED file
+ * \param [in] theMeshName - name of this mesh
+ * \param [in] theAutoGroups - boolean parameter for creating/not creating
+ * the groups Group_On_All_Nodes, Group_On_All_Faces, ... ;
+ * the typical use is auto_groups=false.
+ * \param [in] theVersion - define the minor (xy, where version is x.y.z) of MED file format.
+ * If theVersion is equal to -1, the minor version is not changed (default).
+ * \param [in] meshPart - mesh data to export
+ * \param [in] theAutoDimension - if \c true, a space dimension of a MED mesh can be either
+ * - 1D if all mesh nodes lie on OX coordinate axis, or
+ * - 2D if all mesh nodes lie on XOY coordinate plane, or
+ * - 3D in the rest cases.
+ * If \a theAutoDimension is \c false, the space dimension is always 3.
+ * \param [in] theAddODOnVertices - to create 0D elements on all vertices
+ * \param [in] theAllElemsToGroup - to make every element to belong to any group (PAL23413)
+ * \param [in] ZTolerance - tolerance in Z direction. If Z coordinate of a node is close to zero
+ * within a given tolerance, the coordinate is set to zero.
+ * If \a ZTolerance is negative, the node coordinates are kept as is.
+ * \return int - mesh index in the file
+ */
+//================================================================================
+
+void SMESH_Mesh::ExportMED(const char * file,
+ const char* theMeshName,
+ bool theAutoGroups,
+ int theVersion,
+ const SMESHDS_Mesh* meshPart,
+ bool theAutoDimension,
+ bool theAddODOnVertices,
+ double theZTolerance,
+ bool theAllElemsToGroup)
+{
+ MESSAGE("MED_VERSION:"<< theVersion);
+ DriverMED_W_SMESHDS_Mesh myWriter;
+ myWriter.SetFile( file , theVersion );
+ this->ExportMEDCommmon(myWriter,theMeshName,theAutoGroups,meshPart,theAutoDimension,theAddODOnVertices,theZTolerance,theAllElemsToGroup);
+}
+
//================================================================================
/*!
* \brief Export the mesh to a SAUV file
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
#include <TopTools_ListOfShape.hxx>
+#include "MEDCouplingMemArray.hxx"
+
#include <map>
#include <list>
#include <vector>
class SMESH_subMesh;
class TopoDS_Solid;
+class DriverMED_W_SMESHDS_Mesh;
+
typedef std::list<int> TListOfInt;
typedef std::list<TListOfInt> TListOfListOfInt;
TooLargeForExport(const char* format):runtime_error(format) {}
};
+ MEDCoupling::MCAuto<MEDCoupling::DataArrayByte> ExportMEDCoupling(
+ const char* theMeshName = NULL,
+ bool theAutoGroups = true,
+ const SMESHDS_Mesh* theMeshPart = 0,
+ bool theAutoDimension = false,
+ bool theAddODOnVertices = false,
+ double theZTolerance = -1.,
+ bool theAllElemsToGroup = false);
+
void ExportMED(const char * theFile,
const char* theMeshName = NULL,
bool theAutoGroups = true,
private:
+ void ExportMEDCommmon(DriverMED_W_SMESHDS_Mesh& myWriter,
+ const char* theMeshName,
+ bool theAutoGroups,
+ const SMESHDS_Mesh* meshPart,
+ bool theAutoDimension,
+ bool theAddODOnVertices,
+ double theZTolerance,
+ bool theAllElemsToGroup);
+
+private:
void fillAncestorsMap(const TopoDS_Shape& theShape);
void getAncestorsSubMeshes(const TopoDS_Shape& theSubShape,
std::vector< SMESH_subMesh* >& theSubMeshes) const;
${Boost_INCLUDE_DIRS}
${OpenCASCADE_INCLUDE_DIR}
${OMNIORB_INCLUDE_DIR}
+ ${MEDCOUPLING_INCLUDE_DIRS}
${PROJECT_SOURCE_DIR}/src/Controls
${PROJECT_SOURCE_DIR}/src/Driver
${PROJECT_SOURCE_DIR}/src/DriverDAT
${Boost_INCLUDE_DIRS}
${OMNIORB_INCLUDE_DIR}
${HDF5_INCLUDE_DIRS}
+ ${MEDCOUPLING_INCLUDE_DIRS}
${PROJECT_SOURCE_DIR}/src/OBJECT
${PROJECT_SOURCE_DIR}/src/SMESHFiltersSelection
${PROJECT_SOURCE_DIR}/src/SMDS
</message>
<message>
<source>Generate mesh from CAD model or import mesh</source>
- <translation type="unfinished">Generate mesh from CAD model or import mesh</translation>
+ <translation type="unfinished">Créer un maillage à partir d'un modèle CAO ou par importation</translation>
</message>
</context>
<context>
</message>
<message>
<source>PREF_SELECTION_INCREMENT</source>
- <translation type="unfinished">Elements width increment</translation>
+ <translation type="unfinished">Incrément de largeur d'éléments</translation>
</message>
<message>
<source>PREF_OBJECT_COLOR</source>
</message>
<message>
<source>INFO_WELCOME_TO_SMESH</source>
- <translation type="unfinished">Welcome to Mesh</translation>
+ <translation type="unfinished">Bienvenue dans le module Mesh</translation>
</message>
<message>
<source>INFO_GRP_CREATE_MESH</source>
- <translation type="unfinished">Create mesh</translation>
+ <translation type="unfinished">Créer un maillage</translation>
</message>
<message>
<source>INFO_DEFINE_ALGOS</source>
- <translation type="unfinished">Choose algorithms</translation>
+ <translation type="unfinished">Choisir les algorithmes</translation>
</message>
<message>
<source>INFO_DEFINE_HYPOS</source>
- <translation type="unfinished">Define hypotheses</translation>
+ <translation type="unfinished">Définir des hypothèses</translation>
</message>
<message>
<source>INFO_COMPUTE</source>
- <translation type="unfinished">Compute</translation>
+ <translation type="unfinished">Calculer</translation>
</message>
<message>
<source>INFO_REFINE</source>
- <translation type="unfinished">Add refinements</translation>
+ <translation type="unfinished">Ajouter des raffinements</translation>
</message>
<message>
<source>INFO_REFINE_LOCAL_SIZE</source>
- <translation type="unfinished">via local sizes with some hypotheses</translation>
+ <translation type="unfinished">via des tailles locales dans certaines hypothèses</translation>
</message>
<message>
<source>INFO_REFINE_SUBMESH</source>
- <translation type="unfinished">via sub-meshes</translation>
+ <translation type="unfinished">via des sous-maillages</translation>
</message>
<message>
<source>INFO_GRP_IMPORT_MESH</source>
- <translation type="unfinished">Import mesh</translation>
+ <translation type="unfinished">Importer un maillage</translation>
</message>
<message>
<source>INFO_AVAILABLE_FORMATS</source>
- <translation type="unfinished">Available formats</translation>
+ <translation type="unfinished">Formats disponibles</translation>
</message>
<message>
<source>INFO_GRP_CHECK_MESH</source>
- <translation type="unfinished"> Check mesh quality</translation>
+ <translation type="unfinished">Contrôler la qualité du maillage</translation>
</message>
<message>
<source>INFO_DISPLAY</source>
- <translation type="unfinished">Display mesh</translation>
+ <translation type="unfinished">Afficher le maillage</translation>
</message>
<message>
<source>INFO_QUALITY_INFO</source>
- <translation type="unfinished">Display some quality criteria</translation>
+ <translation type="unfinished">Afficher des critères de qualité</translation>
</message>
<message>
<source>INFO_QUALITY_AREA</source>
- <translation type="unfinished">area</translation>
+ <translation type="unfinished">surface</translation>
</message>
<message>
<source>INFO_QUALITY_VOLUME</source>
</message>
<message>
<source>INFO_QUALITY_ASPECT_RATION</source>
- <translation type="unfinished">aspect ration</translation>
+ <translation type="unfinished">Facteur de forme</translation>
</message>
<message>
<source>INFO_CLIPPING</source>
- <translation type="unfinished">Add clipping planes</translation>
+ <translation type="unfinished">Insérer un plan de coupe</translation>
</message>
</context>
<context>
${KERNEL_INCLUDE_DIRS}
${GUI_INCLUDE_DIRS}
${GEOM_INCLUDE_DIRS}
+ ${MEDCOUPLING_INCLUDE_DIRS}
${PROJECT_SOURCE_DIR}/src/Controls
${PROJECT_SOURCE_DIR}/src/SMDS
${PROJECT_SOURCE_DIR}/src/SMESHDS
#include "SALOME_Container_i.hxx"
#include "SALOME_KernelServices.hxx"
+#include "SALOME_Fake_NamingService.hxx"
+
#include <cstring>
static Engines::EngineComponent_var _unique_compo;
//
pman->activate();
//
+ SMESH_Gen_i::SetNS(new SALOME_Fake_NamingService);
+ //
SMESH_Gen_No_Session_i *servant = new SMESH_Gen_No_Session_i(orb, poa, conId, "SMESH_inst_2", "SMESH");
PortableServer::ObjectId *zeId = servant->getId();
CORBA::Object_var zeRef = poa->id_to_reference(*zeId);
const char* instanceName,
const char* interfaceName):SMESH_Gen_i(orb,poa,contId,instanceName,interfaceName,false)
{
- myNS = new SALOME_Fake_NamingService;
}
GEOM::GEOM_Gen_var SMESH_Gen_No_Session_i::GetGeomEngine( bool isShaper )
return anObj;
}
+// Set Naming Service object
+void SMESH_Gen_i::SetNS(SALOME_NamingService_Abstract *ns)
+{
+ if(myNS)
+ delete myNS;
+ myNS = ns;
+}
+
//=============================================================================
/*!
* GetNS [ static ]
SALOME_NamingService_Abstract* SMESH_Gen_i::GetNS()
{
- if ( myNS == NULL ) {
+ if ( !myNS ) {
myNS = SINGLETON_<SALOME_NamingService>::Instance();
ASSERT(SINGLETON_<SALOME_NamingService>::IsAlreadyExisting());
myNS->init_orb( GetORB() );
static CORBA::ORB_var GetORB() { return myOrb;}
// Get SMESH module's POA object
static PortableServer::POA_var GetPOA() { return myPoa;}
+ // Set Naming Service object
+ static void SetNS(SALOME_NamingService_Abstract *ns);
// Get Naming Service object
static SALOME_NamingService_Abstract* GetNS();
// Get SALOME_LifeCycleCORBA object
}
}
+/*!
+ Return a MeshName
+ */
+std::string SMESH_Mesh_i::generateMeshName()
+{
+ string aMeshName = "Mesh";
+ SALOMEDS::Study_var aStudy = SMESH_Gen_i::GetSMESHGen()->getStudyServant();
+ if ( !aStudy->_is_nil() )
+ {
+ SALOMEDS::SObject_wrap aMeshSO = _gen_i->ObjectToSObject( _this() );
+ if ( !aMeshSO->_is_nil() )
+ {
+ CORBA::String_var name = aMeshSO->GetName();
+ aMeshName = name;
+ }
+ }
+ return aMeshName;
+}
+
//================================================================================
/*!
* \brief Prepare a file for export and pass names of mesh groups from study to mesh DS
{
// Perform Export
PrepareForWriting(file, overwrite);
- string aMeshName = "Mesh";
+ string aMeshName(this->generateMeshName());
SALOMEDS::Study_var aStudy = SMESH_Gen_i::GetSMESHGen()->getStudyServant();
if ( !aStudy->_is_nil() ) {
SALOMEDS::SObject_wrap aMeshSO = _gen_i->ObjectToSObject( _this() );
if ( !aMeshSO->_is_nil() ) {
- CORBA::String_var name = aMeshSO->GetName();
- aMeshName = name;
// asv : 27.10.04 : fix of 6903: check for StudyLocked before adding attributes
if ( !aStudy->GetProperties()->IsLocked() )
{
SMESH_CATCH( SMESH::throwCorbaException );
}
+CORBA::LongLong SMESH_Mesh_i::ExportMEDCoupling(CORBA::Boolean auto_groups, CORBA::Boolean autoDimension)
+{
+ MEDCoupling::MCAuto<MEDCoupling::DataArrayByte> data;
+ SMESH_TRY;
+ // TODO : Fix me ! 2 next lines are required
+ //if( !this->_gen_i->IsEmbeddedMode() )
+ // SMESH::throwCorbaException("SMESH_Mesh_i::ExportMEDCoupling : only for embedded mode !");
+ if ( _preMeshInfo )
+ _preMeshInfo->FullLoadFromFile();
+
+ string aMeshName = this->generateMeshName();
+ data = _impl->ExportMEDCoupling( aMeshName.c_str(), auto_groups, 0, autoDimension );
+ SMESH_CATCH( SMESH::throwCorbaException );
+ MEDCoupling::DataArrayByte *ret(data.retn());
+ return reinterpret_cast<CORBA::LongLong>(ret);
+}
+
//================================================================================
/*!
* \brief Export a mesh to a SAUV file
SMESH_CATCH( SMESH::throwCorbaException );
}
-//================================================================================
-/*!
- * \brief Export a part of mesh to a med file
- */
-//================================================================================
+class MEDFileSpeCls
+{
+public:
+ MEDFileSpeCls(const char *file, CORBA::Boolean overwrite, CORBA::Long version):_file(file),_overwrite(overwrite),_version(version) { }
+ std::string prepareMeshNameAndGroups(SMESH_Mesh_i& self) { return self.prepareMeshNameAndGroups(_file.c_str(),_overwrite); }
+ void exportTo(SMESH_Mesh *mesh, const std::string& aMeshName, CORBA::Boolean auto_groups,
+ SMESH_MeshPartDS* partDS,
+ CORBA::Boolean autoDimension, bool have0dField,
+ CORBA::Double ZTolerance)
+ {
+ mesh->ExportMED( _file.c_str(), aMeshName.c_str(), auto_groups, _version,
+ partDS, autoDimension,have0dField,ZTolerance);
-void SMESH_Mesh_i::ExportPartToMED(SMESH::SMESH_IDSource_ptr meshPart,
- const char* file,
- CORBA::Boolean auto_groups,
- CORBA::Long version,
- CORBA::Boolean overwrite,
- CORBA::Boolean autoDimension,
- const GEOM::ListOfFields& fields,
- const char* geomAssocFields,
- CORBA::Double ZTolerance)
+ }
+
+ void exportField(SMESH_Mesh_i& self, const std::string& aMeshName, bool have0dField, SMESHDS_Mesh *meshDS, const GEOM::ListOfFields& fields, const char*geomAssocFields)
+ {
+ DriverMED_W_Field fieldWriter;
+ fieldWriter.SetFile( _file.c_str() );
+ fieldWriter.SetMeshName( aMeshName );
+ fieldWriter.AddODOnVertices( have0dField );
+ self.exportMEDFields( fieldWriter, meshDS, fields, geomAssocFields );
+ }
+
+ void prepareForWriting(SMESH_Mesh_i& self) { self.PrepareForWriting(_file.c_str(), _overwrite); }
+private:
+ std::string _file;
+ CORBA::Boolean _overwrite;
+ CORBA::Long _version;
+};
+
+
+template<class SPECLS>
+void SMESH_Mesh_i::ExportPartToMEDCommon(SPECLS& speCls,
+ SMESH::SMESH_IDSource_ptr meshPart,
+ CORBA::Boolean auto_groups,
+ CORBA::Boolean autoDimension,
+ const GEOM::ListOfFields& fields,
+ const char* geomAssocFields,
+ CORBA::Double ZTolerance)
{
- MESSAGE("MED version: "<< version);
SMESH_TRY;
if ( _preMeshInfo )
_preMeshInfo->FullLoadFromFile();
if ( CORBA::is_nil( meshPart ) ||
SMESH::DownCast< SMESH_Mesh_i* >( meshPart ))
{
- aMeshName = prepareMeshNameAndGroups(file, overwrite);
- _impl->ExportMED( file, aMeshName.c_str(), auto_groups, version,
- 0, autoDimension, /*addODOnVertices=*/have0dField,
- ZTolerance);
+ aMeshName = speCls.prepareMeshNameAndGroups(*this);
+ speCls.exportTo(_impl, aMeshName, auto_groups, nullptr, autoDimension, have0dField, ZTolerance);
meshDS = _impl->GetMeshDS();
}
else
if ( _preMeshInfo )
_preMeshInfo->FullLoadFromFile();
- PrepareForWriting(file, overwrite);
+ speCls.prepareForWriting(*this);
SALOMEDS::SObject_wrap SO = _gen_i->ObjectToSObject( meshPart );
if ( !SO->_is_nil() ) {
}
SMESH_MeshPartDS* partDS = new SMESH_MeshPartDS( meshPart );
- _impl->ExportMED( file, aMeshName.c_str(), auto_groups, version,
- partDS, autoDimension, /*addODOnVertices=*/have0dField, ZTolerance);
+ speCls.exportTo(_impl, aMeshName, auto_groups, partDS, autoDimension, have0dField, ZTolerance);
meshDS = tmpDSDeleter._obj = partDS;
}
if ( _impl->HasShapeToMesh() )
{
- DriverMED_W_Field fieldWriter;
- fieldWriter.SetFile( file );
- fieldWriter.SetMeshName( aMeshName );
- fieldWriter.AddODOnVertices( have0dField );
-
- exportMEDFields( fieldWriter, meshDS, fields, geomAssocFields );
+ speCls.exportField(*this,aMeshName,have0dField,meshDS,fields,geomAssocFields);
}
+ SMESH_CATCH( SMESH::throwCorbaException );
+}
+
+//================================================================================
+/*!
+ * \brief Export a part of mesh to a med file
+ */
+//================================================================================
+void SMESH_Mesh_i::ExportPartToMED(SMESH::SMESH_IDSource_ptr meshPart,
+ const char* file,
+ CORBA::Boolean auto_groups,
+ CORBA::Long version,
+ CORBA::Boolean overwrite,
+ CORBA::Boolean autoDimension,
+ const GEOM::ListOfFields& fields,
+ const char* geomAssocFields,
+ CORBA::Double ZTolerance)
+{
+ MESSAGE("MED version: "<< version);
+ MEDFileSpeCls spe(file,overwrite,version);
+ this->ExportPartToMEDCommon<MEDFileSpeCls>(spe,meshPart,auto_groups,autoDimension,fields,geomAssocFields,ZTolerance);
// dump
+ SMESH_TRY;
GEOM::ListOfGBO_var goList = new GEOM::ListOfGBO;
goList->length( fields.length() );
for ( size_t i = 0; i < fields.length(); ++i )
<< ( geomAssocFields ? geomAssocFields : "" ) << "',"
<< TVar( ZTolerance )
<< " )";
-
SMESH_CATCH( SMESH::throwCorbaException );
}
+class MEDFileMemSpeCls
+{
+public:
+ std::string prepareMeshNameAndGroups(SMESH_Mesh_i& self) { return self.generateMeshName(); }
+ void exportTo(SMESH_Mesh *mesh, const std::string& aMeshName, CORBA::Boolean auto_groups,
+ SMESH_MeshPartDS* partDS,
+ CORBA::Boolean autoDimension, bool have0dField,
+ CORBA::Double ZTolerance)
+ {
+ _res = mesh->ExportMEDCoupling(aMeshName.c_str(),auto_groups,partDS,autoDimension,have0dField,ZTolerance);
+ }
+ void prepareForWriting(SMESH_Mesh_i& self) { /* nothing here */ }
+ void exportField(SMESH_Mesh_i& self, const std::string& aMeshName, bool have0dField, SMESHDS_Mesh *meshDS, const GEOM::ListOfFields& fields, const char*geomAssocFields)
+ {
+ THROW_IK_EXCEPTION("exportField Not implemented yet for full memory !");
+ }
+public:
+ MEDCoupling::MCAuto<MEDCoupling::DataArrayByte> getData() { return _res; }
+private:
+ MEDCoupling::MCAuto<MEDCoupling::DataArrayByte> _res;
+};
+
+CORBA::LongLong SMESH_Mesh_i::ExportPartToMEDCoupling(SMESH::SMESH_IDSource_ptr meshPart,
+ CORBA::Boolean auto_groups,
+ CORBA::Boolean autoDimension,
+ const GEOM::ListOfFields& fields,
+ const char* geomAssocFields,
+ CORBA::Double ZTolerance)
+{
+ MEDFileMemSpeCls spe;
+ this->ExportPartToMEDCommon<MEDFileMemSpeCls>(spe,meshPart,auto_groups,autoDimension,fields,geomAssocFields,ZTolerance);
+ MEDCoupling::MCAuto<MEDCoupling::DataArrayByte> res( spe.getData() );
+ MEDCoupling::DataArrayByte *ret(res.retn());
+ return reinterpret_cast<CORBA::LongLong>(ret);
+}
+
//================================================================================
/*!
* Write GEOM fields to MED file
CORBA::Boolean overwrite,
CORBA::Boolean autoDimension = true);
+ CORBA::LongLong ExportMEDCoupling(CORBA::Boolean auto_groups,
+ CORBA::Boolean autoDimension = true
+ );
+
void ExportSAUV( const char* file, CORBA::Boolean auto_groups );
void ExportDAT( const char* file );
const char* file,
CORBA::Boolean withRequiredGroups);
+
+ template<class SPECLS>
+ void ExportPartToMEDCommon(SPECLS& speCls,
+ SMESH::SMESH_IDSource_ptr meshPart,
+ CORBA::Boolean auto_groups,
+ CORBA::Boolean autoDim,
+ const GEOM::ListOfFields& fields,
+ const char* geomAssocFields,
+ CORBA::Double ZTolerance);
+
void ExportPartToMED(SMESH::SMESH_IDSource_ptr meshPart,
const char* file,
CORBA::Boolean auto_groups,
const GEOM::ListOfFields& fields,
const char* geomAssocFields,
CORBA::Double ZTolerance);
+
+ CORBA::LongLong ExportPartToMEDCoupling(SMESH::SMESH_IDSource_ptr meshPart,
+ CORBA::Boolean auto_groups,
+ CORBA::Boolean autoDim,
+ const GEOM::ListOfFields& fields,
+ const char* geomAssocFields,
+ CORBA::Double ZTolerance);
+
void ExportPartToDAT(SMESH::SMESH_IDSource_ptr meshPart,
const char* file);
void ExportPartToUNV(SMESH::SMESH_IDSource_ptr meshPart,
std::map<int, SMESH_subMesh_i*> _mapSubMesh_i; //NRI
std::map<int, ::SMESH_subMesh*> _mapSubMesh; //NRI
-private:
+public:
+ std::string generateMeshName( );
std::string prepareMeshNameAndGroups( const char* file, CORBA::Boolean overwrite );
-
- /*!
- * Check and correct names of mesh groups
- */
- void checkGroupNames();
-
/*
* Write GEOM fields to MED file
*/
SMESHDS_Mesh* meshDS,
const GEOM::ListOfFields& fields,
const char* geomAssocFields);
+private:
+ /*!
+ * Check and correct names of mesh groups
+ */
+ void checkGroupNames();
+
/*!
* Convert submesh ids into submesh interfaces
*/
self.mesh.RemoveHypothesis( self.geom, hyp )
pass
pass
+
+ def ExportMEDCoupling(self, *args, **kwargs):
+ """
+ Export the mesh in a memory representation.
+
+ Parameters:
+ auto_groups (boolean): parameter for creating/not creating
+ the groups Group_On_All_Nodes, Group_On_All_Faces, ... ;
+ the typical use is auto_groups=False.
+ overwrite (boolean): parameter for overwriting/not overwriting the file
+ meshPart: a part of mesh (:class:`sub-mesh, group or filter <SMESH.SMESH_IDSource>`) to export instead of the mesh
+ autoDimension: if *True* (default), a space dimension of a MED mesh can be either
+
+ - 1D if all mesh nodes lie on OX coordinate axis, or
+ - 2D if all mesh nodes lie on XOY coordinate plane, or
+ - 3D in the rest cases.
+
+ If *autoDimension* is *False*, the space dimension is always 3.
+ fields: list of GEOM fields defined on the shape to mesh.
+ geomAssocFields: each character of this string means a need to export a
+ corresponding field; correspondence between fields and characters
+ is following:
+
+ - 'v' stands for "_vertices_" field;
+ - 'e' stands for "_edges_" field;
+ - 'f' stands for "_faces_" field;
+ - 's' stands for "_solids_" field.
+
+ zTolerance (float): tolerance in Z direction. If Z coordinate of a node is
+ close to zero within a given tolerance, the coordinate is set to zero.
+ If *ZTolerance* is negative (default), the node coordinates are kept as is.
+ """
+ auto_groups = args[0] if len(args) > 0 else False
+ meshPart = args[1] if len(args) > 1 else None
+ autoDimension = args[2] if len(args) > 2 else True
+ fields = args[3] if len(args) > 3 else []
+ geomAssocFields = args[4] if len(args) > 4 else ''
+ z_tolerance = args[5] if len(args) > 5 else -1.
+ # process keywords arguments
+ auto_groups = kwargs.get("auto_groups", auto_groups)
+ meshPart = kwargs.get("meshPart", meshPart)
+ autoDimension = kwargs.get("autoDimension", autoDimension)
+ fields = kwargs.get("fields", fields)
+ geomAssocFields = kwargs.get("geomAssocFields", geomAssocFields)
+ z_tolerance = kwargs.get("zTolerance", z_tolerance)
+
+ # invoke engine's function
+ if meshPart or fields or geomAssocFields or z_tolerance > 0:
+ unRegister = genObjUnRegister()
+ if isinstance( meshPart, list ):
+ meshPart = self.GetIDSource( meshPart, SMESH.ALL )
+ unRegister.set( meshPart )
+
+ z_tolerance,Parameters,hasVars = ParseParameters(z_tolerance)
+ self.mesh.SetParameters(Parameters)
+
+ return self.mesh.ExportPartToMEDCoupling(meshPart, auto_groups, autoDimension, fields, geomAssocFields, z_tolerance)
+ else:
+ intPtr = self.mesh.ExportMEDCoupling(auto_groups, autoDimension)
+ import medcoupling
+ dab = medcoupling.FromPyIntPtrToDataArrayByte(intPtr)
+ return medcoupling.MEDFileMesh.New(dab)
+
def ExportMED(self, *args, **kwargs):
"""
Export the mesh in a file in MED format
${Boost_INCLUDE_DIRS}
${KERNEL_INCLUDE_DIRS}
${GEOM_INCLUDE_DIRS}
+ ${MEDCOUPLING_INCLUDE_DIRS}
${PROJECT_SOURCE_DIR}/src/SMESHUtils
${PROJECT_SOURCE_DIR}/src/SMESH
${PROJECT_SOURCE_DIR}/src/SMESHDS
${Boost_INCLUDE_DIRS}
${QWT_INCLUDE_DIR}
${OMNIORB_INCLUDE_DIR}
+ ${MEDCOUPLING_INCLUDE_DIRS}
${PROJECT_SOURCE_DIR}/src/SMESH
${PROJECT_SOURCE_DIR}/src/SMESHUtils
${PROJECT_SOURCE_DIR}/src/SMESH_I
${MEDFILE_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
${OMNIORB_INCLUDE_DIR}
+ ${MEDCOUPLING_INCLUDE_DIRS}
${PROJECT_SOURCE_DIR}/src/SMESHImpl
${PROJECT_SOURCE_DIR}/src/SMESH
${PROJECT_SOURCE_DIR}/src/SMESHUtils
# scripts / static
SET(plugin_SCRIPTS
__init__.py
- cubeAngle2.py
+ blocFissureTest.py
+ cubeAngle_2.py
cubeAngle.py
cubeCoin.py
cubeMilieu.py
eprouvetteCourbe.py
eprouvetteDroite_2.py
eprouvetteDroite.py
- execution_Cas.py
faceGauche_2.py
faceGauche.py
fissureCoude_10.py
--- /dev/null
+# -*- coding: utf-8 -*-
+# Copyright (C) 2014-2021 EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+__revision__ = "V03.02"
+
+"""Lancement des cas-tests de blocFissure
+
+Temps par type de matériel :
+. cubeAngle : 24s ["cubeAngle", "cubeAngle_2"])
+. cubeFin : 42s ["cubeCoin", "cubeMilieu", "cubeTransverse"]
+. decoupeCylindre : 8s ["cylindre", "cylindre_2"]
+. disquePerce (+ ellipse_disque) : 9s ["disquePerce"]
+. fissureGauche : 26s ["faceGauche"]
+. fissureGauche_2 (+ ellipse + ellipse_probleme): 22s ["ellipse_1", "ellipse_2", "faceGauche_2"]
+. eprouvetteCourbe : 22s ["eprouvetteCourbe"]
+. eprouvetteDroite : 31s ["eprouvetteDroite", "eprouvetteDroite_2"]
+. vis : 9s ["vis"]
+. tube : ["tube"]
+. sans matériel : 66s ["fissureCoude_1", "fissureCoude_2", "fissureCoude_3", "fissureCoude_4", "fissureCoude_5"]
+. sans matériel : 69s ["fissureCoude_6", "fissureCoude_7", "fissureCoude_8", "fissureCoude_9", "fissureCoude_10"]
+. sans matériel : 28s ["fissure_Coude", "fissure_Coude_4"]
+"""
+
+import logging
+import os
+import sys
+import tempfile
+import traceback
+
+from blocFissure.gmu import initLog
+from blocFissure.gmu.casStandard import casStandard
+
+# -----------------------------------------------------------------------------------------------
+LOGFILE = os.path.join(tempfile.gettempdir(),"blocFissure.log")
+#initLog.setDebug(LOGFILE) # debug = 10
+#initLog.setVerbose(LOGFILE) # info = 20
+#initLog.setRelease(LOGFILE) # warning = 30
+#initLog.setPerfTests(LOGFILE) # critical = 50
+#initLog.setAlways(LOGFILE) # critical = 50
+
+# Les cas qui marchent ...
+TORUNOK = [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 ] # OK 19/04/2021
+# 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28
+TORUNPB = list()
+for IAUX in TORUNOK:
+ TORUNPB.append((IAUX+1)%2)
+print ("TORUN = {} # OK".format(TORUNOK))
+print ("TORUN = {} # PB".format(TORUNPB))
+
+# Numéro de référence associé à chaque problème défini par le nom de son fichier dans le répertoire CasTests
+NREF_PB = dict()
+NREF_PB["cubeAngle"] = 0
+NREF_PB["cubeAngle_2"] = 1
+NREF_PB["cubeCoin"] = 2
+NREF_PB["cubeMilieu"] = 3
+NREF_PB["cubeTransverse"] = 4
+NREF_PB["cylindre"] = 5
+NREF_PB["cylindre_2"] = 6
+NREF_PB["disquePerce"] = 7
+NREF_PB["ellipse_1"] = 8
+NREF_PB["ellipse_2"] = 9
+NREF_PB["eprouvetteCourbe"] = 10
+NREF_PB["eprouvetteDroite"] = 11
+NREF_PB["eprouvetteDroite_2"] = 12
+NREF_PB["faceGauche"] = 13
+NREF_PB["faceGauche_2"] = 14
+NREF_PB["fissureCoude_1"] = 15
+NREF_PB["fissureCoude_2"] = 16
+NREF_PB["fissureCoude_3"] = 17
+NREF_PB["fissureCoude_4"] = 18
+NREF_PB["fissureCoude_5"] = 19
+NREF_PB["fissureCoude_6"] = 20
+NREF_PB["fissureCoude_7"] = 21
+NREF_PB["fissureCoude_8"] = 22
+NREF_PB["fissureCoude_9"] = 23
+NREF_PB["fissureCoude_10"] = 24
+NREF_PB["fissure_Coude"] = 25
+NREF_PB["fissure_Coude_4"] = 26
+NREF_PB["vis_1"] = 27
+NREF_PB["tube"] = 28
+
+#========================= Début de la classe ===================================
+
+class blocFissureTest (object):
+
+ """Test de blocFissure
+
+Options facultatives
+********************
+Le(s) numéro/nom du/des tests à passer. Si aucun n'est donné, tous les cas sont passés.
+ """
+
+# A. La base
+
+ message_info = ""
+ _verbose = 0
+ _verbose_max = 0
+ affiche_aide_globale = 0
+
+# B. Les variables
+
+ l_cas = None
+ l_problemes = None
+ d_nom_probleme = None
+ l_materiels = None
+
+#=========================== Début de la méthode =================================
+
+ def __init__ ( self, liste_option ):
+
+ """Le constructeur de la classe blocFissureTest"""
+
+ self.l_cas = list()
+ erreur = False
+
+ for option in liste_option :
+
+ #print (option, type(option))
+ if isinstance(option, str):
+ saux = option.upper()
+ else:
+ saux = option
+ #print (saux)
+ # Options générales de pilotage
+ if saux in ( "-H", "-HELP" ):
+ self.affiche_aide_globale = 1
+ elif saux == "-V" :
+ self._verbose = 1
+ elif saux == "-VMAX" :
+ self._verbose = 1
+ self._verbose_max = 1
+
+ else :
+ # Options du traitement
+ if isinstance(option, int):
+ self.l_cas.append(option)
+ elif ( option in NREF_PB ):
+ self.l_cas.append(NREF_PB[option])
+ else:
+ print ("Option inconnue : {}".format(option))
+ erreur = True
+
+# Si aucun cas n'est donné, on prend tous ceux par défaut
+ if not self.l_cas:
+ for i_aux, valeur in enumerate(TORUNOK):
+ if valeur:
+ self.l_cas.append(i_aux)
+
+ if erreur:
+ self.l_cas = list()
+
+ if self._verbose_max:
+ print ("Liste des cas : {}".format(self.l_cas))
+
+ if self._verbose_max:
+ initLog.setVerbose(LOGFILE) # info = 20
+
+#=========================== Fin de la méthode ==================================
+
+#=========================== Début de la méthode =================================
+
+ def __del__(self):
+ """A la suppression de l'instance de classe"""
+ if self._verbose_max:
+ print ("Suppression de l'instance de la classe.")
+
+#=========================== Fin de la méthode ==================================
+
+#=========================== Début de la méthode =================================
+
+ def caract_l_problemes (self):
+ """Caractérisation des problèmes"""
+ self.d_nom_probleme = dict()
+ self.l_problemes = list()
+ self.l_materiels = list()
+
+ n_cas = 0
+ if n_cas in self.l_cas:
+ from blocFissure.CasTests.cubeAngle import cubeAngle
+ self.l_problemes.append(cubeAngle(n_cas))
+ self.l_materiels.append("cubeAngle")
+
+ n_cas = 1
+ if n_cas in self.l_cas:
+ from blocFissure.CasTests.cubeAngle_2 import cubeAngle_2
+ self.l_problemes.append(cubeAngle_2(n_cas))
+ self.l_materiels.append("cubeAngle")
+
+ n_cas = 2
+ if n_cas in self.l_cas:
+ from blocFissure.CasTests import cubeCoin
+ self.l_problemes.append(casStandard(cubeCoin.dicoParams, cubeCoin.referencesMaillageFissure, n_cas))
+ self.d_nom_probleme[n_cas] = "cubeCoin"
+ self.l_materiels.append("cubeFin")
+
+ n_cas = 3
+ if n_cas in self.l_cas:
+ from blocFissure.CasTests import cubeMilieu
+ self.l_problemes.append(casStandard(cubeMilieu.dicoParams, cubeMilieu.referencesMaillageFissure, n_cas))
+ self.d_nom_probleme[n_cas] = "cubeMilieu"
+ self.l_materiels.append("cubeFin")
+
+ n_cas = 4
+ if n_cas in self.l_cas:
+ from blocFissure.CasTests import cubeTransverse
+ self.l_problemes.append(casStandard(cubeTransverse.dicoParams, cubeTransverse.referencesMaillageFissure, n_cas))
+ self.d_nom_probleme[n_cas] = "cubeTransverse"
+ self.l_materiels.append("cubeFin")
+
+ n_cas = 5
+ if n_cas in self.l_cas:
+ from blocFissure.CasTests.cylindre import cylindre
+ self.l_problemes.append(cylindre(n_cas))
+ self.l_materiels.append("decoupeCylindre")
+
+ n_cas = 6
+ if n_cas in self.l_cas:
+ from blocFissure.CasTests.cylindre_2 import cylindre_2
+ self.l_problemes.append(cylindre_2(n_cas))
+ self.l_materiels.append("decoupeCylindre")
+
+ n_cas = 7
+ if n_cas in self.l_cas:
+ from blocFissure.CasTests import disquePerce
+ self.l_problemes.append(casStandard(disquePerce.dicoParams, disquePerce.referencesMaillageFissure, n_cas))
+ self.d_nom_probleme[n_cas] = "disquePerce"
+ self.l_materiels.append("disquePerce")
+ self.l_materiels.append("ellipse_disque")
+
+ n_cas = 8
+ if n_cas in self.l_cas:
+ from blocFissure.CasTests.ellipse_1 import ellipse_1
+ self.l_problemes.append(ellipse_1(n_cas))
+ self.l_materiels.append("ellipse")
+ self.l_materiels.append("fissureGauche_2")
+
+ n_cas = 9
+ if n_cas in self.l_cas:
+ from blocFissure.CasTests.ellipse_2 import ellipse_2
+ self.l_problemes.append(ellipse_2(n_cas))
+ self.l_materiels.append("ellipse_probleme")
+ self.l_materiels.append("fissureGauche_2")
+
+ n_cas = 10
+ if n_cas in self.l_cas:
+ from blocFissure.CasTests.eprouvetteCourbe import eprouvetteCourbe
+ self.l_problemes.append(eprouvetteCourbe(n_cas))
+ self.l_materiels.append("eprouvetteCourbe")
+
+ n_cas = 11
+ if n_cas in self.l_cas:
+ from blocFissure.CasTests.eprouvetteDroite import eprouvetteDroite
+ self.l_problemes.append(eprouvetteDroite(n_cas))
+ self.l_materiels.append("eprouvetteDroite")
+
+ n_cas = 12
+ if n_cas in self.l_cas:
+ from blocFissure.CasTests.eprouvetteDroite_2 import eprouvetteDroite_2
+ self.l_problemes.append(eprouvetteDroite_2(n_cas))
+ self.l_materiels.append("eprouvetteDroite")
+
+ n_cas = 13
+ if n_cas in self.l_cas:
+ from blocFissure.CasTests.faceGauche import faceGauche
+ self.l_problemes.append(faceGauche(n_cas))
+ self.l_materiels.append("fissureGauche")
+
+ n_cas = 14
+ if n_cas in self.l_cas:
+ from blocFissure.CasTests.faceGauche_2 import faceGauche_2
+ self.l_problemes.append(faceGauche_2(n_cas))
+ self.l_materiels.append("fissureGauche_2")
+
+ n_cas = 15
+ if n_cas in self.l_cas:
+ from blocFissure.CasTests.fissureCoude_1 import fissureCoude_1
+ self.l_problemes.append(fissureCoude_1(n_cas))
+
+ n_cas = 16
+ if n_cas in self.l_cas:
+ from blocFissure.CasTests.fissureCoude_2 import fissureCoude_2
+ self.l_problemes.append(fissureCoude_2(n_cas))
+
+ n_cas = 17
+ if n_cas in self.l_cas:
+ from blocFissure.CasTests.fissureCoude_3 import fissureCoude_3
+ self.l_problemes.append(fissureCoude_3(n_cas))
+
+ n_cas = 18
+ if n_cas in self.l_cas:
+ from blocFissure.CasTests.fissureCoude_4 import fissureCoude_4
+ self.l_problemes.append(fissureCoude_4(n_cas))
+
+ n_cas = 19
+ if n_cas in self.l_cas:
+ from blocFissure.CasTests.fissureCoude_5 import fissureCoude_5
+ self.l_problemes.append(fissureCoude_5(n_cas))
+
+ n_cas = 20
+ if n_cas in self.l_cas:
+ from blocFissure.CasTests.fissureCoude_6 import fissureCoude_6
+ self.l_problemes.append(fissureCoude_6(n_cas))
+
+ n_cas = 21
+ if n_cas in self.l_cas:
+ from blocFissure.CasTests.fissureCoude_7 import fissureCoude_7
+ self.l_problemes.append(fissureCoude_7(n_cas))
+
+ n_cas = 22
+ if n_cas in self.l_cas:
+ from blocFissure.CasTests.fissureCoude_8 import fissureCoude_8
+ self.l_problemes.append(fissureCoude_8(n_cas))
+
+ n_cas = 23
+ if n_cas in self.l_cas:
+ from blocFissure.CasTests.fissureCoude_9 import fissureCoude_9
+ self.l_problemes.append(fissureCoude_9(n_cas))
+
+ n_cas = 24
+ if n_cas in self.l_cas:
+ from blocFissure.CasTests.fissureCoude_10 import fissureCoude_10
+ self.l_problemes.append(fissureCoude_10(n_cas))
+
+ n_cas = 25
+ if n_cas in self.l_cas:
+ from blocFissure.CasTests.fissure_Coude import fissure_Coude
+ self.l_problemes.append(fissure_Coude(n_cas))
+
+ n_cas = 26
+ if n_cas in self.l_cas:
+ from blocFissure.CasTests.fissure_Coude_4 import fissure_Coude_4
+ self.l_problemes.append(fissure_Coude_4(n_cas))
+
+ n_cas = 27
+ if n_cas in self.l_cas:
+ # genereMateriel : vis
+ from blocFissure.CasTests.vis_1 import vis_1
+ self.l_problemes.append(vis_1(n_cas))
+ self.l_materiels.append("vis")
+
+ n_cas = 28
+ if n_cas in self.l_cas:
+ # genereMateriel : tube
+ from blocFissure.CasTests.tube import tube
+ self.l_problemes.append(tube(n_cas))
+ self.l_materiels.append("tube")
+ #"Mesh_13" has not been computed:
+ #- "algo2d_facePeau_0" failed on "FACE_12 to mesh". Error: Algorithm failed. NgException at Surface meshing: Problem in Surface mesh generation
+ #- "algo1d_cercle1_0" failed on EDGE #20. Error: Algorithm failed. Source elements don't cover totally the geometrical edge
+ #- "algo1d_cercle1_0" failed on EDGE #17. Error: Algorithm failed. Source elements don't cover totally the geometrical edge
+ #- "algo1d_cercle1_0" failed on EDGE #15. Error: Algorithm failed. Source elements don't cover totally the geometrical edge
+ #- "algo1d_cercle1_0" failed on EDGE #12. Error: Algorithm failed. Source elements don't cover totally the geometrical edge
+
+ return
+
+#=========================== Fin de la méthode ==================================
+
+#=========================== Début de la méthode =================================
+
+ def cree_materiels (self):
+ """Création des matériels"""
+
+ if "cubeAngle" in self.l_materiels:
+ from blocFissure.materielCasTests import cubeAngle
+
+ if "cubeFin" in self.l_materiels:
+ from blocFissure.materielCasTests import cubeFin
+
+ if "decoupeCylindre" in self.l_materiels:
+ from blocFissure.materielCasTests import decoupeCylindre
+
+ if "disquePerce" in self.l_materiels:
+ from blocFissure.materielCasTests import disquePerce
+
+ if "ellipse_disque" in self.l_materiels:
+ from blocFissure.materielCasTests import ellipse_disque
+
+ if "ellipse_probleme" in self.l_materiels:
+ from blocFissure.materielCasTests import ellipse_probleme
+
+ if "ellipse" in self.l_materiels:
+ from blocFissure.materielCasTests import ellipse
+
+ if "fissureGauche" in self.l_materiels:
+ from blocFissure.materielCasTests import fissureGauche
+
+ if "fissureGauche_2" in self.l_materiels:
+ from blocFissure.materielCasTests import fissureGauche_2
+
+ if "eprouvetteCourbe" in self.l_materiels:
+ from blocFissure.materielCasTests import eprouvetteCourbe
+
+ if "eprouvetteDroite" in self.l_materiels:
+ from blocFissure.materielCasTests import eprouvetteDroite
+
+ if "vis" in self.l_materiels:
+ from blocFissure.materielCasTests import vis
+
+ if "tube" in self.l_materiels:
+ from blocFissure.materielCasTests import tube
+
+ return
+
+#=========================== Fin de la méthode ==================================
+
+#=========================== Début de la méthode =================================
+
+ def calcul_cas (self, n_cas, cas, ligne):
+ """Calcul d'un cas"""
+ texte = ""
+ if n_cas in self.d_nom_probleme:
+ nom = self.d_nom_probleme[n_cas]
+ else:
+ nom = cas.nomProbleme
+ texte_a = "\n=== Exécution du cas n° {}, '{}'".format(NREF_PB[nom],nom)
+ logging.critical(ligne+texte_a)
+
+ try:
+ ok_maillage = cas.executeProbleme()
+ except:
+ traceback.print_exc()
+ ok_maillage = False
+ if not ok_maillage:
+ texte = "Problème avec le cas n° {}, '{}'\n".format(NREF_PB[nom],nom)
+ print(ligne)
+
+ return ok_maillage, texte
+
+#=========================== Fin de la méthode ==================================
+
+#=========================== Début de la méthode =================================
+
+ def calcul_tout (self):
+ """Calcul de tous les cas"""
+
+ ligne = "---------------------------------------------------------------------"
+ texte = "\n"
+ nb_cas_ok = 0
+ nb_cas_nook = 0
+ for n_cas, cas in enumerate(self.l_problemes):
+ #print ("Cas n° {}, '{}'".format(n_cas,cas.nomProbleme))
+ ok_maillage, texte_a = self.calcul_cas (n_cas, cas, ligne)
+ texte += texte_a
+ if ok_maillage:
+ nb_cas_ok += 1
+ else:
+ nb_cas_nook += 1
+ print(ligne)
+
+ nb_cas = nb_cas_nook + nb_cas_ok
+ if ( nb_cas > 1):
+ if nb_cas_nook:
+ texte += ". Nombre de cas_tests OK : {}\n".format(nb_cas_ok)
+ texte += ". Nombre de cas_tests NOOK : {}\n".format(nb_cas_nook)
+ else:
+ texte += "Les {} tests se sont bien passés.\n".format(nb_cas)
+ print (texte+ligne)
+ logging.critical(ligne+texte)
+
+ return texte
+
+#=========================== Fin de la méthode ==================================
+
+#=========================== Début de la méthode =================================
+
+ def lancement (self):
+ """Lancement général"""
+
+ # Tri des problèmes
+ self.caract_l_problemes ()
+
+ # Création des matériels
+ self.cree_materiels ()
+
+ # Calcul des fissures
+ texte = self.calcul_tout ()
+
+ return texte
+
+#=========================== Fin de la méthode ==================================
+
+#========================== Fin de la classe ====================================
+
+#==================================================================================
+# Lancement
+#==================================================================================
+
+if __name__ == "__main__" :
+
+# 1. Options
+
+ L_OPTIONS = sys.argv[1:]
+ L_OPTIONS.append("-v")
+
+# 2. Lancement de la classe
+
+ #print ("L_OPTIONS :", L_OPTIONS)
+ BLOCFISSURE_TEST = blocFissureTest(L_OPTIONS)
+
+ if BLOCFISSURE_TEST.affiche_aide_globale:
+ sys.stdout.write(BLOCFISSURE_TEST.__doc__+"\n")
+ else:
+ TEXTE = BLOCFISSURE_TEST.lancement()
+ sys.stdout.write(TEXTE)
+
+ del BLOCFISSURE_TEST
+++ /dev/null
-# -*- coding: utf-8 -*-
-# Copyright (C) 2014-2021 EDF R&D
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-"""problème de fissure plane coupant 2 faces (angle)"""
-
-import os
-
-from .cubeAngle import cubeAngle
-
-class cubeAngle2(cubeAngle):
- """problème de fissure plane coupant 2 faces (angle), débouches normaux, objet plan
-
- detection d'un probleme de tolerance sur les edges de jonction pipe et face fissure externe
- """
-
- nomProbleme = "cubeAngle2"
-
- # ---------------------------------------------------------------------------
- def setParamShapeFissure(self):
- """paramètres de la fissure pour méthode construitFissureGenerale
-
- lgInfluence : distance autour de la shape de fissure a remailler (A ajuster selon le maillage)
- rayonPipe : le rayon du pile maillé en hexa autour du fond de fissure
- """
- self.shapeFissureParams = dict(lgInfluence = 20,
- rayonPipe = 5)
-
- # ---------------------------------------------------------------------------
- def setParamMaillageFissure(self):
- self.maillageFissureParams = dict(nomRep = os.curdir,
- nomFicSain = self.nomProbleme,
- nomFicFissure = self.nomProbleme + "_fissure",
- nbsegRad = 5,
- nbsegCercle = 32,
- areteFaceFissure = 5)
-
- # ---------------------------------------------------------------------------
- def setReferencesMaillageFissure(self):
- self.referencesMaillageFissure = dict( \
- Entity_Quad_Quadrangle = 2350, \
- Entity_Quad_Hexa = 5315, \
- Entity_Node = 38196, \
- Entity_Quad_Edge = 345, \
- Entity_Quad_Triangle = 1214, \
- Entity_Quad_Tetra = 7772, \
- Entity_Quad_Pyramid = 620, \
- Entity_Quad_Penta = 512 \
- )
--- /dev/null
+# -*- coding: utf-8 -*-
+# Copyright (C) 2014-2021 EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+"""problème de fissure plane coupant 2 faces (angle)"""
+
+import os
+
+from .cubeAngle import cubeAngle
+
+class cubeAngle_2(cubeAngle):
+ """problème de fissure plane coupant 2 faces (angle), débouches normaux, objet plan
+
+ detection d'un probleme de tolerance sur les edges de jonction pipe et face fissure externe
+ """
+
+ nomProbleme = "cubeAngle_2"
+
+ # ---------------------------------------------------------------------------
+ def setParamShapeFissure(self):
+ """paramètres de la fissure pour méthode construitFissureGenerale
+
+ lgInfluence : distance autour de la shape de fissure a remailler (A ajuster selon le maillage)
+ rayonPipe : le rayon du pile maillé en hexa autour du fond de fissure
+ """
+ self.shapeFissureParams = dict(lgInfluence = 20,
+ rayonPipe = 5)
+
+ # ---------------------------------------------------------------------------
+ def setParamMaillageFissure(self):
+ self.maillageFissureParams = dict(nomRep = os.curdir,
+ nomFicSain = self.nomProbleme,
+ nomFicFissure = self.nomProbleme + "_fissure",
+ nbsegRad = 5,
+ nbsegCercle = 32,
+ areteFaceFissure = 5)
+
+ # ---------------------------------------------------------------------------
+ def setReferencesMaillageFissure(self):
+ self.referencesMaillageFissure = dict( \
+ Entity_Quad_Quadrangle = 2350, \
+ Entity_Quad_Hexa = 5315, \
+ Entity_Node = 38196, \
+ Entity_Quad_Edge = 345, \
+ Entity_Quad_Triangle = 1214, \
+ Entity_Quad_Tetra = 7772, \
+ Entity_Quad_Pyramid = 620, \
+ Entity_Quad_Penta = 512 \
+ )
class cylindre_2(cylindre):
"""problème de fissure plane sur cylindre hexa, fond de fissure complexe : polyline"""
- nomProbleme = "cylindre2"
+ nomProbleme = "cylindre_2"
# ---------------------------------------------------------------------------
def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams, \
import os
from blocFissure import gmu
-dicoParams = dict(nomCas = 'disque',
- nomProbleme = "disque",
+dicoParams = dict(nomCas = 'disquePerce',
+ nomProbleme = "disquePerce",
maillageSain = os.path.join(gmu.pathBloc, "materielCasTests", "disque.med"),
CAOFaceFissure = os.path.join(gmu.pathBloc, "materielCasTests", "ellipse_disque.brep"),
edgeFiss = [3],
class ellipse_1(fissureGenerique):
"""problème de fissure non plane, débouchante non normale"""
- nomProbleme = "ellipse1"
+ nomProbleme = "ellipse_1"
shapeFissureParams = dict()
maillageFissureParams = dict()
referencesMaillageFissure = dict()
lgInfluence = shapeFissureParams['lgInfluence']
- shellFiss = geompy.ImportBREP(os.path.join(gmu.pathBloc, "materielCasTests", "ellipse1.brep"))
+ shellFiss = geompy.ImportBREP(os.path.join(gmu.pathBloc, "materielCasTests", "ellipse_1.brep"))
fondFiss = geompy.CreateGroup(shellFiss, geompy.ShapeType["EDGE"])
geompy.UnionIDs(fondFiss, [3])
geompy.addToStudy( shellFiss, 'shellFiss' )
class ellipse_2(ellipse_1):
"""problème de fissure non plane, débouchante non normale"""
- nomProbleme = "ellipse2"
+ nomProbleme = "ellipse_2"
# ---------------------------------------------------------------------------
def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams, \
lgInfluence = shapeFissureParams['lgInfluence']
- shellFiss = geompy.ImportBREP(os.path.join(gmu.pathBloc, "materielCasTests", "ellipse1_pb.brep"))
+ shellFiss = geompy.ImportBREP(os.path.join(gmu.pathBloc, "materielCasTests", "ellipse_1_pb.brep"))
fondFiss = geompy.CreateGroup(shellFiss, geompy.ShapeType["EDGE"])
geompy.UnionIDs(fondFiss, [3])
geompy.addToStudy( shellFiss, 'shellFiss' )
+++ /dev/null
-# -*- coding: utf-8 -*-
-# Copyright (C) 2014-2021 EDF R&D
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-"""Lancement des cas-tests de blocFissure"""
-
-import logging
-import os
-import tempfile
-import traceback
-
-from blocFissure.gmu import initLog
-from blocFissure.gmu.casStandard import casStandard
-
-# -----------------------------------------------------------------------------------------------
-LOGFILE = os.path.join(tempfile.gettempdir(),"blocFissure.log")
-#initLog.setDebug(LOGFILE) # debug = 10
-#initLog.setVerbose(LOGFILE) # info = 20
-#initLog.setRelease(LOGFILE) # warning = 30
-#initLog.setPerfTests(LOGFILE) # critical = 50
-#initLog.setAlways(LOGFILE) # critical = 50
-
-# ---tous les cas en séquence, ou les cas sélectionnés ...
-TORUNOK = [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 ] # OK 19/04/2021
-# 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28
-#RUNALL = False
-RUNALL = True
-if RUNALL:
- TORUN = [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
-# 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28
- TORUN = TORUNOK
-else:
- TORUNPB = list()
- for IAUX in TORUNOK:
- TORUNPB.append((IAUX+1)%2)
- print ("TORUN = {} # OK".format(TORUNOK))
- print ("TORUN = {} # PB".format(TORUNPB))
-# genereMateriel
- TORUN = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0] # aucun
- TORUN = [ 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] # cubeAngle
- TORUN = [ 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] # cubeFin
- TORUN = [ 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] # decoupeCylindre
- TORUN = [ 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] # disque_perce + ellipse_disque
- TORUN = [ 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] # ellipse + fissureGauche2
- TORUN = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] # ellipse_probleme + fissureGauche2
- TORUN = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] # eprouvetteCourbe
- TORUN = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] # eprouvetteDroite
- TORUN = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] # fissureGauche
- TORUN = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] # fissureGauche2
- TORUN = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0] # vis
- TORUN = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1] # tube
-# 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28
- TORUN = [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0] # OK
-# -----------------------------------------------------------------------------------------------
-
-def caract_l_problemes ():
- """Caractérisation des problèmes"""
- d_aux = dict()
- l_problemes = list()
-
- n_cas = 0
- # genereMateriel : cubeAngle
- from blocFissure.CasTests.cubeAngle import cubeAngle
- l_problemes.append(cubeAngle(n_cas))
-
- n_cas = 1
- # genereMateriel : cubeAngle
- from blocFissure.CasTests.cubeAngle2 import cubeAngle2
- l_problemes.append(cubeAngle2(n_cas))
-
- n_cas = 2
- # genereMateriel : cubeFin
- from blocFissure.CasTests import cubeCoin
- l_problemes.append(casStandard(cubeCoin.dicoParams, cubeCoin.referencesMaillageFissure, n_cas))
- d_aux[n_cas] = "cubeCoin"
-
- n_cas = 3
- # genereMateriel : cubeFin
- from blocFissure.CasTests import cubeMilieu
- l_problemes.append(casStandard(cubeMilieu.dicoParams, cubeMilieu.referencesMaillageFissure, n_cas))
- d_aux[n_cas] = "cubeMilieu"
-
- n_cas = 4
- # genereMateriel : cubeFin
- from blocFissure.CasTests import cubeTransverse
- l_problemes.append(casStandard(cubeTransverse.dicoParams, cubeTransverse.referencesMaillageFissure, n_cas))
- d_aux[n_cas] = "cubeTransverse"
-
- n_cas = 5
- # genereMateriel : decoupeCylindre
- from blocFissure.CasTests.cylindre import cylindre
- l_problemes.append(cylindre(n_cas))
-
- n_cas = 6
- # genereMateriel : decoupeCylindre
- from blocFissure.CasTests.cylindre_2 import cylindre_2
- l_problemes.append(cylindre_2(n_cas))
-
- n_cas = 7
- # genereMateriel : disque_perce
- # genereMateriel : ellipse_disque
- from blocFissure.CasTests import disquePerce
- l_problemes.append(casStandard(disquePerce.dicoParams, disquePerce.referencesMaillageFissure, n_cas))
- d_aux[n_cas] = "disquePerce"
-
- n_cas = 8
- # genereMateriel: ellipse
- # genereMateriel : fissureGauche2
- from blocFissure.CasTests.ellipse_1 import ellipse_1
- l_problemes.append(ellipse_1(n_cas))
-
- n_cas = 9
- # genereMateriel: ellipse_probleme
- # genereMateriel : fissureGauche2
- from blocFissure.CasTests.ellipse_2 import ellipse_2
- l_problemes.append(ellipse_2(n_cas))
-
- n_cas = 10
- # genereMateriel : eprouvetteCourbe
- from blocFissure.CasTests.eprouvetteCourbe import eprouvetteCourbe
- l_problemes.append(eprouvetteCourbe(n_cas))
-
- n_cas = 11
- # genereMateriel : eprouvetteDroite
- from blocFissure.CasTests.eprouvetteDroite import eprouvetteDroite
- l_problemes.append(eprouvetteDroite(n_cas))
-
- n_cas = 12
- # genereMateriel : eprouvetteDroite
- from blocFissure.CasTests.eprouvetteDroite_2 import eprouvetteDroite_2
- l_problemes.append(eprouvetteDroite_2(n_cas))
-
- n_cas = 13
- # genereMateriel : fissureGauche
- from blocFissure.CasTests.faceGauche import faceGauche
- l_problemes.append(faceGauche(n_cas))
-
- n_cas = 14
- # genereMateriel : fissureGauche2
- from blocFissure.CasTests.faceGauche_2 import faceGauche_2
- l_problemes.append(faceGauche_2(n_cas))
-
- n_cas = 15
- # genereMateriel : aucun
- from blocFissure.CasTests.fissureCoude_1 import fissureCoude_1
- l_problemes.append(fissureCoude_1(n_cas))
-
- n_cas = 16
- # genereMateriel : aucun
- from blocFissure.CasTests.fissureCoude_2 import fissureCoude_2
- l_problemes.append(fissureCoude_2(n_cas))
-
- n_cas = 17
- # genereMateriel : aucun
- from blocFissure.CasTests.fissureCoude_3 import fissureCoude_3
- l_problemes.append(fissureCoude_3(n_cas))
-
- n_cas = 18
- # genereMateriel : aucun
- from blocFissure.CasTests.fissureCoude_4 import fissureCoude_4
- l_problemes.append(fissureCoude_4(n_cas))
-
- n_cas = 19
- # genereMateriel : aucun
- from blocFissure.CasTests.fissureCoude_5 import fissureCoude_5
- l_problemes.append(fissureCoude_5(n_cas))
-
- n_cas = 20
- # genereMateriel : aucun
- from blocFissure.CasTests.fissureCoude_6 import fissureCoude_6
- l_problemes.append(fissureCoude_6(n_cas))
-
- n_cas = 21
- # genereMateriel : aucun
- from blocFissure.CasTests.fissureCoude_7 import fissureCoude_7
- l_problemes.append(fissureCoude_7(n_cas))
-
- n_cas = 22
- # genereMateriel : aucun
- from blocFissure.CasTests.fissureCoude_8 import fissureCoude_8
- l_problemes.append(fissureCoude_8(n_cas))
-
- n_cas = 23
- # genereMateriel : aucun
- from blocFissure.CasTests.fissureCoude_9 import fissureCoude_9
- l_problemes.append(fissureCoude_9(n_cas))
-
- n_cas = 24
- # genereMateriel : aucun
- from blocFissure.CasTests.fissureCoude_10 import fissureCoude_10
- l_problemes.append(fissureCoude_10(n_cas))
-
- n_cas = 25
- # genereMateriel : aucun
- from blocFissure.CasTests.fissure_Coude import fissure_Coude
- l_problemes.append(fissure_Coude(n_cas))
-
- n_cas = 26
- # genereMateriel : aucun
- from blocFissure.CasTests.fissure_Coude_4 import fissure_Coude_4
- l_problemes.append(fissure_Coude_4(n_cas))
-
- n_cas = 27
- # genereMateriel : vis
- from blocFissure.CasTests.vis_1 import vis_1
- l_problemes.append(vis_1(n_cas))
-
- n_cas = 28
- # genereMateriel : tube
- from blocFissure.CasTests.tube import tube
- l_problemes.append(tube(n_cas))
- #"Mesh_13" has not been computed:
- #- "algo2d_facePeau_0" failed on "FACE_12 to mesh". Error: Algorithm failed. NgException at Surface meshing: Problem in Surface mesh generation
- #- "algo1d_cercle1_0" failed on EDGE #20. Error: Algorithm failed. Source elements don't cover totally the geometrical edge
- #- "algo1d_cercle1_0" failed on EDGE #17. Error: Algorithm failed. Source elements don't cover totally the geometrical edge
- #- "algo1d_cercle1_0" failed on EDGE #15. Error: Algorithm failed. Source elements don't cover totally the geometrical edge
- #- "algo1d_cercle1_0" failed on EDGE #12. Error: Algorithm failed. Source elements don't cover totally the geometrical edge
-
- return l_problemes, d_aux
-#=============================================================
-def calcul_cas (n_cas, cas, d_aux, ligne):
- """Calcul d'un cas"""
- texte = ""
- if n_cas in d_aux:
- nom = d_aux[n_cas]
- else:
- nom = cas.nomProbleme
- texte_a = "\n=== Exécution du cas n° {}, '{}'".format(n_cas,nom)
- logging.critical(ligne+texte_a)
-
- try:
- ok_maillage = cas.executeProbleme()
- except:
- traceback.print_exc()
- ok_maillage = False
- if not ok_maillage:
- texte = "Problème avec le cas n° {}, '{}'\n".format(n_cas,nom)
- print(ligne)
-
- return ok_maillage, texte
-#=============================================================
-def calcul_tout (l_problemes, d_aux):
- """Calcul de tous les cas"""
-
- ligne = "---------------------------------------------------------------------"
- texte = "\n"
- nb_cas_ok = 0
- nb_cas_nook = 0
- for n_cas, cas in enumerate(l_problemes):
- #print ("Cas n° {}, '{}'".format(n_cas,cas.nomProbleme))
- if TORUN[n_cas]:
- ok_maillage, texte_a = calcul_cas (n_cas, cas, d_aux, ligne)
- texte += texte_a
- if ok_maillage:
- nb_cas_ok += 1
- else:
- nb_cas_nook += 1
- print(ligne)
-
- nb_cas = nb_cas_nook + nb_cas_ok
- if ( nb_cas > 1):
- if nb_cas_nook:
- texte += ". Nombre de cas_tests OK : {}\n".format(nb_cas_ok)
- texte += ". Nombre de cas_tests NOOK : {}\n".format(nb_cas_nook)
- else:
- texte += "Les {} tests se sont bien passés.\n".format(nb_cas)
- print (texte+ligne)
- logging.critical(ligne+texte)
-
- return
-#=============================================================
-#=============================================================
-
-while True:
-
- L_PROBLEMES, D_AUX = caract_l_problemes()
-
- if ( len(L_PROBLEMES) != len(TORUN) ):
- TEXTE = "\nNombre de problèmes définis : {}\n".format(len(L_PROBLEMES))
- TEXTE += "Longueur de la liste 'TORUN' : {}\n".format(len(TORUN))
- TEXTE += "\t==> Incohérence de programmation à corriger dans {}".format(__name__)
- print (TEXTE)
- break
-
- calcul_tout (L_PROBLEMES, D_AUX)
-
- break
# General substitutions.
project = 'Plug-in blocFissure'
-copyright = '2010-2021 EDF R&D'
+copyright = '2010-2021 EDF'
# The default replacements for |version| and |release|, also used in various
# other places throughout the built documents.
:align: center\r
:alt: Geometrical parameters of the tore\r
\r
-Different levels of verbose are available. Use one of this 4 optional functions to set verbose type:\r
+Different levels of verbose are available. The prints are located in the file ''LOGFILE''. Use one of this 4 optional functions to set verbose type:\r
\r
-- / **setDebug()**\r
+- / **setDebug(LOGFILE)**\r
\r
-- / **setVerbose()**\r
+- / **setVerbose(LOGFILE)**\r
\r
-- / **setRelease()**\r
+- / **setRelease(LOGFILE)**\r
\r
-- / **setUnitTests()**\r
+- / **setUnitTests(LOGFILE)**\r
\r
**example to run in salome session**::\r
\r
from blocFissure import gmu\r
from blocFissure.gmu import initLog\r
- initLog.setDebug()\r
+ initLog.setDebug("/tmp/blocFissure.log")\r
\r
from blocFissure.casStandard import casStandard\r
\r
\r
execInstance = casStandard(dicoParams)\r
\r
+ newmesh = execInstance.maillageFissure\r
+\r
\r
\r
\r
Test cases\r
#######################\r
\r
-A base of 30 test cases guarantees the correct functioning of « Bloc Fissure ». 12 cases are dedicated to :ref:`cracked bended pipes <pipeTC>` and the others 13 are for other :ref:`generic geometries <genericTC>`. They are shown here in order to illustrate cases on which « Bloc Fissure » works.\r
+A base of 28 test cases guarantees the correct functioning of « Bloc Fissure ». 12 cases are dedicated to :ref:`cracked bended pipes <pipeTC>` and the others 16 are for other :ref:`generic geometries <genericTC>`. They are shown here in order to illustrate cases on which « Bloc Fissure » works.\r
\r
.. _genericTC:\r
\r
Generic cases\r
===============================\r
\r
-All 13 cases are shown Table 2. Two views show the whole cracked structure and a zoom onto the crack with its tore.\r
-\r
-+-------------------------------------------+----------------------------------------------+\r
-| CubeAngle |\r
-+-------------------------------------------+----------------------------------------------+\r
-|.. image:: images/01_CubeAngle.png | .. image:: images/01_CubeAngle_2.png |\r
-| :height: 300 | :height: 300 |\r
-| :align: center | :align: center |\r
-+-------------------------------------------+----------------------------------------------+\r
-| CubeAngle2 |\r
-+-------------------------------------------+----------------------------------------------+\r
-|.. image:: images/02_CubeAngle2.png | .. image:: images/02_CubeAngle2_2.png |\r
-| :height: 300 | :height: 300 |\r
-| :align: center | :align: center |\r
-+-------------------------------------------+----------------------------------------------+\r
-| cylindre |\r
-+-------------------------------------------+----------------------------------------------+\r
-|.. image:: images/03_cylindre.png | .. image:: images/03_cylindre_2.png |\r
-| :height: 300 | :height: 300 |\r
-| :align: center | :align: center |\r
-+-------------------------------------------+----------------------------------------------+\r
-| cylindre2 |\r
-+-------------------------------------------+----------------------------------------------+\r
-|.. image:: images/04_cylindre2.png | .. image:: images/04_cylindre2_2.png |\r
-| :height: 300 | :height: 300 |\r
-| :align: center | :align: center |\r
-+-------------------------------------------+----------------------------------------------+\r
-| disque |\r
-+-------------------------------------------+----------------------------------------------+\r
-|.. image:: images/05_disque.png | .. image:: images/05_disque_2.png |\r
-| :height: 300 | :height: 300 |\r
-| :align: center | :align: center |\r
-+-------------------------------------------+----------------------------------------------+\r
-| ellipse1 |\r
-+-------------------------------------------+----------------------------------------------+\r
-|.. image:: images/06_ellipse1.png | .. image:: images/06_ellipse1_2.png |\r
-| :height: 300 | :height: 300 |\r
-| :align: center | :align: center |\r
-+-------------------------------------------+----------------------------------------------+\r
-| ellipse2 (tilted crack) |\r
-+-------------------------------------------+----------------------------------------------+\r
-|.. image:: images/07_ellipse2.png | .. image:: images/07_ellipse2_2.png |\r
-| :height: 300 | :height: 300 |\r
-| :align: center | :align: center |\r
-+-------------------------------------------+----------------------------------------------+\r
-| eprouvetteCourbe |\r
-+-------------------------------------------+----------------------------------------------+\r
-|.. image:: images/08_eprouvetteCourbe.png | .. image:: images/08_eprouvetteCourbe_2.png |\r
-| :height: 300 | :height: 300 |\r
-| :align: center | :align: center |\r
-+-------------------------------------------+----------------------------------------------+\r
-| eprouvetteDroite |\r
-+-------------------------------------------+----------------------------------------------+\r
-|.. image:: images/09_eprouvetteDroite.png | .. image:: images/09_eprouvetteDroite_2.png |\r
-| :height: 300 | :height: 300 |\r
-| :align: center | :align: center |\r
-+-------------------------------------------+----------------------------------------------+\r
-| eprouvetteDroite2 |\r
-+-------------------------------------------+----------------------------------------------+\r
-|.. image:: images/10_eprouvetteDroite2.png | .. image:: images/10_eprouvetteDroite2_2.png |\r
-| :height: 300 | :height: 300 |\r
-| :align: center | :align: center |\r
-+-------------------------------------------+----------------------------------------------+\r
-| faceGauche |\r
-+-------------------------------------------+----------------------------------------------+\r
-|.. image:: images/11_faceGauche.png | .. image:: images/11_faceGauche_2.png |\r
-| :height: 300 | :height: 300 |\r
-| :align: center | :align: center |\r
-+-------------------------------------------+----------------------------------------------+\r
-| faceGauche2 |\r
-+-------------------------------------------+----------------------------------------------+\r
-|.. image:: images/12_faceGauche2.png | .. image:: images/12_faceGauche2_2.png |\r
-| :height: 300 | :height: 300 |\r
-| :align: center | :align: center |\r
-+-------------------------------------------+----------------------------------------------+\r
-| vis (Crack is in the radius filet between the screw head and the screw shank) |\r
-+-------------------------------------------+----------------------------------------------+\r
-|.. image:: images/13_vis_1.png | .. image:: images/13_vis_1_2.png |\r
-| :width: 400 | :width: 400 |\r
-| :align: center | :align: center |\r
-+-------------------------------------------+----------------------------------------------+\r
-| tube |\r
-+-------------------------------------------+----------------------------------------------+\r
+All 16 cases are shown Table 2. Two views show the whole cracked structure and a zoom onto the crack with its tore.\r
+\r
++--------------------------------------------+-----------------------------------------------+\r
+| CubeAngle |\r
++--------------------------------------------+-----------------------------------------------+\r
+|.. image:: images/01_CubeAngle.png | .. image:: images/01_CubeAngle_a.png |\r
+| :height: 300 | :height: 300 |\r
+| :align: center | :align: center |\r
++--------------------------------------------+-----------------------------------------------+\r
+| CubeAngle_2 |\r
++--------------------------------------------+-----------------------------------------------+\r
+|.. image:: images/02_CubeAngle_2.png | .. image:: images/02_CubeAngle_2_a.png |\r
+| :height: 300 | :height: 300 |\r
+| :align: center | :align: center |\r
++--------------------------------------------+-----------------------------------------------+\r
+| cubeCoin |\r
++--------------------------------------------+-----------------------------------------------+\r
+| cubeMilieu |\r
++--------------------------------------------+-----------------------------------------------+\r
+| cubeTransverse |\r
++--------------------------------------------+-----------------------------------------------+\r
+| cylindre |\r
++--------------------------------------------+-----------------------------------------------+\r
+|.. image:: images/03_cylindre.png | .. image:: images/03_cylindre_a.png |\r
+| :height: 300 | :height: 300 |\r
+| :align: center | :align: center |\r
++--------------------------------------------+-----------------------------------------------+\r
+| cylindre_2 |\r
++--------------------------------------------+-----------------------------------------------+\r
+|.. image:: images/04_cylindre_2.png | .. image:: images/04_cylindre_2_a.png |\r
+| :height: 300 | :height: 300 |\r
+| :align: center | :align: center |\r
++--------------------------------------------+-----------------------------------------------+\r
+| disquePerce |\r
++--------------------------------------------+-----------------------------------------------+\r
+|.. image:: images/05_disque.png | .. image:: images/05_disque_a.png |\r
+| :height: 300 | :height: 300 |\r
+| :align: center | :align: center |\r
++--------------------------------------------+-----------------------------------------------+\r
+| ellipse_1 |\r
++--------------------------------------------+-----------------------------------------------+\r
+|.. image:: images/06_ellipse_1.png | .. image:: images/06_ellipse_1_a.png |\r
+| :height: 300 | :height: 300 |\r
+| :align: center | :align: center |\r
++--------------------------------------------+-----------------------------------------------+\r
+| ellipse_2 (tilted crack) |\r
++--------------------------------------------+-----------------------------------------------+\r
+|.. image:: images/07_ellipse_2.png | .. image:: images/07_ellipse_2_a.png |\r
+| :height: 300 | :height: 300 |\r
+| :align: center | :align: center |\r
++--------------------------------------------+-----------------------------------------------+\r
+| eprouvetteCourbe |\r
++--------------------------------------------+-----------------------------------------------+\r
+|.. image:: images/08_eprouvetteCourbe.png | .. image:: images/08_eprouvetteCourbe_a.png |\r
+| :height: 300 | :height: 300 |\r
+| :align: center | :align: center |\r
++--------------------------------------------+-----------------------------------------------+\r
+| eprouvetteDroite |\r
++--------------------------------------------+-----------------------------------------------+\r
+|.. image:: images/09_eprouvetteDroite.png | .. image:: images/09_eprouvetteDroite_a.png |\r
+| :height: 300 | :height: 300 |\r
+| :align: center | :align: center |\r
++--------------------------------------------+-----------------------------------------------+\r
+| eprouvetteDroite_2 |\r
++--------------------------------------------+-----------------------------------------------+\r
+|.. image:: images/10_eprouvetteDroite_2.png | .. image:: images/10_eprouvetteDroite_2_a.png |\r
+| :height: 300 | :height: 300 |\r
+| :align: center | :align: center |\r
++--------------------------------------------+-----------------------------------------------+\r
+| faceGauche |\r
++--------------------------------------------+-----------------------------------------------+\r
+|.. image:: images/11_faceGauche.png | .. image:: images/11_faceGauche_2.png |\r
+| :height: 300 | :height: 300 |\r
+| :align: center | :align: center |\r
++--------------------------------------------+-----------------------------------------------+\r
+| faceGauche_2 |\r
++--------------------------------------------+-----------------------------------------------+\r
+|.. image:: images/12_faceGauche_2.png | .. image:: images/12_faceGauche_2_a.png |\r
+| :height: 300 | :height: 300 |\r
+| :align: center | :align: center |\r
++--------------------------------------------+-----------------------------------------------+\r
+| vis (Crack is in the radius filet between the screw head and the screw shank) |\r
++--------------------------------------------+-----------------------------------------------+\r
+|.. image:: images/13_vis_1.png | .. image:: images/13_vis_1_2.png |\r
+| :width: 400 | :width: 400 |\r
+| :align: center | :align: center |\r
++--------------------------------------------+-----------------------------------------------+\r
+| tube |\r
++--------------------------------------------+-----------------------------------------------+\r
\r
.. _pipeTC:\r
\r
\r
« Bloc Fissure » is very efficient for the case of bended pipes. The generation of the geometry and the crack insertion takes only around 15s.\r
\r
-Running test cases\r
+Data for the test cases\r
=====================================\r
\r
All the files for these test cases are stored in the directory of the installation of SALOME:\r
\r
``Salome-VXXXX_package-YY/modules/SMESH_VXXXX/lib/python3.6/site-packages/salome/blocFissure``\r
\r
-The test cases can be runned either through the python window of the SALOME GUI or with a python script.\r
-\r
-0) **Generate med and breps files.**::\r
+The set of the med, xao and brep files can be created by the following importation:\r
\r
from blocFissure.materielCasTests import genereMateriel\r
\r
\r
There is no need to generate them again.\r
\r
-1) **To execute all test cases**::\r
-\r
- from blocFissure.CasTests import execution_Cas\r
-\r
-2) **To execute only selected test cases**:\r
+To check the installation of salome, the test cases can be computed by the salome test process::\r
\r
-modify the file ``CasTests/execution_Cas.py`` and change::\r
+ salome -test blocFissure\r
\r
- runall = False. #old : True\r
-\r
-And change from 0 to 1 of the index of the test you want to launch::\r
+Running test cases\r
+=====================================\r
\r
- torun = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\r
+The test cases can be runned by the following instructions::\r
\r
-then launch the test cases::\r
+ from blocFissure.CasTests.blocFissureTest import blocFissureTest\r
+ BLOCFISSURE_TEST = blocFissureTest(list_of_cases)\r
+ MESSAGE_ERREUR = BLOCFISSURE_TEST.lancement()\r
+ sys.stdout.write(MESSAGE_ERREUR)\r
+ del BLOCFISSURE_TEST\r
\r
- from blocFissure.CasTests import execution_Cas\r
+If ``list_of_cases`` is an empty list, all the cases are computed.\r
\r
-The index of each test is the position of the test in the following table, from 0 for cubeAngle, 1 for cubeAngle2,\r
-2 for cubeCoin... from top to bottom, then from left to right.\r
+If not, ``list_of_cases`` is made of the list of the numbers and/or the name of the requested case. The index of each test is the position of the test in the following table, from 0 for cubeAngle, 1 for cubeAngle_2, 2 for cubeCoin... from top to bottom, then from left to right.\r
\r
+--------------------+--------------------+--------------------+-----------------+-----------------+\r
| cubeAngle | cylindre_2 | eprouvetteDroite_2 | fissureCoude_3 | fissureCoude_9 |\r
+--------------------+--------------------+--------------------+-----------------+-----------------+\r
-| cubeAngle2 | disquePerce | faceGauche | fissureCoude_4 | fissure_Coude |\r
+| cubeAngle_2 | disquePerce | faceGauche | fissureCoude_4 | fissure_Coude |\r
+--------------------+--------------------+--------------------+-----------------+-----------------+\r
| cubeCoin | ellipse_1 | faceGauche_2 | fissureCoude_5 | fissure_Coude_4 |\r
+--------------------+--------------------+--------------------+-----------------+-----------------+\r
| cubeMilieu | ellipse_2 | fissureCoude_1 | fissureCoude_6 | vis_1 |\r
+--------------------+--------------------+--------------------+-----------------+-----------------+\r
-| cubeTransverse | eprouvetteCourbe | fissureCoude_10 | fissureCoude_7 | tube |\r
+| cubeTransverse | eprouvetteCourbe | fissureCoude_10 | fissureCoude_7 | |\r
+--------------------+--------------------+--------------------+-----------------+-----------------+\r
| cylindre | eprouvetteDroite | fissureCoude_2 | fissureCoude_8 | |\r
+--------------------+--------------------+--------------------+-----------------+-----------------+\r
\r
-3) **To execute only one test case**::\r
-\r
- from blocFissure.CasTests.[TEST_CASE_NAME] import [TEST_CASE_NAME]\r
-\r
- [TEST_CASE_NAME](0).executeProbleme()\r
-\r
-[TEST_CASE_NAME] is the name of the test case in the previous list. Note that the test cases fissureCoude_4 and fissure_Coude_4 are very similar.\r
-\r
-\r
-\r
# --- inventaire des faces de peau coupées par la fissure
- ptEdgeFond, fsFissuExt, edFisExtPe, edFisExtPi, \
- facesPeaux, edCircPeau, ptCircPeau, gpedgeBord, gpedgeVifs, edFissPeau, ptFisExtPi, \
+ ptEdgeFond, fsFissuExt, edFisExtPe, edFisExtPi, facesPeaux, edCircPeau, \
+ gpedgeBord, gpedgeVifs, edFissPeau, ptFisExtPi, \
edgeRadFacePipePeau, facesPipePeau = \
construitFissureGenerale_b( partitionsPeauFissFond, \
edgesPipeFiss, edgesFondFiss, wireFondFiss, aretesVivesC, \
# --- maillage faces de peau
meshesFacesPeau = mailleFacesPeau(partitionsPeauFissFond, idFillingFromBout, facesDefaut, \
- facesPeaux, edCircPeau, ptCircPeau, gpedgeBord, gpedgeVifs, edFissPeau, \
+ facesPeaux, edCircPeau, gpedgeBord, gpedgeVifs, edFissPeau, \
bordsLibres, grpEdgesPeauFissureExterne, grpAretesVives, \
edgesCircPipeGroup, dmoyen, rayonPipe, nbsegRad, \
mailleur, nro_cas)
edFisExtPi = [ list() for _ in range(nbFacesFilling)] # pour chaque face [edge commun au pipe des faces de fissure externes]
facesPeaux = [None for _ in range(nbFacesFilling)] # pour chaque face : la face de peau finale a mailler (percée des faces débouchantes)
edCircPeau = [ list() for _ in range(nbFacesFilling)] # pour chaque face de peau : [subshape edge circulaire aux débouchés du pipe]
- ptCircPeau = [ list() for _ in range(nbFacesFilling)] # pour chaque face de peau : [subshape point sur edge circulaire aux débouchés du pipe]
gpedgeBord = [None for _ in range(nbFacesFilling)] # pour chaque face de peau : groupe subshape des edges aux bords liés à la partie saine
gpedgeVifs = [None for _ in range(nbFacesFilling)] # pour chaque face de peau : groupes subshape des edges aux arêtes vives entre fillings
edFissPeau = [ list() for _ in range(nbFacesFilling)] # pour chaque face de peau : [subshape edge en peau des faces de fissure externes]
edFisExtPi[ifil] = dataPPFF['edgesFissExtPipe']
facesPeaux[ifil] = dataPPFF['facePeau']
edCircPeau[ifil] = dataPPFF['edgesCircPeau']
- ptCircPeau[ifil] = dataPPFF['verticesCircPeau']
gpedgeBord[ifil] = dataPPFF['groupEdgesBordPeau']
gpedgeVifs[ifil] = dataPPFF['bordsVifs']
edFissPeau[ifil] = dataPPFF['edgesFissurePeau']
geomPublish(initLog.debug, avc, name, nro_cas)
return ptEdgeFond, fsFissuExt, edFisExtPe, edFisExtPi, facesPeaux, edCircPeau, \
- ptCircPeau, gpedgeBord, gpedgeVifs, edFissPeau, ptFisExtPi, \
+ gpedgeBord, gpedgeVifs, edFissPeau, ptFisExtPi, \
edgeRadFacePipePeau, facesPipePeau
"""
nomProbleme = "fissureGenerique"
+ maillageFissure = None
geomParams = dict()
meshParams = dict()
shapeFissureParams = dict()
if step == 4:
return
- maillageFissure = self.genereMaillageFissure(geometriesSaines, maillagesSains, \
- shapesFissure, self.shapeFissureParams, self.maillageFissureParams, \
- elementsDefaut, step, mailleur)
+ self.maillageFissure = self.genereMaillageFissure(geometriesSaines, maillagesSains, \
+ shapesFissure, self.shapeFissureParams, self.maillageFissureParams, \
+ elementsDefaut, step, mailleur)
self.setReferencesMaillageFissure()
- ok_maillage = getStatsMaillageFissure(maillageFissure, self.referencesMaillageFissure, self.maillageFissureParams)
+ ok_maillage = getStatsMaillageFissure(self.maillageFissure, self.referencesMaillageFissure, self.maillageFissureParams)
return ok_maillage
# --- edges de la face de peau partagées avec la face de fissure
edgesFissurePeau = identifieEdgesPeau_c(verticesPipePeau, facePeau, edgesListees, verticesCircPeau)
- return (endsEdgeFond, facesPipePeau, edgeRadFacePipePeau,
- edgesCircPeau, verticesCircPeau, groupEdgesBordPeau,
+ return (endsEdgeFond, facesPipePeau, edgeRadFacePipePeau, \
+ edgesCircPeau, groupEdgesBordPeau, \
bordsVifs, edgesFissurePeau, aretesVivesCoupees)
nro_cas=None):
"""Identification précise des edges et disques des faces de peau selon index extremité fissure"""
logging.info('start')
+ logging.info("Traitement des arêtes de '%s'", facePeau.GetName())
for face in facesPeauSorted[:-1]: # la ou les faces débouchantes, pas la grande face de peau
logging.debug("examen face debouchante circulaire")
sharedVertices = geompy.GetSharedShapesMulti([face, edgesPeauFondIn[j_aux_0]], geompy.ShapeType["VERTEX"])
nameFace = "facePipePeau_{}".format(i_aux)
nameVert = "endEdgeFond_{}".format(i_aux)
- nameEdge = "edgeRadFacePipePeau_{}".format(i_aux)
facesPipePeau[i_aux] = face
endsEdgeFond[i_aux] = sharedVertices[0]
geomPublish(initLog.debug, face, nameFace, nro_cas)
for edge in edgesFace:
if geompy.MinDistance(edge, sharedVertices[0]) < 1e-3:
edgeRadFacePipePeau[i_aux] = edge
+ nameEdge = "edgeRadFacePipePeau_{}".format(i_aux)
geomPublish(initLog.debug, edge, nameEdge, nro_cas)
break
# --- edges elliptiques de la face de peau et points de jonction de la face externe de fissure
- logging.info("Traitement des arêtes de '%s'", facePeau.GetName())
- edgesCircPeau = [None for _ in range(len(facesPipePeau))]
- verticesCircPeau = [None for _ in range(len(facesPipePeau))]
+ logging.info('Nombre de faces : len(facesPipePeau) = %d', len(facesPipePeau))
+ edgesCircPeau = list()
+ verticesCircPeau = list()
for i_aux,fcirc in enumerate(facesPipePeau):
- logging.info(". Partage avec la face '%s'", fcirc.GetName())
+ # Arêtes
edges = geompy.GetSharedShapesMulti([facePeau, fcirc], geompy.ShapeType["EDGE"])
- grpEdgesCirc = geompy.CreateGroup(facePeau, geompy.ShapeType["EDGE"])
- geompy.UnionList(grpEdgesCirc, edges)
- edgesCircPeau[i_aux] = grpEdgesCirc
- name = "edgeCirc_{}".format(i_aux)
- geomPublishInFather(initLog.always, facePeau, grpEdgesCirc, name)
+ groupe = geompy.CreateGroup(facePeau, geompy.ShapeType["EDGE"])
+ geompy.UnionList(groupe, edges)
+ geomPublishInFather(initLog.always, facePeau, groupe, "edgeCirc_{}".format(i_aux))
+ edgesCircPeau.append(groupe)
edgesListees = edgesListees + edges
+ # Sommets
vertices = geompy.GetSharedShapesMulti([facePeau, fcirc], geompy.ShapeType["VERTEX"])
- grpVertCircPeau = geompy.CreateGroup(facePeau, geompy.ShapeType["VERTEX"])
- geompy.UnionList(grpVertCircPeau, vertices)
- verticesCircPeau[i_aux] = grpVertCircPeau
- name = "pointEdgeCirc_{}".format(i_aux)
- geomPublishInFather(initLog.info, facePeau, grpVertCircPeau, name)
+ groupe = geompy.CreateGroup(facePeau, geompy.ShapeType["VERTEX"])
+ geompy.UnionList(groupe, vertices)
+ geomPublishInFather(initLog.info, facePeau, groupe, "point(s)EdgeCirc_{}".format(i_aux))
+ verticesCircPeau.append(groupe)
- logging.info('==> Nombre de sommets : len(verticesCircPeau) = %d', len(verticesCircPeau))
+ logging.info("==> Nombre de groupes d'arêtes : len(edgesCircPeau) = %d", len(edgesCircPeau))
+ logging.info("==> Nombre de groupes de sommets : len(verticesCircPeau) = %d", len(verticesCircPeau))
return edgesCircPeau, verticesCircPeau
"""edges de bord de la face de peau"""
logging.info('start')
+ # Liste des arêtes de bord
edgesFilling = geompy.ExtractShapes(fillingFaceExterne, geompy.ShapeType["EDGE"], False)
+ logging.info('Détermination des arêtes de bord à partir des %d arêtes de fillingFaceExterne', len(edgesFilling))
edgesBords = list()
for i_aux, edge in enumerate(edgesFilling):
edgepeau = geompy.GetInPlace(facePeau, edge)
if geompy.ShapeInfo(edgepeau)['EDGE'] > 1:
logging.debug(" EDGES multiples")
l_edges = geompy.ExtractShapes(edgepeau, geompy.ShapeType["EDGE"], False)
- edgesBords += l_edges
- edgesListees += l_edges
+ edgesBords.extend(l_edges)
+ edgesListees.extend(l_edges)
else:
logging.debug(" EDGE")
edgesBords.append(edgepeau)
edgesListees.append(edgepeau)
+ logging.info('==> Nombre d arêtes de bord : len(edgesBords) = %d', len(edgesBords))
groupEdgesBordPeau = geompy.CreateGroup(facePeau, geompy.ShapeType["EDGE"])
geompy.UnionList(groupEdgesBordPeau, edgesBords)
bordsVifs = None
if aretesVivesC is not None:
- logging.debug("identification des bords vifs par GetInPlace")
+ logging.info("identification des bords vifs par GetInPlace")
bordsVifs = geompy.GetInPlace(facePeau, aretesVivesC)
if bordsVifs is None:
logging.debug("pas d'identification des bords vifs par GetInPlace: test par distance")
if ( dist < 0.001 ):
edvifs.append(edge)
break
- if len(edvifs) >0:
+ if edvifs:
+ logging.info('==> Nombre d arêtes de bord vif : len(edvifs) = %d', len(edvifs))
bordsVifs = geompy.CreateGroup(facePeau,geompy.ShapeType["EDGE"])
for edge in edvifs:
geompy.AddObject(bordsVifs, geompy.GetSubShapeID(facePeau, edge))
logging.info('start')
logging.info("Traitement des arêtes de '%s'", facePeau.GetName())
logging.info('Nombre de sommets : len(verticesPipePeau) = %d', len(verticesPipePeau))
- #logging.info('verticesPipePeau = %s', verticesPipePeau)
- logging.info('Nombre de sommets : len(verticesCircPeau) = %d', len(verticesCircPeau))
- #logging.info('verticesCircPeau = %s', verticesCircPeau)
edgesPeau = geompy.ExtractShapes(facePeau, geompy.ShapeType["EDGE"], False)
logging.info('Nombre total d arêtes de la peau : len(edgesPeau) = %d', len(edgesPeau))
edges = substractSubShapes(facePeau, edgesPeau, edgesListees)
- edgesFissurePeau = list()
-# --- au moins une extrémité du pipe sur cette face de peau
+ l_edge_cercle = list()
+# --- au moins une extrémité du pipe sur cette face de peau : arêtes sui les prenent toutes
if verticesPipePeau:
- # En premier, les edges associés aux extrémités du pipe
- edgesFissurePeau = [None for _ in range(len(verticesCircPeau))]
- for edge in edges:
- for i_aux, vertex in enumerate(verticesCircPeau):
- logging.info(".. distance %s", geompy.MinDistance(vertex, edge))
- if ( ( geompy.MinDistance(vertex, edge) < 1.e-3 ) and ( edge not in edgesFissurePeau ) ):
- edgesFissurePeau[i_aux] = edge
- name = "edgeFissurePeau_{}".format(i_aux)
- logging.info("... entrée de %s à la place %d", edge, i_aux)
- geomPublishInFather(initLog.debug, facePeau, edge, name)
- # Ensuite, on ajoute les edges manquantes
+ i_aux = -1
for edge in edges:
- if edge not in edgesFissurePeau:
- logging.info("... ajout")
- edgesFissurePeau.append(edge)
+ for groupe in verticesCircPeau:
+ cercle = True
+ for id_vertex in geompy.GetObjectIDs(groupe):
+ vertex = geompy.GetSubShape(facePeau, [id_vertex])
+ distance = geompy.MinDistance(vertex, edge)
+ logging.info(".. distance %s", distance)
+ if ( distance > 1.e-3 ):
+ cercle = False
+ break
+ if cercle:
+ logging.info("... entrée de %s dans l_edge_cercle", edge)
+ l_edge_cercle.append(edge)
+ i_aux += 1
+ name = "edgeFissurePeauCercle_{}".format(i_aux)
+ geomPublishInFather(initLog.info, facePeau, edge, name)
- else:
- for i_aux, edge in enumerate(edges):
+# --- Les arêtes n'appartenant pas aux cercles
+ edgesFissurePeau = list()
+ for i_aux, edge in enumerate(edges):
+ if edge not in l_edge_cercle:
edgesFissurePeau.append(edge)
- name = "edgeFissurePeau{}".format(i_aux)
+ name = "edgeFissurePeau_{}".format(i_aux)
geomPublishInFather(initLog.debug, facePeau, edge, name)
logging.info('==> Nombre d arêtes : len(edgesFissurePeau) = %d', len(edgesFissurePeau))
from .identifieFacesPeau import identifieFacesPeau
from .identifieEdgesPeau import identifieEdgesPeau
-def identifieElementsGeometriquesPeau(ifil, partitionPeauFissFond, edgesPipeFiss, \
- edgesFondFiss, wireFondFiss, aretesVivesC, \
- facesDefaut, centreFondFiss, rayonPipe, \
- aretesVivesCoupees, \
+def identifieElementsGeometriquesPeau(ifil, partitionPeauFissFond, \
+ edgesPipeFiss, edgesFondFiss, wireFondFiss, aretesVivesC, \
+ facesDefaut, centreFondFiss, rayonPipe, aretesVivesCoupees, \
nro_cas=None):
"""Identification des éléments géométriques de la face de peau"""
logging.info('start')
# --- identification précise des edges et disques des faces de peau selon index extremité fissure
- (endsEdgeFond, facesPipePeau, edgeRadFacePipePeau, edgesCircPeau, verticesCircPeau, groupEdgesBordPeau, \
+ (endsEdgeFond, facesPipePeau, edgeRadFacePipePeau, \
+ edgesCircPeau, groupEdgesBordPeau, \
bordsVifs, edgesFissurePeau, aretesVivesCoupees) = \
identifieEdgesPeau(edgesFissExtPipe, verticesPipePeau, facePeau, facesPeauSorted, \
edgesPeauFondIn, fillingFaceExterne, aretesVivesC, aretesVivesCoupees, \
edgesFissExtPipe = edgesFissExtPipe, # pour chaque face [edge commun au pipe des faces de fissure externes]
facePeau = facePeau, # pour chaque face : la face de peau finale a mailler (percee des faces débouchantes)
edgesCircPeau = edgesCircPeau, # pour chaque face de peau : [groupe subshapes edges circulaires aux débouchés du pipe]
- verticesCircPeau = verticesCircPeau, # pour chaque face de peau : [groupe subshapes points sur edges circulaires aux débouchés du pipe]
groupEdgesBordPeau = groupEdgesBordPeau, # pour chaque face de peau : groupe subshape des edges aux bords liés à la partie saine
bordsVifs = bordsVifs, # pour chaque face de peau : groupe subshape des edges aux bords correspondant à des arêtes vives
edgesFissurePeau = edgesFissurePeau, # pour chaque face de peau : [subshape edge en peau des faces de fissure externes]
hypo2d.SetQuadAllowed( 0 )
putName(hypo2d, "faceFiss", i_pref=nro_cas)
- logging.info("UseExisting1DElements depuis '%s'", edgesPipeFissureExterneC.GetName())
+ logging.info("UseExisting1DElements sur la géométrie '%s' avec les mailles de '%s'", \
+ edgesPipeFissureExterneC.GetName(), edgeFaceFissGroup.GetName())
algo1d = meshFaceFiss.UseExisting1DElements(geom=edgesPipeFissureExterneC)
putName(algo1d.GetSubMesh(), "edgeFissPeau", i_pref=nro_cas)
hypo1d = algo1d.SourceEdges([ edgeFaceFissGroup ],0,0)
from .putName import putName
def mailleFacesPeau(partitionsPeauFissFond, idFillingFromBout, facesDefaut, \
- facesPeaux, edCircPeau, ptCircPeau, gpedgeBord, gpedgeVifs, edFissPeau, \
+ facesPeaux, edCircPeau, gpedgeBord, gpedgeVifs, edFissPeau, \
bordsLibres, grpEdgesPeauFissureExterne, grpAretesVives, \
edgesCircPipeGroup, dmoyen, rayonPipe, nbsegRad, \
mailleur="MeshGems", nro_cas=None):
# --- edges de bord de la face de filling
filling = facesDefaut[ifil]
edgesFilling = geompy.ExtractShapes(filling, geompy.ShapeType["EDGE"], False)
- groupEdgesBordPeau = geompy.CreateGroup(filling, geompy.ShapeType["EDGE"])
- geompy.UnionList(groupEdgesBordPeau, edgesFilling)
- geomPublishInFather(initLog.always, filling, groupEdgesBordPeau, "EdgesBords", nro_cas)
+ gpedgeBord[ifil] = geompy.CreateGroup(filling, geompy.ShapeType["EDGE"])
+ geompy.UnionList(gpedgeBord[ifil], edgesFilling)
+ geomPublishInFather(initLog.always, filling, gpedgeBord[ifil], "EdgesBords", nro_cas)
logging.info("UseExisting1DElements sur la géométrie '%s' avec les mailles de '%s'", \
- groupEdgesBordPeau.GetName(), bordsLibres.GetName())
- algo1d = meshFacePeau.UseExisting1DElements(geom=groupEdgesBordPeau)
+ gpedgeBord[ifil].GetName(), bordsLibres.GetName())
+ algo1d = meshFacePeau.UseExisting1DElements(geom=gpedgeBord[ifil])
putName(algo1d.GetSubMesh(), "bordsLibres", ifil, nro_cas)
hypo1d = algo1d.SourceEdges([ bordsLibres ],0,0)
putName(hypo1d, "SourceEdges_{}".format(bordsLibres.GetName()), ifil, nro_cas)
else:
logging.info("face de peau %d coupée par la fissure", ifil)
- edgesCircPeau = edCircPeau[ifil] # pour chaque face de peau : [subshape edge circulaire aux débouchés du pipe]
- _ = ptCircPeau[ifil] # pour chaque face de peau : [subshape point sur edge circulaire aux débouchés du pipe]
- groupEdgesBordPeau = gpedgeBord[ifil] # pour chaque face de peau : groupe subshape des edges aux bords liés à la partie saine
- bordsVifs = gpedgeVifs[ifil] # pour chaque face de peau : groupe subshape des edges aux bords correspondant à des arêtes vives
- edgesFissurePeau = edFissPeau[ifil] # pour chaque face de peau : [subshape edge en peau des faces de fissure externes]
+ # edCircPeau[ifil] # pour chaque face de peau : [subshape edge circulaire aux débouchés du pipe]
+ # gpedgeBord[ifil] : pour chaque face de peau : groupe subshape des edges aux bords liés à la partie saine
+ # gpedgeVifs[ifil] : pour chaque face de peau : groupe subshape des edges aux bords correspondant à des arêtes vives
+ # edFissPeau[ifil] : pour chaque face de peau : [subshape edge en peau des faces de fissure externes]
logging.info("UseExisting1DElements sur la géométrie '%s' avec les mailles de '%s'", \
- groupEdgesBordPeau.GetName(), bordsLibres.GetName())
- algo1d = meshFacePeau.UseExisting1DElements(geom=groupEdgesBordPeau)
+ gpedgeBord[ifil].GetName(), bordsLibres.GetName())
+ algo1d = meshFacePeau.UseExisting1DElements(geom=gpedgeBord[ifil])
putName(algo1d.GetSubMesh(), "bordsLibres", ifil, nro_cas)
hypo1d = algo1d.SourceEdges([ bordsLibres ],0,0)
putName(hypo1d, "SourceEdges_{}".format(bordsLibres.GetName()), i_pref=nro_cas)
- objet = geompy.MakeCompound(edgesFissurePeau)
- geomPublishInFather(initLog.always, facePeau, objet, "edgesFissurePeau")
+ objet = geompy.MakeCompound(edFissPeau[ifil])
+ geomPublishInFather(initLog.always, facePeau, objet, "edFissPeau_{}".format(ifil))
logging.info("UseExisting1DElements sur la géométrie '%s' avec les mailles de '%s'", \
objet.GetName(), grpEdgesPeauFissureExterne.GetName())
algo1d = meshFacePeau.UseExisting1DElements(geom=objet)
hypo1d = algo1d.SourceEdges([ grpEdgesPeauFissureExterne ],0,0)
putName(hypo1d, "SourceEdges_{}".format(grpEdgesPeauFissureExterne.GetName()), i_pref=nro_cas)
- if bordsVifs is not None:
+ if gpedgeVifs[ifil] is not None:
logging.info("UseExisting1DElements sur la géométrie '%s' avec les mailles de '%s'", \
- bordsVifs.GetName(), grpAretesVives.GetName())
- algo1d = meshFacePeau.UseExisting1DElements(geom=bordsVifs)
- putName(algo1d.GetSubMesh(), "bordsVifs", ifil, nro_cas)
+ gpedgeVifs[ifil].GetName(), grpAretesVives.GetName())
+ algo1d = meshFacePeau.UseExisting1DElements(geom=gpedgeVifs[ifil])
+ putName(algo1d.GetSubMesh(), "gpedgeVifs", ifil, nro_cas)
hypo1d = algo1d.SourceEdges([ grpAretesVives ],0,0)
putName(hypo1d, "SourceEdges_{}".format(grpAretesVives.GetName()), i_pref=nro_cas)
- for i_aux, edgeCirc in enumerate(edgesCircPeau):
+ for i_aux, edgeCirc in enumerate(edCircPeau[ifil]):
texte = "i_aux = {}".format(i_aux)
logging.info(texte)
if edgeCirc is not None:
cubeAngle.py
cubeFin.py
decoupeCylindre.py
- disque_perce.py
+ disquePerce.py
ellipse_disque.py
ellipse_probleme.py
ellipse.py
eprouvetteCourbe.py
eprouvetteDroite.py
- fissureGauche2.py
+ fissureGauche_2.py
fissureGauche.py
genereMateriel.py
tube.py
#
"""Géométries et maillages de base nécessaires aux cas-tests :
. cubeAngle
-. cubeAngle2
+. cubeAngle_2
"""
import os
--- /dev/null
+# -*- coding: iso-8859-1 -*-
+# Copyright (C) 2014-2021 EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+"""Géométrie et maillage de base nécessaire au cas-test :
+. disquePerce
+"""
+
+import os
+
+import logging
+
+import salome
+from salome.smesh import smeshBuilder
+from salome.StdMeshers import StdMeshersBuilder
+import GEOM
+import SMESH
+import SALOMEDS
+
+from blocFissure import gmu
+from blocFissure.gmu.geomsmesh import geompy
+from blocFissure.gmu.geomsmesh import geomPublish
+from blocFissure.gmu.geomsmesh import geomPublishInFather
+
+from blocFissure.gmu.triedreBase import triedreBase
+from blocFissure.gmu.putName import putName
+from blocFissure.gmu import initLog
+
+###
+### GEOM component
+###
+
+O, OX, OY, OZ = triedreBase()
+
+Cylinder_1 = geompy.MakeCylinderRH(100, 300)
+Cylinder_2 = geompy.MakeCylinderRH(600, 200)
+Cut_1 = geompy.MakeCut(Cylinder_2, Cylinder_1)
+Face_1 = geompy.MakeFaceHW(500, 1500, 3)
+Disque = geompy.MakePartition([Cut_1], [Face_1], [], [], geompy.ShapeType["SOLID"], 0, [], 0)
+[Compound_1, Compound_2, Compound_3, Compound_4] = geompy.Propagate(Disque)
+geompy.addToStudy( Disque, 'Disque' )
+geompy.addToStudyInFather( Disque, Compound_1, 'Compound_1' )
+geompy.addToStudyInFather( Disque, Compound_2, 'Compound_2' )
+geompy.addToStudyInFather( Disque, Compound_3, 'Compound_3' )
+geompy.addToStudyInFather( Disque, Compound_4, 'Compound_4' )
+
+geomPublish(initLog.debug, Cylinder_1, 'Cylinder_1' )
+geomPublish(initLog.debug, Cylinder_2, 'Cylinder_2' )
+geomPublish(initLog.debug, Cut_1, 'Cut_1' )
+geomPublish(initLog.debug, Face_1, 'Face_1' )
+
+###
+### SMESH component
+###
+
+smesh = smeshBuilder.New()
+Disque_1 = smesh.Mesh(Disque)
+putName(Disque_1.GetMesh(), 'Disque')
+
+Regular_1D = Disque_1.Segment()
+Nb_Segments_1 = Regular_1D.NumberOfSegments(10)
+Nb_Segments_1.SetDistrType( 0 )
+Hexa_3D = Disque_1.Hexahedron(algo=smeshBuilder.Hexa)
+Regular_1D_1 = Disque_1.Segment(geom=Compound_3)
+Nb_Segments_2 = Regular_1D_1.NumberOfSegments(20)
+Nb_Segments_2.SetDistrType( 0 )
+Regular_1D_2 = Disque_1.Segment(geom=Compound_4)
+status = Disque_1.AddHypothesis(Nb_Segments_2,Compound_4)
+Quadrangle_2D = Disque_1.Quadrangle(algo=smeshBuilder.QUADRANGLE)
+
+## set object names
+#smesh.SetName(Regular_1D.GetAlgorithm(), 'Regular_1D')
+#smesh.SetName(Quadrangle_2D.GetAlgorithm(), 'Quadrangle_2D')
+#smesh.SetName(Hexa_3D.GetAlgorithm(), 'Hexa_3D')
+putName(Nb_Segments_1, 'Nb. Segments_1', i_pref='Disque')
+putName(Nb_Segments_2, 'Nb. Segments_2', i_pref='Disque')
+
+is_done = Disque_1.Compute()
+text = "Disque_1.Compute"
+if is_done:
+ logging.info(text+" OK")
+else:
+ text = "Erreur au calcul du maillage.\n" + text
+ logging.info(text)
+ raise Exception(text)
+
+Disque_1.ExportMED(os.path.join(gmu.pathBloc, "materielCasTests", "disque.med"))
+
+if salome.sg.hasDesktop():
+ salome.sg.updateObjBrowser()
+++ /dev/null
-# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2014-2021 EDF R&D
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-"""Géométrie et maillage de base nécessaire au cas-test :
-. disque_perce
-"""
-
-import os
-
-import logging
-
-import salome
-from salome.smesh import smeshBuilder
-from salome.StdMeshers import StdMeshersBuilder
-import GEOM
-import SMESH
-import SALOMEDS
-
-from blocFissure import gmu
-from blocFissure.gmu.geomsmesh import geompy
-from blocFissure.gmu.geomsmesh import geomPublish
-from blocFissure.gmu.geomsmesh import geomPublishInFather
-
-from blocFissure.gmu.triedreBase import triedreBase
-from blocFissure.gmu.putName import putName
-from blocFissure.gmu import initLog
-
-###
-### GEOM component
-###
-
-O, OX, OY, OZ = triedreBase()
-
-Cylinder_1 = geompy.MakeCylinderRH(100, 300)
-Cylinder_2 = geompy.MakeCylinderRH(600, 200)
-Cut_1 = geompy.MakeCut(Cylinder_2, Cylinder_1)
-Face_1 = geompy.MakeFaceHW(500, 1500, 3)
-Disque = geompy.MakePartition([Cut_1], [Face_1], [], [], geompy.ShapeType["SOLID"], 0, [], 0)
-[Compound_1, Compound_2, Compound_3, Compound_4] = geompy.Propagate(Disque)
-geompy.addToStudy( Disque, 'Disque' )
-geompy.addToStudyInFather( Disque, Compound_1, 'Compound_1' )
-geompy.addToStudyInFather( Disque, Compound_2, 'Compound_2' )
-geompy.addToStudyInFather( Disque, Compound_3, 'Compound_3' )
-geompy.addToStudyInFather( Disque, Compound_4, 'Compound_4' )
-
-geomPublish(initLog.debug, Cylinder_1, 'Cylinder_1' )
-geomPublish(initLog.debug, Cylinder_2, 'Cylinder_2' )
-geomPublish(initLog.debug, Cut_1, 'Cut_1' )
-geomPublish(initLog.debug, Face_1, 'Face_1' )
-
-###
-### SMESH component
-###
-
-smesh = smeshBuilder.New()
-Disque_1 = smesh.Mesh(Disque)
-putName(Disque_1.GetMesh(), 'Disque')
-
-Regular_1D = Disque_1.Segment()
-Nb_Segments_1 = Regular_1D.NumberOfSegments(10)
-Nb_Segments_1.SetDistrType( 0 )
-Hexa_3D = Disque_1.Hexahedron(algo=smeshBuilder.Hexa)
-Regular_1D_1 = Disque_1.Segment(geom=Compound_3)
-Nb_Segments_2 = Regular_1D_1.NumberOfSegments(20)
-Nb_Segments_2.SetDistrType( 0 )
-Regular_1D_2 = Disque_1.Segment(geom=Compound_4)
-status = Disque_1.AddHypothesis(Nb_Segments_2,Compound_4)
-Quadrangle_2D = Disque_1.Quadrangle(algo=smeshBuilder.QUADRANGLE)
-
-## set object names
-#smesh.SetName(Regular_1D.GetAlgorithm(), 'Regular_1D')
-#smesh.SetName(Quadrangle_2D.GetAlgorithm(), 'Quadrangle_2D')
-#smesh.SetName(Hexa_3D.GetAlgorithm(), 'Hexa_3D')
-putName(Nb_Segments_1, 'Nb. Segments_1', i_pref='Disque')
-putName(Nb_Segments_2, 'Nb. Segments_2', i_pref='Disque')
-
-is_done = Disque_1.Compute()
-text = "Disque_1.Compute"
-if is_done:
- logging.info(text+" OK")
-else:
- text = "Erreur au calcul du maillage.\n" + text
- logging.info(text)
- raise Exception(text)
-
-Disque_1.ExportMED(os.path.join(gmu.pathBloc, "materielCasTests", "disque.med"))
-
-if salome.sg.hasDesktop():
- salome.sg.updateObjBrowser()
Vertex_3 = geompy.MakeVertex(420, -400, 300)
Vertex_4 = geompy.MakeVertex(500, 400, 500)
Box_1 = geompy.MakeBoxTwoPnt(Vertex_4, Vertex_3)
-ellipse1 = geompy.MakeCut(Scale_1, Box_1)
-[fondFiss] = geompy.SubShapes(ellipse1, [4])
+ellipse_1 = geompy.MakeCut(Scale_1, Box_1)
+[fondFiss] = geompy.SubShapes(ellipse_1, [4])
geompy.addToStudy( O, 'O' )
geompy.addToStudy( OX, 'OX' )
geompy.addToStudy( OY, 'OY' )
geompy.addToStudy( Vertex_3, 'Vertex_3' )
geompy.addToStudy( Vertex_4, 'Vertex_4' )
geompy.addToStudy( Box_1, 'Box_1' )
-geompy.addToStudy( ellipse1, 'ellipse1' )
-geompy.addToStudyInFather( ellipse1, fondFiss, 'fondFiss' )
-geompy.ExportBREP(ellipse1, os.path.join(gmu.pathBloc, "materielCasTests", "ellipse1.brep"))
+geompy.addToStudy( ellipse_1, 'ellipse_1' )
+geompy.addToStudyInFather( ellipse_1, fondFiss, 'fondFiss' )
+geompy.ExportBREP(ellipse_1, os.path.join(gmu.pathBloc, "materielCasTests", "ellipse_1.brep"))
if salome.sg.hasDesktop():
Vertex_4 = geompy.MakeVertex(100, 100, 50)
Box_1 = geompy.MakeBoxTwoPnt(Vertex_2, Vertex_4)
Cut_1 = geompy.MakeCut(Rotation_1, Box_1)
-ellipse1 = geompy.MakeTranslation(Cut_1, 400, 0, 400)
+ellipse_1 = geompy.MakeTranslation(Cut_1, 400, 0, 400)
geompy.addToStudy( Disk_1, 'Disk_1' )
geompy.addToStudy( O, 'O' )
geompy.addToStudy( OX, 'OX' )
geompy.addToStudy( Box_1, 'Box_1' )
geompy.addToStudy( Vertex_4, 'Vertex_4' )
geompy.addToStudy( Cut_1, 'Cut_1' )
-geompy.addToStudy( ellipse1, 'ellipse1_pb' )
-geompy.ExportBREP(ellipse1, os.path.join(gmu.pathBloc, "materielCasTests", "ellipse1_pb.brep"))
+geompy.addToStudy( ellipse_1, 'ellipse_1_pb' )
+geompy.ExportBREP(ellipse_1, os.path.join(gmu.pathBloc, "materielCasTests", "ellipse_1_pb.brep"))
if salome.sg.hasDesktop():
+++ /dev/null
-# -*- coding: utf-8 -*-
-# Copyright (C) 2014-2021 EDF R&D
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-"""Géométrie et maillage de base nécessaire au cas-test :
-. faceGauche_2
-"""
-
-import os
-import math
-
-import logging
-
-import salome
-from salome.smesh import smeshBuilder
-from salome.StdMeshers import StdMeshersBuilder
-import GEOM
-import SMESH
-import SALOMEDS
-
-from blocFissure import gmu
-from blocFissure.gmu.geomsmesh import geompy
-from blocFissure.gmu.geomsmesh import geomPublish
-from blocFissure.gmu.geomsmesh import geomPublishInFather
-
-from blocFissure.gmu.triedreBase import triedreBase
-from blocFissure.gmu.putName import putName
-from blocFissure.gmu import initLog
-
-###
-### GEOM component
-###
-
-O, OX, OY, OZ = triedreBase()
-
-Circle_1 = geompy.MakeCircle(O, OX, 500.)
-Extrusion_1 = geompy.MakePrismVecH2Ways(Circle_1, OX, 500)
-Vertex_1 = geompy.MakeVertex(500., 0., 0.)
-Circle_3 = geompy.MakeCircle(Vertex_1, OZ, 300)
-Extrusion_2 = geompy.MakePrismVecH(Circle_3, OZ, 1000)
-Partition_1 = geompy.MakePartition([Extrusion_1], [Extrusion_2], [], [], geompy.ShapeType["FACE"], 0, [], 0)
-[Face_1,Face_2] = geompy.SubShapes(Partition_1, [18, 13])
-
-FaceFissExt = geompy.MakeFuse(Face_2, Face_1)
-geompy.addToStudy( FaceFissExt, 'FaceFissExt' )
-geompy.ExportBREP(FaceFissExt, os.path.join(gmu.pathBloc, "materielCasTests", "faceGauche2Fiss.brep"))
-
-Vertex_2 = geompy.MakeVertex(0, -500, 0)
-Vertex_3 = geompy.MakeVertex(400, 500, 800)
-objetSain = geompy.MakeBoxTwoPnt(Vertex_3, Vertex_2)
-geompy.addToStudy( objetSain, 'objetSain' )
-
-Rotation_1 = geompy.MakeRotation(Extrusion_1, OX, math.pi)
-Partition_2 = geompy.MakePartition([Rotation_1], [Extrusion_2], [], [], geompy.ShapeType["FACE"], 0, [], 0)
-geompy.addToStudy( Partition_2, 'Partition_2' )
-[FaceFissExtSimple] = geompy.SubShapes(Partition_2, [13])
-geompy.addToStudyInFather( Partition_2, FaceFissExtSimple, 'FaceFissExtSimple' )
-Plane_1 = geompy.MakePlaneLCS(None, 2000., 3)
-
-FaceFissExtCoupe = geompy.MakePartition([FaceFissExtSimple], [Plane_1], [], [], geompy.ShapeType["FACE"], 0, [], 0)
-geompy.addToStudy( FaceFissExtCoupe, 'FaceFissExtCoupe' )
-
-geompy.ExportBREP(FaceFissExtCoupe, os.path.join(gmu.pathBloc, "materielCasTests", "faceGauche2FissCoupe.brep"))
-
-geomPublish(initLog.debug, Circle_1, 'Circle_1' )
-geomPublish(initLog.debug, Extrusion_1, 'Extrusion_1' )
-geomPublish(initLog.debug, Vertex_1, 'Vertex_1' )
-geomPublish(initLog.debug, Circle_3, 'Circle_3' )
-geomPublish(initLog.debug, Extrusion_2, 'Extrusion_2' )
-geomPublish(initLog.debug, Partition_1, 'Partition_1' )
-geomPublishInFather(initLog.debug, Partition_1, Face_1, 'Face_1' )
-geomPublishInFather(initLog.debug, Partition_1, Face_2, 'Face_2' )
-geomPublish(initLog.debug, Vertex_2, 'Vertex_2' )
-geomPublish(initLog.debug, Vertex_3, 'Vertex_3' )
-geomPublish(initLog.debug, Rotation_1, 'Rotation_1' )
-geomPublish(initLog.debug, Plane_1, 'Plane_1' )
-
-###
-### SMESH component
-###
-smesh = smeshBuilder.New()
-Mesh_1 = smesh.Mesh(objetSain)
-putName(Mesh_1.GetMesh(), 'Mesh_1')
-
-Regular_1D = Mesh_1.Segment()
-Nb_Segments_1 = Regular_1D.NumberOfSegments(15,[],[ ])
-Nb_Segments_1.SetDistrType( 0 )
-Quadrangle_2D = Mesh_1.Quadrangle(algo=smeshBuilder.QUADRANGLE)
-Hexa_3D = Mesh_1.Hexahedron(algo=smeshBuilder.Hexa)
-
-## set object names
-#smesh.SetName(Regular_1D.GetAlgorithm(), 'Regular_1D')
-#smesh.SetName(Quadrangle_2D.GetAlgorithm(), 'Quadrangle_2D')
-#smesh.SetName(Hexa_3D.GetAlgorithm(), 'Hexa_3D')
-putName(Nb_Segments_1, 'Nb. Segments_1', i_pref='fissuregauche2')
-
-is_done = Mesh_1.Compute()
-text = "Mesh_1.Compute"
-if is_done:
- logging.info(text+" OK")
-else:
- text = "Erreur au calcul du maillage.\n" + text
- logging.info(text)
- raise Exception(text)
-
-Mesh_1.ExportMED(os.path.join(gmu.pathBloc, "materielCasTests", "boiteSaine.med"))
-
-if salome.sg.hasDesktop():
- salome.sg.updateObjBrowser()
--- /dev/null
+# -*- coding: utf-8 -*-
+# Copyright (C) 2014-2021 EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+"""Géométrie et maillage de base nécessaire au cas-test :
+. faceGauche_2
+"""
+
+import os
+import math
+
+import logging
+
+import salome
+from salome.smesh import smeshBuilder
+from salome.StdMeshers import StdMeshersBuilder
+import GEOM
+import SMESH
+import SALOMEDS
+
+from blocFissure import gmu
+from blocFissure.gmu.geomsmesh import geompy
+from blocFissure.gmu.geomsmesh import geomPublish
+from blocFissure.gmu.geomsmesh import geomPublishInFather
+
+from blocFissure.gmu.triedreBase import triedreBase
+from blocFissure.gmu.putName import putName
+from blocFissure.gmu import initLog
+
+###
+### GEOM component
+###
+
+O, OX, OY, OZ = triedreBase()
+
+Circle_1 = geompy.MakeCircle(O, OX, 500.)
+Extrusion_1 = geompy.MakePrismVecH2Ways(Circle_1, OX, 500)
+Vertex_1 = geompy.MakeVertex(500., 0., 0.)
+Circle_3 = geompy.MakeCircle(Vertex_1, OZ, 300)
+Extrusion_2 = geompy.MakePrismVecH(Circle_3, OZ, 1000)
+Partition_1 = geompy.MakePartition([Extrusion_1], [Extrusion_2], [], [], geompy.ShapeType["FACE"], 0, [], 0)
+[Face_1,Face_2] = geompy.SubShapes(Partition_1, [18, 13])
+
+FaceFissExt = geompy.MakeFuse(Face_2, Face_1)
+geompy.addToStudy( FaceFissExt, 'FaceFissExt' )
+geompy.ExportBREP(FaceFissExt, os.path.join(gmu.pathBloc, "materielCasTests", "faceGauche2Fiss.brep"))
+
+Vertex_2 = geompy.MakeVertex(0, -500, 0)
+Vertex_3 = geompy.MakeVertex(400, 500, 800)
+objetSain = geompy.MakeBoxTwoPnt(Vertex_3, Vertex_2)
+geompy.addToStudy( objetSain, 'objetSain' )
+
+Rotation_1 = geompy.MakeRotation(Extrusion_1, OX, math.pi)
+Partition_2 = geompy.MakePartition([Rotation_1], [Extrusion_2], [], [], geompy.ShapeType["FACE"], 0, [], 0)
+geompy.addToStudy( Partition_2, 'Partition_2' )
+[FaceFissExtSimple] = geompy.SubShapes(Partition_2, [13])
+geompy.addToStudyInFather( Partition_2, FaceFissExtSimple, 'FaceFissExtSimple' )
+Plane_1 = geompy.MakePlaneLCS(None, 2000., 3)
+
+FaceFissExtCoupe = geompy.MakePartition([FaceFissExtSimple], [Plane_1], [], [], geompy.ShapeType["FACE"], 0, [], 0)
+geompy.addToStudy( FaceFissExtCoupe, 'FaceFissExtCoupe' )
+
+geompy.ExportBREP(FaceFissExtCoupe, os.path.join(gmu.pathBloc, "materielCasTests", "faceGauche2FissCoupe.brep"))
+
+geomPublish(initLog.debug, Circle_1, 'Circle_1' )
+geomPublish(initLog.debug, Extrusion_1, 'Extrusion_1' )
+geomPublish(initLog.debug, Vertex_1, 'Vertex_1' )
+geomPublish(initLog.debug, Circle_3, 'Circle_3' )
+geomPublish(initLog.debug, Extrusion_2, 'Extrusion_2' )
+geomPublish(initLog.debug, Partition_1, 'Partition_1' )
+geomPublishInFather(initLog.debug, Partition_1, Face_1, 'Face_1' )
+geomPublishInFather(initLog.debug, Partition_1, Face_2, 'Face_2' )
+geomPublish(initLog.debug, Vertex_2, 'Vertex_2' )
+geomPublish(initLog.debug, Vertex_3, 'Vertex_3' )
+geomPublish(initLog.debug, Rotation_1, 'Rotation_1' )
+geomPublish(initLog.debug, Plane_1, 'Plane_1' )
+
+###
+### SMESH component
+###
+smesh = smeshBuilder.New()
+Mesh_1 = smesh.Mesh(objetSain)
+putName(Mesh_1.GetMesh(), 'Mesh_1')
+
+Regular_1D = Mesh_1.Segment()
+Nb_Segments_1 = Regular_1D.NumberOfSegments(15,[],[ ])
+Nb_Segments_1.SetDistrType( 0 )
+Quadrangle_2D = Mesh_1.Quadrangle(algo=smeshBuilder.QUADRANGLE)
+Hexa_3D = Mesh_1.Hexahedron(algo=smeshBuilder.Hexa)
+
+## set object names
+#smesh.SetName(Regular_1D.GetAlgorithm(), 'Regular_1D')
+#smesh.SetName(Quadrangle_2D.GetAlgorithm(), 'Quadrangle_2D')
+#smesh.SetName(Hexa_3D.GetAlgorithm(), 'Hexa_3D')
+putName(Nb_Segments_1, 'Nb. Segments_1', i_pref='fissuregauche2')
+
+is_done = Mesh_1.Compute()
+text = "Mesh_1.Compute"
+if is_done:
+ logging.info(text+" OK")
+else:
+ text = "Erreur au calcul du maillage.\n" + text
+ logging.info(text)
+ raise Exception(text)
+
+Mesh_1.ExportMED(os.path.join(gmu.pathBloc, "materielCasTests", "boiteSaine.med"))
+
+if salome.sg.hasDesktop():
+ salome.sg.updateObjBrowser()
from blocFissure.materielCasTests import cubeAngle
from blocFissure.materielCasTests import cubeFin
from blocFissure.materielCasTests import decoupeCylindre
-from blocFissure.materielCasTests import disque_perce
+from blocFissure.materielCasTests import disquePerce
from blocFissure.materielCasTests import ellipse_disque
from blocFissure.materielCasTests import ellipse
from blocFissure.materielCasTests import ellipse_probleme
from blocFissure.materielCasTests import eprouvetteCourbe
from blocFissure.materielCasTests import eprouvetteDroite
from blocFissure.materielCasTests import fissureGauche
-from blocFissure.materielCasTests import fissureGauche2
+from blocFissure.materielCasTests import fissureGauche_2
from blocFissure.materielCasTests import vis
from blocFissure.materielCasTests import tube
${Boost_INCLUDE_DIRS}
${OMNIORB_INCLUDE_DIR}
${LIBXML2_INCLUDE_DIR}
+ ${MEDCOUPLING_INCLUDE_DIRS}
${PROJECT_SOURCE_DIR}/src/SMESH
${PROJECT_SOURCE_DIR}/src/SMESH_I
${PROJECT_SOURCE_DIR}/src/SMESHDS