Starting Calculix integration

This commit is contained in:
jriegel 2013-12-06 23:25:45 +01:00
parent 75216d9d8c
commit f53579f671
3 changed files with 66 additions and 1 deletions

View File

@ -39,6 +39,7 @@ FemResultObject::FemResultObject()
{
ADD_PROPERTY_TYPE(DataType,(""), "General",Prop_None,"Type identifier of the result data");
ADD_PROPERTY_TYPE(Unit,(Base::Quantity()), "General",Prop_None,"Unit of the data");
ADD_PROPERTY_TYPE(ElementNumbers,(0), "Data",Prop_None,"Numbers of the result elements");
}
FemResultObject::~FemResultObject()

View File

@ -26,6 +26,7 @@
#include <App/DocumentObject.h>
#include <App/PropertyUnits.h>
#include <App/PropertyStandard.h>
#include <App/FeaturePython.h>
#include "FemResultObject.h"
@ -45,7 +46,8 @@ public:
App::PropertyString DataType;
/// Unit and factor of the values
App::PropertyQuantity Unit;
/// List of element numbers in this result object
App::PropertyIntegerList ElementNumbers;
/// returns the type name of the ViewProvider
//virtual const char* getViewProviderName(void) const {
// return "FemGui::ViewProviderFemSet";

View File

@ -0,0 +1,62 @@
#***************************************************************************
#* *
#* 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 *
#* *
#***************************************************************************
def readResult(frd_input) :
input = open(frd_input,"r")
nodes_x = []
nodes_y = []
nodes_z = []
disp_x = []
disp_y = []
disp_z = []
displaced_nodes_x = []
displaced_nodes_y = []
displaced_nodes_z = []
disp_found = False
nodes_found = True
while True:
line=input.readline()
if not line: break
#first lets extract the node and coordinate information from the results file
if nodes_found and (line[1:3] == "-1"):
nodes_x.append(float(line[13:25]))
nodes_y.append(float(line[25:37]))
nodes_z.append(float(line[37:49]))
#Check if we found displacement section
if line[5:9] == "DISP":
disp_found = True
#we found a displacement line in the frd file
if disp_found and (line[1:3] == "-1"):
disp_x.append(float(line[13:25]))
disp_y.append(float(line[25:37]))
disp_z.append(float(line[37:49]))
#Check for the end of a section
if line[1:3] == "-3":
#the section with the displacements and the nodes ended
disp_found = False
nodes_found = False
input.close()