FEM: remove trailing whitespaces

This commit is contained in:
Bernd Hahnebach
2016-04-14 19:43:47 +02:00
committed by wmayer
parent 11a1de07d1
commit 3091fd5973
65 changed files with 217 additions and 217 deletions

View File

@@ -50,7 +50,7 @@
#include "FemConstraintPressure.h"
#include "FemConstraintGear.h"
#include "FemConstraintPulley.h"
#include "FemConstraintDisplacement.h"
#include "FemConstraintDisplacement.h"
#include "FemResultObject.h"
#include "FemSolverObject.h"
@@ -115,7 +115,7 @@ PyMODINIT_FUNC initFem()
// NOTE: To finish the initialization of our own type objects we must
// call PyType_Ready, otherwise we run into a segmentation fault, later on.
// This function is responsible for adding inherited slots from a type's base class.
Fem::FemAnalysis ::init();
Fem::FemAnalysisPython ::init();
Fem::DocumentObject ::init();

View File

@@ -220,7 +220,7 @@ private:
if (!PyArg_ParseTuple(args.ptr(), "O!", &(FemMeshPy::Type), &pcObj))
throw Py::Exception();
App::Document *pcDoc = App::GetApplication().getActiveDocument();
App::Document *pcDoc = App::GetApplication().getActiveDocument();
if (!pcDoc)
pcDoc = App::GetApplication().newDocument();

View File

@@ -154,8 +154,8 @@ SET(FemBase_SRCS
FemMeshProperty.h
)
SOURCE_GROUP("Base types" FILES ${FemBase_SRCS})
SET(FemSet_SRCS
FemSetObject.cpp
FemSetObject.h
@@ -169,7 +169,7 @@ SET(FemSet_SRCS
FemSetGeometryObject.h
)
SOURCE_GROUP("Set objects" FILES ${FemSet_SRCS})
SET(FemConstraints_SRCS
FemConstraintBearing.h
FemConstraintBearing.cpp
@@ -205,10 +205,10 @@ add_library(Fem SHARED ${Fem_SRCS})
target_link_libraries(Fem ${Fem_LIBS})
fc_target_copy_resource(Fem
fc_target_copy_resource(Fem
${CMAKE_SOURCE_DIR}/src/Mod/Fem
${CMAKE_BINARY_DIR}/Mod/Fem
Init.py
Init.py
${FemScripts_SRCS}
${FemTests_SRCS}
)

View File

@@ -60,7 +60,7 @@ PyObject *FemAnalysis::getPyObject()
// ref counter is set to 1
PythonObject = Py::Object(new DocumentObjectPy(this),true);
}
return Py::new_reference_to(PythonObject);
return Py::new_reference_to(PythonObject);
}
void FemAnalysis::onChanged(const Property* prop)

View File

@@ -55,7 +55,7 @@ public:
/// Member objects of the Analysis
App::PropertyLinkList Member;
/// unique identifier of the Analysis
/// unique identifier of the Analysis
App::PropertyUUID Uid;

View File

@@ -44,7 +44,7 @@ public:
App::PropertyLinkSubList References;
// Read-only (calculated values). These trigger changes in the ViewProvider
App::PropertyVector NormalDirection;
//OvG: Scale
App::PropertyInteger Scale;
@@ -55,7 +55,7 @@ public:
virtual const char* getViewProviderName(void) const {
return "FemGui::ViewProviderFemConstraint";
}
//OvG: Allow automatic determination of scaling of constraint drawings, e.g. arrow length and size
int calcDrawScaleFactor(double lparam) const;
int calcDrawScaleFactor(double lvparam, double luparam) const;

View File

@@ -44,25 +44,25 @@ PROPERTY_SOURCE(Fem::ConstraintDisplacement, Fem::Constraint);
ConstraintDisplacement::ConstraintDisplacement()
{
ADD_PROPERTY(xDisplacement,(0.0));
ADD_PROPERTY(yDisplacement,(0.0));
ADD_PROPERTY(zDisplacement,(0.0));
ADD_PROPERTY(xRotation,(0.0));
ADD_PROPERTY(yRotation,(0.0));
ADD_PROPERTY(zRotation,(0.0));
ADD_PROPERTY(xFree,(1));
ADD_PROPERTY(yFree,(1));
ADD_PROPERTY(zFree,(1));
ADD_PROPERTY(xFix,(0));
ADD_PROPERTY(yFix,(0));
ADD_PROPERTY(zFix,(0));
ADD_PROPERTY(rotxFree,(1));
ADD_PROPERTY(rotyFree,(1));
ADD_PROPERTY(rotzFree,(1));
ADD_PROPERTY(xDisplacement,(0.0));
ADD_PROPERTY(yDisplacement,(0.0));
ADD_PROPERTY(zDisplacement,(0.0));
ADD_PROPERTY(xRotation,(0.0));
ADD_PROPERTY(yRotation,(0.0));
ADD_PROPERTY(zRotation,(0.0));
ADD_PROPERTY(xFree,(1));
ADD_PROPERTY(yFree,(1));
ADD_PROPERTY(zFree,(1));
ADD_PROPERTY(xFix,(0));
ADD_PROPERTY(yFix,(0));
ADD_PROPERTY(zFix,(0));
ADD_PROPERTY(rotxFree,(1));
ADD_PROPERTY(rotyFree,(1));
ADD_PROPERTY(rotzFree,(1));
ADD_PROPERTY(rotxFix,(0));
ADD_PROPERTY(rotyFix,(0));
ADD_PROPERTY(rotzFix,(0));
ADD_PROPERTY_TYPE(Points,(Base::Vector3d()),"ConstraintFixed",App::PropertyType(App::Prop_ReadOnly|App::Prop_Output),
"Points where symbols are drawn");
ADD_PROPERTY_TYPE(Normals,(Base::Vector3d()),"ConstraintFixed",App::PropertyType(App::Prop_ReadOnly|App::Prop_Output),

View File

@@ -39,18 +39,18 @@ class AppFemExport ConstraintDisplacement : public Fem::Constraint
public:
/// Constructor
ConstraintDisplacement(void);
// Read-only (calculated values). These trigger changes in the ViewProvider
App::PropertyVectorList Points;
App::PropertyVectorList Normals;
//Displacement parameters
App::PropertyFloat xDisplacement;
App::PropertyFloat yDisplacement;
App::PropertyFloat zDisplacement;
App::PropertyFloat xRotation;
App::PropertyFloat yRotation;
App::PropertyFloat zRotation;
App::PropertyFloat xDisplacement;
App::PropertyFloat yDisplacement;
App::PropertyFloat zDisplacement;
App::PropertyFloat xRotation;
App::PropertyFloat yRotation;
App::PropertyFloat zRotation;
App::PropertyBool xFree;
App::PropertyBool yFree;
App::PropertyBool zFree;

View File

@@ -726,7 +726,7 @@ void FemMesh::readNastran(const std::string &Filename)
{
tetra_element.clear();
//Lets extract the elements
//As each Element Line consists of two subsequent lines as well
//As each Element Line consists of two subsequent lines as well
//we have to take care of that
//At a first step we only extract Quadratic Tetrahedral Elements
std::getline(inputfile,line2);
@@ -739,7 +739,7 @@ void FemMesh::readNastran(const std::string &Filename)
offset = 1;
else if (id < 100000000)
offset = 2;
element_id.push_back(id);
tetra_element.push_back(atoi(line1.substr(24,32).c_str()));
@@ -764,7 +764,7 @@ void FemMesh::readNastran(const std::string &Filename)
continue;//Line does not include Nodal coordinates
nodal_id.push_back(atoi(token_results[1].c_str()));
current_node.x = atof(token_results[3].c_str());
current_node.y = atof(token_results[4].c_str());
current_node.y = atof(token_results[4].c_str());
current_node.z = atof(token_results[5].c_str());
vertices.push_back(current_node);
}
@@ -772,7 +772,7 @@ void FemMesh::readNastran(const std::string &Filename)
{
tetra_element.clear();
//Lets extract the elements
//As each Element Line consists of two subsequent lines as well
//As each Element Line consists of two subsequent lines as well
//we have to take care of that
//At a first step we only extract Quadratic Tetrahedral Elements
std::getline(inputfile,line2);
@@ -815,7 +815,7 @@ void FemMesh::readNastran(const std::string &Filename)
for(unsigned int i=0;i<all_elements.size();i++)
{
//Die Reihenfolge wie hier die Elemente hinzugefügt werden ist sehr wichtig.
//Die Reihenfolge wie hier die Elemente hinzugefügt werden ist sehr wichtig.
//Ansonsten ist eine konsistente Datenstruktur nicht möglich
//meshds->AddVolumeWithID
//(
@@ -855,11 +855,11 @@ void FemMesh::read(const char *FileName)
{
Base::FileInfo File(FileName);
_Mtrx = Base::Matrix4D();
// checking on the file
if (!File.isReadable())
throw Base::Exception("File to load not existing or not readable");
if (File.hasExtension("unv") ) {
// read UNV file
myMesh->UNVToMesh(File.filePath().c_str());
@@ -1179,10 +1179,10 @@ void FemMesh::SaveDocFile (Base::Writer &writer) const
Base::FileInfo fi(App::Application::getTempFileName().c_str());
myMesh->ExportUNV(fi.filePath().c_str());
Base::ifstream file(fi, std::ios::in | std::ios::binary);
if (file){
unsigned long ulSize = 0;
unsigned long ulSize = 0;
std::streambuf* buf = file.rdbuf();
if (buf) {
unsigned long ulCurr;
@@ -1255,7 +1255,7 @@ Base::BoundBox3d FemMesh::getBoundBox(void) const
for (;aNodeIter->more();) {
const SMDS_MeshNode* aNode = aNodeIter->next();
Base::Vector3d vec(aNode->X(),aNode->Y(),aNode->Z());
// Apply the matrix to hold the BoundBox in absolute space.
// Apply the matrix to hold the BoundBox in absolute space.
vec = _Mtrx * vec;
box.Add(vec);
}
@@ -1281,7 +1281,7 @@ unsigned long FemMesh::countSubElements(const char* Type) const
Data::Segment* FemMesh::getSubElement(const char* Type, unsigned long n) const
{
// FIXME implement subelement interface
// FIXME implement subelement interface
//std::stringstream str;
//str << Type << n;
//std::string temp = str.str();
@@ -1312,7 +1312,7 @@ struct Fem::FemMesh::FemMeshInfo FemMesh::getInfo(void) const{
}
// for(unsigned int i=0;i<all_elements.size();i++)
// {
// //Die Reihenfolge wie hier die Elemente hinzugefügt werden ist sehr wichtig.
// //Die Reihenfolge wie hier die Elemente hinzugefügt werden ist sehr wichtig.
// //Ansonsten ist eine konsistente Datenstruktur nicht möglich
// meshds->AddVolumeWithID(
// meshds->FindNode(all_elements[i][0]),
@@ -1339,10 +1339,10 @@ Base::Quantity FemMesh::getVolume(void)const
Base::Vector3d a,b,c,a_b_product;
double volume = 0.0;
for (;aVolIter->more();)
for (;aVolIter->more();)
{
const SMDS_MeshVolume* aVol = aVolIter->next();
if ( aVol->NbNodes() != 10 ) continue;
Base::Vector3d v1(aVol->GetNode(1)->X(),aVol->GetNode(1)->Y(),aVol->GetNode(1)->Z());
@@ -1405,7 +1405,7 @@ Base::Quantity FemMesh::getVolume(void)const
c = v3 -v7 ;
a_b_product.x = a.y*b.z-b.y*a.z;a_b_product.y = a.z*b.x-b.z*a.x;a_b_product.z = a.x*b.y-b.x*a.y;
volume += 1.0/6.0 * fabs((a_b_product.x * c.x)+ (a_b_product.y * c.y)+(a_b_product.z * c.z));
}
return Base::Quantity(volume,Unit::Volume);

View File

@@ -106,9 +106,9 @@ public:
/** @name Placement control */
//@{
/// set the transformation
/// set the transformation
void setTransform(const Base::Matrix4D& rclTrf);
/// get the transformation
/// get the transformation
Base::Matrix4D getTransform(void) const;
/// Bound box from the shape
Base::BoundBox3d getBoundBox(void)const;
@@ -123,7 +123,7 @@ public:
//@}
struct FemMeshInfo {
int numFaces;
int numFaces;
int numNode;
int numTria;
int numQuad;

View File

@@ -57,7 +57,7 @@ PyObject *FemMeshObject::getPyObject()
// ref counter is set to 1
PythonObject = Py::Object(new DocumentObjectPy(this),true);
}
return Py::new_reference_to(PythonObject);
return Py::new_reference_to(PythonObject);
}
void FemMeshObject::onChanged(const Property* prop)
@@ -66,7 +66,7 @@ void FemMeshObject::onChanged(const Property* prop)
// if the placement has changed apply the change to the mesh data as well
if (prop == &this->Placement) {
const_cast<Fem::FemMesh&>(this->FemMesh.getValue()).setTransform(this->Placement.getValue().toMatrix());
const_cast<Fem::FemMesh&>(this->FemMesh.getValue()).setTransform(this->Placement.getValue().toMatrix());
}
}

View File

@@ -69,7 +69,7 @@ void PropertyFemMesh::setValue(const FemMesh& sh)
hasSetValue();
}
const FemMesh &PropertyFemMesh::getValue(void)const
const FemMesh &PropertyFemMesh::getValue(void)const
{
return *_FemMesh;
}

View File

@@ -49,13 +49,13 @@ public:
/// set the FemMesh shape
void setValue(const FemMesh&);
/// does nothing, for add property macro
void setValue(void){};
void setValue(void){};
/// get the FemMesh shape
const FemMesh &getValue(void) const;
const Data::ComplexGeoData* getComplexData() const;
//@}
/** @name Getting basic geometric entities */
//@{
/** Returns the bounding box around the underlying mesh kernel */

View File

@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<GenerateModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="generateMetaModel_Module.xsd">
<PythonExport
Father="ComplexGeoDataPy"
Name="FemMeshPy"
Twin="FemMesh"
TwinPointer="FemMesh"
Include="Mod/Fem/App/FemMesh.h"
Namespace="Fem"
FatherInclude="App/ComplexGeoDataPy.h"
<PythonExport
Father="ComplexGeoDataPy"
Name="FemMeshPy"
Twin="FemMesh"
TwinPointer="FemMesh"
Include="Mod/Fem/App/FemMesh.h"
Namespace="Fem"
FatherInclude="App/ComplexGeoDataPy.h"
FatherNamespace="Data"
Constructor="true">
<Documentation>

View File

@@ -63,7 +63,7 @@ std::string FemMeshPy::representation(void) const
PyObject *FemMeshPy::PyMake(struct _typeobject *, PyObject *, PyObject *) // Python wrapper
{
// create a new instance of FemMeshPy and the Twin object
// create a new instance of FemMeshPy and the Twin object
return new FemMeshPy(new FemMesh);
}
@@ -71,7 +71,7 @@ PyObject *FemMeshPy::PyMake(struct _typeobject *, PyObject *, PyObject *) // Py
int FemMeshPy::PyInit(PyObject* args, PyObject* /*kwd*/)
{
PyObject *pcObj=0;
if (!PyArg_ParseTuple(args, "|O", &pcObj)) // convert args: Python->C
if (!PyArg_ParseTuple(args, "|O", &pcObj)) // convert args: Python->C
return -1; // NULL triggers exception
try {
@@ -287,7 +287,7 @@ PyObject* FemMeshPy::addFace(PyObject *args)
throw std::runtime_error("Failed to get node of the given indices");
Nodes.push_back(node);
}
SMDS_MeshFace* face=0;
switch(Nodes.size()){
case 3:
@@ -390,7 +390,7 @@ PyObject* FemMeshPy::addVolume(PyObject *args)
throw std::runtime_error("Failed to get node of the given indices");
Nodes.push_back(node);
}
SMDS_MeshVolume* vol=0;
if(ElementId != -1) {
switch(Nodes.size()){
@@ -810,7 +810,7 @@ Py::Dict FemMeshPy::getNodes(void) const
for (int i=0;aNodeIter->more();i++) {
const SMDS_MeshNode* aNode = aNodeIter->next();
Base::Vector3d vec(aNode->X(),aNode->Y(),aNode->Z());
// Apply the matrix to hold the BoundBox in absolute space.
// Apply the matrix to hold the BoundBox in absolute space.
vec = Mtrx * vec;
int id = aNode->GetID();
@@ -947,7 +947,7 @@ Py::Int FemMeshPy::getGroupCount(void) const
Py::Object FemMeshPy::getVolume(void) const
{
return Py::Object(new Base::QuantityPy(new Base::Quantity(getFemMeshPtr()->getVolume())));
}
// ===== custom attributes ============================================================
@@ -958,5 +958,5 @@ PyObject *FemMeshPy::getCustomAttributes(const char* /*attr*/) const
int FemMeshPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
{
return 0;
return 0;
}

View File

@@ -88,7 +88,7 @@ FemMeshShapeObject::~FemMeshShapeObject()
{
}
App::DocumentObjectExecReturn *FemMeshShapeObject::execute(void)
App::DocumentObjectExecReturn *FemMeshShapeObject::execute(void)
{
Fem::FemMesh newMesh;
@@ -102,7 +102,7 @@ App::DocumentObjectExecReturn *FemMeshShapeObject::execute(void)
#else
TopoDS_Shape shape = feat->Shape.getValue();
#endif
newMesh.getSMesh()->ShapeToMesh(shape);
SMESH_Gen *myGen = newMesh.getGenerator();
@@ -188,21 +188,21 @@ App::DocumentObjectExecReturn *FemMeshShapeObject::execute(void)
NETGENPlugin_Mesher myNetGenMesher(newMesh.getSMesh(),shape,true);
//NETGENPlugin_SimpleHypothesis_2D * tet2 = new NETGENPlugin_SimpleHypothesis_2D(hyp++,1,myGen);
//static_cast<NETGENPlugin_SimpleHypothesis_2D*>(tet2.get())->SetNumberOfSegments(5);
//static_cast<NETGENPlugin_SimpleHypothesis_2D*>(tet2.get())->SetLocalLength(0.1);
//static_cast<NETGENPlugin_SimpleHypothesis_2D*>(tet2.get())->LengthFromEdges();
//static_cast<NETGENPlugin_SimpleHypothesis_2D*>(tet2.get())->SetNumberOfSegments(5);
//static_cast<NETGENPlugin_SimpleHypothesis_2D*>(tet2.get())->SetLocalLength(0.1);
//static_cast<NETGENPlugin_SimpleHypothesis_2D*>(tet2.get())->LengthFromEdges();
//myNetGenMesher.SetParameters(tet2);
//NETGENPlugin_SimpleHypothesis_3D* tet= new NETGENPlugin_SimpleHypothesis_3D(hyp++,1,myGen);
//static_cast<NETGENPlugin_SimpleHypothesis_3D*>(tet.get())->LengthFromFaces();
//static_cast<NETGENPlugin_SimpleHypothesis_3D*>(tet.get())->SetMaxElementVolume(0.1);
//static_cast<NETGENPlugin_SimpleHypothesis_3D*>(tet.get())->LengthFromFaces();
//static_cast<NETGENPlugin_SimpleHypothesis_3D*>(tet.get())->SetMaxElementVolume(0.1);
//myNetGenMesher.SetParameters( tet);
myNetGenMesher.Compute();
#endif
#endif
//SMESHDS_Mesh* data = const_cast<SMESH_Mesh*>(newMesh.getSMesh())->GetMeshDS();
//const SMDS_MeshInfo& info = data->GetMeshInfo();
//int numNode = info.NbNodes();
@@ -219,7 +219,7 @@ App::DocumentObjectExecReturn *FemMeshShapeObject::execute(void)
// set the value to the object
FemMesh.setValue(newMesh);
return App::DocumentObject::StdReturn;
}
@@ -234,7 +234,7 @@ App::DocumentObjectExecReturn *FemMeshShapeObject::execute(void)
// // ref counter is set to 1
// PythonObject = Py::Object(new DocumentObjectPy(this),true);
// }
// return Py::new_reference_to(PythonObject);
// return Py::new_reference_to(PythonObject);
//}
//void FemMeshShapeObject::onChanged(const Property* prop)

View File

@@ -71,7 +71,7 @@ PyObject *FemResultObject::getPyObject()
// ref counter is set to 1
PythonObject = Py::Object(new DocumentObjectPy(this),true);
}
return Py::new_reference_to(PythonObject);
return Py::new_reference_to(PythonObject);
}
// Python feature ---------------------------------------------------------

View File

@@ -54,6 +54,6 @@ PyObject *FemSetElementsObject::getPyObject()
// ref counter is set to 1
PythonObject = Py::Object(new DocumentObjectPy(this),true);
}
return Py::new_reference_to(PythonObject);
return Py::new_reference_to(PythonObject);
}

View File

@@ -55,6 +55,6 @@ PyObject *FemSetFacesObject::getPyObject()
// ref counter is set to 1
PythonObject = Py::Object(new DocumentObjectPy(this),true);
}
return Py::new_reference_to(PythonObject);
return Py::new_reference_to(PythonObject);
}

View File

@@ -55,6 +55,6 @@ PyObject *FemSetGeometryObject::getPyObject()
// ref counter is set to 1
PythonObject = Py::Object(new DocumentObjectPy(this),true);
}
return Py::new_reference_to(PythonObject);
return Py::new_reference_to(PythonObject);
}

View File

@@ -56,6 +56,6 @@ PyObject *FemSetNodesObject::getPyObject()
// ref counter is set to 1
PythonObject = Py::Object(new DocumentObjectPy(this),true);
}
return Py::new_reference_to(PythonObject);
return Py::new_reference_to(PythonObject);
}

View File

@@ -56,6 +56,6 @@ PyObject *FemSetObject::getPyObject()
// ref counter is set to 1
PythonObject = Py::Object(new DocumentObjectPy(this),true);
}
return Py::new_reference_to(PythonObject);
return Py::new_reference_to(PythonObject);
}

View File

@@ -73,7 +73,7 @@ PyObject *FemSolverObject::getPyObject()
// ref counter is set to 1
PythonObject = Py::Object(new DocumentObjectPy(this),true);
}
return Py::new_reference_to(PythonObject);
return Py::new_reference_to(PythonObject);
}
// Python feature ---------------------------------------------------------

View File

@@ -54,7 +54,7 @@ public:
App::PropertyString ExternalCaseEditor;
/// Path to External Result Viewer like Paraview, empty string means using FreeCAD
App::PropertyString ExternalResultViewer;
/// for FEM: Static, Frequency, etc
App::PropertyString AnalysisType;
/// Path of working dir for the solver

View File

@@ -55,13 +55,13 @@ public:
*/
static bool isPlanar(const TopoDS_Face&);
/*!
It is assumed that the edge is 'linear'.
It is assumed that the edge is 'linear'.
The direction vector of the line is returned.
@see isLinear
*/
static gp_XYZ getDirection(const TopoDS_Edge&);
/*!
It is assumed that the face is 'planar'.
It is assumed that the face is 'planar'.
The normal vector of the plane is returned.
@see isPlanar
*/

View File

@@ -21,4 +21,4 @@
***************************************************************************/
#include "PreCompiled.h"
#include "PreCompiled.h"