FEM: fenics mesh, trailing white spaces

This commit is contained in:
Bernd Hahnebach
2018-04-03 07:00:19 +02:00
parent ccfe39d115
commit 485630fb36
3 changed files with 6 additions and 6 deletions

View File

@@ -151,8 +151,8 @@ def export(objectslist, fileString):
fileName, fileExtension = os.path.splitext(fileString)
if fileExtension.lower() == '.xml':
FreeCAD.Console.PrintWarning("XML is not designed to save higher order elements.\n")
FreeCAD.Console.PrintWarning("Reducing order for second order mesh.\n")
FreeCAD.Console.PrintWarning("Tri6 -> Tri3, Tet10 -> Tet4, etc.\n")
FreeCAD.Console.PrintWarning("Reducing order for second order mesh.\n")
FreeCAD.Console.PrintWarning("Tri6 -> Tri3, Tet10 -> Tet4, etc.\n")
writeFenicsXML.write_fenics_mesh_xml(obj, fileString)
elif fileExtension.lower() == '.xdmf':
if importToolsFem.get_FemMeshObjectMeshGroups(obj) is not ():

View File

@@ -232,7 +232,7 @@ def read_fenics_mesh_xml(xmlfilename):
print("Mesh found")
(nodes, cells_dict, cell_type, dim) = read_mesh_block(find_mesh)
element_dict = generate_lower_dimensional_structures(nodes, cells_dict, cell_type, dim)
print("Show min max element dict")
print("Show min max element dict")
for (elm, numbers) in list(element_dict.items()):
lst = sorted(list(numbers.items()), key=lambda x: x[0])
if lst != []:

View File

@@ -40,7 +40,7 @@ def write_fenics_mesh_xml(fem_mesh_obj, outputfile):
vertices to be exported. (For second order elements, we have to delete the mid element nodes.)
"""
# TODO: check for second order elements
# TODO: check for second order elements
# (reduce element order would be ok - all elements have at least the first
# necessary nodes)
@@ -55,7 +55,7 @@ def write_fenics_mesh_xml(fem_mesh_obj, outputfile):
"Polygon": "unknown", "Polyhedron": "unknown",
"Prism": "unknown", "Pyramid": "unknown",
}
XML_Number_of_Nodes_dict = {
"point": 1,
"interval": 2,
@@ -102,7 +102,7 @@ def write_fenics_mesh_xml(fem_mesh_obj, outputfile):
cell_args = {}
for (vi, ni) in enumerate(nodeindices):
if vi < num_verts_cell: # XML only supports first order meshs
if vi < num_verts_cell: # XML only supports first order meshs
cell_args["v" + str(vi)] = str(ni - 1)
# generate as many v entries in dict as nodes are listed in cell (works only for first order elements)