FEM: constraints thermomechanical: object implementation
This commit is contained in:
@@ -51,6 +51,9 @@
|
||||
#include "FemConstraintGear.h"
|
||||
#include "FemConstraintPulley.h"
|
||||
#include "FemConstraintDisplacement.h"
|
||||
#include "FemConstraintTemperature.h"
|
||||
#include "FemConstraintHeatflux.h"
|
||||
#include "FemConstraintInitialTemperature.h"
|
||||
#include "FemConstraintPlaneRotation.h"
|
||||
#include "FemConstraintContact.h"
|
||||
|
||||
@@ -149,6 +152,9 @@ PyMODINIT_FUNC initFem()
|
||||
Fem::ConstraintGear ::init();
|
||||
Fem::ConstraintPulley ::init();
|
||||
Fem::ConstraintDisplacement ::init();
|
||||
Fem::ConstraintTemperature ::init();
|
||||
Fem::ConstraintHeatflux ::init();
|
||||
Fem::ConstraintInitialTemperature ::init();
|
||||
Fem::ConstraintPlaneRotation ::init();
|
||||
Fem::ConstraintContact ::init();
|
||||
|
||||
|
||||
@@ -200,6 +200,12 @@ SET(FemConstraints_SRCS
|
||||
FemConstraintPulley.h
|
||||
FemConstraintDisplacement.h
|
||||
FemConstraintDisplacement.cpp
|
||||
FemConstraintTemperature.h
|
||||
FemConstraintTemperature.cpp
|
||||
FemConstraintHeatflux.h
|
||||
FemConstraintHeatflux.cpp
|
||||
FemConstraintInitialTemperature.h
|
||||
FemConstraintInitialTemperature.cpp
|
||||
FemConstraintPlaneRotation.cpp
|
||||
FemConstraintPlaneRotation.h
|
||||
FemConstraintContact.cpp
|
||||
|
||||
85
src/Mod/Fem/App/FemConstraintHeatflux.cpp
Normal file
85
src/Mod/Fem/App/FemConstraintHeatflux.cpp
Normal file
@@ -0,0 +1,85 @@
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2015 FreeCAD Developers *
|
||||
* Authors: Michael Hindley <hindlemp@eskom.co.za> *
|
||||
* Ruan Olwagen <olwager@eskom.co.za> *
|
||||
* Oswald van Ginkel <vginkeo@eskom.co.za> *
|
||||
* This file is part of the FreeCAD CAx development system. *
|
||||
* *
|
||||
* This library is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU Library General Public *
|
||||
* License as published by the Free Software Foundation; either *
|
||||
* version 2 of the License, or (at your option) any later version. *
|
||||
* *
|
||||
* This library 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 library; see the file COPYING.LIB. If not, *
|
||||
* write to the Free Software Foundation, Inc., 59 Temple Place, *
|
||||
* Suite 330, Boston, MA 02111-1307, USA *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
|
||||
#include "PreCompiled.h"
|
||||
|
||||
#ifndef _PreComp_
|
||||
#include <BRepAdaptor_Curve.hxx>
|
||||
#include <BRepAdaptor_Surface.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <gp_Lin.hxx>
|
||||
#include <gp_Pln.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#endif
|
||||
|
||||
#include "FemConstraintHeatflux.h"
|
||||
|
||||
using namespace Fem;
|
||||
|
||||
PROPERTY_SOURCE(Fem::ConstraintHeatflux, Fem::Constraint);
|
||||
|
||||
ConstraintHeatflux::ConstraintHeatflux()
|
||||
{
|
||||
ADD_PROPERTY(AmbientTemp,(0.0));
|
||||
/*ADD_PROPERTY(FaceTemp,(0.0));*/
|
||||
ADD_PROPERTY(FilmCoef,(0.0));
|
||||
|
||||
ADD_PROPERTY_TYPE(Points,(Base::Vector3d()),"ConstraintHeatflux",App::PropertyType(App::Prop_ReadOnly|App::Prop_Output),
|
||||
"Points where symbols are drawn");
|
||||
ADD_PROPERTY_TYPE(Normals,(Base::Vector3d()),"ConstraintHeatflux",App::PropertyType(App::Prop_ReadOnly|App::Prop_Output),
|
||||
"Normals where symbols are drawn");
|
||||
Points.setValues(std::vector<Base::Vector3d>());
|
||||
Normals.setValues(std::vector<Base::Vector3d>());
|
||||
}
|
||||
|
||||
App::DocumentObjectExecReturn *ConstraintHeatflux::execute(void)
|
||||
{
|
||||
return Constraint::execute();
|
||||
}
|
||||
|
||||
const char* ConstraintHeatflux::getViewProviderName(void) const
|
||||
{
|
||||
return "FemGui::ViewProviderFemConstraintHeatflux";
|
||||
}
|
||||
|
||||
void ConstraintHeatflux::onChanged(const App::Property* prop)
|
||||
{
|
||||
// Note: If we call this at the end, then the arrows are not oriented correctly initially
|
||||
// because the NormalDirection has not been calculated yet
|
||||
Constraint::onChanged(prop);
|
||||
|
||||
if (prop == &References) {
|
||||
std::vector<Base::Vector3d> points;
|
||||
std::vector<Base::Vector3d> normals;
|
||||
int scale = 1; //OvG: Enforce use of scale
|
||||
if (getPoints(points, normals, &scale)) {
|
||||
Points.setValues(points);
|
||||
Normals.setValues(normals);
|
||||
Scale.setValue(scale); //OvG: Scale
|
||||
Points.touch(); // This triggers ViewProvider::updateData()
|
||||
}
|
||||
}
|
||||
}
|
||||
59
src/Mod/Fem/App/FemConstraintHeatflux.h
Normal file
59
src/Mod/Fem/App/FemConstraintHeatflux.h
Normal file
@@ -0,0 +1,59 @@
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2015 FreeCAD Developers *
|
||||
* Authors: Michael Hindley <hindlemp@eskom.co.za> *
|
||||
* Ruan Olwagen <olwager@eskom.co.za> *
|
||||
* Oswald van Ginkel <vginkeo@eskom.co.za> *
|
||||
* Based on Force constraint by Jan Rheinländer *
|
||||
* This file is part of the FreeCAD CAx development system. *
|
||||
* *
|
||||
* This library is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU Library General Public *
|
||||
* License as published by the Free Software Foundation; either *
|
||||
* version 2 of the License, or (at your option) any later version. *
|
||||
* *
|
||||
* This library 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 library; see the file COPYING.LIB. If not, *
|
||||
* write to the Free Software Foundation, Inc., 59 Temple Place, *
|
||||
* Suite 330, Boston, MA 02111-1307, USA *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
|
||||
#ifndef FEM_CONSTRAINTHEATFLUX_H
|
||||
#define FEM_CONSTRAINTHEATFLUX_H
|
||||
|
||||
#include "FemConstraint.h"
|
||||
|
||||
namespace Fem {
|
||||
|
||||
class AppFemExport ConstraintHeatflux : public Fem::Constraint
|
||||
{
|
||||
PROPERTY_HEADER(Fem::ConstraintHeatflux);
|
||||
|
||||
public:
|
||||
ConstraintHeatflux(void);
|
||||
|
||||
App::PropertyFloat AmbientTemp;
|
||||
/*App::PropertyFloat FaceTemp;*/
|
||||
App::PropertyFloat FilmCoef;
|
||||
App::PropertyVectorList Points;
|
||||
App::PropertyVectorList Normals;
|
||||
|
||||
/// recalculate the object
|
||||
virtual App::DocumentObjectExecReturn *execute(void);
|
||||
|
||||
/// returns the type name of the ViewProvider
|
||||
const char* getViewProviderName(void) const;
|
||||
|
||||
protected:
|
||||
virtual void onChanged(const App::Property* prop);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // FEM_CONSTRAINTHEATFLUX_H
|
||||
84
src/Mod/Fem/App/FemConstraintInitialTemperature.cpp
Normal file
84
src/Mod/Fem/App/FemConstraintInitialTemperature.cpp
Normal file
@@ -0,0 +1,84 @@
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2015 FreeCAD Developers *
|
||||
* Authors: Michael Hindley <hindlemp@eskom.co.za> *
|
||||
* Ruan Olwagen <olwager@eskom.co.za> *
|
||||
* Oswald van Ginkel <vginkeo@eskom.co.za> *
|
||||
* Based on Force constraint by Jan Rheinländer *
|
||||
* This file is part of the FreeCAD CAx development system. *
|
||||
* *
|
||||
* This library is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU Library General Public *
|
||||
* License as published by the Free Software Foundation; either *
|
||||
* version 2 of the License, or (at your option) any later version. *
|
||||
* *
|
||||
* This library 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 library; see the file COPYING.LIB. If not, *
|
||||
* write to the Free Software Foundation, Inc., 59 Temple Place, *
|
||||
* Suite 330, Boston, MA 02111-1307, USA *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
|
||||
#include "PreCompiled.h"
|
||||
|
||||
#ifndef _PreComp_
|
||||
#include <BRepAdaptor_Curve.hxx>
|
||||
#include <BRepAdaptor_Surface.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <gp_Lin.hxx>
|
||||
#include <gp_Pln.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#endif
|
||||
|
||||
#include "FemConstraintInitialTemperature.h"
|
||||
|
||||
using namespace Fem;
|
||||
|
||||
PROPERTY_SOURCE(Fem::ConstraintInitialTemperature, Fem::Constraint);
|
||||
|
||||
ConstraintInitialTemperature::ConstraintInitialTemperature()
|
||||
{
|
||||
ADD_PROPERTY(initialTemperature,(300.0));
|
||||
|
||||
ADD_PROPERTY_TYPE(Points,(Base::Vector3d()),"ConstraintInitialTemperature",App::PropertyType(App::Prop_ReadOnly|App::Prop_Output),
|
||||
"Points where symbols are drawn");
|
||||
ADD_PROPERTY_TYPE(Normals,(Base::Vector3d()),"ConstraintInitialTemperature",App::PropertyType(App::Prop_ReadOnly|App::Prop_Output),
|
||||
"Normals where symbols are drawn");
|
||||
Points.setValues(std::vector<Base::Vector3d>());
|
||||
Normals.setValues(std::vector<Base::Vector3d>());
|
||||
}
|
||||
|
||||
App::DocumentObjectExecReturn *ConstraintInitialTemperature::execute(void)
|
||||
{
|
||||
return Constraint::execute();
|
||||
}
|
||||
|
||||
const char* ConstraintInitialTemperature::getViewProviderName(void) const
|
||||
{
|
||||
return "FemGui::ViewProviderFemConstraintInitialTemperature";
|
||||
}
|
||||
|
||||
void ConstraintInitialTemperature::onChanged(const App::Property* prop)
|
||||
{
|
||||
// Note: If we call this at the end, then the arrows are not oriented correctly initially
|
||||
// because the NormalDirection has not been calculated yet
|
||||
Constraint::onChanged(prop);
|
||||
|
||||
if (prop == &References) {
|
||||
std::vector<Base::Vector3d> points;
|
||||
std::vector<Base::Vector3d> normals;
|
||||
int scale = 1; //OvG: Enforce use of scale
|
||||
if (getPoints(points, normals, &scale)) {
|
||||
Points.setValues(points);
|
||||
Normals.setValues(normals);
|
||||
Scale.setValue(scale); //OvG: Scale
|
||||
Points.touch(); // This triggers ViewProvider::updateData()
|
||||
}
|
||||
}
|
||||
}
|
||||
65
src/Mod/Fem/App/FemConstraintInitialTemperature.h
Normal file
65
src/Mod/Fem/App/FemConstraintInitialTemperature.h
Normal file
@@ -0,0 +1,65 @@
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2015 FreeCAD Developers *
|
||||
* Authors: Michael Hindley <hindlemp@eskom.co.za> *
|
||||
* Ruan Olwagen <olwager@eskom.co.za> *
|
||||
* Oswald van Ginkel <vginkeo@eskom.co.za> *
|
||||
* Based on Force constraint by Jan Rheinländer *
|
||||
* This file is part of the FreeCAD CAx development system. *
|
||||
* *
|
||||
* This library is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU Library General Public *
|
||||
* License as published by the Free Software Foundation; either *
|
||||
* version 2 of the License, or (at your option) any later version. *
|
||||
* *
|
||||
* This library 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 library; see the file COPYING.LIB. If not, *
|
||||
* write to the Free Software Foundation, Inc., 59 Temple Place, *
|
||||
* Suite 330, Boston, MA 02111-1307, USA *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
|
||||
#ifndef FEM_CONSTRAINTINITIALTEMPERATURE_H
|
||||
#define FEM_CONSTRAINTINITIALTEMPERATURE_H
|
||||
|
||||
#include "FemConstraint.h"
|
||||
|
||||
namespace Fem
|
||||
{
|
||||
|
||||
class AppFemExport ConstraintInitialTemperature : public Fem::Constraint
|
||||
{
|
||||
PROPERTY_HEADER(Fem::ConstraintInitialTemperature);
|
||||
|
||||
public:
|
||||
/// Constructor
|
||||
ConstraintInitialTemperature(void);
|
||||
|
||||
// Read-only (calculated values). These trigger changes in the ViewProvider
|
||||
App::PropertyVectorList Points;
|
||||
App::PropertyVectorList Normals;
|
||||
|
||||
//Temperature parameters
|
||||
App::PropertyFloat initialTemperature;
|
||||
|
||||
|
||||
/// recalculate the object
|
||||
virtual App::DocumentObjectExecReturn *execute(void);
|
||||
|
||||
/// returns the type name of the ViewProvider
|
||||
const char* getViewProviderName(void) const;
|
||||
|
||||
protected:
|
||||
virtual void onChanged(const App::Property* prop);
|
||||
|
||||
};
|
||||
|
||||
} //namespace Fem
|
||||
|
||||
|
||||
#endif // FEM_CONSTRAINTINITIALTEMPERATURE_H
|
||||
84
src/Mod/Fem/App/FemConstraintTemperature.cpp
Normal file
84
src/Mod/Fem/App/FemConstraintTemperature.cpp
Normal file
@@ -0,0 +1,84 @@
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2015 FreeCAD Developers *
|
||||
* Authors: Michael Hindley <hindlemp@eskom.co.za> *
|
||||
* Ruan Olwagen <olwager@eskom.co.za> *
|
||||
* Oswald van Ginkel <vginkeo@eskom.co.za> *
|
||||
* Based on Force constraint by Jan Rheinländer *
|
||||
* This file is part of the FreeCAD CAx development system. *
|
||||
* *
|
||||
* This library is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU Library General Public *
|
||||
* License as published by the Free Software Foundation; either *
|
||||
* version 2 of the License, or (at your option) any later version. *
|
||||
* *
|
||||
* This library 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 library; see the file COPYING.LIB. If not, *
|
||||
* write to the Free Software Foundation, Inc., 59 Temple Place, *
|
||||
* Suite 330, Boston, MA 02111-1307, USA *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
|
||||
#include "PreCompiled.h"
|
||||
|
||||
#ifndef _PreComp_
|
||||
#include <BRepAdaptor_Curve.hxx>
|
||||
#include <BRepAdaptor_Surface.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <gp_Lin.hxx>
|
||||
#include <gp_Pln.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#endif
|
||||
|
||||
#include "FemConstraintTemperature.h"
|
||||
|
||||
using namespace Fem;
|
||||
|
||||
PROPERTY_SOURCE(Fem::ConstraintTemperature, Fem::Constraint);
|
||||
|
||||
ConstraintTemperature::ConstraintTemperature()
|
||||
{
|
||||
ADD_PROPERTY(Temperature,(300.0));
|
||||
|
||||
ADD_PROPERTY_TYPE(Points,(Base::Vector3d()),"ConstraintTemperature",App::PropertyType(App::Prop_ReadOnly|App::Prop_Output),
|
||||
"Points where symbols are drawn");
|
||||
ADD_PROPERTY_TYPE(Normals,(Base::Vector3d()),"ConstraintTemperature",App::PropertyType(App::Prop_ReadOnly|App::Prop_Output),
|
||||
"Normals where symbols are drawn");
|
||||
Points.setValues(std::vector<Base::Vector3d>());
|
||||
Normals.setValues(std::vector<Base::Vector3d>());
|
||||
}
|
||||
|
||||
App::DocumentObjectExecReturn *ConstraintTemperature::execute(void)
|
||||
{
|
||||
return Constraint::execute();
|
||||
}
|
||||
|
||||
const char* ConstraintTemperature::getViewProviderName(void) const
|
||||
{
|
||||
return "FemGui::ViewProviderFemConstraintTemperature";
|
||||
}
|
||||
|
||||
void ConstraintTemperature::onChanged(const App::Property* prop)
|
||||
{
|
||||
// Note: If we call this at the end, then the arrows are not oriented correctly initially
|
||||
// because the NormalDirection has not been calculated yet
|
||||
Constraint::onChanged(prop);
|
||||
|
||||
if (prop == &References) {
|
||||
std::vector<Base::Vector3d> points;
|
||||
std::vector<Base::Vector3d> normals;
|
||||
int scale = 1; //OvG: Enforce use of scale
|
||||
if (getPoints(points, normals, &scale)) {
|
||||
Points.setValues(points);
|
||||
Normals.setValues(normals);
|
||||
Scale.setValue(scale); //OvG: Scale
|
||||
Points.touch(); // This triggers ViewProvider::updateData()
|
||||
}
|
||||
}
|
||||
}
|
||||
65
src/Mod/Fem/App/FemConstraintTemperature.h
Normal file
65
src/Mod/Fem/App/FemConstraintTemperature.h
Normal file
@@ -0,0 +1,65 @@
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2015 FreeCAD Developers *
|
||||
* Authors: Michael Hindley <hindlemp@eskom.co.za> *
|
||||
* Ruan Olwagen <olwager@eskom.co.za> *
|
||||
* Oswald van Ginkel <vginkeo@eskom.co.za> *
|
||||
* Based on Force constraint by Jan Rheinländer *
|
||||
* This file is part of the FreeCAD CAx development system. *
|
||||
* *
|
||||
* This library is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU Library General Public *
|
||||
* License as published by the Free Software Foundation; either *
|
||||
* version 2 of the License, or (at your option) any later version. *
|
||||
* *
|
||||
* This library 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 library; see the file COPYING.LIB. If not, *
|
||||
* write to the Free Software Foundation, Inc., 59 Temple Place, *
|
||||
* Suite 330, Boston, MA 02111-1307, USA *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
|
||||
#ifndef FEM_CONSTRAINTTEMPERATURE_H
|
||||
#define FEM_CONSTRAINTTEMPERATURE_H
|
||||
|
||||
#include "FemConstraint.h"
|
||||
|
||||
namespace Fem
|
||||
{
|
||||
|
||||
class AppFemExport ConstraintTemperature : public Fem::Constraint
|
||||
{
|
||||
PROPERTY_HEADER(Fem::ConstraintTemperature);
|
||||
|
||||
public:
|
||||
/// Constructor
|
||||
ConstraintTemperature(void);
|
||||
|
||||
// Read-only (calculated values). These trigger changes in the ViewProvider
|
||||
App::PropertyVectorList Points;
|
||||
App::PropertyVectorList Normals;
|
||||
|
||||
//Temperature parameters
|
||||
App::PropertyFloat Temperature;
|
||||
|
||||
|
||||
/// recalculate the object
|
||||
virtual App::DocumentObjectExecReturn *execute(void);
|
||||
|
||||
/// returns the type name of the ViewProvider
|
||||
const char* getViewProviderName(void) const;
|
||||
|
||||
protected:
|
||||
virtual void onChanged(const App::Property* prop);
|
||||
|
||||
};
|
||||
|
||||
} //namespace Fem
|
||||
|
||||
|
||||
#endif // FEM_CONSTRAINTTEMPERATURE_H
|
||||
Reference in New Issue
Block a user