FEM: objects, use same name system no matter if C++ or Python object
This commit is contained in:
@@ -306,7 +306,7 @@ void CmdFemConstraintBearing::activated(int)
|
||||
if(getConstraintPrerequisits(&Analysis))
|
||||
return;
|
||||
|
||||
std::string FeatName = getUniqueObjectName("FemConstraintBearing");
|
||||
std::string FeatName = getUniqueObjectName("ConstraintBearing");
|
||||
|
||||
openCommand("Make FEM constraint for bearing");
|
||||
doCommand(Doc,"App.activeDocument().addObject(\"Fem::ConstraintBearing\",\"%s\")",FeatName.c_str());
|
||||
@@ -347,7 +347,7 @@ void CmdFemConstraintContact::activated(int)
|
||||
if(getConstraintPrerequisits(&Analysis))
|
||||
return;
|
||||
|
||||
std::string FeatName = getUniqueObjectName("FemConstraintContact");
|
||||
std::string FeatName = getUniqueObjectName("ConstraintContact");
|
||||
|
||||
openCommand("Make FEM constraint contact on face");
|
||||
doCommand(Doc,"App.activeDocument().addObject(\"Fem::ConstraintContact\",\"%s\")",FeatName.c_str());
|
||||
@@ -392,7 +392,7 @@ void CmdFemConstraintDisplacement::activated(int)
|
||||
if(getConstraintPrerequisits(&Analysis))
|
||||
return;
|
||||
|
||||
std::string FeatName = getUniqueObjectName("FemConstraintDisplacement");
|
||||
std::string FeatName = getUniqueObjectName("ConstraintDisplacement");
|
||||
|
||||
openCommand("Make FEM constraint displacement on face");
|
||||
doCommand(Doc,"App.activeDocument().addObject(\"Fem::ConstraintDisplacement\",\"%s\")",FeatName.c_str());
|
||||
@@ -435,7 +435,7 @@ void CmdFemConstraintFixed::activated(int)
|
||||
if(getConstraintPrerequisits(&Analysis))
|
||||
return;
|
||||
|
||||
std::string FeatName = getUniqueObjectName("FemConstraintFixed");
|
||||
std::string FeatName = getUniqueObjectName("ConstraintFixed");
|
||||
|
||||
openCommand("Make FEM constraint fixed geometry");
|
||||
doCommand(Doc,"App.activeDocument().addObject(\"Fem::ConstraintFixed\",\"%s\")",FeatName.c_str());
|
||||
@@ -477,7 +477,7 @@ void CmdFemConstraintFluidBoundary::activated(int)
|
||||
if(getConstraintPrerequisits(&Analysis))
|
||||
return;
|
||||
|
||||
std::string FeatName = getUniqueObjectName("FluidBoundary");
|
||||
std::string FeatName = getUniqueObjectName("ConstraintFluidBoundary");
|
||||
|
||||
openCommand("Create fluid boundary condition");
|
||||
doCommand(Doc,"App.activeDocument().addObject(\"Fem::ConstraintFluidBoundary\",\"%s\")",FeatName.c_str());
|
||||
@@ -520,7 +520,7 @@ void CmdFemConstraintForce::activated(int)
|
||||
if(getConstraintPrerequisits(&Analysis))
|
||||
return;
|
||||
|
||||
std::string FeatName = getUniqueObjectName("FemConstraintForce");
|
||||
std::string FeatName = getUniqueObjectName("ConstraintForce");
|
||||
|
||||
openCommand("Make FEM constraint force on geometry");
|
||||
doCommand(Doc,"App.activeDocument().addObject(\"Fem::ConstraintForce\",\"%s\")",FeatName.c_str());
|
||||
@@ -563,7 +563,7 @@ void CmdFemConstraintGear::activated(int)
|
||||
|
||||
if(getConstraintPrerequisits(&Analysis))
|
||||
return;
|
||||
std::string FeatName = getUniqueObjectName("FemConstraintGear");
|
||||
std::string FeatName = getUniqueObjectName("ConstraintGear");
|
||||
|
||||
openCommand("Make FEM constraint for gear");
|
||||
doCommand(Doc,"App.activeDocument().addObject(\"Fem::ConstraintGear\",\"%s\")",FeatName.c_str());
|
||||
@@ -605,7 +605,7 @@ void CmdFemConstraintHeatflux::activated(int)
|
||||
if(getConstraintPrerequisits(&Analysis))
|
||||
return;
|
||||
|
||||
std::string FeatName = getUniqueObjectName("FemConstraintHeatflux");
|
||||
std::string FeatName = getUniqueObjectName("ConstraintHeatflux");
|
||||
|
||||
openCommand("Make FEM constraint heatflux on face");
|
||||
doCommand(Doc,"App.activeDocument().addObject(\"Fem::ConstraintHeatflux\",\"%s\")",FeatName.c_str());
|
||||
@@ -650,7 +650,7 @@ void CmdFemConstraintInitialTemperature::activated(int)
|
||||
if(getConstraintPrerequisits(&Analysis))
|
||||
return;
|
||||
|
||||
std::string FeatName = getUniqueObjectName("FemConstraintInitialTemperature");
|
||||
std::string FeatName = getUniqueObjectName("ConstraintInitialTemperature");
|
||||
|
||||
openCommand("Make FEM constraint initial temperature on body");
|
||||
doCommand(Doc,"App.activeDocument().addObject(\"Fem::ConstraintInitialTemperature\",\"%s\")",FeatName.c_str());
|
||||
@@ -693,7 +693,7 @@ void CmdFemConstraintPlaneRotation::activated(int)
|
||||
if(getConstraintPrerequisits(&Analysis))
|
||||
return;
|
||||
|
||||
std::string FeatName = getUniqueObjectName("FemConstraintPlaneRotation");
|
||||
std::string FeatName = getUniqueObjectName("ConstraintPlaneRotation");
|
||||
|
||||
openCommand("Make FEM constraint Plane Rotation face");
|
||||
doCommand(Doc,"App.activeDocument().addObject(\"Fem::ConstraintPlaneRotation\",\"%s\")",FeatName.c_str());
|
||||
@@ -735,7 +735,7 @@ void CmdFemConstraintPressure::activated(int)
|
||||
if(getConstraintPrerequisits(&Analysis))
|
||||
return;
|
||||
|
||||
std::string FeatName = getUniqueObjectName("FemConstraintPressure");
|
||||
std::string FeatName = getUniqueObjectName("ConstraintPressure");
|
||||
|
||||
openCommand("Make FEM constraint pressure on face");
|
||||
doCommand(Doc,"App.activeDocument().addObject(\"Fem::ConstraintPressure\",\"%s\")",FeatName.c_str());
|
||||
@@ -780,7 +780,7 @@ void CmdFemConstraintPulley::activated(int)
|
||||
if(getConstraintPrerequisits(&Analysis))
|
||||
return;
|
||||
|
||||
std::string FeatName = getUniqueObjectName("FemConstraintPulley");
|
||||
std::string FeatName = getUniqueObjectName("ConstraintPulley");
|
||||
|
||||
openCommand("Make FEM constraint for pulley");
|
||||
doCommand(Doc,"App.activeDocument().addObject(\"Fem::ConstraintPulley\",\"%s\")",FeatName.c_str());
|
||||
@@ -826,7 +826,7 @@ void CmdFemConstraintTemperature::activated(int)
|
||||
if(getConstraintPrerequisits(&Analysis))
|
||||
return;
|
||||
|
||||
std::string FeatName = getUniqueObjectName("FemConstraintTemperature");
|
||||
std::string FeatName = getUniqueObjectName("ConstraintTemperature");
|
||||
|
||||
openCommand("Make FEM constraint temperature on face");
|
||||
doCommand(Doc,"App.activeDocument().addObject(\"Fem::ConstraintTemperature\",\"%s\")",FeatName.c_str());
|
||||
@@ -869,7 +869,7 @@ void CmdFemConstraintTransform::activated(int)
|
||||
if(getConstraintPrerequisits(&Analysis))
|
||||
return;
|
||||
|
||||
std::string FeatName = getUniqueObjectName("FemConstraintTransform");
|
||||
std::string FeatName = getUniqueObjectName("ConstraintTransform");
|
||||
|
||||
openCommand("Make FEM constraint transform on face");
|
||||
doCommand(Doc,"App.activeDocument().addObject(\"Fem::ConstraintTransform\",\"%s\")",FeatName.c_str());
|
||||
@@ -1635,7 +1635,7 @@ void CmdFemPostPipelineFromResult::activated(int)
|
||||
|
||||
std::vector<Fem::FemResultObject*> results = getSelection().getObjectsOfType<Fem::FemResultObject>();
|
||||
if (results.size() == 1) {
|
||||
std::string FeatName = getUniqueObjectName("Pipeline");
|
||||
std::string FeatName = getUniqueObjectName("ResultPipeline");
|
||||
openCommand("Create pipeline from result");
|
||||
doCommand(Doc,"App.activeDocument().addObject('Fem::FemPostPipeline','%s')",FeatName.c_str());
|
||||
doCommand(Doc,"App.activeDocument().ActiveObject.load("
|
||||
|
||||
@@ -428,7 +428,7 @@ def makeMeshBoundaryLayer(
|
||||
|
||||
def makeMeshGmsh(
|
||||
doc,
|
||||
name="FEMMeshGmsh"
|
||||
name="MeshGmsh"
|
||||
):
|
||||
'''makeMeshGmsh(document, [name]):
|
||||
makes a Gmsh FEM mesh object'''
|
||||
@@ -445,7 +445,7 @@ def makeMeshGroup(
|
||||
doc,
|
||||
base_mesh,
|
||||
use_label=False,
|
||||
name="FEMMeshGroup"
|
||||
name="MeshGroup"
|
||||
):
|
||||
'''makeMeshGroup(document, base_mesh, [use_label], [name]):
|
||||
creates a FEM mesh region object to define properties for a region of a FEM mesh'''
|
||||
@@ -467,7 +467,7 @@ def makeMeshGroup(
|
||||
|
||||
def makeMeshNetgen(
|
||||
doc,
|
||||
name="FEMMeshNetgen"
|
||||
name="MeshNetgen"
|
||||
):
|
||||
'''makeMeshNetgen(document, [name]):
|
||||
makes a Fem MeshShapeNetgenObject object'''
|
||||
@@ -479,7 +479,7 @@ def makeMeshRegion(
|
||||
doc,
|
||||
base_mesh,
|
||||
element_length=0.0,
|
||||
name="FEMMeshRegion"
|
||||
name="MeshRegion"
|
||||
):
|
||||
'''makeMeshRegion(document, base_mesh, [element_length], [name]):
|
||||
creates a FEM mesh region object to define properties for a region of a FEM mesh'''
|
||||
@@ -501,7 +501,7 @@ def makeMeshRegion(
|
||||
|
||||
def makeMeshResult(
|
||||
doc,
|
||||
name="FEMMeshResult"
|
||||
name="MeshResult"
|
||||
):
|
||||
'''makeMeshResult(document, name): makes a Fem MeshResult object'''
|
||||
obj = doc.addObject("Fem::FemMeshObjectPython", name)
|
||||
@@ -532,7 +532,7 @@ def makeResultMechanical(
|
||||
def makePostVtkFilterClipRegion(
|
||||
doc,
|
||||
base_vtk_result,
|
||||
name="FEMVtkFilterClipRegion"
|
||||
name="VtkFilterClipRegion"
|
||||
):
|
||||
'''makePostVtkFilterClipRegion(document, base_vtk_result, [name]):
|
||||
creates an FEM post processing region clip filter object (vtk based)'''
|
||||
@@ -547,7 +547,7 @@ def makePostVtkFilterClipRegion(
|
||||
def makePostVtkFilterClipScalar(
|
||||
doc,
|
||||
base_vtk_result,
|
||||
name="FEMVtkFilterClipScalar"
|
||||
name="VtkFilterClipScalar"
|
||||
):
|
||||
'''makePostVtkFilterClipScalar(document, base_vtk_result, [name]):
|
||||
creates an FEM post processing scalar clip filter object (vtk based)'''
|
||||
@@ -562,7 +562,7 @@ def makePostVtkFilterClipScalar(
|
||||
def makePostVtkFilterCutFunction(
|
||||
doc,
|
||||
base_vtk_result,
|
||||
name="FEMVtkFilterCutFunction"
|
||||
name="VtkFilterCutFunction"
|
||||
):
|
||||
'''makePostVtkFilterCutFunction(document, base_vtk_result, [name]):
|
||||
creates an FEM post processing cut function filter object (vtk based)'''
|
||||
@@ -577,7 +577,7 @@ def makePostVtkFilterCutFunction(
|
||||
def makePostVtkFilterWarp(
|
||||
doc,
|
||||
base_vtk_result,
|
||||
name="FEMVtkFilterWarp"
|
||||
name="VtkFilterWarp"
|
||||
):
|
||||
'''makePostVtkFilterWarp(document, base_vtk_result, [name]):
|
||||
creates an FEM post processing warp filter object (vtk based)'''
|
||||
@@ -591,7 +591,7 @@ def makePostVtkFilterWarp(
|
||||
|
||||
def makePostVtkResult(
|
||||
doc, base_result,
|
||||
name="FEMVtkResult"
|
||||
name="VtkResult"
|
||||
):
|
||||
'''makePostVtkResult(document, base_result [name]):
|
||||
creates an FEM post processing result object (vtk based) to hold FEM results'''
|
||||
|
||||
@@ -81,7 +81,7 @@ def importFrd(
|
||||
mesh = importToolsFem.make_femmesh(m)
|
||||
result_mesh_object = ObjectsFem.makeMeshResult(
|
||||
FreeCAD.ActiveDocument,
|
||||
'Result_mesh'
|
||||
'ResultMesh'
|
||||
)
|
||||
result_mesh_object.FemMesh = mesh
|
||||
res_mesh_is_compacted = False
|
||||
@@ -101,17 +101,17 @@ def importFrd(
|
||||
step_time = round(step_time, 2)
|
||||
if eigenmode_number > 0:
|
||||
results_name = (
|
||||
'{}mode_{}_results'
|
||||
'{}Mode{}_Results'
|
||||
.format(result_name_prefix, eigenmode_number)
|
||||
)
|
||||
elif number_of_increments > 1:
|
||||
results_name = (
|
||||
'{}time_{}_results'
|
||||
'{}Time{}_Results'
|
||||
.format(result_name_prefix, step_time)
|
||||
)
|
||||
else:
|
||||
results_name = (
|
||||
'{}results'
|
||||
'{}Results'
|
||||
.format(result_name_prefix)
|
||||
)
|
||||
|
||||
|
||||
@@ -1116,8 +1116,7 @@ class FemToolsCcx(QtCore.QRunnable, QtCore.QObject):
|
||||
import feminout.importCcxFrdResults as importCcxFrdResults
|
||||
frd_result_file = os.path.splitext(self.inp_file_name)[0] + '.frd'
|
||||
if os.path.isfile(frd_result_file):
|
||||
result_name_prefix = 'CalculiX_' + self.solver.AnalysisType + '_'
|
||||
importCcxFrdResults.importFrd(frd_result_file, self.analysis, result_name_prefix)
|
||||
importCcxFrdResults.importFrd(frd_result_file, self.analysis, 'CCX_')
|
||||
for m in self.analysis.Group:
|
||||
if m.isDerivedFrom("Fem::FemResultObject"):
|
||||
self.results_present = True
|
||||
|
||||
Reference in New Issue
Block a user