SMESH Engine.
nmailles[9]++;
break;
}
+ case 4 :
+ {
+ elem_Id[7].push_back(elem->GetID());
+ nmailles[7]++;
+ break;
+ }
}
}
LDFLAGS+= $(HDF5_LIBS) $(MED2_LIBS) -lOpUtil -lSMESHDS -lSMDS -lMEFISTO2D -lMeshDriverDAT -lMeshDriverMED -lMeshDriverUNV -L${KERNEL_ROOT_DIR}/lib/salome
+ifeq (@WITHNETGEN@,yes)
+ EXPORT_HEADERS+= SMESH_Tetra_3D.hxx
+ LIB_SRC+= SMESH_Tetra_3D.cxx
+ NETGEN_INCLUDES=@NETGEN_INCLUDES@
+ CPPFLAGS+= $(NETGEN_INCLUDES)
+ CXXFLAGS+= $(NETGEN_INCLUDES)
+ LDFLAGS+= -lNETGEN
+endif
+
@CONCLUDE@
#include "SMESH_LengthFromEdges.hxx"
#include "SMESH_NumberOfSegments.hxx"
#include "SMESH_MaxElementArea.hxx"
+#include "SMESH_MaxElementVolume.hxx"
#include "SMESH_Regular_1D.hxx"
#include "SMESH_MEFISTO_2D.hxx"
#include "SMESH_Quadrangle_2D.hxx"
#include "SMESH_Hexa_3D.hxx"
+#include "SMESH_Tetra_3D.hxx"
//---------------------------------------
_creatorMap["NumberOfSegments"] = new SMESH_HypothesisCreator<SMESH_NumberOfSegments>;
_creatorMap["LengthFromEdges"] = new SMESH_HypothesisCreator<SMESH_LengthFromEdges>;
_creatorMap["MaxElementArea"] = new SMESH_HypothesisCreator<SMESH_MaxElementArea>;
+_creatorMap["MaxElementVolume"] = new SMESH_HypothesisCreator<SMESH_MaxElementVolume>;
_creatorMap["Regular_1D"] = new SMESH_HypothesisCreator<SMESH_Regular_1D>;
_creatorMap["MEFISTO_2D"] = new SMESH_HypothesisCreator<SMESH_MEFISTO_2D>;
_creatorMap["Quadrangle_2D"] = new SMESH_HypothesisCreator<SMESH_Quadrangle_2D>;
_creatorMap["Hexa_3D"] = new SMESH_HypothesisCreator<SMESH_Hexa_3D>;
-
+_creatorMap["Tetra_3D"] = new SMESH_HypothesisCreator<SMESH_Tetra_3D>;
//---------------------------------------
}
// $Header$
using namespace std;
+
+#include "SMESH_MaxElementVolume.hxx"
+#include "utilities.h"
+
+//=============================================================================
+/*!
+ *
+ */
+//=============================================================================
+
+SMESH_MaxElementVolume::SMESH_MaxElementVolume(int hypId, int studyId, SMESH_Gen* gen)
+ : SMESH_Hypothesis(hypId, studyId, gen)
+{
+ _maxVolume =1.;
+ _name = "MaxElementVolume";
+// SCRUTE(_name);
+ SCRUTE(&_name);
+}
+
+//=============================================================================
+/*!
+ *
+ */
+//=============================================================================
+
+SMESH_MaxElementVolume::~SMESH_MaxElementVolume()
+{
+ MESSAGE("SMESH_MaxElementVolume::~SMESH_MaxElementVolume");
+}
+
+//=============================================================================
+/*!
+ *
+ */
+//=============================================================================
+
+void SMESH_MaxElementVolume::SetMaxVolume(double maxVolume)
+ throw (SALOME_Exception)
+{
+ double oldVolume = _maxVolume;
+ if (maxVolume <= 0)
+ throw SALOME_Exception(LOCALIZED("maxVolume must be positive"));
+ _maxVolume = maxVolume;
+ if (_maxVolume != oldVolume)
+ NotifySubMeshesHypothesisModification();
+}
+
+//=============================================================================
+/*!
+ *
+ */
+//=============================================================================
+
+double SMESH_MaxElementVolume::GetMaxVolume() const
+{
+ return _maxVolume;
+}
+
+//=============================================================================
+/*!
+ *
+ */
+//=============================================================================
+
+ostream & SMESH_MaxElementVolume::SaveTo(ostream & save)
+{
+ return save << this;
+}
+
+//=============================================================================
+/*!
+ *
+ */
+//=============================================================================
+
+istream & SMESH_MaxElementVolume::LoadFrom(istream & load)
+{
+ return load >> (*this);
+}
+
+//=============================================================================
+/*!
+ *
+ */
+//=============================================================================
+
+ostream & operator << (ostream & save, SMESH_MaxElementVolume & hyp)
+{
+ save << hyp._maxVolume;
+ return save;
+}
+
+//=============================================================================
+/*!
+ *
+ */
+//=============================================================================
+
+istream & operator >> (istream & load, SMESH_MaxElementVolume & hyp)
+{
+ bool isOK = true;
+ double a;
+ isOK = (load >> a);
+ if (isOK) hyp._maxVolume = a;
+ else load.clear(ios::badbit | load.rdstate());
+ return load;
+}
+
// Module : SMESH
// $Header$
+#ifndef _SMESH_MAXELEMENTVOLUME_HXX_
+#define _SMESH_MAXELEMENTVOLUME_HXX_
+
+#include "SMESH_Hypothesis.hxx"
+#include "Utils_SALOME_Exception.hxx"
+
+class SMESH_MaxElementVolume:
+ public SMESH_Hypothesis
+{
+public:
+ SMESH_MaxElementVolume(int hypId, int studyId, SMESH_Gen* gen);
+ virtual ~SMESH_MaxElementVolume();
+
+ void SetMaxVolume(double maxVolume)
+ throw (SALOME_Exception);
+
+ double GetMaxVolume() const;
+
+ virtual ostream & SaveTo(ostream & save);
+ virtual istream & LoadFrom(istream & load);
+ friend ostream & operator << (ostream & save, SMESH_MaxElementVolume & hyp);
+ friend istream & operator >> (istream & load, SMESH_MaxElementVolume & hyp);
+
+protected:
+ double _maxVolume;
+};
+
+#endif
Hyp = myComponentMesh->CreateHypothesis( TypeAlgo, myStudyId );
else if ( TypeAlgo.compare("Hexa_3D") == 0 )
Hyp = myComponentMesh->CreateHypothesis( TypeAlgo, myStudyId );
+ else if ( TypeAlgo.compare("Tetra_3D") == 0 )
+ Hyp = myComponentMesh->CreateHypothesis( TypeAlgo, myStudyId );
if ( !Hyp->_is_nil() ) {
SALOMEDS::SObject_var SHyp = myStudyAPI.AddNewAlgorithms( Hyp );
double beforeMaxVolume = MEV->GetMaxElementVolume() ;
double MaxVolume = smeshGUI->Parameter( res,
beforeMaxVolume,
- tr("SMESH_MAX_ELEMENT_AREA_HYPOTHESIS"),
+ tr("SMESH_MAX_ELEMENT_VOLUME_HYPOTHESIS"),
tr("SMESH_VALUE"),
1.0E-5, 1E6, 6 ) ;
if ( res && MaxVolume != beforeMaxVolume ) {
}
case 5020:
{
- smeshGUI->CreateAlgorithm("Hexa_3D","Hexaedral (i,j,k)");
+ smeshGUI->CreateAlgorithm("Hexa_3D","Hexahedral (i,j,k)");
+ break;
+ }
+ case 5021:
+ {
+ smeshGUI->CreateAlgorithm("Tetra_3D","Tetrahedral (Netgen)");
break;
}
msgid "ICON_SMESH_TREE_ALGO_Quadrangle_2D"
msgstr "mesh_tree_algo_quad.png"
+#mesh_tree_algo_tetra
+msgid "ICON_SMESH_TREE_ALGO_Tetra_3D"
+msgstr "mesh_tree_algo_tetra.png"
+
#mesh_tree_hypo
msgid "ICON_SMESH_TREE_HYPO"
msgstr "mesh_tree_hypo.png"
LDFLAGS+= $(HDF5_LIBS) $(MED2_LIBS) -lSMESHimpl -lSalomeContainer -lSalomeNS -lSalomeDS -lRegistry -lSalomeHDFPersist -lOpUtil -lGEOMClient -lSMESHDS -lSMDS -lMEFISTO2D -lMeshDriverMED -lSalomeLifeCycleCORBA -L${KERNEL_ROOT_DIR}/lib/salome -L${GEOM_ROOT_DIR}/lib/salome
+ifeq (@WITHNETGEN@,yes)
+ LIB_SRC += SMESH_Tetra_3D_i.cxx
+ LDFLAGS += -lNETGEN
+endif
+
@CONCLUDE@
#include "SMESH_LocalLength_i.hxx"
#include "SMESH_NumberOfSegments_i.hxx"
#include "SMESH_MaxElementArea_i.hxx"
+#include "SMESH_MaxElementVolume_i.hxx"
#include "SMESHDS_Document.hxx"
//************branch 1 : hypothesis
if (gotBranch->Tag()==Tag_HypothesisRoot) { //hypothesis = tag 1
- double length,maxElementsArea;
+ double length,maxElementsArea,maxElementsVolume;
int numberOfSegments;
destFile = fopen( hypofile.ToCString() ,"w");
maxElementsArea = MEA->GetMaxElementArea();
fprintf(destFile,"%f\n",maxElementsArea);
}
+ else if (strcmp(myHyp->GetName(),"MaxElementVolume")==0) {
+ SMESH::SMESH_MaxElementVolume_var MEV = SMESH::SMESH_MaxElementVolume::_narrow( myHyp );
+ maxElementsVolume = MEV->GetMaxElementVolume();
+ fprintf(destFile,"%f\n",maxElementsVolume);
+ }
}
}
fclose(destFile);
//***************
if (strcmp(name,"Hypothesis")==0) {
- double length,maxElementsArea;
+ double length,maxElementsArea,maxElementsVolume;
int numberOfSegments;
hdf_group[Tag_HypothesisRoot] = new HDFgroup(name,hdf_file);
sprintf(objectId,"%d",MEA->GetId());
_SMESHCorbaObj[string("Hypo_")+string(objectId)] = iorString;
}
+ else if (strcmp(aLine,"MaxElementVolume")==0) {
+ SMESH::SMESH_Hypothesis_var myHyp = this->CreateHypothesis(aLine,studyId);
+ SMESH::SMESH_MaxElementVolume_var MEV = SMESH::SMESH_MaxElementVolume::_narrow( myHyp );
+ fscanf(loadedFile,"%s",aLine);
+ maxElementsVolume = atof(aLine);
+ MEV->SetMaxElementVolume(maxElementsVolume);
+ string iorString = _orb->object_to_string(MEV);
+ sprintf(objectId,"%d",MEV->GetId());
+ _SMESHCorbaObj[string("Hypo_")+string(objectId)] = iorString;
+ }
}
#include "SMESH_LocalLength_i.hxx"
#include "SMESH_NumberOfSegments_i.hxx"
#include "SMESH_MaxElementArea_i.hxx"
+#include "SMESH_MaxElementVolume_i.hxx"
#include "SMESH_Regular_1D_i.hxx"
#include "SMESH_MEFISTO_2D_i.hxx"
#include "SMESH_Quadrangle_2D_i.hxx"
#include "SMESH_Hexa_3D_i.hxx"
+#include "SMESH_Tetra_3D_i.hxx"
//---------------------------------------
_creatorMap["LocalLength"] = new HypothesisCreator_i<SMESH_LocalLength_i>;
_creatorMap["NumberOfSegments"] = new HypothesisCreator_i<SMESH_NumberOfSegments_i>;
_creatorMap["MaxElementArea"] = new HypothesisCreator_i<SMESH_MaxElementArea_i>;
+_creatorMap["MaxElementVolume"] = new HypothesisCreator_i<SMESH_MaxElementVolume_i>;
_creatorMap["Regular_1D"] = new HypothesisCreator_i<SMESH_Regular_1D_i>;
_creatorMap["MEFISTO_2D"] = new HypothesisCreator_i<SMESH_MEFISTO_2D_i>;
_creatorMap["Quadrangle_2D"] = new HypothesisCreator_i<SMESH_Quadrangle_2D_i>;
_creatorMap["Hexa_3D"] = new HypothesisCreator_i<SMESH_Hexa_3D_i>;
+_creatorMap["Tetra_3D"] = new HypothesisCreator_i<SMESH_Tetra_3D_i>;
//---------------------------------------
}
* CORBA: Accessor for Coordinate
*/
//=============================================================================
-double SMESH_MEDMesh_i::getCoordinate(CORBA::Long Number, CORBA::Long Axis)
+CORBA::Double SMESH_MEDMesh_i::getCoordinate(CORBA::Long Number, CORBA::Long Axis)
throw (SALOME::SALOME_Exception)
{
MESSAGE("!!!!!! NOT YET IMPLEMENTED !!!!");
SALOME_MED::double_array * getCoordinates(SALOME_MED::medModeSwitch typeSwitch)
throw(SALOME::SALOME_Exception);
- double getCoordinate(CORBA::Long Number, CORBA::Long Axis)
+ CORBA::Double getCoordinate(CORBA::Long Number, CORBA::Long Axis)
throw (SALOME::SALOME_Exception);
SALOME_MED::string_array * getCoordinatesNames()
// $Header$
using namespace std;
+
+#include "SMESH_MaxElementVolume_i.hxx"
+#include "SMESH_Gen.hxx"
+#include "SMESH_HypothesisFactory.hxx"
+
+#include "Utils_CorbaException.hxx"
+#include "utilities.h"
+
+//=============================================================================
+/*!
+ * Constructor:
+ * _name is related to the class name: prefix = SMESH_ ; suffix = _i .
+ */
+//=============================================================================
+
+SMESH_MaxElementVolume_i::SMESH_MaxElementVolume_i(const char* anHyp,
+ int studyId,
+ ::SMESH_Gen* genImpl)
+{
+ MESSAGE("SMESH_MaxElementVolume_i::SMESH_MaxElementVolume_i");
+ _impl = new ::SMESH_MaxElementVolume(genImpl->_hypothesisFactory.GetANewId(),
+ studyId,
+ genImpl);
+ _baseImpl = _impl;
+}
+
+//=============================================================================
+/*!
+ *
+ */
+//=============================================================================
+
+SMESH_MaxElementVolume_i::~SMESH_MaxElementVolume_i()
+{
+ MESSAGE("SMESH_MaxElementVolume_i::~SMESH_MaxElementVolume_i()");
+}
+
+//=============================================================================
+/*!
+ *
+ */
+//=============================================================================
+
+void SMESH_MaxElementVolume_i::SetMaxElementVolume(CORBA::Double volume)
+ throw (SALOME::SALOME_Exception)
+{
+ ASSERT(_impl);
+ try
+ {
+ _impl->SetMaxVolume(volume);
+ }
+ catch (SALOME_Exception& S_ex)
+ {
+ THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), \
+ SALOME::BAD_PARAM);
+ }
+}
+
+//=============================================================================
+/*!
+ *
+ */
+//=============================================================================
+
+CORBA::Double SMESH_MaxElementVolume_i::GetMaxElementVolume()
+{
+ ASSERT(_impl);
+ return _impl->GetMaxVolume();
+}
+
// Module : SMESH
// $Header$
+#ifndef _SMESH_MAXELEMENTVOLUME_I_HXX_
+#define _SMESH_MAXELEMENTVOLUME_I_HXX_
+
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER(SMESH_BasicHypothesis)
+
+#include "SMESH_Hypothesis_i.hxx"
+
+#include "SMESH_MaxElementVolume.hxx"
+
+class SMESH_MaxElementVolume_i:
+ public POA_SMESH::SMESH_MaxElementVolume,
+ public SMESH_Hypothesis_i
+{
+public:
+ SMESH_MaxElementVolume_i(const char* anHyp,
+ int studyId,
+ ::SMESH_Gen* genImpl);
+ virtual ~SMESH_MaxElementVolume_i();
+
+ void SetMaxElementVolume(CORBA::Double volume)
+ throw (SALOME::SALOME_Exception);
+
+ CORBA::Double GetMaxElementVolume();
+
+protected:
+ ::SMESH_MaxElementVolume* _impl;
+};
+
+#endif
SWIG_DEF = libSMESH_Swig.i
EXPORT_PYSCRIPTS = libSMESH_Swig.py \
- SMESH_test0.py SMESH_test1.py SMESH_test2.py SMESH_test3.py SMESH_mechanic.py SMESH_fixation.py batchmode_smesh.py
+ SMESH_test0.py\
+ SMESH_test1.py \
+ SMESH_test2.py \
+ SMESH_test3.py \
+ SMESH_mechanic.py \
+ SMESH_mechanic_tetra.py \
+ SMESH_fixation.py \
+ batchmode_smesh.py \
+ SMESH_box_tetra.py \
+ SMESH_box2_tetra.py
LIB_CLIENT_IDL = SALOMEDS.idl \
SALOME_Exception.idl \