Correct spelling of FEM Netgen Mesh 'Fineness' parameter
This commit is contained in:
parent
c6fe925dfd
commit
65092be5f3
|
@ -42,7 +42,7 @@
|
||||||
#include <NETGENPlugin_SimpleHypothesis_3D.hxx>
|
#include <NETGENPlugin_SimpleHypothesis_3D.hxx>
|
||||||
#include <NETGENPlugin_Hypothesis.hxx>
|
#include <NETGENPlugin_Hypothesis.hxx>
|
||||||
#include <NETGENPlugin_Mesher.hxx>
|
#include <NETGENPlugin_Mesher.hxx>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <BRepBuilderAPI_Copy.hxx>
|
#include <BRepBuilderAPI_Copy.hxx>
|
||||||
#include <BRepTools.hxx>
|
#include <BRepTools.hxx>
|
||||||
|
@ -52,14 +52,14 @@ using namespace App;
|
||||||
|
|
||||||
PROPERTY_SOURCE(Fem::FemMeshShapeNetgenObject, Fem::FemMeshShapeObject)
|
PROPERTY_SOURCE(Fem::FemMeshShapeNetgenObject, Fem::FemMeshShapeObject)
|
||||||
|
|
||||||
const char* FininessEnums[]= {"VeryCoarse","Coarse","Moderate","Fine","VeryFine","UserDefined",NULL};
|
const char* FinenessEnums[]= {"VeryCoarse","Coarse","Moderate","Fine","VeryFine","UserDefined",NULL};
|
||||||
|
|
||||||
FemMeshShapeNetgenObject::FemMeshShapeNetgenObject()
|
FemMeshShapeNetgenObject::FemMeshShapeNetgenObject()
|
||||||
{
|
{
|
||||||
ADD_PROPERTY_TYPE(MaxSize,(1000), "MeshParams",Prop_None,"Maximum element size");
|
ADD_PROPERTY_TYPE(MaxSize,(1000), "MeshParams",Prop_None,"Maximum element size");
|
||||||
ADD_PROPERTY_TYPE(SecondOrder,(true), "MeshParams",Prop_None,"Create quadric elements");
|
ADD_PROPERTY_TYPE(SecondOrder,(true), "MeshParams",Prop_None,"Create quadric elements");
|
||||||
ADD_PROPERTY_TYPE(Fininess,(2), "MeshParams",Prop_None,"Fininess level of the mesh");
|
ADD_PROPERTY_TYPE(Fineness,(2), "MeshParams",Prop_None,"Fineness level of the mesh");
|
||||||
Fininess.setEnums(FininessEnums);
|
Fineness.setEnums(FinenessEnums);
|
||||||
ADD_PROPERTY_TYPE(GrowthRate,(0.3), "MeshParams",Prop_None," allows to define how much the linear dimensions of two adjacent cells can differ");
|
ADD_PROPERTY_TYPE(GrowthRate,(0.3), "MeshParams",Prop_None," allows to define how much the linear dimensions of two adjacent cells can differ");
|
||||||
ADD_PROPERTY_TYPE(NbSegsPerEdge,(1), "MeshParams",Prop_None,"allows to define the minimum number of mesh segments in which edges will be split");
|
ADD_PROPERTY_TYPE(NbSegsPerEdge,(1), "MeshParams",Prop_None,"allows to define the minimum number of mesh segments in which edges will be split");
|
||||||
ADD_PROPERTY_TYPE(NbSegsPerRadius,(2), "MeshParams",Prop_None,"allows to define the minimum number of mesh segments in which radiuses will be split");
|
ADD_PROPERTY_TYPE(NbSegsPerRadius,(2), "MeshParams",Prop_None,"allows to define the minimum number of mesh segments in which radiuses will be split");
|
||||||
|
@ -71,10 +71,10 @@ FemMeshShapeNetgenObject::~FemMeshShapeNetgenObject()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
App::DocumentObjectExecReturn *FemMeshShapeNetgenObject::execute(void)
|
App::DocumentObjectExecReturn *FemMeshShapeNetgenObject::execute(void)
|
||||||
{
|
{
|
||||||
#ifdef FCWithNetgen
|
#ifdef FCWithNetgen
|
||||||
|
|
||||||
Fem::FemMesh newMesh;
|
Fem::FemMesh newMesh;
|
||||||
|
|
||||||
Part::Feature *feat = Shape.getValue<Part::Feature*>();
|
Part::Feature *feat = Shape.getValue<Part::Feature*>();
|
||||||
|
@ -82,7 +82,7 @@ App::DocumentObjectExecReturn *FemMeshShapeNetgenObject::execute(void)
|
||||||
|
|
||||||
TopoDS_Shape shape = feat->Shape.getValue();
|
TopoDS_Shape shape = feat->Shape.getValue();
|
||||||
|
|
||||||
|
|
||||||
newMesh.getSMesh()->ShapeToMesh(shape);
|
newMesh.getSMesh()->ShapeToMesh(shape);
|
||||||
SMESH_Gen *myGen = newMesh.getGenerator();
|
SMESH_Gen *myGen = newMesh.getGenerator();
|
||||||
|
|
||||||
|
@ -91,26 +91,26 @@ App::DocumentObjectExecReturn *FemMeshShapeNetgenObject::execute(void)
|
||||||
NETGENPlugin_Mesher myNetGenMesher(newMesh.getSMesh(),shape,true);
|
NETGENPlugin_Mesher myNetGenMesher(newMesh.getSMesh(),shape,true);
|
||||||
|
|
||||||
//NETGENPlugin_SimpleHypothesis_2D * tet2 = new NETGENPlugin_SimpleHypothesis_2D(hyp++,1,myGen);
|
//NETGENPlugin_SimpleHypothesis_2D * tet2 = new NETGENPlugin_SimpleHypothesis_2D(hyp++,1,myGen);
|
||||||
//static_cast<NETGENPlugin_SimpleHypothesis_2D*>(tet2.get())->SetNumberOfSegments(5);
|
//static_cast<NETGENPlugin_SimpleHypothesis_2D*>(tet2.get())->SetNumberOfSegments(5);
|
||||||
//static_cast<NETGENPlugin_SimpleHypothesis_2D*>(tet2.get())->SetLocalLength(0.1);
|
//static_cast<NETGENPlugin_SimpleHypothesis_2D*>(tet2.get())->SetLocalLength(0.1);
|
||||||
//static_cast<NETGENPlugin_SimpleHypothesis_2D*>(tet2.get())->LengthFromEdges();
|
//static_cast<NETGENPlugin_SimpleHypothesis_2D*>(tet2.get())->LengthFromEdges();
|
||||||
//myNetGenMesher.SetParameters(tet2);
|
//myNetGenMesher.SetParameters(tet2);
|
||||||
|
|
||||||
//NETGENPlugin_SimpleHypothesis_3D* tet= new NETGENPlugin_SimpleHypothesis_3D(hyp++,1,myGen);
|
//NETGENPlugin_SimpleHypothesis_3D* tet= new NETGENPlugin_SimpleHypothesis_3D(hyp++,1,myGen);
|
||||||
//static_cast<NETGENPlugin_SimpleHypothesis_3D*>(tet.get())->LengthFromFaces();
|
//static_cast<NETGENPlugin_SimpleHypothesis_3D*>(tet.get())->LengthFromFaces();
|
||||||
//static_cast<NETGENPlugin_SimpleHypothesis_3D*>(tet.get())->SetMaxElementVolume(0.1);
|
//static_cast<NETGENPlugin_SimpleHypothesis_3D*>(tet.get())->SetMaxElementVolume(0.1);
|
||||||
//myNetGenMesher.SetParameters( tet);
|
//myNetGenMesher.SetParameters( tet);
|
||||||
|
|
||||||
NETGENPlugin_Hypothesis* tet= new NETGENPlugin_Hypothesis(hyp++,1,myGen);
|
NETGENPlugin_Hypothesis* tet= new NETGENPlugin_Hypothesis(hyp++,1,myGen);
|
||||||
tet->SetMaxSize(MaxSize.getValue());
|
tet->SetMaxSize(MaxSize.getValue());
|
||||||
tet->SetSecondOrder(SecondOrder.getValue());
|
tet->SetSecondOrder(SecondOrder.getValue());
|
||||||
tet->SetOptimize(Optimize.getValue());
|
tet->SetOptimize(Optimize.getValue());
|
||||||
int iFininess = Fininess.getValue();
|
int iFineness = Fineness.getValue();
|
||||||
tet->SetFineness((NETGENPlugin_Hypothesis::Fineness)iFininess);
|
tet->SetFineness((NETGENPlugin_Hypothesis::Fineness)iFineness);
|
||||||
if(iFininess == 5){
|
if(iFineness == 5){
|
||||||
tet->SetGrowthRate(GrowthRate.getValue());
|
tet->SetGrowthRate(GrowthRate.getValue());
|
||||||
tet->SetNbSegPerEdge(NbSegsPerEdge.getValue());
|
tet->SetNbSegPerEdge(NbSegsPerEdge.getValue());
|
||||||
tet->SetNbSegPerRadius(NbSegsPerRadius.getValue());
|
tet->SetNbSegPerRadius(NbSegsPerRadius.getValue());
|
||||||
}
|
}
|
||||||
myNetGenMesher.SetParameters( tet);
|
myNetGenMesher.SetParameters( tet);
|
||||||
|
|
||||||
|
@ -135,8 +135,8 @@ App::DocumentObjectExecReturn *FemMeshShapeNetgenObject::execute(void)
|
||||||
|
|
||||||
// set the value to the object
|
// set the value to the object
|
||||||
FemMesh.setValue(newMesh);
|
FemMesh.setValue(newMesh);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return App::DocumentObject::StdReturn;
|
return App::DocumentObject::StdReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -151,7 +151,7 @@ App::DocumentObjectExecReturn *FemMeshShapeNetgenObject::execute(void)
|
||||||
// // ref counter is set to 1
|
// // ref counter is set to 1
|
||||||
// PythonObject = Py::Object(new DocumentObjectPy(this),true);
|
// PythonObject = Py::Object(new DocumentObjectPy(this),true);
|
||||||
// }
|
// }
|
||||||
// return Py::new_reference_to(PythonObject);
|
// return Py::new_reference_to(PythonObject);
|
||||||
//}
|
//}
|
||||||
|
|
||||||
//void FemMeshShapeNetgenObject::onChanged(const Property* prop)
|
//void FemMeshShapeNetgenObject::onChanged(const Property* prop)
|
||||||
|
|
|
@ -43,10 +43,10 @@ public:
|
||||||
|
|
||||||
App::PropertyFloat MaxSize;
|
App::PropertyFloat MaxSize;
|
||||||
App::PropertyBool SecondOrder;
|
App::PropertyBool SecondOrder;
|
||||||
App::PropertyEnumeration Fininess;
|
App::PropertyEnumeration Fineness;
|
||||||
App::PropertyFloat GrowthRate;
|
App::PropertyFloat GrowthRate;
|
||||||
App::PropertyInteger NbSegsPerEdge;
|
App::PropertyInteger NbSegsPerEdge;
|
||||||
App::PropertyInteger NbSegsPerRadius;
|
App::PropertyInteger NbSegsPerRadius;
|
||||||
App::PropertyBool Optimize;
|
App::PropertyBool Optimize;
|
||||||
|
|
||||||
/// returns the type name of the ViewProvider
|
/// returns the type name of the ViewProvider
|
||||||
|
|
|
@ -50,7 +50,7 @@ using namespace Gui;
|
||||||
TaskTetParameter::TaskTetParameter(Fem::FemMeshShapeNetgenObject *pcObject,QWidget *parent)
|
TaskTetParameter::TaskTetParameter(Fem::FemMeshShapeNetgenObject *pcObject,QWidget *parent)
|
||||||
: TaskBox(Gui::BitmapFactory().pixmap("Fem_FemMesh_createnodebypoly"),
|
: TaskBox(Gui::BitmapFactory().pixmap("Fem_FemMesh_createnodebypoly"),
|
||||||
tr("Tet Parameter"),
|
tr("Tet Parameter"),
|
||||||
true,
|
true,
|
||||||
parent),
|
parent),
|
||||||
pcObject(pcObject)
|
pcObject(pcObject)
|
||||||
{
|
{
|
||||||
|
@ -63,7 +63,7 @@ TaskTetParameter::TaskTetParameter(Fem::FemMeshShapeNetgenObject *pcObject,QWidg
|
||||||
this->groupLayout()->addWidget(proxy);
|
this->groupLayout()->addWidget(proxy);
|
||||||
|
|
||||||
ui->doubleSpinBox_MaxSize->setValue(pcObject->MaxSize.getValue());
|
ui->doubleSpinBox_MaxSize->setValue(pcObject->MaxSize.getValue());
|
||||||
ui->comboBox_Fineness->setCurrentIndex(pcObject->Fininess.getValue());
|
ui->comboBox_Fineness->setCurrentIndex(pcObject->Fineness.getValue());
|
||||||
ui->checkBox_SecondOrder->setChecked(pcObject->SecondOrder.getValue());
|
ui->checkBox_SecondOrder->setChecked(pcObject->SecondOrder.getValue());
|
||||||
ui->doubleSpinBox_GrowthRate->setValue(pcObject->GrowthRate.getValue());
|
ui->doubleSpinBox_GrowthRate->setValue(pcObject->GrowthRate.getValue());
|
||||||
ui->spinBox_SegsPerEdge->setValue(pcObject->NbSegsPerEdge.getValue());
|
ui->spinBox_SegsPerEdge->setValue(pcObject->NbSegsPerEdge.getValue());
|
||||||
|
@ -103,7 +103,7 @@ void TaskTetParameter::SwitchMethod(int Value)
|
||||||
ui->spinBox_SegsPerRadius->setEnabled(false);
|
ui->spinBox_SegsPerRadius->setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
pcObject->Fininess.setValue(Value);
|
pcObject->Fineness.setValue(Value);
|
||||||
touched = true;
|
touched = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user