FEM: FemTest rework

- move test files to a separate directory
- use real life model to generate .inp files (model included)
- change format of csv node/volume files to allow direct copy&paste from .inp files
- use pre prepared real-life .dat & .frd files to test analysis results loading functions
- much more fine grained error reporting
- remove empty lines for output
- add helper function to print to console

Example run of the FEM test:

--------------- Start of FEM tests ---------------
Checking FEM new analysis...
Checking FEM new mesh...
sh: SMDS_MemoryLimit: command not found
Checking FEM new material...
Checking FEM new fixed constraint...
Checking FEM new force constraint...
Checking FEM new pressure constraint...
Checking FEM inp file prerequisites...
Checking FEM inp file write...
Setting up working directory /tmp/FEM_static
Writing /tmp/FEM_static/Mesh.inp for static analysis
Comparing /home/przemo/software/FreeCAD/build/Mod/Fem/test_files/cube_static.inp to /tmp/FEM_static/Mesh.inp
Setting up working directory to /home/przemo/software/FreeCAD/build/Mod/Fem/test_files in order to read simulated calculations
Setting base name to read test cube_static.frd file...
Checking FEM frd file read from static analysis...
Result object created as "Results"
Reading stats from result object for static analysis...
Setting analysis type to 'frequency"
Setting up working directory /tmp/FEM_frequency
Writing /tmp/FEM_frequency/Mesh.inp for frequency analysis
Comparing /home/przemo/software/FreeCAD/build/Mod/Fem/test_files/cube_frequency.inp to /tmp/FEM_frequency/Mesh.inp
Setting working directory to read simulated calculations...
Setting base name to read test cube_frequency.frd file...
Checking FEM frd file read from frequency analysis...
Last result object created as "Mode_10_results"
Reading stats from result object for frequency analysis...
--------------- End of FEM tests ---------------

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
This commit is contained in:
Przemo Firszt
2015-09-10 22:50:43 +01:00
committed by Yorik van Havre
parent 14b15ac095
commit b25d2cd54d
19 changed files with 21423 additions and 425 deletions

View File

@@ -73,10 +73,6 @@ SET(FemScripts_SRCS
ccxInpWriter.py
TestFem.py
FemTools.py
mesh_points.csv
mesh_volumes.csv
static_analysis.inp
frequency_analysis.inp
MechanicalAnalysis.ui
MechanicalAnalysis.py
MechanicalMaterial.ui
@@ -85,6 +81,21 @@ SET(FemScripts_SRCS
)
#SOURCE_GROUP("Scripts" FILES ${FemScripts_SRCS})
SET(FemTests_SRCS
test_files/mesh_points.csv
test_files/mesh_volumes.csv
test_files/static_analysis.inp
test_files/frequency_analysis.inp
test_files/cube_frequency.inp
test_files/cube_frequency.dat
test_files/cube_frequency.frd
test_files/cube_frequency_expected_values
test_files/cube_static.inp
test_files/cube_static.dat
test_files/cube_static.frd
test_files/cube_static_expected_values
)
SET(FemBase_SRCS
FemMeshObject.cpp
FemMeshObject.h
@@ -158,6 +169,7 @@ fc_target_copy_resource(Fem
${CMAKE_BINARY_DIR}/Mod/Fem
Init.py
${FemScripts_SRCS}
${FemTests_SRCS}
)
SET_BIN_DIR(Fem Fem /Mod/Fem)