Skip to content

Commit dc09765

Browse files
committed
Further steps. Add test case.
1 parent 4bc52cd commit dc09765

File tree

10 files changed

+6199
-25
lines changed

10 files changed

+6199
-25
lines changed

fem/src/MortarUtils.F90

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3379,7 +3379,6 @@ FUNCTION LevelProjector( BMesh1, BMesh2, Repeating, AntiRepeating, &
33793379
ArcCoeff = 1.0_dp
33803380
END IF
33813381

3382-
33833382

33843383
! We have a weak projector if it is requested
33853384
NitscheProjector = ListGetLogical( BC,'Nitsche Projector', Found )
@@ -3454,7 +3453,6 @@ FUNCTION LevelProjector( BMesh1, BMesh2, Repeating, AntiRepeating, &
34543453
Projector % FORMAT = MATRIX_LIST
34553454

34563455
IF( NitscheProjector ) THEN
3457-
34583456
Projector % ProjectorType = PROJECTOR_TYPE_NITSCHE
34593457
ELSE
34603458
Projector % ProjectorType = PROJECTOR_TYPE_GALERKIN
@@ -3769,9 +3767,11 @@ FUNCTION LevelProjector( BMesh1, BMesh2, Repeating, AntiRepeating, &
37693767
END IF
37703768

37713769
CALL Info(Caller,'Max number of rows in projector: '//I2S(ProjectorRows),Level=10)
3772-
ALLOCATE( Projector % InvPerm(ProjectorRows) )
3773-
Projector % InvPerm = 0
3774-
3770+
IF(.NOT. NitscheProjector ) THEN
3771+
ALLOCATE( Projector % InvPerm(ProjectorRows) )
3772+
Projector % InvPerm = 0
3773+
END IF
3774+
37753775
! If after strong projectors there are still something undone they must
37763776
! be dealt with the weak projectors.
37773777
SomethingUndone = .FALSE.
@@ -3860,11 +3860,13 @@ FUNCTION LevelProjector( BMesh1, BMesh2, Repeating, AntiRepeating, &
38603860
IF( CreateDual ) DEALLOCATE( DualNodePerm )
38613861
IF( DoEdges ) DEALLOCATE( EdgePerm )
38623862

3863-
m = COUNT( Projector % InvPerm == 0 )
3864-
IF( m > 0 ) THEN
3865-
CALL Warn(Caller,'Projector % InvPerm not set in for dofs: '//I2S(m))
3863+
IF(ASSOCIATED(Projector % InvPerm) ) THEN
3864+
m = COUNT( Projector % InvPerm == 0 )
3865+
IF( m > 0 ) THEN
3866+
CALL Warn(Caller,'Projector % InvPerm not set in for dofs: '//I2S(m))
3867+
END IF
38663868
END IF
3867-
3869+
38683870
CALL Info(Caller,'Projector created',Level=10)
38693871

38703872
CONTAINS
@@ -5480,8 +5482,7 @@ SUBROUTINE AddProjectorWeakGeneric()
54805482

54815483
IF( SaveErr ) CLOSE(11)
54825484

5483-
5484-
5485+
54855486
DEALLOCATE( Nodes % x, Nodes % y, Nodes % z, &
54865487
NodesM % x, NodesM % y, NodesM % z, &
54875488
NodesT % x, NodesT % y, NodesT % z, &

fem/src/SolverUtils.F90

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26034,9 +26034,6 @@ SUBROUTINE GenerateAddMatrix( Model, Solver )
2603426034
END IF
2603526035

2603626036
CALL Info(Caller,'Adding mortar projector of type Nitsche for BC: '//I2S(bc_ind),Level=8)
26037-
IF( .NOT. ASSOCIATED( Atmp % InvPerm ) ) THEN
26038-
CALL Fatal(Caller,'InvPerm is required for geometric projector!')
26039-
END IF
2604026037

2604126038
! Enable that the user can for vector valued cases either set some
2604226039
! or skip some field components.

fem/tests/ContactBlunt3DNormalProj/case.sif

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Header
2020
End
2121

2222
Simulation
23-
Max Output Level = 5
23+
Max Output Level = 25
2424
Coordinate System = Cartesian 3D
2525
Coordinate Mapping(3) = 1 2 3
2626
Simulation Type = Steady State

fem/tests/RotatingBCMagnetoDynamics2/case.sif

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Header
2121
End
2222

2323
Simulation
24-
Max Output Level = 5
24+
Max Output Level = 25
2525
Coordinate System = Cartesian
2626
Coordinate Mapping(3) = 1 2 3
2727
Simulation Type = Transient
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
INCLUDE(test_macros)
2+
INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}/fem/src)
3+
4+
CONFIGURE_FILE( case.sif case.sif COPYONLY)
5+
6+
file(COPY ELMERSOLVER_STARTINFO mortar.msh DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/")
7+
8+
ADD_ELMER_TEST(RotatingBCPoisson2DNitsche LABELS mortar)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
case.sif

fem/tests/RotatingBCPoisson2D/nitsche.sif renamed to fem/tests/RotatingBCPoissonNitsche/case.sif

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
! Test case for 2D nonconforming mortar elements
2-
! Some timing settings inhereted from benchmark computations
2+
! This test uses the Nitshce method to ensure continuity over the
3+
! interface.
4+
!
5+
! P.R. 26.2.2026
36

47
Header
58
CHECK KEYWORDS Warn
@@ -18,7 +21,7 @@ Simulation
1821
Steady State Max Iterations = 1
1922
Output Intervals = 1
2023

21-
Timestep Intervals = 20
24+
Timestep Intervals = 3 !90
2225
Output Intervals = 1
2326

2427
! signs = Variable "time"
@@ -27,12 +30,9 @@ Simulation
2730
! 2 1
2831
! End
2932

30-
Post File = case-a.vtu
31-
33+
Post File = case.vtu
3234
Ascii Output = True
3335

34-
! Output File = case.result
35-
3636
Simulation Timing = Logical True
3737
End
3838

@@ -161,8 +161,6 @@ Body Force 3
161161
Real MATC "omega*tx+phi0"
162162
End
163163

164-
165-
166164
Boundary Condition 1
167165
Target Boundaries(4) = 10 11 12 13
168166
Name = "Ambient"
@@ -187,5 +185,5 @@ Boundary Condition 3
187185
End
188186

189187

190-
Solver 2 :: Reference Norm = 6.93769175
188+
Solver 2 :: Reference Norm = 7.3154459807490548
191189

0 commit comments

Comments
 (0)