diff --git a/PRIVATE b/PRIVATE index 5be24da73..6f87ed87e 160000 --- a/PRIVATE +++ b/PRIVATE @@ -1 +1 @@ -Subproject commit 5be24da737ceb89599c7b995c605cab08fdc05c2 +Subproject commit 6f87ed87eddeea4a63827647256fd68328907fca diff --git a/VERSION b/VERSION index 3339b66fc..66536aad6 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.3-1531-g3d6ec695 +v2.0.3-1601-gc433e244 diff --git a/python/damask/table.py b/python/damask/table.py index 582089a54..15b501ac9 100644 --- a/python/damask/table.py +++ b/python/damask/table.py @@ -74,13 +74,13 @@ class Table(): f.seek(0) try: - N_comment_lines,keyword = f.readline().split() + N_comment_lines,keyword = f.readline().strip().split(maxsplit=1) if keyword != 'header': - raise TypeError + raise ValueError else: comments = [f.readline().strip() for i in range(1,int(N_comment_lines))] labels = f.readline().split() - except TypeError: + except ValueError: f.seek(0) comments = [] line = f.readline().strip() diff --git a/python/tests/test_Table.py b/python/tests/test_Table.py index d5f505e76..369a99efb 100644 --- a/python/tests/test_Table.py +++ b/python/tests/test_Table.py @@ -38,14 +38,21 @@ class TestTable: def test_write_read_str(self,default,tmpdir): default.to_ASCII(str(tmpdir.join('default.txt'))) new = Table.from_ASCII(str(tmpdir.join('default.txt'))) - assert all(default.data==new.data) + assert all(default.data==new.data) and default.shapes == new.shapes def test_write_read_file(self,default,tmpdir): with open(tmpdir.join('default.txt'),'w') as f: default.to_ASCII(f) with open(tmpdir.join('default.txt')) as f: new = Table.from_ASCII(f) - assert all(default.data==new.data) + assert all(default.data==new.data) and default.shapes == new.shapes + + def test_write_read_new_style(self,default,tmpdir): + with open(tmpdir.join('new_style.txt'),'w') as f: + default.to_ASCII(f,new=True) + with open(tmpdir.join('new_style.txt')) as f: + new = Table.from_ASCII(f) + assert all(default.data==new.data) and default.shapes == new.shapes def test_read_ang_str(self,reference_dir): new = Table.from_ang(os.path.join(reference_dir,'simple.ang')) diff --git a/src/element.f90 b/src/element.f90 index a38036f93..6ce23a9da 100644 --- a/src/element.f90 +++ b/src/element.f90 @@ -43,38 +43,39 @@ module element integer, dimension(NELEMTYPE), parameter :: NNODE = & [ & - 3, & ! 2D 3node 1ip - 6, & ! 2D 6node 3ip - 4, & ! 2D 4node 4ip - 8, & ! 2D 8node 9ip - 8, & ! 2D 8node 4ip - !-------------------- - 4, & ! 3D 4node 1ip - 5, & ! 3D 5node 4ip - 10, & ! 3D 10node 4ip - 6, & ! 3D 6node 6ip - 8, & ! 3D 8node 1ip - 8, & ! 3D 8node 8ip - 20, & ! 3D 20node 8ip - 20 & ! 3D 20node 27ip + 3, & ! 2D, 1 IP + 6, & ! 2D, 3 IP + 4, & ! 2D, 4 IP + 8, & ! 2D, 9 IP + 8, & ! 2D, 4 IP + !---------------------- + 4, & ! 3D, 1 IP + 5, & ! 3D, 4 IP + 10, & ! 3D, 4 IP + 6, & ! 3D, 6 IP + 8, & ! 3D, 1 IP + 8, & ! 3D, 8 IP + 20, & ! 3D, 8 IP + 20 & ! 3D, 27 IP ] !< number of nodes that constitute a specific type of element integer, dimension(NELEMTYPE), parameter :: GEOMTYPE = & [ & - 1, & - 2, & - 3, & - 4, & - 3, & - 5, & - 6, & - 6, & - 7, & - 8, & - 9, & - 9, & - 10 & - ] !< geometry type of particular element type + 1, & ! 1 triangle + 2, & ! 3 quadrilaterals + 3, & ! 4 quadrilaterals + 4, & ! 9 quadrilaterals + 3, & ! 4 quadrilaterals + !---------------------- + 5, & ! 1 tetrahedron + 6, & ! 4 hexahedrons + 6, & ! 4 hexahedrons + 7, & ! 6 hexahedrons + 8, & ! 1 hexahedron + 9, & ! 8 hexahedrons + 9, & ! 8 hexahedrons + 10 & ! 27 hexahedrons + ] !< geometry type (same number of cell nodes and IPs) integer, dimension(maxval(GEOMTYPE)), parameter :: NCELLNODE = & [ & @@ -88,7 +89,7 @@ module element 8, & 27, & 64 & - ] !< number of cell nodes in a specific geometry type + ] !< number of cell nodes integer, dimension(maxval(GEOMTYPE)), parameter :: NIP = & [ & @@ -102,45 +103,45 @@ module element 1, & 8, & 27 & - ] !< number of IPs in a specific geometry type + ] !< number of IPs integer, dimension(maxval(GEOMTYPE)), parameter :: CELLTYPE = & [ & - 1, & ! 2D 3node - 2, & ! 2D 4node - 2, & ! 2D 4node - 2, & ! 2D 4node - 3, & ! 3D 4node - 4, & ! 3D 8node - 4, & ! 3D 8node - 4, & ! 3D 8node - 4, & ! 3D 8node - 4 & ! 3D 8node - ] !< cell type that is used by each geometry type + 1, & ! 2D, 3 node (Triangle) + 2, & ! 2D, 4 node (Quadrilateral) + 2, & ! - " - + 2, & ! - " - + 3, & ! 3D, 4 node (Tetrahedron) + 4, & ! 3D, 4 node (Hexahedron) + 4, & ! - " - + 4, & ! - " - + 4, & ! - " - + 4 & ! - " - + ] !< cell type integer, dimension(maxval(CELLTYPE)), parameter :: NIPNEIGHBOR = & [ & - 3, & ! 2D 3node - 4, & ! 2D 4node - 4, & ! 3D 4node - 6 & ! 3D 8node - ] !< number of ip neighbors / cell faces in a specific cell type + 3, & + 4, & + 4, & + 6 & + ] !< number of ip neighbors / cell faces integer, dimension(maxval(CELLTYPE)), parameter :: NCELLNODEPERCELLFACE = & [ & - 2, & ! 2D 3node - 2, & ! 2D 4node - 3, & ! 3D 4node - 4 & ! 3D 8node - ] !< number of cell nodes in a specific cell type + 2, & + 2, & + 3, & + 4 & + ] !< number of cell nodes per face integer, dimension(maxval(CELLTYPE)), parameter :: NCELLNODEPERCELL = & [ & - 3, & ! 2D 3node - 4, & ! 2D 4node - 4, & ! 3D 4node - 8 & ! 3D 8node - ] !< number of cell nodes in a specific cell type + 3, & + 4, & + 4, & + 8 & + ] !< number of total cell nodes ! *** IPneighbor *** ! list of the neighborhood of each IP. @@ -494,14 +495,14 @@ module element 0, 1, 1, 0, 0, 0, 0, 0, & ! 10 0, 0, 1, 1, 0, 0, 0, 0, & ! 1, 0, 0, 1, 0, 0, 0, 0, & ! - 1, 0, 0, 0, 1, 0, 0, 0, & ! - 0, 1, 0, 0, 0, 1, 0, 0, & ! - 0, 0, 1, 0, 0, 0, 1, 0, & ! 15 - 0, 0, 0, 1, 0, 0, 0, 1, & ! 0, 0, 0, 0, 1, 1, 0, 0, & ! 0, 0, 0, 0, 0, 1, 1, 0, & ! - 0, 0, 0, 0, 0, 0, 1, 1, & ! - 0, 0, 0, 0, 1, 0, 0, 1, & ! 20 + 0, 0, 0, 0, 0, 0, 1, 1, & ! 15 + 0, 0, 0, 0, 1, 0, 0, 1, & ! + 1, 0, 0, 0, 1, 0, 0, 0, & ! + 0, 1, 0, 0, 0, 1, 0, 0, & ! + 0, 0, 1, 0, 0, 0, 1, 0, & ! + 0, 0, 0, 1, 0, 0, 0, 1, & ! 20 1, 1, 1, 1, 0, 0, 0, 0, & ! 1, 1, 0, 0, 1, 1, 0, 0, & ! 0, 1, 1, 0, 0, 1, 1, 0, & ! @@ -718,14 +719,14 @@ module element integer, dimension(NCELLNODEPERCELL(CELLTYPE(9)),NIP(9)), parameter :: CELL9 = & reshape([& - 1, 9,21,12,13,22,27,25, & - 9, 2,10,21,22,14,23,27, & - 12,21,11, 4,25,27,24,16, & - 21,10, 3,11,27,23,15,24, & - 13,22,27,25, 5,17,26,20, & - 22,14,23,27,17, 6,18,26, & - 25,27,24,16,20,26,19, 8, & - 27,23,15,24,26,18, 7,19 & + 1, 9,21,12,17,22,27,25, & + 9, 2,10,21,22,18,23,27, & + 12,21,11, 4,25,27,24,20, & + 21,10, 3,11,27,23,19,24, & + 17,22,27,25, 5,13,26,16, & + 22,18,23,27,13, 6,14,26, & + 25,27,24,20,16,26,15, 8, & + 27,23,19,24,26,14, 7,15 & #if !defined(__GFORTRAN__) ],shape(CELL9)) #else diff --git a/src/mesh_marc.f90 b/src/mesh_marc.f90 index 22f978609..f89c016c1 100644 --- a/src/mesh_marc.f90 +++ b/src/mesh_marc.f90 @@ -561,26 +561,23 @@ subroutine inputRead_elemType(elem, & select case (IO_lc(what)) case ( '6') mapElemtype = 1 ! Two-dimensional Plane Strain Triangle - case ( '155', & - '125', & - '128') + case ( '125') ! 155, 128 (need test) mapElemtype = 2 ! Two-dimensional Plane Strain triangle (155: cubic shape function, 125/128: second order isoparametric) - case ( '11') - mapElemtype = 3 ! Arbitrary Quadrilateral Plane-strain + !case ( '11') ! need test + ! mapElemtype = 3 ! Arbitrary Quadrilateral Plane-strain case ( '27') mapElemtype = 4 ! Plane Strain, Eight-node Distorted Quadrilateral case ( '54') mapElemtype = 5 ! Plane Strain, Eight-node Distorted Quadrilateral with reduced integration - case ( '134') - mapElemtype = 6 ! Three-dimensional Four-node Tetrahedron - case ( '157') - mapElemtype = 7 ! Three-dimensional, Low-order, Tetrahedron, Herrmann Formulations - case ( '127') - mapElemtype = 8 ! Three-dimensional Ten-node Tetrahedron - case ( '136') - mapElemtype = 9 ! Three-dimensional Arbitrarily Distorted Pentahedral - case ( '117', & - '123') + !case ( '134') ! need test + ! mapElemtype = 6 ! Three-dimensional Four-node Tetrahedron + !case ( '157') ! need test + ! mapElemtype = 7 ! Three-dimensional, Low-order, Tetrahedron, Herrmann Formulations + !case ( '127') ! need test + ! mapElemtype = 8 ! Three-dimensional Ten-node Tetrahedron + !case ( '136') ! need test + ! mapElemtype = 9 ! Three-dimensional Arbitrarily Distorted Pentahedral + case ( '117') ! 123 (need test) mapElemtype = 10 ! Three-dimensional Arbitrarily Distorted linear hexahedral with reduced integration case ( '7') mapElemtype = 11 ! Three-dimensional Arbitrarily Distorted Brick @@ -1072,7 +1069,6 @@ end function mesh_FEasCP !> @brief return integer list corresponding to items in consecutive lines. !! First integer in array is counter !> @details ints concatenated by "c" as last char, range of a "to" b, or named set -! REMARK: should replace IO_continuousIntValues !-------------------------------------------------------------------------------------------------- function continuousIntValues(fileContent,maxN,lookupName,lookupMap,lookupMaxN)