mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-12-26 17:30:35 +05:00
first update of those files to administrate the integration of Netgen in the
SMESH Engine.
This commit is contained in:
parent
97f7fad1d3
commit
1a2bebb5ff
@ -361,6 +361,12 @@ void DriverMED_W_SMESHDS_Mesh::Add()
|
||||
nmailles[9]++;
|
||||
break;
|
||||
}
|
||||
case 4 :
|
||||
{
|
||||
elem_Id[7].push_back(elem->GetID());
|
||||
nmailles[7]++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -95,5 +95,14 @@ CXXFLAGS+= $(OCC_CXXFLAGS) $(MED2_INCLUDES) $(HDF5_INCLUDES) -I${KERNEL_ROOT_DIR
|
||||
|
||||
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@
|
||||
|
||||
|
@ -41,10 +41,12 @@ using namespace std;
|
||||
#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"
|
||||
|
||||
//---------------------------------------
|
||||
|
||||
@ -87,11 +89,12 @@ _creatorMap["LocalLength"] = new SMESH_HypothesisCreator<SMESH_LocalLength>;
|
||||
_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>;
|
||||
//---------------------------------------
|
||||
}
|
||||
|
||||
|
@ -27,3 +27,111 @@
|
||||
// $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;
|
||||
}
|
||||
|
||||
|
@ -26,3 +26,31 @@
|
||||
// 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
|
||||
|
@ -846,6 +846,8 @@ void SMESHGUI::CreateAlgorithm( QString TypeAlgo, QString NameAlgo )
|
||||
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 );
|
||||
@ -2283,7 +2285,7 @@ bool SMESHGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
|
||||
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 ) {
|
||||
@ -2487,7 +2489,12 @@ bool SMESHGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -168,6 +168,10 @@ msgstr "mesh_tree_algo_mefisto.png"
|
||||
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"
|
||||
|
@ -78,5 +78,10 @@ CXXFLAGS+= $(OCC_CXXFLAGS) $(MED2_INCLUDES) $(HDF5_INCLUDES) -I${KERNEL_ROOT_DIR
|
||||
|
||||
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@
|
||||
|
||||
|
@ -53,6 +53,7 @@ using namespace std;
|
||||
#include "SMESH_LocalLength_i.hxx"
|
||||
#include "SMESH_NumberOfSegments_i.hxx"
|
||||
#include "SMESH_MaxElementArea_i.hxx"
|
||||
#include "SMESH_MaxElementVolume_i.hxx"
|
||||
|
||||
#include "SMESHDS_Document.hxx"
|
||||
|
||||
@ -465,7 +466,7 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save(SALOMEDS::SComponent_ptr theComponent,
|
||||
//************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");
|
||||
@ -495,6 +496,11 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save(SALOMEDS::SComponent_ptr theComponent,
|
||||
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);
|
||||
@ -945,7 +951,7 @@ bool SMESH_Gen_i::Load(SALOMEDS::SComponent_ptr theComponent,
|
||||
//***************
|
||||
if (strcmp(name,"Hypothesis")==0) {
|
||||
|
||||
double length,maxElementsArea;
|
||||
double length,maxElementsArea,maxElementsVolume;
|
||||
int numberOfSegments;
|
||||
|
||||
hdf_group[Tag_HypothesisRoot] = new HDFgroup(name,hdf_file);
|
||||
@ -1000,6 +1006,16 @@ bool SMESH_Gen_i::Load(SALOMEDS::SComponent_ptr theComponent,
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -39,10 +39,12 @@ using namespace std;
|
||||
#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"
|
||||
|
||||
//---------------------------------------
|
||||
|
||||
@ -83,10 +85,12 @@ SMESH_HypothesisFactory_i::SMESH_HypothesisFactory_i()
|
||||
_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>;
|
||||
|
||||
//---------------------------------------
|
||||
}
|
||||
|
@ -196,7 +196,7 @@ SMESH_MEDMesh_i::existConnectivity(SALOME_MED::medConnectivity connectivityType,
|
||||
* 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 !!!!");
|
||||
|
@ -91,7 +91,7 @@ class SMESH_MEDMesh_i:
|
||||
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()
|
||||
|
@ -27,3 +27,73 @@
|
||||
// $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();
|
||||
}
|
||||
|
||||
|
@ -26,3 +26,33 @@
|
||||
// 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
|
||||
|
@ -39,7 +39,16 @@ LIB_SRC =
|
||||
|
||||
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 \
|
||||
|
Loading…
Reference in New Issue
Block a user