Skip to content

Commit c6e5864

Browse files
committed
hanging node tests
1 parent 8df6cb3 commit c6e5864

5 files changed

Lines changed: 127 additions & 6 deletions

File tree

src/oofemlib/hangingnode.C

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
#include "feinterpol.h"
4141
#include "spatiallocalizer.h"
4242
#include "classfactory.h"
43+
#include "elementgeometrytype.h"
4344

4445
namespace oofem {
4546
REGISTER_DofManager( HangingNode );
@@ -169,11 +170,12 @@ void HangingNode ::postInitialize()
169170
}
170171
}
171172

173+
//Deal with rotations. Works only for linear tetrahedron so far.
174+
if (e->giveGeometryType() == EGT_tetra_1) {
175+
172176
Dof *dof;
173177
const int nnodes = e->giveNumberOfNodes();
174178

175-
176-
//Deal with rotations.
177179
// Compute shape function gradients once
178180
FloatMatrix dNdX;
179181
fei->evaldNdx(dNdX, lcoords, FEIElementGeometryWrapper(e));
@@ -296,6 +298,10 @@ void HangingNode ::postInitialize()
296298
}
297299
}
298300

301+
} else {
302+
OOFEM_WARNING("HangingNode: rotational DOFs only supported for EGT_tetra_1 (linear tetrahedron). Skipping rotational constraint.");
303+
}
304+
299305

300306
}
301307
} // end namespace oofem

src/sm/Elements/LatticeElements/latticelink3d.C

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -318,10 +318,7 @@ namespace oofem {
318318
Node *nodeA, *nodeB;
319319
FloatArray coordsA(3), coordsB(3);
320320

321-
//Order of nodes. However, might not matter.
322-
//Reinforcement node
323321
nodeA = this->giveNode(1);
324-
//Lattice node
325322
nodeB = this->giveNode(2);
326323

327324
//Calculate components of distance from reinforcement node to lattice node.
@@ -389,7 +386,6 @@ namespace oofem {
389386
this->globalCentroid.resize(3);
390387
for ( int i = 1; i <= 3; i++ ) {
391388
this->globalCentroid.at(i) = nodeA->giveCoordinate(i);
392-
;
393389
}
394390

395391
this->geometryFlag = 1;

tests/sm/hangingrotation1.in

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
hangingrotation1.out
2+
#
3+
Test of rotation constrain in tetrahedron. Only rotations (0.1, 0.2, 0.3) are expected at hanging node.
4+
NonLinearStatic nmsteps 1 nsteps 2 nmodules 1 contextOutputStep 1000
5+
nsteps 2 rtolf 1.e-3 stiffMode 2 maxiter 1000 controllmode 1 donotfixload
6+
errorcheck
7+
domain 3d
8+
OutputManager
9+
#
10+
ndofman 5 nelem 1 ncrosssect 1 nmat 1 nbc 4 nltf 1 nic 0 nset 5
11+
node 1 coords 3 0. 0. 0.
12+
node 2 coords 3 1. 0. 0.
13+
node 3 coords 3 0. 1. 0.
14+
node 4 coords 3 0. 0. 1.
15+
hangingnode 5 coords 3 0.25 0.25 0.25 dofType 6 2 2 2 2 2 2 dofidmask 6 1 2 3 4 5 6
16+
#
17+
ltrspace 1 nodes 4 1 2 3 4
18+
#
19+
SimpleCS 1 material 1 set 1
20+
#
21+
con2dpm 1 d 0 E 30.e9 n 0.15 talpha 0. wf 9.3755e-4 fc 3.e6 ft 1.e6 hp 0.01 yieldtol 1.e-5 asoft 5. stype 1 helem 0.1 kinit 0.3
22+
#
23+
BoundaryCondition 1 loadTimeFunction 1 dofs 3 1 2 3 values 3 0.025 -0.05 0.025 set 2
24+
BoundaryCondition 2 loadTimeFunction 1 dofs 3 1 2 3 values 3 0.025 0.25 -0.175 set 3
25+
BoundaryCondition 3 loadTimeFunction 1 dofs 3 1 2 3 values 3 -0.275 -0.05 0.125 set 4
26+
BoundaryCondition 4 loadTimeFunction 1 dofs 3 1 2 3 values 3 0.225 -0.150 0.025 set 5
27+
#
28+
PiecewiseLinFunction 1 npoints 2 t 2 0. 1. f(t) 2 0. 1.
29+
set 1 elements 1 1
30+
Set 2 nodes 1 1
31+
Set 3 nodes 1 2
32+
Set 4 nodes 1 3
33+
Set 5 nodes 1 4
34+
35+
#%BEGIN_CHECK% tolerance 1e-6
36+
#NODE tStep 2 number 5 dof 1 unknown d value 0.0
37+
#NODE tStep 2 number 5 dof 2 unknown d value 0.0
38+
#NODE tStep 2 number 5 dof 3 unknown d value 0.0
39+
#NODE tStep 2 number 5 dof 4 unknown d value 0.1
40+
#NODE tStep 2 number 5 dof 5 unknown d value 0.2
41+
#NODE tStep 2 number 5 dof 6 unknown d value 0.3
42+
#%END_CHECK%

tests/sm/hangingrotation2.in

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
hangingrotation2.out
2+
Test of rotation constrain in tetrahedron: Only translations applied
3+
NonLinearStatic nmsteps 1 nsteps 2 nmodules 1 contextOutputStep 1000
4+
nsteps 2 rtolf 1.e-3 stiffMode 2 maxiter 1000 controllmode 1 donotfixload
5+
errorcheck
6+
domain 3d
7+
OutputManager tstep_all dofman_all element_all
8+
#
9+
ndofman 5 nelem 1 ncrosssect 1 nmat 1 nbc 1 nltf 1 nic 0 nset 2
10+
node 1 coords 3 0. 0. 0.
11+
node 2 coords 3 1. 0. 0.
12+
node 3 coords 3 0. 1. 0.
13+
node 4 coords 3 0. 0. 1.
14+
hangingnode 5 coords 3 0.25 0.25 0.25 dofType 6 2 2 2 2 2 2 dofidmask 6 1 2 3 4 5 6
15+
#
16+
ltrspace 1 nodes 4 1 2 3 4
17+
#
18+
SimpleCS 1 material 1 set 1
19+
#
20+
con2dpm 1 d 0 E 30.e9 n 0.15 talpha 0. wf 9.3755e-4 fc 3.e6 ft 1.e6 hp 0.01 yieldtol 1.e-5 asoft 5. stype 1 helem 0.1 kinit 0.3
21+
#
22+
BoundaryCondition 1 loadTimeFunction 1 dofs 3 1 2 3 values 3 0.025 -0.05 0.025 set 2
23+
#
24+
PiecewiseLinFunction 1 npoints 2 t 2 0. 1. f(t) 2 0. 1.
25+
set 1 elements 1 1
26+
Set 2 nodes 4 1 2 3 4
27+
28+
#%BEGIN_CHECK% tolerance 1e-6
29+
#NODE tStep 2 number 5 dof 1 unknown d value 0.025
30+
#NODE tStep 2 number 5 dof 2 unknown d value -0.05
31+
#NODE tStep 2 number 5 dof 3 unknown d value 0.025
32+
#NODE tStep 2 number 5 dof 4 unknown d value 0.0
33+
#NODE tStep 2 number 5 dof 5 unknown d value 0.0
34+
#NODE tStep 2 number 5 dof 6 unknown d value 0.0
35+
#%END_CHECK%

tests/sm/hangingrotation3.in

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
hangingrotation3.out
2+
Test of rotation constrain in tetrahedron: Rotations (0.1,0.2,0.3) and translations (0.01, 0.01, 0.01) are expected at hanging node.
3+
NonLinearStatic nmsteps 1 nsteps 2 nmodules 1 contextOutputStep 1000
4+
nsteps 2 rtolf 1.e-3 stiffMode 2 maxiter 1000 controllmode 1 donotfixload
5+
#StaticStructural nsteps 2 solverType "calm" initialguess 0 rtolf 2.e-3 reqIterations 10 stiffMode 2 maxiter 10 stepLength 1.e-4 minsteplength 1.e-4 Psi 0. nmodules 1
6+
errorcheck
7+
domain 3d
8+
OutputManager
9+
#
10+
ndofman 5 nelem 1 ncrosssect 1 nmat 1 nbc 4 nltf 1 nic 0 nset 5
11+
node 1 coords 3 0. 0. 0.
12+
node 2 coords 3 1. 0. 0.
13+
node 3 coords 3 0. 1. 0.
14+
node 4 coords 3 0. 0. 1.
15+
hangingnode 5 coords 3 0.25 0.25 0.25 dofType 6 2 2 2 2 2 2 dofidmask 6 1 2 3 4 5 6
16+
#
17+
ltrspace 1 nodes 4 1 2 3 4
18+
#
19+
SimpleCS 1 material 1 set 1
20+
#
21+
con2dpm 1 d 0 E 30.e9 n 0.15 talpha 0. wf 9.3755e-4 fc 3.e6 ft 1.e6 hp 0.01 yieldtol 1.e-5 asoft 5. stype 1 helem 0.1 kinit 0.3
22+
#
23+
BoundaryCondition 1 loadTimeFunction 1 dofs 3 1 2 3 values 3 0.035 -0.04 0.035 set 2
24+
BoundaryCondition 2 loadTimeFunction 1 dofs 3 1 2 3 values 3 0.035 0.26 -0.165 set 3
25+
BoundaryCondition 3 loadTimeFunction 1 dofs 3 1 2 3 values 3 -0.265 -0.04 0.135 set 4
26+
BoundaryCondition 4 loadTimeFunction 1 dofs 3 1 2 3 values 3 0.235 -0.140 0.035 set 5
27+
#
28+
PiecewiseLinFunction 1 npoints 2 t 2 0. 1. f(t) 2 0. 1.
29+
set 1 elements 1 1
30+
Set 2 nodes 1 1
31+
Set 3 nodes 1 2
32+
Set 4 nodes 1 3
33+
Set 5 nodes 1 4
34+
35+
#%BEGIN_CHECK% tolerance 1e-6
36+
#NODE tStep 2 number 5 dof 1 unknown d value 0.01
37+
#NODE tStep 2 number 5 dof 2 unknown d value 0.01
38+
#NODE tStep 2 number 5 dof 3 unknown d value 0.01
39+
#NODE tStep 2 number 5 dof 4 unknown d value 0.1
40+
#NODE tStep 2 number 5 dof 5 unknown d value 0.2
41+
#NODE tStep 2 number 5 dof 6 unknown d value 0.3
42+
#%END_CHECK%

0 commit comments

Comments
 (0)