From ab30391742d2e731b9f884cdf7507ee851536b2a Mon Sep 17 00:00:00 2001 From: mos Date: Tue, 21 May 2024 19:27:11 +0200 Subject: [PATCH] [fem] clean clean unused code --- src/Mod/Fem/App/FemMeshShapeObject.cpp | 83 -------------------------- src/Mod/Fem/App/FemVTKTools.cpp | 8 --- src/Mod/Fem/App/HypothesisPy.cpp | 1 - 3 files changed, 92 deletions(-) diff --git a/src/Mod/Fem/App/FemMeshShapeObject.cpp b/src/Mod/Fem/App/FemMeshShapeObject.cpp index 04d9f1e9d4..4ae25d16a9 100644 --- a/src/Mod/Fem/App/FemMeshShapeObject.cpp +++ b/src/Mod/Fem/App/FemMeshShapeObject.cpp @@ -77,59 +77,13 @@ App::DocumentObjectExecReturn* FemMeshShapeObject::execute() Part::Feature* feat = Shape.getValue(); -#if 0 - TopoDS_Shape oshape = feat->Shape.getValue(); - BRepBuilderAPI_Copy copy(oshape); - const TopoDS_Shape& shape = copy.Shape(); - BRepTools::Clean(shape); // remove triangulation -#else TopoDS_Shape shape = feat->Shape.getValue(); -#endif newMesh.getSMesh()->ShapeToMesh(shape); SMESH_Gen* myGen = newMesh.getGenerator(); int hyp = 0; -#if 0 - SMESH_HypothesisPtr len(new StdMeshers_MaxLength(hyp++, 1, myGen)); - static_cast(len.get())->SetLength(1.0); - newMesh.addHypothesis(shape, len); - SMESH_HypothesisPtr loc(new StdMeshers_LocalLength(hyp++, 1, myGen)); - static_cast(loc.get())->SetLength(1.0); - newMesh.addHypothesis(shape, loc); - - SMESH_HypothesisPtr area(new StdMeshers_MaxElementArea(hyp++, 1, myGen)); - static_cast(area.get())->SetMaxArea(1.0); - newMesh.addHypothesis(shape, area); - - SMESH_HypothesisPtr segm(new StdMeshers_NumberOfSegments(hyp++, 1, myGen)); - static_cast(segm.get())->SetNumberOfSegments(1); - newMesh.addHypothesis(shape, segm); - - SMESH_HypothesisPtr defl(new StdMeshers_Deflection1D(hyp++, 1, myGen)); - static_cast(defl.get())->SetDeflection(0.01); - newMesh.addHypothesis(shape, defl); - - SMESH_HypothesisPtr reg(new StdMeshers_Regular_1D(hyp++, 1, myGen)); - newMesh.addHypothesis(shape, reg); - - //SMESH_HypothesisPtr sel(new StdMeshers_StartEndLength(hyp++, 1, myGen)); - //static_cast(sel.get())->SetLength(1.0, true); - //newMesh.addHypothesis(shape, sel; - - SMESH_HypothesisPtr qdp(new StdMeshers_QuadranglePreference(hyp++,1,myGen)); - newMesh.addHypothesis(shape, qdp); - - //SMESH_HypothesisPtr q2d(new StdMeshers_Quadrangle_2D(hyp++,1,myGen)); - //newMesh.addHypothesis(shape, q2d); - - SMESH_HypothesisPtr h3d(new StdMeshers_Hexa_3D(hyp++,1,myGen)); - newMesh.addHypothesis(shape, h3d); - - // create mesh - newMesh.compute(); -#endif #if 1 // Surface quad mesh #if SMESH_VERSION_MAJOR >= 9 SMESH_HypothesisPtr len(new StdMeshers_MaxLength(hyp++, myGen)); @@ -184,10 +138,6 @@ App::DocumentObjectExecReturn* FemMeshShapeObject::execute() SMESH_HypothesisPtr reg(new StdMeshers_Regular_1D(hyp++, 1, myGen)); newMesh.addHypothesis(shape, reg); - // SMESH_HypothesisPtr sel(new StdMeshers_StartEndLength(hyp++, 1, myGen)); - // static_cast(sel.get())->SetLength(1.0, true); - // newMesh.addHypothesis(shape, sel; - SMESH_HypothesisPtr qdp(new StdMeshers_QuadranglePreference(hyp++, 1, myGen)); newMesh.addHypothesis(shape, qdp); @@ -198,22 +148,7 @@ App::DocumentObjectExecReturn* FemMeshShapeObject::execute() // create mesh newMesh.compute(); #endif -#if 0 // NETGEN test - NETGENPlugin_Mesher myNetGenMesher(newMesh.getSMesh(),shape,true); - //NETGENPlugin_SimpleHypothesis_2D * tet2 = new NETGENPlugin_SimpleHypothesis_2D(hyp++,1,myGen); - //static_cast(tet2.get())->SetNumberOfSegments(5); - //static_cast(tet2.get())->SetLocalLength(0.1); - //static_cast(tet2.get())->LengthFromEdges(); - //myNetGenMesher.SetParameters(tet2); - - //NETGENPlugin_SimpleHypothesis_3D* tet= new NETGENPlugin_SimpleHypothesis_3D(hyp++,1,myGen); - //static_cast(tet.get())->LengthFromFaces(); - //static_cast(tet.get())->SetMaxElementVolume(0.1); - //myNetGenMesher.SetParameters( tet); - - myNetGenMesher.Compute(); -#endif // set the value to the object FemMesh.setValue(newMesh); @@ -222,21 +157,3 @@ App::DocumentObjectExecReturn* FemMeshShapeObject::execute() return App::DocumentObject::StdReturn; } -// short FemMeshShapeObject::mustExecute(void) const -//{ -// return 0; -// } - -// PyObject *FemMeshShapeObject::getPyObject() -//{ -// if (PythonObject.is(Py::_None())){ -// // ref counter is set to 1 -// PythonObject = Py::Object(new DocumentObjectPy(this),true); -// } -// return Py::new_reference_to(PythonObject); -// } - -// void FemMeshShapeObject::onChanged(const Property* prop) -//{ -// App::GeoFeature::onChanged(prop); -// } diff --git a/src/Mod/Fem/App/FemVTKTools.cpp b/src/Mod/Fem/App/FemVTKTools.cpp index fbb6175913..77465d008c 100644 --- a/src/Mod/Fem/App/FemVTKTools.cpp +++ b/src/Mod/Fem/App/FemVTKTools.cpp @@ -470,7 +470,6 @@ void FemVTKTools::writeVTKMesh(const char* filename, const FemMesh* mesh) vtkSmartPointer grid = vtkSmartPointer::New(); exportVTKMesh(mesh, grid); - // vtkSmartPointer dataset = vtkDataSet::SafeDownCast(grid); Base::Console().Log("Start: writing mesh data ======================\n"); if (f.hasExtension("vtu")) { writeVTKFile(filename, grid); @@ -630,7 +629,6 @@ void FemVTKTools::writeResult(const char* filename, const App::DocumentObject* r // result FemVTKTools::exportFreeCADResult(res, grid); - // vtkSmartPointer dataset = vtkDataSet::SafeDownCast(grid); if (f.hasExtension("vtu")) { writeVTKFile(filename, grid); } @@ -868,9 +866,6 @@ void FemVTKTools::exportFreeCADResult(const App::DocumentObject* result, } if (field && field->getSize() > 0) { - // if (nPoints != field->getSize()) - // Base::Console().Error("Size of PropertyVectorList = %d, not equal - // to vtk mesh node count %d \n", field->getSize(), nPoints); const std::vector& vel = field->getValues(); vtkSmartPointer data = vtkSmartPointer::New(); data->SetNumberOfComponents(dim); @@ -925,9 +920,6 @@ void FemVTKTools::exportFreeCADResult(const App::DocumentObject* result, } if (field && field->getSize() > 0) { - // if (nPoints != field->getSize()) - // Base::Console().Error("Size of PropertyFloatList = %d, not equal to vtk mesh - // node count %d \n", field->getSize(), nPoints); const std::vector& vec = field->getValues(); vtkSmartPointer data = vtkSmartPointer::New(); data->SetNumberOfValues(nPoints); diff --git a/src/Mod/Fem/App/HypothesisPy.cpp b/src/Mod/Fem/App/HypothesisPy.cpp index ace521afca..d61826e411 100644 --- a/src/Mod/Fem/App/HypothesisPy.cpp +++ b/src/Mod/Fem/App/HypothesisPy.cpp @@ -1234,6 +1234,5 @@ Py::Object StdMeshers_LayerDistributionPy::getLayerDistribution(const Py::Tuple& if (!PyArg_ParseTuple(args.ptr(), "")) { throw Py::Exception(); } - // return hypothesis()->GetLayerDistribution(); return Py::None(); }