Skip to content

Commit

Permalink
Correct spelling of FEM Netgen Mesh 'Fineness' parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
crobarcro authored and wwmayer committed Jan 12, 2015
1 parent c6fe925 commit 65092be
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 29 deletions.
48 changes: 24 additions & 24 deletions src/Mod/Fem/App/FemMeshShapeNetgenObject.cpp
Expand Up @@ -42,7 +42,7 @@
#include <NETGENPlugin_SimpleHypothesis_3D.hxx>
#include <NETGENPlugin_Hypothesis.hxx>
#include <NETGENPlugin_Mesher.hxx>
#endif
#endif

#include <BRepBuilderAPI_Copy.hxx>
#include <BRepTools.hxx>
Expand All @@ -52,14 +52,14 @@ using namespace App;

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()
{
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(Fininess,(2), "MeshParams",Prop_None,"Fininess level of the mesh");
Fininess.setEnums(FininessEnums);
ADD_PROPERTY_TYPE(Fineness,(2), "MeshParams",Prop_None,"Fineness level of the mesh");
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(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");
Expand All @@ -71,18 +71,18 @@ FemMeshShapeNetgenObject::~FemMeshShapeNetgenObject()
{
}

App::DocumentObjectExecReturn *FemMeshShapeNetgenObject::execute(void)
App::DocumentObjectExecReturn *FemMeshShapeNetgenObject::execute(void)
{
#ifdef FCWithNetgen

Fem::FemMesh newMesh;

Part::Feature *feat = Shape.getValue<Part::Feature*>();


TopoDS_Shape shape = feat->Shape.getValue();


newMesh.getSMesh()->ShapeToMesh(shape);
SMESH_Gen *myGen = newMesh.getGenerator();

Expand All @@ -91,26 +91,26 @@ App::DocumentObjectExecReturn *FemMeshShapeNetgenObject::execute(void)
NETGENPlugin_Mesher myNetGenMesher(newMesh.getSMesh(),shape,true);

//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())->SetLocalLength(0.1);
//static_cast<NETGENPlugin_SimpleHypothesis_2D*>(tet2.get())->LengthFromEdges();
//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())->LengthFromEdges();
//myNetGenMesher.SetParameters(tet2);

//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())->SetMaxElementVolume(0.1);
//static_cast<NETGENPlugin_SimpleHypothesis_3D*>(tet.get())->LengthFromFaces();
//static_cast<NETGENPlugin_SimpleHypothesis_3D*>(tet.get())->SetMaxElementVolume(0.1);
//myNetGenMesher.SetParameters( tet);

NETGENPlugin_Hypothesis* tet= new NETGENPlugin_Hypothesis(hyp++,1,myGen);
tet->SetMaxSize(MaxSize.getValue());
tet->SetSecondOrder(SecondOrder.getValue());
tet->SetOptimize(Optimize.getValue());
int iFininess = Fininess.getValue();
tet->SetFineness((NETGENPlugin_Hypothesis::Fineness)iFininess);
if(iFininess == 5){
tet->SetGrowthRate(GrowthRate.getValue());
tet->SetNbSegPerEdge(NbSegsPerEdge.getValue());
tet->SetNbSegPerRadius(NbSegsPerRadius.getValue());
tet->SetMaxSize(MaxSize.getValue());
tet->SetSecondOrder(SecondOrder.getValue());
tet->SetOptimize(Optimize.getValue());
int iFineness = Fineness.getValue();
tet->SetFineness((NETGENPlugin_Hypothesis::Fineness)iFineness);
if(iFineness == 5){
tet->SetGrowthRate(GrowthRate.getValue());
tet->SetNbSegPerEdge(NbSegsPerEdge.getValue());
tet->SetNbSegPerRadius(NbSegsPerRadius.getValue());
}
myNetGenMesher.SetParameters( tet);

Expand All @@ -135,8 +135,8 @@ App::DocumentObjectExecReturn *FemMeshShapeNetgenObject::execute(void)

// set the value to the object
FemMesh.setValue(newMesh);
#endif
#endif

return App::DocumentObject::StdReturn;
}

Expand All @@ -151,7 +151,7 @@ App::DocumentObjectExecReturn *FemMeshShapeNetgenObject::execute(void)
// // ref counter is set to 1
// 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)
Expand Down
4 changes: 2 additions & 2 deletions src/Mod/Fem/App/FemMeshShapeNetgenObject.h
Expand Up @@ -43,10 +43,10 @@ class AppFemExport FemMeshShapeNetgenObject : public FemMeshShapeObject

App::PropertyFloat MaxSize;
App::PropertyBool SecondOrder;
App::PropertyEnumeration Fininess;
App::PropertyEnumeration Fineness;
App::PropertyFloat GrowthRate;
App::PropertyInteger NbSegsPerEdge;
App::PropertyInteger NbSegsPerRadius;
App::PropertyInteger NbSegsPerRadius;
App::PropertyBool Optimize;

/// returns the type name of the ViewProvider
Expand Down
6 changes: 3 additions & 3 deletions src/Mod/Fem/Gui/TaskTetParameter.cpp
Expand Up @@ -50,7 +50,7 @@ using namespace Gui;
TaskTetParameter::TaskTetParameter(Fem::FemMeshShapeNetgenObject *pcObject,QWidget *parent)
: TaskBox(Gui::BitmapFactory().pixmap("Fem_FemMesh_createnodebypoly"),
tr("Tet Parameter"),
true,
true,
parent),
pcObject(pcObject)
{
Expand All @@ -63,7 +63,7 @@ TaskTetParameter::TaskTetParameter(Fem::FemMeshShapeNetgenObject *pcObject,QWidg
this->groupLayout()->addWidget(proxy);

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->doubleSpinBox_GrowthRate->setValue(pcObject->GrowthRate.getValue());
ui->spinBox_SegsPerEdge->setValue(pcObject->NbSegsPerEdge.getValue());
Expand Down Expand Up @@ -103,7 +103,7 @@ void TaskTetParameter::SwitchMethod(int Value)
ui->spinBox_SegsPerRadius->setEnabled(false);
}

pcObject->Fininess.setValue(Value);
pcObject->Fineness.setValue(Value);
touched = true;
}

Expand Down

0 comments on commit 65092be

Please sign in to comment.