Merge branch 'fix-elem-7-57' into noAbaqus

This commit is contained in:
Martin Diehl 2020-01-27 19:27:53 +01:00
commit 5d1f68bf93
6 changed files with 97 additions and 93 deletions

@ -1 +1 @@
Subproject commit 5be24da737ceb89599c7b995c605cab08fdc05c2 Subproject commit 6f87ed87eddeea4a63827647256fd68328907fca

View File

@ -1 +1 @@
v2.0.3-1531-g3d6ec695 v2.0.3-1601-gc433e244

View File

@ -74,13 +74,13 @@ class Table():
f.seek(0) f.seek(0)
try: try:
N_comment_lines,keyword = f.readline().split() N_comment_lines,keyword = f.readline().strip().split(maxsplit=1)
if keyword != 'header': if keyword != 'header':
raise TypeError raise ValueError
else: else:
comments = [f.readline().strip() for i in range(1,int(N_comment_lines))] comments = [f.readline().strip() for i in range(1,int(N_comment_lines))]
labels = f.readline().split() labels = f.readline().split()
except TypeError: except ValueError:
f.seek(0) f.seek(0)
comments = [] comments = []
line = f.readline().strip() line = f.readline().strip()

View File

@ -38,14 +38,21 @@ class TestTable:
def test_write_read_str(self,default,tmpdir): def test_write_read_str(self,default,tmpdir):
default.to_ASCII(str(tmpdir.join('default.txt'))) default.to_ASCII(str(tmpdir.join('default.txt')))
new = Table.from_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): def test_write_read_file(self,default,tmpdir):
with open(tmpdir.join('default.txt'),'w') as f: with open(tmpdir.join('default.txt'),'w') as f:
default.to_ASCII(f) default.to_ASCII(f)
with open(tmpdir.join('default.txt')) as f: with open(tmpdir.join('default.txt')) as f:
new = Table.from_ASCII(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): def test_read_ang_str(self,reference_dir):
new = Table.from_ang(os.path.join(reference_dir,'simple.ang')) new = Table.from_ang(os.path.join(reference_dir,'simple.ang'))

View File

@ -43,38 +43,39 @@ module element
integer, dimension(NELEMTYPE), parameter :: NNODE = & integer, dimension(NELEMTYPE), parameter :: NNODE = &
[ & [ &
3, & ! 2D 3node 1ip 3, & ! 2D, 1 IP
6, & ! 2D 6node 3ip 6, & ! 2D, 3 IP
4, & ! 2D 4node 4ip 4, & ! 2D, 4 IP
8, & ! 2D 8node 9ip 8, & ! 2D, 9 IP
8, & ! 2D 8node 4ip 8, & ! 2D, 4 IP
!-------------------- !----------------------
4, & ! 3D 4node 1ip 4, & ! 3D, 1 IP
5, & ! 3D 5node 4ip 5, & ! 3D, 4 IP
10, & ! 3D 10node 4ip 10, & ! 3D, 4 IP
6, & ! 3D 6node 6ip 6, & ! 3D, 6 IP
8, & ! 3D 8node 1ip 8, & ! 3D, 1 IP
8, & ! 3D 8node 8ip 8, & ! 3D, 8 IP
20, & ! 3D 20node 8ip 20, & ! 3D, 8 IP
20 & ! 3D 20node 27ip 20 & ! 3D, 27 IP
] !< number of nodes that constitute a specific type of element ] !< number of nodes that constitute a specific type of element
integer, dimension(NELEMTYPE), parameter :: GEOMTYPE = & integer, dimension(NELEMTYPE), parameter :: GEOMTYPE = &
[ & [ &
1, & 1, & ! 1 triangle
2, & 2, & ! 3 quadrilaterals
3, & 3, & ! 4 quadrilaterals
4, & 4, & ! 9 quadrilaterals
3, & 3, & ! 4 quadrilaterals
5, & !----------------------
6, & 5, & ! 1 tetrahedron
6, & 6, & ! 4 hexahedrons
7, & 6, & ! 4 hexahedrons
8, & 7, & ! 6 hexahedrons
9, & 8, & ! 1 hexahedron
9, & 9, & ! 8 hexahedrons
10 & 9, & ! 8 hexahedrons
] !< geometry type of particular element type 10 & ! 27 hexahedrons
] !< geometry type (same number of cell nodes and IPs)
integer, dimension(maxval(GEOMTYPE)), parameter :: NCELLNODE = & integer, dimension(maxval(GEOMTYPE)), parameter :: NCELLNODE = &
[ & [ &
@ -88,7 +89,7 @@ module element
8, & 8, &
27, & 27, &
64 & 64 &
] !< number of cell nodes in a specific geometry type ] !< number of cell nodes
integer, dimension(maxval(GEOMTYPE)), parameter :: NIP = & integer, dimension(maxval(GEOMTYPE)), parameter :: NIP = &
[ & [ &
@ -102,45 +103,45 @@ module element
1, & 1, &
8, & 8, &
27 & 27 &
] !< number of IPs in a specific geometry type ] !< number of IPs
integer, dimension(maxval(GEOMTYPE)), parameter :: CELLTYPE = & integer, dimension(maxval(GEOMTYPE)), parameter :: CELLTYPE = &
[ & [ &
1, & ! 2D 3node 1, & ! 2D, 3 node (Triangle)
2, & ! 2D 4node 2, & ! 2D, 4 node (Quadrilateral)
2, & ! 2D 4node 2, & ! - " -
2, & ! 2D 4node 2, & ! - " -
3, & ! 3D 4node 3, & ! 3D, 4 node (Tetrahedron)
4, & ! 3D 8node 4, & ! 3D, 4 node (Hexahedron)
4, & ! 3D 8node 4, & ! - " -
4, & ! 3D 8node 4, & ! - " -
4, & ! 3D 8node 4, & ! - " -
4 & ! 3D 8node 4 & ! - " -
] !< cell type that is used by each geometry type ] !< cell type
integer, dimension(maxval(CELLTYPE)), parameter :: NIPNEIGHBOR = & integer, dimension(maxval(CELLTYPE)), parameter :: NIPNEIGHBOR = &
[ & [ &
3, & ! 2D 3node 3, &
4, & ! 2D 4node 4, &
4, & ! 3D 4node 4, &
6 & ! 3D 8node 6 &
] !< number of ip neighbors / cell faces in a specific cell type ] !< number of ip neighbors / cell faces
integer, dimension(maxval(CELLTYPE)), parameter :: NCELLNODEPERCELLFACE = & integer, dimension(maxval(CELLTYPE)), parameter :: NCELLNODEPERCELLFACE = &
[ & [ &
2, & ! 2D 3node 2, &
2, & ! 2D 4node 2, &
3, & ! 3D 4node 3, &
4 & ! 3D 8node 4 &
] !< number of cell nodes in a specific cell type ] !< number of cell nodes per face
integer, dimension(maxval(CELLTYPE)), parameter :: NCELLNODEPERCELL = & integer, dimension(maxval(CELLTYPE)), parameter :: NCELLNODEPERCELL = &
[ & [ &
3, & ! 2D 3node 3, &
4, & ! 2D 4node 4, &
4, & ! 3D 4node 4, &
8 & ! 3D 8node 8 &
] !< number of cell nodes in a specific cell type ] !< number of total cell nodes
! *** IPneighbor *** ! *** IPneighbor ***
! list of the neighborhood of each IP. ! list of the neighborhood of each IP.
@ -494,14 +495,14 @@ module element
0, 1, 1, 0, 0, 0, 0, 0, & ! 10 0, 1, 1, 0, 0, 0, 0, 0, & ! 10
0, 0, 1, 1, 0, 0, 0, 0, & ! 0, 0, 1, 1, 0, 0, 0, 0, & !
1, 0, 0, 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, 1, 1, 0, 0, & !
0, 0, 0, 0, 0, 1, 1, 0, & ! 0, 0, 0, 0, 0, 1, 1, 0, & !
0, 0, 0, 0, 0, 0, 1, 1, & ! 0, 0, 0, 0, 0, 0, 1, 1, & ! 15
0, 0, 0, 0, 1, 0, 0, 1, & ! 20 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, 1, 1, 0, 0, 0, 0, & !
1, 1, 0, 0, 1, 1, 0, 0, & ! 1, 1, 0, 0, 1, 1, 0, 0, & !
0, 1, 1, 0, 0, 1, 1, 0, & ! 0, 1, 1, 0, 0, 1, 1, 0, & !
@ -718,14 +719,14 @@ module element
integer, dimension(NCELLNODEPERCELL(CELLTYPE(9)),NIP(9)), parameter :: CELL9 = & integer, dimension(NCELLNODEPERCELL(CELLTYPE(9)),NIP(9)), parameter :: CELL9 = &
reshape([& reshape([&
1, 9,21,12,13,22,27,25, & 1, 9,21,12,17,22,27,25, &
9, 2,10,21,22,14,23,27, & 9, 2,10,21,22,18,23,27, &
12,21,11, 4,25,27,24,16, & 12,21,11, 4,25,27,24,20, &
21,10, 3,11,27,23,15,24, & 21,10, 3,11,27,23,19,24, &
13,22,27,25, 5,17,26,20, & 17,22,27,25, 5,13,26,16, &
22,14,23,27,17, 6,18,26, & 22,18,23,27,13, 6,14,26, &
25,27,24,16,20,26,19, 8, & 25,27,24,20,16,26,15, 8, &
27,23,15,24,26,18, 7,19 & 27,23,19,24,26,14, 7,15 &
#if !defined(__GFORTRAN__) #if !defined(__GFORTRAN__)
],shape(CELL9)) ],shape(CELL9))
#else #else

View File

@ -561,26 +561,23 @@ subroutine inputRead_elemType(elem, &
select case (IO_lc(what)) select case (IO_lc(what))
case ( '6') case ( '6')
mapElemtype = 1 ! Two-dimensional Plane Strain Triangle mapElemtype = 1 ! Two-dimensional Plane Strain Triangle
case ( '155', & case ( '125') ! 155, 128 (need test)
'125', &
'128')
mapElemtype = 2 ! Two-dimensional Plane Strain triangle (155: cubic shape function, 125/128: second order isoparametric) mapElemtype = 2 ! Two-dimensional Plane Strain triangle (155: cubic shape function, 125/128: second order isoparametric)
case ( '11') !case ( '11') ! need test
mapElemtype = 3 ! Arbitrary Quadrilateral Plane-strain ! mapElemtype = 3 ! Arbitrary Quadrilateral Plane-strain
case ( '27') case ( '27')
mapElemtype = 4 ! Plane Strain, Eight-node Distorted Quadrilateral mapElemtype = 4 ! Plane Strain, Eight-node Distorted Quadrilateral
case ( '54') case ( '54')
mapElemtype = 5 ! Plane Strain, Eight-node Distorted Quadrilateral with reduced integration mapElemtype = 5 ! Plane Strain, Eight-node Distorted Quadrilateral with reduced integration
case ( '134') !case ( '134') ! need test
mapElemtype = 6 ! Three-dimensional Four-node Tetrahedron ! mapElemtype = 6 ! Three-dimensional Four-node Tetrahedron
case ( '157') !case ( '157') ! need test
mapElemtype = 7 ! Three-dimensional, Low-order, Tetrahedron, Herrmann Formulations ! mapElemtype = 7 ! Three-dimensional, Low-order, Tetrahedron, Herrmann Formulations
case ( '127') !case ( '127') ! need test
mapElemtype = 8 ! Three-dimensional Ten-node Tetrahedron ! mapElemtype = 8 ! Three-dimensional Ten-node Tetrahedron
case ( '136') !case ( '136') ! need test
mapElemtype = 9 ! Three-dimensional Arbitrarily Distorted Pentahedral ! mapElemtype = 9 ! Three-dimensional Arbitrarily Distorted Pentahedral
case ( '117', & case ( '117') ! 123 (need test)
'123')
mapElemtype = 10 ! Three-dimensional Arbitrarily Distorted linear hexahedral with reduced integration mapElemtype = 10 ! Three-dimensional Arbitrarily Distorted linear hexahedral with reduced integration
case ( '7') case ( '7')
mapElemtype = 11 ! Three-dimensional Arbitrarily Distorted Brick 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. !> @brief return integer list corresponding to items in consecutive lines.
!! First integer in array is counter !! First integer in array is counter
!> @details ints concatenated by "c" as last char, range of a "to" b, or named set !> @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) function continuousIntValues(fileContent,maxN,lookupName,lookupMap,lookupMaxN)