FEM: objects, use fem name sheme for object package names
This commit is contained in:
committed by
Yorik van Havre
parent
07ae0e56c4
commit
c85afd0e44
34
src/Mod/Fem/femobjects/FemConstraint.py
Normal file
34
src/Mod/Fem/femobjects/FemConstraint.py
Normal file
@@ -0,0 +1,34 @@
|
||||
# ***************************************************************************
|
||||
# * *
|
||||
# * Copyright (c) 2017 - Markus Hovorka <m.hovorka@live.de> *
|
||||
# * *
|
||||
# * This program is free software; you can redistribute it and/or modify *
|
||||
# * it under the terms of the GNU Lesser General Public License (LGPL) *
|
||||
# * as published by the Free Software Foundation; either version 2 of *
|
||||
# * the License, or (at your option) any later version. *
|
||||
# * for detail see the LICENCE text file. *
|
||||
# * *
|
||||
# * This program is distributed in the hope that it will be useful, *
|
||||
# * but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
# * GNU Library General Public License for more details. *
|
||||
# * *
|
||||
# * You should have received a copy of the GNU Library General Public *
|
||||
# * License along with this program; if not, write to the Free Software *
|
||||
# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
|
||||
# * USA *
|
||||
# * *
|
||||
# ***************************************************************************
|
||||
|
||||
|
||||
__title__ = "_Base"
|
||||
__author__ = "Markus Hovorka"
|
||||
__url__ = "http://www.freecadweb.org"
|
||||
|
||||
|
||||
class Proxy(object):
|
||||
|
||||
BaseType = "Fem::ConstraintPython"
|
||||
|
||||
def __init__(self, obj):
|
||||
obj.Proxy = self
|
||||
40
src/Mod/Fem/femobjects/_FemConstraintBodyHeatSource.py
Normal file
40
src/Mod/Fem/femobjects/_FemConstraintBodyHeatSource.py
Normal file
@@ -0,0 +1,40 @@
|
||||
# ***************************************************************************
|
||||
# * *
|
||||
# * Copyright (c) 2017 - Markus Hovorka <m.hovorka@live.de> *
|
||||
# * *
|
||||
# * This program is free software; you can redistribute it and/or modify *
|
||||
# * it under the terms of the GNU Lesser General Public License (LGPL) *
|
||||
# * as published by the Free Software Foundation; either version 2 of *
|
||||
# * the License, or (at your option) any later version. *
|
||||
# * for detail see the LICENCE text file. *
|
||||
# * *
|
||||
# * This program is distributed in the hope that it will be useful, *
|
||||
# * but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
# * GNU Library General Public License for more details. *
|
||||
# * *
|
||||
# * You should have received a copy of the GNU Library General Public *
|
||||
# * License along with this program; if not, write to the Free Software *
|
||||
# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
|
||||
# * USA *
|
||||
# * *
|
||||
# ***************************************************************************
|
||||
|
||||
|
||||
__title__ = "the constraint body heat source object"
|
||||
__author__ = "Markus Hovorka, Bernd Hahnebach"
|
||||
__url__ = "http://www.freecadweb.org"
|
||||
|
||||
|
||||
from . import FemConstraint
|
||||
|
||||
|
||||
class Proxy(FemConstraint.Proxy):
|
||||
|
||||
Type = "Fem::ConstraintBodyHeatSource"
|
||||
|
||||
def __init__(self, obj):
|
||||
super(Proxy, self).__init__(obj)
|
||||
obj.addProperty(
|
||||
"App::PropertyFloat", "HeatSource",
|
||||
"Base", "Body heat source")
|
||||
@@ -0,0 +1,46 @@
|
||||
# ***************************************************************************
|
||||
# * *
|
||||
# * Copyright (c) 2017 - Markus Hovorka <m.hovorka@live.de> *
|
||||
# * *
|
||||
# * This program is free software; you can redistribute it and/or modify *
|
||||
# * it under the terms of the GNU Lesser General Public License (LGPL) *
|
||||
# * as published by the Free Software Foundation; either version 2 of *
|
||||
# * the License, or (at your option) any later version. *
|
||||
# * for detail see the LICENCE text file. *
|
||||
# * *
|
||||
# * This program is distributed in the hope that it will be useful, *
|
||||
# * but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
# * GNU Library General Public License for more details. *
|
||||
# * *
|
||||
# * You should have received a copy of the GNU Library General Public *
|
||||
# * License along with this program; if not, write to the Free Software *
|
||||
# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
|
||||
# * USA *
|
||||
# * *
|
||||
# ***************************************************************************
|
||||
|
||||
|
||||
__title__ = "Elmer Solver Object"
|
||||
__author__ = "Markus Hovorka, Bernd Hahnebach"
|
||||
__url__ = "http://www.freecadweb.org"
|
||||
|
||||
|
||||
from . import FemConstraint
|
||||
|
||||
|
||||
class Proxy(FemConstraint.Proxy):
|
||||
|
||||
Type = "Fem::ConstraintElectrostaticPotential"
|
||||
|
||||
def __init__(self, obj):
|
||||
super(Proxy, self).__init__(obj)
|
||||
obj.addProperty(
|
||||
"App::PropertyFloat", "Potential",
|
||||
"Parameter", "Potential"),
|
||||
obj.addProperty(
|
||||
"App::PropertyBool", "PotentialEnabled",
|
||||
"Parameter", "Potential Enabled"),
|
||||
obj.addProperty(
|
||||
"App::PropertyBool", "PotentialConstant",
|
||||
"Parameter", "Potential Constant")
|
||||
58
src/Mod/Fem/femobjects/_FemConstraintFlowVelocity.py
Normal file
58
src/Mod/Fem/femobjects/_FemConstraintFlowVelocity.py
Normal file
@@ -0,0 +1,58 @@
|
||||
# ***************************************************************************
|
||||
# * *
|
||||
# * Copyright (c) 2017 - Markus Hovorka <m.hovorka@live.de> *
|
||||
# * *
|
||||
# * This program is free software; you can redistribute it and/or modify *
|
||||
# * it under the terms of the GNU Lesser General Public License (LGPL) *
|
||||
# * as published by the Free Software Foundation; either version 2 of *
|
||||
# * the License, or (at your option) any later version. *
|
||||
# * for detail see the LICENCE text file. *
|
||||
# * *
|
||||
# * This program is distributed in the hope that it will be useful, *
|
||||
# * but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
# * GNU Library General Public License for more details. *
|
||||
# * *
|
||||
# * You should have received a copy of the GNU Library General Public *
|
||||
# * License along with this program; if not, write to the Free Software *
|
||||
# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
|
||||
# * USA *
|
||||
# * *
|
||||
# ***************************************************************************
|
||||
|
||||
|
||||
__title__ = "the constraint flow velocity object"
|
||||
__author__ = "Markus Hovorka, Bernd Hahnebach"
|
||||
__url__ = "http://www.freecadweb.org"
|
||||
|
||||
|
||||
from . import FemConstraint
|
||||
|
||||
|
||||
class Proxy(FemConstraint.Proxy):
|
||||
|
||||
Type = "Fem::ConstraintFlowVelocity"
|
||||
|
||||
def __init__(self, obj):
|
||||
super(Proxy, self).__init__(obj)
|
||||
obj.addProperty(
|
||||
"App::PropertyFloat", "VelocityX",
|
||||
"Parameter", "Body heat flux")
|
||||
obj.addProperty(
|
||||
"App::PropertyBool", "VelocityXEnabled",
|
||||
"Parameter", "Body heat flux")
|
||||
obj.addProperty(
|
||||
"App::PropertyFloat", "VelocityY",
|
||||
"Parameter", "Body heat flux")
|
||||
obj.addProperty(
|
||||
"App::PropertyBool", "VelocityYEnabled",
|
||||
"Parameter", "Body heat flux")
|
||||
obj.addProperty(
|
||||
"App::PropertyFloat", "VelocityZ",
|
||||
"Parameter", "Body heat flux")
|
||||
obj.addProperty(
|
||||
"App::PropertyBool", "VelocityZEnabled",
|
||||
"Parameter", "Body heat flux")
|
||||
obj.addProperty(
|
||||
"App::PropertyBool", "NormalToBoundary",
|
||||
"Parameter", "Body heat flux")
|
||||
55
src/Mod/Fem/femobjects/_FemConstraintInitialFlowVelocity.py
Normal file
55
src/Mod/Fem/femobjects/_FemConstraintInitialFlowVelocity.py
Normal file
@@ -0,0 +1,55 @@
|
||||
# ***************************************************************************
|
||||
# * *
|
||||
# * Copyright (c) 2017 - Markus Hovorka <m.hovorka@live.de> *
|
||||
# * *
|
||||
# * This program is free software; you can redistribute it and/or modify *
|
||||
# * it under the terms of the GNU Lesser General Public License (LGPL) *
|
||||
# * as published by the Free Software Foundation; either version 2 of *
|
||||
# * the License, or (at your option) any later version. *
|
||||
# * for detail see the LICENCE text file. *
|
||||
# * *
|
||||
# * This program is distributed in the hope that it will be useful, *
|
||||
# * but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
# * GNU Library General Public License for more details. *
|
||||
# * *
|
||||
# * You should have received a copy of the GNU Library General Public *
|
||||
# * License along with this program; if not, write to the Free Software *
|
||||
# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
|
||||
# * USA *
|
||||
# * *
|
||||
# ***************************************************************************
|
||||
|
||||
|
||||
__title__ = "the constraint initial flow velocity object"
|
||||
__author__ = "Markus Hovorka, Bernd Hahnebach"
|
||||
__url__ = "http://www.freecadweb.org"
|
||||
|
||||
|
||||
from . import FemConstraint
|
||||
|
||||
|
||||
class Proxy(FemConstraint.Proxy):
|
||||
|
||||
Type = "Fem::ConstraintInitialFlowVelocity"
|
||||
|
||||
def __init__(self, obj):
|
||||
super(Proxy, self).__init__(obj)
|
||||
obj.addProperty(
|
||||
"App::PropertyFloat", "VelocityX",
|
||||
"Parameter", "Body heat flux")
|
||||
obj.addProperty(
|
||||
"App::PropertyBool", "VelocityXEnabled",
|
||||
"Parameter", "Body heat flux")
|
||||
obj.addProperty(
|
||||
"App::PropertyFloat", "VelocityY",
|
||||
"Parameter", "Body heat flux")
|
||||
obj.addProperty(
|
||||
"App::PropertyBool", "VelocityYEnabled",
|
||||
"Parameter", "Body heat flux")
|
||||
obj.addProperty(
|
||||
"App::PropertyFloat", "VelocityZ",
|
||||
"Parameter", "Body heat flux")
|
||||
obj.addProperty(
|
||||
"App::PropertyBool", "VelocityZEnabled",
|
||||
"Parameter", "Body heat flux")
|
||||
44
src/Mod/Fem/femobjects/_FemConstraintSelfWeight.py
Normal file
44
src/Mod/Fem/femobjects/_FemConstraintSelfWeight.py
Normal file
@@ -0,0 +1,44 @@
|
||||
# ***************************************************************************
|
||||
# * *
|
||||
# * Copyright (c) 2015 - Bernd Hahnebach <bernd@bimstatik.org> *
|
||||
# * *
|
||||
# * This program is free software; you can redistribute it and/or modify *
|
||||
# * it under the terms of the GNU Lesser General Public License (LGPL) *
|
||||
# * as published by the Free Software Foundation; either version 2 of *
|
||||
# * the License, or (at your option) any later version. *
|
||||
# * for detail see the LICENCE text file. *
|
||||
# * *
|
||||
# * This program is distributed in the hope that it will be useful, *
|
||||
# * but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
# * GNU Library General Public License for more details. *
|
||||
# * *
|
||||
# * You should have received a copy of the GNU Library General Public *
|
||||
# * License along with this program; if not, write to the Free Software *
|
||||
# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
|
||||
# * USA *
|
||||
# * *
|
||||
# ***************************************************************************
|
||||
|
||||
__title__ = "the constraint self weight object"
|
||||
__author__ = "Bernd Hahnebach"
|
||||
__url__ = "http://www.freecadweb.org"
|
||||
|
||||
## @package FemConstraintSelfWeight
|
||||
# \ingroup FEM
|
||||
|
||||
|
||||
class _FemConstraintSelfWeight:
|
||||
"The FemConstraintSelfWeight object"
|
||||
def __init__(self, obj):
|
||||
obj.addProperty("App::PropertyFloat", "Gravity_x", "Gravity", "set the gravity component in the x direction")
|
||||
obj.addProperty("App::PropertyFloat", "Gravity_y", "Gravity", "set the gravity component in the y direction")
|
||||
obj.addProperty("App::PropertyFloat", "Gravity_z", "Gravity", "set the gravity component in the z direction")
|
||||
obj.Gravity_x = 0.0
|
||||
obj.Gravity_y = 0.0
|
||||
obj.Gravity_z = -1.0
|
||||
obj.Proxy = self
|
||||
self.Type = "Fem::ConstraintSelfWeight"
|
||||
|
||||
def execute(self, obj):
|
||||
return
|
||||
122
src/Mod/Fem/femobjects/_FemElementFluid1D.py
Normal file
122
src/Mod/Fem/femobjects/_FemElementFluid1D.py
Normal file
@@ -0,0 +1,122 @@
|
||||
# ***************************************************************************
|
||||
# * *
|
||||
# * Copyright (c) 2016 - Ofentse Kgoa <kgoaot@eskom.co.za> *
|
||||
# * Based on the FemElementGeometry1D by Bernd Hahnebach *
|
||||
# * *
|
||||
# * This program is free software; you can redistribute it and/or modify *
|
||||
# * it under the terms of the GNU Lesser General Public License (LGPL) *
|
||||
# * as published by the Free Software Foundation; either version 2 of *
|
||||
# * the License, or (at your option) any later version. *
|
||||
# * for detail see the LICENCE text file. *
|
||||
# * *
|
||||
# * This program is distributed in the hope that it will be useful, *
|
||||
# * but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
# * GNU Library General Public License for more details. *
|
||||
# * *
|
||||
# * You should have received a copy of the GNU Library General Public *
|
||||
# * License along with this program; if not, write to the Free Software *
|
||||
# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
|
||||
# * USA *
|
||||
# * *
|
||||
# ***************************************************************************
|
||||
|
||||
__title__ = "_FemElementFluid1D"
|
||||
__author__ = "Ofentse Kgoa"
|
||||
__url__ = "http://www.freecadweb.org"
|
||||
|
||||
## @package FemElementFluid1D
|
||||
# \ingroup FEM
|
||||
|
||||
|
||||
class _FemElementFluid1D:
|
||||
"The FemElementFluid1D object"
|
||||
|
||||
known_fluid_types = ['Liquid', 'Gas', 'Open Channel']
|
||||
known_liquid_types = ['PIPE MANNING', 'PIPE ENLARGEMENT', 'PIPE CONTRACTION', 'PIPE INLET', 'PIPE OUTLET', 'PIPE ENTRANCE', 'PIPE DIAPHRAGM', 'PIPE BEND', 'PIPE GATE VALVE', 'LIQUID PUMP', 'PIPE WHITE-COLEBROOK']
|
||||
known_gas_types = ['NONE']
|
||||
known_channel_types = ['NONE']
|
||||
|
||||
def __init__(self, obj):
|
||||
obj.addProperty("App::PropertyLinkSubList", "References", "FluidSection", "List of fluid section shapes")
|
||||
obj.addProperty("App::PropertyEnumeration", "SectionType", "FluidSection", "select fluid section type")
|
||||
obj.addProperty("App::PropertyEnumeration", "LiquidSectionType", "LiquidSection", "select liquid section type")
|
||||
obj.addProperty("App::PropertyArea", "ManningArea", "LiquidManning", "set area of the manning fluid section")
|
||||
obj.addProperty("App::PropertyLength", "ManningRadius", "LiquidManning", "set hydraulic radius of manning fluid section")
|
||||
obj.addProperty("App::PropertyFloat", "ManningCoefficient", "LiquidManning", "set coefficient of manning fluid section")
|
||||
obj.addProperty("App::PropertyArea", "EnlargeArea1", "LiquidEnlargement", "set initial area of the enlargement fluid section")
|
||||
obj.addProperty("App::PropertyArea", "EnlargeArea2", "LiquidEnlargement", "set enlarged area of enlargement fluid section")
|
||||
obj.addProperty("App::PropertyArea", "ContractArea1", "LiquidContraction", "set initial area of the contraction fluid section")
|
||||
obj.addProperty("App::PropertyArea", "ContractArea2", "LiquidContraction", "set contracted area of contraction fluid section")
|
||||
obj.addProperty("App::PropertyFloat", "InletPressure", "LiquidInlet", "set inlet pressure for fluid section")
|
||||
obj.addProperty("App::PropertyFloat", "OutletPressure", "LiquidOutlet", "set outlet pressure for fluid section")
|
||||
obj.addProperty("App::PropertyFloat", "InletFlowRate", "LiquidInlet", "set inlet mass flow rate for fluid section")
|
||||
obj.addProperty("App::PropertyFloat", "OutletFlowRate", "LiquidOutlet", "set outlet mass flow rate for fluid section")
|
||||
obj.addProperty("App::PropertyBool", "InletPressureActive", "LiquidInlet", "activates or deactivates inlet pressure for fluid section")
|
||||
obj.addProperty("App::PropertyBool", "OutletPressureActive", "LiquidOutlet", "activates or deactivates outlet pressure for fluid section")
|
||||
obj.addProperty("App::PropertyBool", "InletFlowRateActive", "LiquidInlet", "activates or deactivates inlet flow rate for fluid section")
|
||||
obj.addProperty("App::PropertyBool", "OutletFlowRateActive", "LiquidOutlet", "activates or deactivates outlet flow rate for fluid section")
|
||||
obj.addProperty("App::PropertyArea", "EntrancePipeArea", "LiquidEntrance", "set the pipe area of the entrance fluid section")
|
||||
obj.addProperty("App::PropertyArea", "EntranceArea", "LiquidEntrance", "set the entrance area of the entrance fluid section")
|
||||
obj.addProperty("App::PropertyArea", "DiaphragmPipeArea", "LiquidDiaphragm", "set the pipe area of the diaphragm fluid section")
|
||||
obj.addProperty("App::PropertyArea", "DiaphragmArea", "LiquidDiaphragm", "set the diaphragm area of the diaphragm fluid section")
|
||||
obj.addProperty("App::PropertyArea", "BendPipeArea", "LiquidBend", "set pipe area of the bend fluid section")
|
||||
obj.addProperty("App::PropertyFloat", "BendRadiusDiameter", "LiquidBend", "set ratio of bend radius over pipe diameter of the bend fluid section")
|
||||
obj.addProperty("App::PropertyFloat", "BendAngle", "LiquidBend", "set bend angle of the bend fluid section")
|
||||
obj.addProperty("App::PropertyFloat", "BendLossCoefficient", "LiquidBend", "set loss coefficient of the bend fluid section")
|
||||
obj.addProperty("App::PropertyArea", "GateValvePipeArea", "LiquidGateValve", "set pipe area of the gate valve fluid section")
|
||||
obj.addProperty("App::PropertyFloat", "GateValveClosingCoeff", "LiquidGateValve", "set closing coefficient of the gate valve fluid section")
|
||||
obj.addProperty("App::PropertyFloatList", "PumpFlowRate", "LiquidPump", "set the pump characteristic flow rate of the pump fluid section")
|
||||
obj.addProperty("App::PropertyFloatList", "PumpHeadLoss", "LiquidPump", "set the pump characteristic head loss of the pump fluid section")
|
||||
obj.addProperty("App::PropertyArea", "ColebrookeArea", "LiquidColebrooke", "set pipe area of the colebrooke fluid section")
|
||||
obj.addProperty("App::PropertyLength", "ColebrookeRadius", "LiquidColebrooke", "set hydraulic radius of the colebrooke fluid section")
|
||||
obj.addProperty("App::PropertyLength", "ColebrookeGrainDiameter", "LiquidColebrooke", "set grain diameter of the colebrooke fluid section")
|
||||
obj.addProperty("App::PropertyFloat", "ColebrookeFormFactor", "LiquidColebrooke", "set coefficient of the colebrooke fluid section")
|
||||
obj.addProperty("App::PropertyEnumeration", "GasSectionType", "GasSection", "select gas section type")
|
||||
obj.addProperty("App::PropertyEnumeration", "ChannelSectionType", "ChannelSection", "select channel section type")
|
||||
|
||||
# set property default values
|
||||
obj.SectionType = _FemElementFluid1D.known_fluid_types
|
||||
obj.SectionType = 'Liquid'
|
||||
obj.LiquidSectionType = _FemElementFluid1D.known_liquid_types
|
||||
obj.LiquidSectionType = 'PIPE INLET'
|
||||
obj.GasSectionType = _FemElementFluid1D.known_gas_types
|
||||
obj.GasSectionType = 'NONE'
|
||||
obj.ChannelSectionType = _FemElementFluid1D.known_channel_types
|
||||
obj.ChannelSectionType = 'NONE'
|
||||
obj.ManningArea = 10.0
|
||||
obj.ManningRadius = 1.0
|
||||
obj.ManningCoefficient = 0.0015 # has units of s/mm^(1/3)
|
||||
obj.EnlargeArea1 = 10.0
|
||||
obj.EnlargeArea2 = 20.0
|
||||
obj.ContractArea1 = 20.0
|
||||
obj.ContractArea2 = 10.0
|
||||
obj.EntrancePipeArea = 20.0
|
||||
obj.EntranceArea = 20.0
|
||||
obj.DiaphragmPipeArea = 20.0
|
||||
obj.DiaphragmArea = 20.0
|
||||
obj.BendPipeArea = 20.0
|
||||
obj.BendRadiusDiameter = 1.0
|
||||
obj.BendAngle = 0.0
|
||||
obj.BendLossCoefficient = 0.0
|
||||
obj.GateValvePipeArea = 20.0
|
||||
obj.GateValveClosingCoeff = 0.125
|
||||
obj.PumpFlowRate = [0, 1.04e-04, 2.08e-4, 3.13e-4, 4.17e-4]
|
||||
obj.PumpHeadLoss = [30, 29.17, 26.67, 23.33, 18.33]
|
||||
obj.ColebrookeArea = 20.0
|
||||
obj.ColebrookeRadius = 1.0
|
||||
obj.ColebrookeGrainDiameter = 0.0025
|
||||
obj.ColebrookeFormFactor = 1.0
|
||||
obj.InletPressure = 1.0
|
||||
obj.OutletPressure = 1.0
|
||||
obj.InletFlowRate = 1.0
|
||||
obj.OutletFlowRate = 1.0
|
||||
obj.InletPressureActive = True
|
||||
obj.OutletPressureActive = True
|
||||
obj.InletFlowRateActive = False
|
||||
obj.OutletFlowRateActive = False
|
||||
obj.Proxy = self
|
||||
self.Type = "Fem::FemElementFluid1D"
|
||||
|
||||
def execute(self, obj):
|
||||
return
|
||||
50
src/Mod/Fem/femobjects/_FemElementGeometry1D.py
Normal file
50
src/Mod/Fem/femobjects/_FemElementGeometry1D.py
Normal file
@@ -0,0 +1,50 @@
|
||||
# ***************************************************************************
|
||||
# * *
|
||||
# * Copyright (c) 2015 - Bernd Hahnebach <bernd@bimstatik.org> *
|
||||
# * *
|
||||
# * This program is free software; you can redistribute it and/or modify *
|
||||
# * it under the terms of the GNU Lesser General Public License (LGPL) *
|
||||
# * as published by the Free Software Foundation; either version 2 of *
|
||||
# * the License, or (at your option) any later version. *
|
||||
# * for detail see the LICENCE text file. *
|
||||
# * *
|
||||
# * This program is distributed in the hope that it will be useful, *
|
||||
# * but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
# * GNU Library General Public License for more details. *
|
||||
# * *
|
||||
# * You should have received a copy of the GNU Library General Public *
|
||||
# * License along with this program; if not, write to the Free Software *
|
||||
# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
|
||||
# * USA *
|
||||
# * *
|
||||
# ***************************************************************************
|
||||
|
||||
__title__ = "FemElementGeometry1D"
|
||||
__author__ = "Bernd Hahnebach"
|
||||
__url__ = "http://www.freecadweb.org"
|
||||
|
||||
## @package FemElementGeometry1D
|
||||
# \ingroup FEM
|
||||
|
||||
|
||||
class _FemElementGeometry1D:
|
||||
"The FemElementGeometry1D object"
|
||||
|
||||
known_beam_types = ['Rectangular', 'Circular', 'Pipe']
|
||||
|
||||
def __init__(self, obj):
|
||||
obj.addProperty("App::PropertyLength", "RectWidth", "RectBeamSection", "set width of the rectangular beam elements")
|
||||
obj.addProperty("App::PropertyLength", "RectHeight", "RectBeamSection", "set height of therectangular beam elements")
|
||||
obj.addProperty("App::PropertyLength", "CircDiameter", "CircBeamSection", "set diameter of the circular beam elements")
|
||||
obj.addProperty("App::PropertyLength", "PipeDiameter", "PipeBeamSection", "set outer diameter of the pipe beam elements")
|
||||
obj.addProperty("App::PropertyLength", "PipeThickness", "PipeBeamSection", "set thickness of the pipe beam elements")
|
||||
obj.addProperty("App::PropertyEnumeration", "SectionType", "BeamSection", "select beam section type")
|
||||
obj.addProperty("App::PropertyLinkSubList", "References", "BeamSection", "List of beam section shapes")
|
||||
obj.SectionType = _FemElementGeometry1D.known_beam_types
|
||||
obj.SectionType = 'Rectangular'
|
||||
obj.Proxy = self
|
||||
self.Type = "Fem::FemElementGeometry1D"
|
||||
|
||||
def execute(self, obj):
|
||||
return
|
||||
40
src/Mod/Fem/femobjects/_FemElementGeometry2D.py
Normal file
40
src/Mod/Fem/femobjects/_FemElementGeometry2D.py
Normal file
@@ -0,0 +1,40 @@
|
||||
# ***************************************************************************
|
||||
# * *
|
||||
# * Copyright (c) 2015 - Bernd Hahnebach <bernd@bimstatik.org> *
|
||||
# * *
|
||||
# * This program is free software; you can redistribute it and/or modify *
|
||||
# * it under the terms of the GNU Lesser General Public License (LGPL) *
|
||||
# * as published by the Free Software Foundation; either version 2 of *
|
||||
# * the License, or (at your option) any later version. *
|
||||
# * for detail see the LICENCE text file. *
|
||||
# * *
|
||||
# * This program is distributed in the hope that it will be useful, *
|
||||
# * but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
# * GNU Library General Public License for more details. *
|
||||
# * *
|
||||
# * You should have received a copy of the GNU Library General Public *
|
||||
# * License along with this program; if not, write to the Free Software *
|
||||
# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
|
||||
# * USA *
|
||||
# * *
|
||||
# ***************************************************************************
|
||||
|
||||
__title__ = "_FemElementGeometry2D"
|
||||
__author__ = "Bernd Hahnebach"
|
||||
__url__ = "http://www.freecadweb.org"
|
||||
|
||||
## @package FemElementGeometry2D
|
||||
# \ingroup FEM
|
||||
|
||||
|
||||
class _FemElementGeometry2D:
|
||||
"The FemElementGeometry2D object"
|
||||
def __init__(self, obj):
|
||||
obj.addProperty("App::PropertyLength", "Thickness", "ShellThickness", "set thickness of the shell elements")
|
||||
obj.addProperty("App::PropertyLinkSubList", "References", "ShellThickness", "List of shell thickness shapes")
|
||||
obj.Proxy = self
|
||||
self.Type = "Fem::FemElementGeometry2D"
|
||||
|
||||
def execute(self, obj):
|
||||
return
|
||||
41
src/Mod/Fem/femobjects/_FemElementRotation1D.py
Normal file
41
src/Mod/Fem/femobjects/_FemElementRotation1D.py
Normal file
@@ -0,0 +1,41 @@
|
||||
# ***************************************************************************
|
||||
# * *
|
||||
# * Copyright (c) 2017 - Bernd Hahnebach <bernd@bimstatik.org> *
|
||||
# * *
|
||||
# * This program is free software; you can redistribute it and/or modify *
|
||||
# * it under the terms of the GNU Lesser General Public License (LGPL) *
|
||||
# * as published by the Free Software Foundation; either version 2 of *
|
||||
# * the License, or (at your option) any later version. *
|
||||
# * for detail see the LICENCE text file. *
|
||||
# * *
|
||||
# * This program is distributed in the hope that it will be useful, *
|
||||
# * but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
# * GNU Library General Public License for more details. *
|
||||
# * *
|
||||
# * You should have received a copy of the GNU Library General Public *
|
||||
# * License along with this program; if not, write to the Free Software *
|
||||
# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
|
||||
# * USA *
|
||||
# * *
|
||||
# ***************************************************************************
|
||||
|
||||
__title__ = "FemElementRotation1D"
|
||||
__author__ = "Bernd Hahnebach"
|
||||
__url__ = "http://www.freecadweb.org"
|
||||
|
||||
## @package FemElementRotation1D
|
||||
# \ingroup FEM
|
||||
|
||||
|
||||
class _FemElementRotation1D:
|
||||
"The FemElementRotation1D object"
|
||||
|
||||
def __init__(self, obj):
|
||||
obj.addProperty("App::PropertyAngle", "Rotation", "BeamRotation", "Set the rotation of beam elements")
|
||||
obj.addProperty("App::PropertyLinkSubList", "References", "BeamRotation", "List of beam rotation shapes")
|
||||
obj.Proxy = self
|
||||
self.Type = "Fem::FemElementRotation1D"
|
||||
|
||||
def execute(self, obj):
|
||||
return
|
||||
41
src/Mod/Fem/femobjects/_FemMaterial.py
Normal file
41
src/Mod/Fem/femobjects/_FemMaterial.py
Normal file
@@ -0,0 +1,41 @@
|
||||
# ***************************************************************************
|
||||
# * *
|
||||
# * Copyright (c) 2013 - Juergen Riegel <FreeCAD@juergen-riegel.net> *
|
||||
# * *
|
||||
# * This program is free software; you can redistribute it and/or modify *
|
||||
# * it under the terms of the GNU Lesser General Public License (LGPL) *
|
||||
# * as published by the Free Software Foundation; either version 2 of *
|
||||
# * the License, or (at your option) any later version. *
|
||||
# * for detail see the LICENCE text file. *
|
||||
# * *
|
||||
# * This program is distributed in the hope that it will be useful, *
|
||||
# * but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
# * GNU Library General Public License for more details. *
|
||||
# * *
|
||||
# * You should have received a copy of the GNU Library General Public *
|
||||
# * License along with this program; if not, write to the Free Software *
|
||||
# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
|
||||
# * USA *
|
||||
# * *
|
||||
# ***************************************************************************
|
||||
|
||||
__title__ = "FemMaterial"
|
||||
__author__ = "Juergen Riegel, Bernd Hahnebach"
|
||||
__url__ = "http://www.freecadweb.org"
|
||||
|
||||
## @package FemMaterial
|
||||
# \ingroup FEM
|
||||
|
||||
|
||||
class _FemMaterial:
|
||||
"The FEM Material object"
|
||||
def __init__(self, obj):
|
||||
obj.addProperty("App::PropertyLinkSubList", "References", "Material", "List of material shapes")
|
||||
obj.addProperty("App::PropertyEnumeration", "Category", "Material", "Material type: fluid or solid")
|
||||
obj.Category = ['Solid', 'Fluid'] # used in TaskPanel
|
||||
obj.Proxy = self
|
||||
self.Type = "Fem::Material"
|
||||
|
||||
def execute(self, obj):
|
||||
return
|
||||
54
src/Mod/Fem/femobjects/_FemMaterialMechanicalNonlinear.py
Normal file
54
src/Mod/Fem/femobjects/_FemMaterialMechanicalNonlinear.py
Normal file
@@ -0,0 +1,54 @@
|
||||
# ***************************************************************************
|
||||
# * *
|
||||
# * Copyright (c) 2016 - Bernd Hahnebach <bernd@bimstatik.org> *
|
||||
# * *
|
||||
# * This program is free software; you can redistribute it and/or modify *
|
||||
# * it under the terms of the GNU Lesser General Public License (LGPL) *
|
||||
# * as published by the Free Software Foundation; either version 2 of *
|
||||
# * the License, or (at your option) any later version. *
|
||||
# * for detail see the LICENCE text file. *
|
||||
# * *
|
||||
# * This program is distributed in the hope that it will be useful, *
|
||||
# * but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
# * GNU Library General Public License for more details. *
|
||||
# * *
|
||||
# * You should have received a copy of the GNU Library General Public *
|
||||
# * License along with this program; if not, write to the Free Software *
|
||||
# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
|
||||
# * USA *
|
||||
# * *
|
||||
# ***************************************************************************
|
||||
|
||||
__title__ = "the fem nonlinear mechanical material object"
|
||||
__author__ = "Bernd Hahnebach"
|
||||
__url__ = "http://www.freecadweb.org"
|
||||
|
||||
## @package FemMaterialMechanicalNonLinear
|
||||
# \ingroup FEM
|
||||
|
||||
|
||||
class _FemMaterialMechanicalNonlinear:
|
||||
"The FemMaterialMechanicalNonlinear object"
|
||||
def __init__(self, obj):
|
||||
obj.Proxy = self
|
||||
self.Type = "Fem::MaterialMechanicalNonlinear"
|
||||
|
||||
obj.addProperty("App::PropertyLink", "LinearBaseMaterial", "Base", "Set the linear material the nonlinear builds upon.")
|
||||
|
||||
choices_nonlinear_material_models = ["simple hardening"]
|
||||
obj.addProperty("App::PropertyEnumeration", "MaterialModelNonlinearity", "Fem", "Set the type on nonlinear material model")
|
||||
obj.MaterialModelNonlinearity = choices_nonlinear_material_models
|
||||
obj.MaterialModelNonlinearity = choices_nonlinear_material_models[0]
|
||||
|
||||
obj.addProperty("App::PropertyString", "YieldPoint1", "Fem", "Set stress and strain for yield point one, separated by a comma.")
|
||||
obj.YieldPoint1 = "235.0, 0.0"
|
||||
|
||||
obj.addProperty("App::PropertyString", "YieldPoint2", "Fem", "Set stress and strain for yield point two, separated by a comma.")
|
||||
obj.YieldPoint2 = "241.0, 0.025"
|
||||
|
||||
obj.addProperty("App::PropertyString", "YieldPoint3", "Fem", "Set stress and strain for yield point three, separated by a comma.")
|
||||
obj.YieldPoint3 = ""
|
||||
|
||||
def execute(self, obj):
|
||||
return
|
||||
59
src/Mod/Fem/femobjects/_FemMeshBoundaryLayer.py
Normal file
59
src/Mod/Fem/femobjects/_FemMeshBoundaryLayer.py
Normal file
@@ -0,0 +1,59 @@
|
||||
# ***************************************************************************
|
||||
# * *
|
||||
# * Copyright (c) 2016 - Bernd Hahnebach <bernd@bimstatik.org> *
|
||||
# * *
|
||||
# * This program is free software; you can redistribute it and/or modify *
|
||||
# * it under the terms of the GNU Lesser General Public License (LGPL) *
|
||||
# * as published by the Free Software Foundation; either version 2 of *
|
||||
# * the License, or (at your option) any later version. *
|
||||
# * for detail see the LICENCE text file. *
|
||||
# * *
|
||||
# * This program is distributed in the hope that it will be useful, *
|
||||
# * but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
# * GNU Library General Public License for more details. *
|
||||
# * *
|
||||
# * You should have received a copy of the GNU Library General Public *
|
||||
# * License along with this program; if not, write to the Free Software *
|
||||
# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
|
||||
# * USA *
|
||||
# * *
|
||||
# ***************************************************************************
|
||||
|
||||
__title__ = "_FemMeshBoundaryLayer"
|
||||
__author__ = "Bernd Hahnebach, Qingfeng Xia"
|
||||
__url__ = "http://www.freecadweb.org"
|
||||
|
||||
## @package FemMeshBoundaryLayer
|
||||
# \ingroup FEM
|
||||
|
||||
|
||||
class _FemMeshBoundaryLayer:
|
||||
"The FemMeshBoundaryLayer object"
|
||||
def __init__(self, obj):
|
||||
self.Type = "Fem::FemMeshBoundaryLayer"
|
||||
self.Object = obj # keep a ref to the DocObj for nonGui usage
|
||||
obj.Proxy = self # link between App::DocumentObject to this object
|
||||
|
||||
obj.addProperty("App::PropertyInteger", "NumberOfLayers", "MeshBoundaryLayerProperties", "set number of inflation layers for this boundary")
|
||||
|
||||
obj.NumberOfLayers = 3
|
||||
|
||||
obj.addProperty("App::PropertyLength", "MinimumThickness", "MeshBoundaryLayerProperties", "set minimum thickness,usually the first inflation layer")
|
||||
# default to zero, user must specify a proper value for this property
|
||||
|
||||
obj.addProperty("App::PropertyFloat", "GrowthRate", "MeshBoundaryLayerProperties", "set growth rate of inflation layers for smooth transition")
|
||||
|
||||
obj.GrowthRate = 1.5
|
||||
|
||||
obj.addProperty("App::PropertyLinkSubList", "References", "MeshBoundaryLayerShapes", "List of FEM mesh region shapes")
|
||||
|
||||
def execute(self, obj):
|
||||
return
|
||||
|
||||
def __getstate__(self):
|
||||
return self.Type
|
||||
|
||||
def __setstate__(self, state):
|
||||
if state:
|
||||
self.Type = state
|
||||
109
src/Mod/Fem/femobjects/_FemMeshGmsh.py
Normal file
109
src/Mod/Fem/femobjects/_FemMeshGmsh.py
Normal file
@@ -0,0 +1,109 @@
|
||||
# ***************************************************************************
|
||||
# * *
|
||||
# * Copyright (c) 2016 - Bernd Hahnebach <bernd@bimstatik.org> *
|
||||
# * *
|
||||
# * This program is free software; you can redistribute it and/or modify *
|
||||
# * it under the terms of the GNU Lesser General Public License (LGPL) *
|
||||
# * as published by the Free Software Foundation; either version 2 of *
|
||||
# * the License, or (at your option) any later version. *
|
||||
# * for detail see the LICENCE text file. *
|
||||
# * *
|
||||
# * This program is distributed in the hope that it will be useful, *
|
||||
# * but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
# * GNU Library General Public License for more details. *
|
||||
# * *
|
||||
# * You should have received a copy of the GNU Library General Public *
|
||||
# * License along with this program; if not, write to the Free Software *
|
||||
# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
|
||||
# * USA *
|
||||
# * *
|
||||
# ***************************************************************************
|
||||
|
||||
__title__ = "_FemMeshGmsh"
|
||||
__author__ = "Bernd Hahnebach"
|
||||
__url__ = "http://www.freecadweb.org"
|
||||
|
||||
## @package FemMeshGmsh
|
||||
# \ingroup FEM
|
||||
|
||||
|
||||
class _FemMeshGmsh():
|
||||
"""A Fem::FemMeshObject python type, add Gmsh specific properties
|
||||
"""
|
||||
|
||||
# they will be used from the task panel too, thus they need to be outside of the __init__
|
||||
known_element_dimensions = ['From Shape', '1D', '2D', '3D']
|
||||
known_element_orders = ['1st', '2nd']
|
||||
known_mesh_algorithm_2D = ['Automatic', 'MeshAdapt', 'Delaunay', 'Frontal', 'BAMG', 'DelQuad']
|
||||
known_mesh_algorithm_3D = ['Automatic', 'Delaunay', 'New Delaunay', 'Frontal', 'Frontal Delaunay', 'Frontal Hex', 'MMG3D', 'R-tree']
|
||||
|
||||
def __init__(self, obj):
|
||||
self.Type = "Fem::FemMeshGmsh"
|
||||
self.Object = obj # keep a ref to the DocObj for nonGui usage
|
||||
obj.Proxy = self # link between App::DocumentObject to this object
|
||||
|
||||
obj.addProperty("App::PropertyLinkList", "MeshBoundaryLayerList", "Base", "Mesh boundaries need inflation layers")
|
||||
obj.MeshBoundaryLayerList = []
|
||||
|
||||
obj.addProperty("App::PropertyLinkList", "MeshRegionList", "Base", "Mesh regions of the mesh")
|
||||
obj.MeshRegionList = []
|
||||
|
||||
obj.addProperty("App::PropertyLinkList", "MeshGroupList", "Base", "Mesh groups of the mesh")
|
||||
obj.MeshRegionList = []
|
||||
|
||||
obj.addProperty("App::PropertyLink", "Part", "FEM Mesh", "Part object to mesh")
|
||||
obj.Part = None
|
||||
|
||||
obj.addProperty("App::PropertyLength", "CharacteristicLengthMax", "FEM Gmsh Mesh Params", "Max mesh element size (0.0 = infinity)")
|
||||
obj.CharacteristicLengthMax = 0.0 # will be 1e+22
|
||||
|
||||
obj.addProperty("App::PropertyLength", "CharacteristicLengthMin", "FEM Gmsh Mesh Params", "Min mesh element size")
|
||||
obj.CharacteristicLengthMin = 0.0
|
||||
|
||||
obj.addProperty("App::PropertyEnumeration", "ElementDimension", "FEM Gmsh Mesh Params", "Dimension of mesh elements (Auto = according ShapeType of part to mesh)")
|
||||
obj.ElementDimension = _FemMeshGmsh.known_element_dimensions
|
||||
obj.ElementDimension = 'From Shape' # according ShapeType of Part to mesh
|
||||
|
||||
obj.addProperty("App::PropertyEnumeration", "ElementOrder", "FEM Gmsh Mesh Params", "Order of mesh elements")
|
||||
obj.ElementOrder = _FemMeshGmsh.known_element_orders
|
||||
obj.ElementOrder = '2nd'
|
||||
|
||||
obj.addProperty("App::PropertyBool", "OptimizeStd", "FEM Gmsh Mesh Params", "Optimize tetra elements")
|
||||
obj.OptimizeStd = True
|
||||
|
||||
obj.addProperty("App::PropertyBool", "OptimizeNetgen", "FEM Gmsh Mesh Params", "Optimize tetra elements by use of Netgen")
|
||||
obj.OptimizeNetgen = False
|
||||
|
||||
obj.addProperty("App::PropertyBool", "HighOrderOptimize", "FEM Gmsh Mesh Params", "Optimize high order meshes")
|
||||
obj.HighOrderOptimize = False
|
||||
|
||||
obj.addProperty("App::PropertyBool", "RecombineAll", "FEM Gmsh Mesh Params", "Apply recombination algorithm to all surfaces")
|
||||
obj.RecombineAll = False
|
||||
|
||||
obj.addProperty("App::PropertyBool", "CoherenceMesh", "FEM Gmsh Mesh Params", "Removes all duplicate mesh vertices")
|
||||
obj.CoherenceMesh = True
|
||||
|
||||
obj.addProperty("App::PropertyFloat", "GeometryTolerance", "FEM Gmsh Mesh Params", "Geometrical Tolerance (0.0 = GMSH std = 1e-08)")
|
||||
obj.GeometryTolerance = 1e-06
|
||||
|
||||
obj.addProperty("App::PropertyEnumeration", "Algorithm2D", "FEM Gmsh Mesh Params", "mesh algorithm 2D")
|
||||
obj.Algorithm2D = _FemMeshGmsh.known_mesh_algorithm_2D
|
||||
obj.Algorithm2D = 'Automatic' # ?
|
||||
|
||||
obj.addProperty("App::PropertyEnumeration", "Algorithm3D", "FEM Gmsh Mesh Params", "mesh algorithm 3D")
|
||||
obj.Algorithm3D = _FemMeshGmsh.known_mesh_algorithm_3D
|
||||
obj.Algorithm3D = 'Automatic' # ?
|
||||
|
||||
obj.addProperty("App::PropertyBool", "GroupsOfNodes", "FEM Gmsh Mesh Params", "For each group create not only the elements but the nodes too.")
|
||||
obj.GroupsOfNodes = False
|
||||
|
||||
def execute(self, obj):
|
||||
return
|
||||
|
||||
def __getstate__(self):
|
||||
return self.Type
|
||||
|
||||
def __setstate__(self, state):
|
||||
if state:
|
||||
self.Type = state
|
||||
40
src/Mod/Fem/femobjects/_FemMeshGroup.py
Normal file
40
src/Mod/Fem/femobjects/_FemMeshGroup.py
Normal file
@@ -0,0 +1,40 @@
|
||||
# ***************************************************************************
|
||||
# * *
|
||||
# * Copyright (c) 2016 - Bernd Hahnebach <bernd@bimstatik.org> *
|
||||
# * *
|
||||
# * This program is free software; you can redistribute it and/or modify *
|
||||
# * it under the terms of the GNU Lesser General Public License (LGPL) *
|
||||
# * as published by the Free Software Foundation; either version 2 of *
|
||||
# * the License, or (at your option) any later version. *
|
||||
# * for detail see the LICENCE text file. *
|
||||
# * *
|
||||
# * This program is distributed in the hope that it will be useful, *
|
||||
# * but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
# * GNU Library General Public License for more details. *
|
||||
# * *
|
||||
# * You should have received a copy of the GNU Library General Public *
|
||||
# * License along with this program; if not, write to the Free Software *
|
||||
# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
|
||||
# * USA *
|
||||
# * *
|
||||
# ***************************************************************************
|
||||
|
||||
__title__ = "_FemMeshGroup"
|
||||
__author__ = "Bernd Hahnebach"
|
||||
__url__ = "http://www.freecadweb.org"
|
||||
|
||||
## @package FemMeshGroup
|
||||
# \ingroup FEM
|
||||
|
||||
|
||||
class _FemMeshGroup:
|
||||
"The FemMeshGroup object"
|
||||
def __init__(self, obj):
|
||||
obj.addProperty("App::PropertyBool", "UseLabel", "MeshGroupProperties", "The identifier used for export (True: Label, False: Name)")
|
||||
obj.addProperty("App::PropertyLinkSubList", "References", "MeshGroupShapes", "List of FEM mesh group shapes")
|
||||
obj.Proxy = self
|
||||
self.Type = "Fem::FemMeshGroup"
|
||||
|
||||
def execute(self, obj):
|
||||
return
|
||||
40
src/Mod/Fem/femobjects/_FemMeshRegion.py
Normal file
40
src/Mod/Fem/femobjects/_FemMeshRegion.py
Normal file
@@ -0,0 +1,40 @@
|
||||
# ***************************************************************************
|
||||
# * *
|
||||
# * Copyright (c) 2016 - Bernd Hahnebach <bernd@bimstatik.org> *
|
||||
# * *
|
||||
# * This program is free software; you can redistribute it and/or modify *
|
||||
# * it under the terms of the GNU Lesser General Public License (LGPL) *
|
||||
# * as published by the Free Software Foundation; either version 2 of *
|
||||
# * the License, or (at your option) any later version. *
|
||||
# * for detail see the LICENCE text file. *
|
||||
# * *
|
||||
# * This program is distributed in the hope that it will be useful, *
|
||||
# * but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
# * GNU Library General Public License for more details. *
|
||||
# * *
|
||||
# * You should have received a copy of the GNU Library General Public *
|
||||
# * License along with this program; if not, write to the Free Software *
|
||||
# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
|
||||
# * USA *
|
||||
# * *
|
||||
# ***************************************************************************
|
||||
|
||||
__title__ = "_FemMeshRegion"
|
||||
__author__ = "Bernd Hahnebach"
|
||||
__url__ = "http://www.freecadweb.org"
|
||||
|
||||
## @package FemMeshRegion
|
||||
# \ingroup FEM
|
||||
|
||||
|
||||
class _FemMeshRegion:
|
||||
"The FemMeshRegion object"
|
||||
def __init__(self, obj):
|
||||
obj.addProperty("App::PropertyLength", "CharacteristicLength", "MeshRegionProperties", "set characteristic length of FEM elements for this region")
|
||||
obj.addProperty("App::PropertyLinkSubList", "References", "MeshRegionShapes", "List of FEM mesh region shapes")
|
||||
obj.Proxy = self
|
||||
self.Type = "Fem::FemMeshRegion"
|
||||
|
||||
def execute(self, obj):
|
||||
return
|
||||
48
src/Mod/Fem/femobjects/_FemMeshResult.py
Normal file
48
src/Mod/Fem/femobjects/_FemMeshResult.py
Normal file
@@ -0,0 +1,48 @@
|
||||
# ***************************************************************************
|
||||
# * *
|
||||
# * Copyright (c) 2017 - Bernd Hahnebach <bernd@bimstatik.org> *
|
||||
# * *
|
||||
# * This program is free software; you can redistribute it and/or modify *
|
||||
# * it under the terms of the GNU Lesser General Public License (LGPL) *
|
||||
# * as published by the Free Software Foundation; either version 2 of *
|
||||
# * the License, or (at your option) any later version. *
|
||||
# * for detail see the LICENCE text file. *
|
||||
# * *
|
||||
# * This program is distributed in the hope that it will be useful, *
|
||||
# * but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
# * GNU Library General Public License for more details. *
|
||||
# * *
|
||||
# * You should have received a copy of the GNU Library General Public *
|
||||
# * License along with this program; if not, write to the Free Software *
|
||||
# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
|
||||
# * USA *
|
||||
# * *
|
||||
# ***************************************************************************
|
||||
|
||||
__title__ = "_FemMeshResult"
|
||||
__author__ = "Bernd Hahnebach"
|
||||
__url__ = "http://www.freecadweb.org"
|
||||
|
||||
## @package FemMeshResult
|
||||
# \ingroup FEM
|
||||
|
||||
|
||||
class _FemMeshResult():
|
||||
"""The Fem::FemMeshObject's Proxy python type, add Result specific object type
|
||||
"""
|
||||
|
||||
def __init__(self, obj):
|
||||
self.Type = "Fem::FemMeshResult"
|
||||
self.Object = obj # keep a ref to the DocObj for nonGui usage
|
||||
obj.Proxy = self # link between App::DocumentObject to this object
|
||||
|
||||
def execute(self, obj):
|
||||
return
|
||||
|
||||
def __getstate__(self):
|
||||
return self.Type
|
||||
|
||||
def __setstate__(self, state):
|
||||
if state:
|
||||
self.Type = state
|
||||
99
src/Mod/Fem/femobjects/_FemResultMechanical.py
Normal file
99
src/Mod/Fem/femobjects/_FemResultMechanical.py
Normal file
@@ -0,0 +1,99 @@
|
||||
#***************************************************************************
|
||||
#* *
|
||||
#* Copyright (c) 2016 - Qingfeng Xia <qingfeng.xia()eng.ox.ac.uk> *
|
||||
#* *
|
||||
#* This program is free software; you can redistribute it and/or modify *
|
||||
#* it under the terms of the GNU Lesser General Public License (LGPL) *
|
||||
#* as published by the Free Software Foundation; either version 2 of *
|
||||
#* the License, or (at your option) any later version. *
|
||||
#* for detail see the LICENCE text file. *
|
||||
#* *
|
||||
#* This program is distributed in the hope that it will be useful, *
|
||||
#* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
#* GNU Library General Public License for more details. *
|
||||
#* *
|
||||
#* You should have received a copy of the GNU Library General Public *
|
||||
#* License along with this program; if not, write to the Free Software *
|
||||
#* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
|
||||
#* USA *
|
||||
#* *
|
||||
#***************************************************************************
|
||||
|
||||
__title__ = "DocumentOject Class to hold mechanical FEM results"
|
||||
__author__ = "Qingfeng Xia, Bernd Hahnebach"
|
||||
__url__ = "http://www.freecadweb.org"
|
||||
|
||||
## @package FemResultMechanical
|
||||
# \ingroup FEM
|
||||
# \brief FreeCAD DocumentObject class to hold mechanical results in FEM workbench
|
||||
|
||||
|
||||
class _FemResultMechanical():
|
||||
"""The Fem::_FemResultMechanical's Proxy python type, add result specific properties
|
||||
"""
|
||||
def __init__(self, obj):
|
||||
self.Type = "Fem::FemResultMechanical"
|
||||
self.Object = obj # keep a ref to the DocObj for nonGui usage
|
||||
obj.Proxy = self # link between App::DocumentObject to this object
|
||||
|
||||
obj.addProperty("App::PropertyString", "ResultType", "Base", "Type of the result", 1) # the 1 set the property to ReadOnly
|
||||
obj.ResultType = str(self.Type)
|
||||
|
||||
# `Time, Stats` should have been defined in base cpp class
|
||||
|
||||
# does not show up in propertyEditor of combiView
|
||||
obj.addProperty("App::PropertyVectorList", "DisplacementVectors", "Fem", "List of displacement vectors", True)
|
||||
|
||||
# does not show up in propertyEditor of combiView
|
||||
obj.addProperty("App::PropertyVectorList", "StressVectors", "Fem", "List of stress vectors", True)
|
||||
|
||||
# does not show up in propertyEditor of combiView
|
||||
obj.addProperty("App::PropertyVectorList", "StrainVectors", "Fem", "List of strain vectors", True)
|
||||
|
||||
# does not show up in propertyEditor of combiView
|
||||
obj.addProperty("App::PropertyFloatList", "Peeq", "Fem", "List of equivalent plastic strain values", True)
|
||||
|
||||
# readonly in propertyEditor of combiView
|
||||
obj.addProperty("App::PropertyFloatList", "DisplacementLengths", "Fem", "List of displacement lengths", True)
|
||||
|
||||
obj.addProperty("App::PropertyFloatList", "StressValues", "Fem", "", True)
|
||||
|
||||
obj.addProperty("App::PropertyFloatList", "PrincipalMax", "Fem", "", True)
|
||||
|
||||
obj.addProperty("App::PropertyFloatList", "PrincipalMed", "Fem", "", True)
|
||||
|
||||
obj.addProperty("App::PropertyFloatList", "PrincipalMin", "Fem", "", True)
|
||||
|
||||
obj.addProperty("App::PropertyFloatList", "MaxShear", "Fem", "List of Maximum Shear stress values", True)
|
||||
|
||||
obj.addProperty("App::PropertyFloatList", "MassFlowRate", "Fem", "List of mass flow rate values", True)
|
||||
|
||||
obj.addProperty("App::PropertyFloatList", "NetworkPressure", "Fem", "List of network pressure values", True)
|
||||
|
||||
obj.addProperty("App::PropertyFloatList", "UserDefined", "Fem", "User Defined Results", True)
|
||||
|
||||
# temperature field is needed in the thermal stress analysis
|
||||
obj.addProperty("App::PropertyFloatList", "Temperature", "Fem", "Temperature field", True)
|
||||
|
||||
# for frequency analysis
|
||||
obj.addProperty("App::PropertyInteger", "Eigenmode", "Fem", "", True)
|
||||
|
||||
obj.addProperty("App::PropertyFloat", "EigenmodeFrequency", "Fem", "User Defined Results", True)
|
||||
|
||||
# standard FeutureT methods
|
||||
def execute(self, obj):
|
||||
""""this method is executed on object creation and whenever the document is recomputed"
|
||||
update Part or Mesh should NOT lead to recompution of the analysis automatically, time consuming
|
||||
"""
|
||||
return
|
||||
|
||||
def onChanged(self, obj, prop):
|
||||
return
|
||||
|
||||
def __getstate__(self):
|
||||
return self.Type
|
||||
|
||||
def __setstate__(self, state):
|
||||
if state:
|
||||
self.Type = state
|
||||
159
src/Mod/Fem/femobjects/_FemSolverCalculix.py
Normal file
159
src/Mod/Fem/femobjects/_FemSolverCalculix.py
Normal file
@@ -0,0 +1,159 @@
|
||||
# ***************************************************************************
|
||||
# * *
|
||||
# * Copyright (c) 2015 - Bernd Hahnebach <bernd@bimstatik.org> *
|
||||
# * *
|
||||
# * This program is free software; you can redistribute it and/or modify *
|
||||
# * it under the terms of the GNU Lesser General Public License (LGPL) *
|
||||
# * as published by the Free Software Foundation; either version 2 of *
|
||||
# * the License, or (at your option) any later version. *
|
||||
# * for detail see the LICENCE text file. *
|
||||
# * *
|
||||
# * This program is distributed in the hope that it will be useful, *
|
||||
# * but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
# * GNU Library General Public License for more details. *
|
||||
# * *
|
||||
# * You should have received a copy of the GNU Library General Public *
|
||||
# * License along with this program; if not, write to the Free Software *
|
||||
# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
|
||||
# * USA *
|
||||
# * *
|
||||
# ***************************************************************************
|
||||
|
||||
__title__ = "_FemSolverCalculix"
|
||||
__author__ = "Bernd Hahnebach"
|
||||
__url__ = "http://www.freecadweb.org"
|
||||
|
||||
## @package FemSolverCalculix
|
||||
# \ingroup FEM
|
||||
|
||||
import FreeCAD
|
||||
from femtools import ccxtools
|
||||
|
||||
|
||||
class _FemSolverCalculix():
|
||||
"""The Fem::FemSolver's Proxy python type, add solver specific properties
|
||||
"""
|
||||
def __init__(self, obj):
|
||||
self.Type = "Fem::FemSolverCalculix"
|
||||
self.Object = obj # keep a ref to the DocObj for nonGui usage
|
||||
obj.Proxy = self # link between App::DocumentObject to this object
|
||||
|
||||
obj.addProperty("App::PropertyString", "SolverType", "Base", "Type of the solver", 1) # the 1 set the property to ReadOnly
|
||||
obj.SolverType = 'FemSolverCalculix'
|
||||
|
||||
# fem_prefs = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Fem/General") # not needed ATM
|
||||
ccx_prefs = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Fem/Ccx")
|
||||
|
||||
obj.addProperty("App::PropertyPath", "WorkingDir", "Fem", "Working directory for calculations, will only be used it is left blank in preferences")
|
||||
# the working directory is not set, the solver working directory is only used if the preferences working directory is left blank
|
||||
|
||||
obj.addProperty("App::PropertyEnumeration", "AnalysisType", "Fem", "Type of the analysis")
|
||||
obj.AnalysisType = ccxtools.FemToolsCcx.known_analysis_types
|
||||
analysis_type = ccx_prefs.GetInt("AnalysisType", 0)
|
||||
obj.AnalysisType = ccxtools.FemToolsCcx.known_analysis_types[analysis_type]
|
||||
|
||||
choices_geom_nonlinear = ["linear", "nonlinear"]
|
||||
obj.addProperty("App::PropertyEnumeration", "GeometricalNonlinearity", "Fem", "Set geometrical nonlinearity")
|
||||
obj.GeometricalNonlinearity = choices_geom_nonlinear
|
||||
nonlinear_geom = ccx_prefs.GetBool("NonlinearGeometry", False)
|
||||
if nonlinear_geom is True:
|
||||
obj.GeometricalNonlinearity = choices_geom_nonlinear[1] # nonlinear
|
||||
else:
|
||||
obj.GeometricalNonlinearity = choices_geom_nonlinear[0] # linear
|
||||
|
||||
choices_material_nonlinear = ["linear", "nonlinear"]
|
||||
obj.addProperty("App::PropertyEnumeration", "MaterialNonlinearity", "Fem", "Set material nonlinearity (needs geometrical nonlinearity)")
|
||||
obj.MaterialNonlinearity = choices_material_nonlinear
|
||||
obj.MaterialNonlinearity = choices_material_nonlinear[0]
|
||||
|
||||
obj.addProperty("App::PropertyIntegerConstraint", "EigenmodesCount", "Fem", "Number of modes for frequency calculations")
|
||||
noe = ccx_prefs.GetInt("EigenmodesCount", 10)
|
||||
obj.EigenmodesCount = (noe, 1, 100, 1)
|
||||
|
||||
obj.addProperty("App::PropertyFloatConstraint", "EigenmodeLowLimit", "Fem", "Low frequency limit for eigenmode calculations")
|
||||
ell = ccx_prefs.GetFloat("EigenmodeLowLimit", 0.0)
|
||||
obj.EigenmodeLowLimit = (ell, 0.0, 1000000.0, 10000.0)
|
||||
|
||||
obj.addProperty("App::PropertyFloatConstraint", "EigenmodeHighLimit", "Fem", "High frequency limit for eigenmode calculations")
|
||||
ehl = ccx_prefs.GetFloat("EigenmodeHighLimit", 1000000.0)
|
||||
obj.EigenmodeHighLimit = (ehl, 0.0, 1000000.0, 10000.0)
|
||||
|
||||
obj.addProperty("App::PropertyIntegerConstraint", "IterationsThermoMechMaximum", "Fem", "Maximum Number of thermo mechanical iterations in each time step before stopping jobs")
|
||||
niter = ccx_prefs.GetInt("AnalysisMaxIterations", 200)
|
||||
obj.IterationsThermoMechMaximum = niter
|
||||
|
||||
obj.addProperty("App::PropertyFloatConstraint", "TimeInitialStep", "Fem", "Initial time steps")
|
||||
ini = ccx_prefs.GetFloat("AnalysisTimeInitialStep", 1.0)
|
||||
obj.TimeInitialStep = ini
|
||||
|
||||
obj.addProperty("App::PropertyFloatConstraint", "TimeEnd", "Fem", "End time analysis")
|
||||
eni = ccx_prefs.GetFloat("AnalysisTime", 1.0)
|
||||
obj.TimeEnd = eni
|
||||
|
||||
obj.addProperty("App::PropertyBool", "ThermoMechSteadyState", "Fem", "Choose between steady state thermo mech or transient thermo mech analysis")
|
||||
sted = ccx_prefs.GetBool("StaticAnalysis", True)
|
||||
obj.ThermoMechSteadyState = sted
|
||||
|
||||
obj.addProperty("App::PropertyBool", "IterationsControlParameterTimeUse", "Fem", "Use the user defined time incrementation control parameter")
|
||||
use_non_ccx_iterations_param = ccx_prefs.GetInt("UseNonCcxIterationParam", False)
|
||||
obj.IterationsControlParameterTimeUse = use_non_ccx_iterations_param
|
||||
|
||||
obj.addProperty("App::PropertyBool", "SplitInputWriter", "Fem", "Split writing of ccx input file")
|
||||
split = ccx_prefs.GetBool("SplitInputWriter", False)
|
||||
obj.SplitInputWriter = split
|
||||
|
||||
ccx_default_time_incrementation_control_parameter = {
|
||||
# iteration parameter
|
||||
'I_0': 4,
|
||||
'I_R': 8,
|
||||
'I_P': 9,
|
||||
'I_C': 200, # ccx default = 16
|
||||
'I_L': 10,
|
||||
'I_G': 400, # ccx default = 4
|
||||
'I_S': None,
|
||||
'I_A': 200, # ccx default = 5
|
||||
'I_J': None,
|
||||
'I_T': None,
|
||||
# cutback parameter
|
||||
'D_f': 0.25,
|
||||
'D_C': 0.5,
|
||||
'D_B': 0.75,
|
||||
'D_A': 0.85,
|
||||
'D_S': None,
|
||||
'D_H': None,
|
||||
'D_D': 1.5,
|
||||
'W_G': None}
|
||||
p = ccx_default_time_incrementation_control_parameter
|
||||
p_iter = '{0},{1},{2},{3},{4},{5},{6},{7},{8},{9}'.format(p['I_0'], p['I_R'], p['I_P'], p['I_C'], p['I_L'], p['I_G'], '', p['I_A'], '', '')
|
||||
p_cutb = '{0},{1},{2},{3},{4},{5},{6},{7}'.format(p['D_f'], p['D_C'], p['D_B'], p['D_A'], '', '', p['D_D'], '')
|
||||
obj.addProperty("App::PropertyString", "IterationsControlParameterIter", "Fem", "User defined time incrementation iterations control parameter")
|
||||
obj.IterationsControlParameterIter = p_iter
|
||||
obj.addProperty("App::PropertyString", "IterationsControlParameterCutb", "Fem", "User defined time incrementation cutbacks control parameter")
|
||||
obj.IterationsControlParameterCutb = p_cutb
|
||||
|
||||
obj.addProperty("App::PropertyBool", "IterationsUserDefinedIncrementations", "Fem", "Set to True to switch off the ccx automatic incrementation completely (ccx parameter DIRECT). Use with care. Analysis may not converge!")
|
||||
obj.IterationsUserDefinedIncrementations = False
|
||||
|
||||
obj.addProperty("App::PropertyBool", "IterationsUserDefinedTimeStepLength", "Fem", "Set to True to use the user defined time steps. The time steps are set with TimeInitialStep and TimeEnd")
|
||||
obj.IterationsUserDefinedTimeStepLength = False
|
||||
|
||||
known_ccx_solver_types = ["default", "spooles", "iterativescaling", "iterativecholesky"]
|
||||
obj.addProperty("App::PropertyEnumeration", "MatrixSolverType", "Fem", "Type of solver to use")
|
||||
obj.MatrixSolverType = known_ccx_solver_types
|
||||
solver_type = ccx_prefs.GetInt("Solver", 0)
|
||||
obj.MatrixSolverType = known_ccx_solver_types[solver_type]
|
||||
|
||||
obj.addProperty("App::PropertyBool", "BeamShellResultOutput3D", "Fem", "Output 3D results for 1D and 2D analysis ")
|
||||
dimout = ccx_prefs.GetBool("BeamShellOutput", False)
|
||||
obj.BeamShellResultOutput3D = dimout
|
||||
|
||||
def execute(self, obj):
|
||||
return
|
||||
|
||||
def __getstate__(self):
|
||||
return self.Type
|
||||
|
||||
def __setstate__(self, state):
|
||||
if state:
|
||||
self.Type = state
|
||||
29
src/Mod/Fem/femobjects/__init__.py
Normal file
29
src/Mod/Fem/femobjects/__init__.py
Normal file
@@ -0,0 +1,29 @@
|
||||
# ***************************************************************************
|
||||
# * *
|
||||
# * Copyright (c) 2017 - Bernd Hahnebach <bernd@bimstatik.org> *
|
||||
# * *
|
||||
# * This program is free software; you can redistribute it and/or modify *
|
||||
# * it under the terms of the GNU Lesser General Public License (LGPL) *
|
||||
# * as published by the Free Software Foundation; either version 2 of *
|
||||
# * the License, or (at your option) any later version. *
|
||||
# * for detail see the LICENCE text file. *
|
||||
# * *
|
||||
# * This program is distributed in the hope that it will be useful, *
|
||||
# * but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
# * GNU Library General Public License for more details. *
|
||||
# * *
|
||||
# * You should have received a copy of the GNU Library General Public *
|
||||
# * License along with this program; if not, write to the Free Software *
|
||||
# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
|
||||
# * USA *
|
||||
# * *
|
||||
# ***************************************************************************
|
||||
|
||||
__title__ = "Fem Gui modules"
|
||||
__author__ = "Bernd Hahnebach"
|
||||
__url__ = "http://www.freecadweb.org"
|
||||
|
||||
## @package PyGui
|
||||
# \ingroup Fem
|
||||
# \brief Fem Gui module
|
||||
Reference in New Issue
Block a user