Skip to content

Commit

Permalink
Added: Regression tests using the SPR equation solver
Browse files Browse the repository at this point in the history
  • Loading branch information
kmokstad committed Oct 2, 2024
1 parent 59acd64 commit 4efdbda
Show file tree
Hide file tree
Showing 104 changed files with 9,533 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Linear/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,19 @@ if(LRSpline_FOUND OR LRSPLINE_FOUND)
file(GLOB LRE_HDF5FILES RELATIVE ${PROJECT_SOURCE_DIR}/Test
${PROJECT_SOURCE_DIR}/Test/LR/*.hreg)
endif()
if(SPR_LIBRARIES)
file(GLOB SPR_TESTFILES RELATIVE ${PROJECT_SOURCE_DIR}/Test
${PROJECT_SOURCE_DIR}/Test/SPR/*.reg)
endif()

list(REMOVE_ITEM LINEL_TESTFILES CanTS2D-p2-restart.reg)

if(NOT HDF5_FOUND)
list(REMOVE_ITEM LINEL_TESTFILES CanTS2D-fields-p2.reg)
endif()

if(NOT MPI_FOUND OR IFEM_SERIAL_TESTS_IN_PARALLEL)
foreach(TESTFILE ${LINEL_TESTFILES} ${LRE_TESTFILES})
foreach(TESTFILE ${LINEL_TESTFILES} ${LRE_TESTFILES} ${SPR_TESTFILES})
ifem_add_test(${TESTFILE} LinEl)
endforeach()
foreach(TESTFILE ${LINEL_VTF_FILES} ${LRE_VTF_FILES})
Expand Down
1 change: 1 addition & 0 deletions Linear/Test/SPR/0445-properties.csv
64 changes: 64 additions & 0 deletions Linear/Test/SPR/Annulus2D.reg
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
../Annulus2D.xinp -spr

Input file: Annulus2D.xinp
Equation solver: 1
Number of Gauss points: 4
Parsing input file Annulus2D.xinp
Parsing <geometry>
Parsing <patchfile>
Reading data file annulus.g2
Reading patch 1
Parsing <raiseorder>
Parsing <refine>
Parsing <topologysets>
Topology sets: fixed end (1,1,1D)
fixed point (1,3,0D)
inner curve (1,4,1D)
pulled end (1,2,1D)
Raising order of P1 0 1
Refining P1 7 1
Parsing <boundaryconditions>
Parsing <dirichlet>
Dirichlet code 12: (fixed)
Parsing <dirichlet>
Dirichlet code 2: (fixed)
Parsing <dirichlet>
Dirichlet code 1: (fixed)
Parsing <neumann>
Neumann code 1000000 direction 2: 1e+10
Parsing <elasticity>
Material code 0: 2.068e+11 0.29 7820
Parsing input file succeeded.
Equation solver: 1
Number of Gauss points: 4
Problem definition:
Elasticity: 2D, gravity = 0 0
LinIsotropic: plane stress, E = 2.068e+11, nu = 0.29, rho = 7820
Resolving Dirichlet boundary conditions
Constraining P1 V3 in direction(s) 12
Constraining P1 E1 in direction(s) 2
Constraining P1 E4 in direction(s) 1 (local projected)
>>> SAM model summary <<<
Number of elements 32
Number of nodes 94
Number of dofs 188
Number of constraints 36
Number of unknowns 129
Assembling interior matrix terms for P1
Assembling Neumann matrix terms for boundary 2 on P1
Solving the equation system ...
>>> Solution summary <<<
L2-norm : 0.44475
Max X-displacement : 0.69500
Max Y-displacement : 1.22735
Projecting secondary solution ...
Greville point projection
Energy norm |u^h| = a(u^h,u^h)^0.5 : 145174
External energy ((f,u^h)+(t,u^h)^0.5 : 145174
>>> Error estimates based on Greville point projection <<<
Energy norm |u^r| = a(u^r,u^r)^0.5 : 144766
Error norm a(e,e)^0.5, e=u^r-u^h : 1266.18
relative error (% of |u^r|) : 0.874634
L2-norm |s^r| = (s^r,s^r)^0.5 : 5.74485e+10
L2-error (e,e)^0.5, e=s^r-s^h : 5.79253e+08
relative error (% of |s^r|) : 1.0083
78 changes: 78 additions & 0 deletions Linear/Test/SPR/Annulus3D.reg
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
../Annulus3D.xinp -spr

Input file: Annulus3D.xinp
Equation solver: 1
Number of Gauss points: 4
Parsing input file Annulus3D.xinp
Parsing <geometry>
Parsing <patchfile>
Reading data file annulus3D.g2
Reading patch 1
Parsing <raiseorder>
Parsing <refine>
Parsing <topologysets>
Topology sets: back surface (1,1,1D) (1,5,-1D) (1,6,-1D) (1,5,-2D)
fixed edge (1,11,1D)
fixed end (1,1,2D)
inner edge (1,2,1D)
inner surface (1,4,2D)
pulled end (1,2,2D)
Raising order of P1 0 1 1
Refining P1 7 1 1
Parsing <boundaryconditions>
Parsing <dirichlet>
Dirichlet code 3: (fixed)
Parsing <dirichlet>
Dirichlet code 123: (fixed)
Parsing <dirichlet>
Dirichlet code 2: (fixed)
Parsing <dirichlet>
Dirichlet code 1: (fixed)
Parsing <dirichlet>
Dirichlet code 1000003: (fixed)
Parsing <neumann>
Neumann code 1000000 direction 2: 1e+10
Parsing <elasticity>
Material code 0: 2.068e+11 0.29 7820
Parsing input file succeeded.
Equation solver: 1
Number of Gauss points: 4
Problem definition:
Elasticity: 3D, gravity = 0 0 0
LinIsotropic: E = 2.068e+11, nu = 0.29, rho = 7820
Resolving Dirichlet boundary conditions
Constraining P1 E1 in direction(s) 3
Constraining P1 E5 in direction(s) 3
Constraining P1 E6 in direction(s) 3
Constraining P1 E11 in direction(s) 123
Constraining P1 E2 in direction(s) 1
Constraining P1 F5 in direction(s) 3
Constraining P1 F1 in direction(s) 2
Constraining P1 F-4 in direction(s) 3 (local projected)
>>> SAM model summary <<<
Number of elements 64
Number of nodes 376
Number of dofs 1128
Number of D-dofs 912
Number of X-dofs 216
Number of constraints 216
Number of unknowns 741
Assembling interior matrix terms for P1
Assembling Neumann matrix terms for boundary 2 on P1
Solving the equation system ...
>>> Solution summary <<<
L2-norm : 0.300821
Max X-displacement : 0.59306 node 370
Max Y-displacement : 1.0174 node 376
Max Z-displacement : 0.0223644 node 359
Projecting secondary solution ...
Greville point projection
Energy norm |u^h| = a(u^h,u^h)^0.5 : 132214
External energy ((f,u^h)+(t,u^h)^0.5 : 132214
>>> Error estimates based on Greville point projection <<<
Energy norm |u^r| = a(u^r,u^r)^0.5 : 131734
Error norm a(e,e)^0.5, e=u^r-u^h : 1218.15
relative error (% of |u^r|) : 0.924711
L2-norm |s^r| = (s^r,s^r)^0.5 : 6.00616e+10
L2-error (e,e)^0.5, e=s^r-s^h : 6.53109e+08
relative error (% of |s^r|) : 1.0874
68 changes: 68 additions & 0 deletions Linear/Test/SPR/AnnulusWithTemp2D.reg
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
../AnnulusWithTemp2D.xinp -2Dpstrain -spr

Input file: AnnulusWithTemp2D.xinp
Equation solver: 1
Number of Gauss points: 4
Parsing input file AnnulusWithTemp2D.xinp
Parsing <geometry>
Parsing <patchfile>
Reading data file quartulus.g2
Reading patch 1
Parsing <raiseorder>
Parsing <refine>
Parsing <topologysets>
Topology sets: Bottom (1,1,1D)
Left (1,2,1D)
Parsing <patchfile>
Parsing <raiseorder>
Raising order of P1 1 1
Parsing <refine>
Refining P1 15 15
Parsing <topologysets>
Parsing <elasticity>
Parsing <dirichlet>
Dirichlet code 1: (fixed)
Parsing <dirichlet>
Dirichlet code 2: (fixed)
Material code 0: 2e+11 0.3 7850 1.2e-05
Initial temperature: 273
Temperature: r=sqrt(x\*x+y\*y); a=0.03; b=0.04; Ti=373.0; To=293.0; Ti+(To-Ti)\*log(r/a)/log(b/a)
Analytical solution: Pipe Ri=0.03 Ro=0.04 Ti=373 To=293
Parsing input file succeeded.
Equation solver: 1
Number of Gauss points: 4
Problem definition:
Elasticity: 2D, gravity = 0 0
LinIsotropic: E = 2e+11, nu = 0.3, rho = 7850, alpha = 1.2e-05
Resolving Dirichlet boundary conditions
Constraining P1 E2 in direction(s) 1
Constraining P1 E1 in direction(s) 2
>>> SAM model summary <<<
Number of elements 256
Number of nodes 342
Number of dofs 684
Number of unknowns 648
Number of quadrature points 4096
Processing integrand associated with code 0
Assembling interior matrix terms for P1
Solving the equation system ...
>>> Solution summary <<<
L2-norm : 1.74959e-05
Max X-displacement : 2.69689e-05
Max Y-displacement : 2.69689e-05
Projecting secondary solution ...
Greville point projection
Energy norm |u^h| = a(u^h,u^h)^0.5 : -3.02129
Exact norm |u| = a(u,u)^0.5 : -3.02129
Exact error a(e,e)^0.5, e=u-u^h : -0.00144707
Exact relative error (%) : 0.0478958
>>> Error estimates based on Greville point projection <<<
Energy norm |u^r| = a(u^r,u^r)^0.5 : -3.02117
Error norm a(e,e)^0.5, e=u^r-u^h : -0.00217803
relative error (% of |u|) : 0.0720893
Exact error a(e,e)^0.5, e=u-u^r : -0.00170025
relative error (% of |u|) : 0.0562756
Effectivity index : 1.50513
L2-norm |s^r| = (s^r,s^r)^0.5 : -1.32478e+06
L2-error (e,e)^0.5, e=s^r-s^h : -1208.39
relative error (% of |s^r|) : 0.091214
130 changes: 130 additions & 0 deletions Linear/Test/SPR/Beam+KLcyl-p3.reg
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
../Beam+KLcyl-p3.xinp -1D2DKLshell -spr

Input file: Beam+KLcyl-p3.xinp
Equation solver: 1
Number of Gauss points: 4
Spline basis with C1-continuous patch interfaces is used
Evaluation time for property functions: 1
Solution component output zero tolerance: 1e-06
1. Coupled linear static solver
Parsing input file Beam+KLcyl-p3.xinp
Parsing <KirchhoffLove>
Parsing <patchfile>
Reading data file halfcyl.g2
Reading patch 1
Parsing <raiseorder>
Parsing <refine>
Parsing <topologysets>
Topology sets: P1 (0,0,0D) 3 0 0
P2 (0,1,0D) 5 0 0
left (1,3,1D)
plate (1,0,2D)
right (1,4,1D)
Parsing <patchfile>
Parsing <raiseorder>
Raising order of P1 1 1
Parsing <refine>
Refining P1 3 3
Parsing <topologysets>
Parsing <rigid>
Slave code 1000000 (P1): Master point index 0 (3 0 0)
Parsing <rigid>
Slave code 2000000 (P2): Master point index 1 (5 0 0)
Material code 0: 2.1e+11 0.3 7850 0.01
Pressure code 1: 10000
Parsing <beam>
Parsing <geometry>
Parsing <patches>
Reading inlined patch geometry definition
Reading patch 1
Reading patch 2
Parsing <refine>
Parsing <topologysets>
Topology sets: end1 (1,2,0D)
end2 (2,1,0D)
support (1,1,0D) (2,2,0D)
Parsing <patches>
Parsing <refine>
Refining P1 3
Refining P2 3
Parsing <topologysets>
Parsing <boundaryconditions>
Parsing <dirichlet>
Dirichlet code 12345: (fixed)
Parsing <material>
Stiffness moduli = 2.1e+11 8.07692e+10, mass density = 7850
Parsing <properties>
Constant beam properties:
Cross section area = 0.00596903, moments of inertia = 5.40197e-05 2.70098e-05 2.70098e-05 5.40197e-05
Shear parameters = 0 0 2 2
Parsing <coupling>
Parsing <connection>
Master point: "P1" (0,0,0D)
Slave point: "end1" (1,2,0D)
Parsing <connection>
Master point: "P2" (0,1,0D)
Slave point: "end2" (2,1,0D)
Parsing <postprocessing>
Parsing <resultpoints>
Parsing <plot_rigid>
Parsing <resultpoints>
Parsing <plot_rigid>
Parsing input file succeeded.
Equation solver: 1
Number of Gauss points: p (p = polynomial degree of basis)
Spline basis with C1-continuous patch interfaces is used
11. Kirchhoff-Love plate/shell solver
Problem definition:
KirchhoffLoveShell: thickness = 0.01, gravity = 0
LinIsotropic: plane stress, E = 2.1e+11, nu = 0.3, rho = 7850, alpha = 0
Resolving Dirichlet boundary conditions
>>> SAM model summary <<<
Number of elements 32
Number of nodes 80
Number of dofs 246
Number of D-dofs 234
Number of X-dofs 12
Number of constraints 156
Number of unknowns 90
12. Linear Elastic Beam solver
Problem definition:
ElasticBeam: E = 2.1e+11, G = 8.07692e+10, rho = 7850
A = 0.00596903, Ix = 5.40197e-05, Iy = 2.70098e-05, Iz = 2.70098e-05, It = 5.40197e-05
Ky = 2, Kz = 2, Sy = 0, Sz = 0
Resolving Dirichlet boundary conditions
Constraining P1 V1 in direction(s) 12345
Constraining P2 V2 in direction(s) 12345
>>> SAM model summary <<<
Number of elements 8
Number of nodes 10
Number of dofs 60
Number of unknowns 50
13. Coupled linear static solver
Coupling node mapping:
85 -> 79
86 -> 80
>>> SAM model summary <<<
Number of elements 40
Number of nodes 90
Number of dofs 294
Number of D-dofs 294
Number of constraints 156
Number of unknowns 128
21. Kirchhoff-Love plate/shell solver
Number of quadrature points 240
Processing integrand associated with code 0
Assembling interior matrix terms for P1
Done.
22. Linear Elastic Beam solver
Number of quadrature points 8
Processing integrand associated with code 0
Assembling interior matrix terms for P1
Assembling interior matrix terms for P2
Done.
23. Coupled linear static solver
Solving the equation system ...
>>> Solution summary <<<
L2-norm : 0.00780397
Max X-displacement : 0.000204385
Max Y-displacement : 0.0159828
Max Z-displacement : 0.000220573
Loading

0 comments on commit 4efdbda

Please sign in to comment.