Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
ElmerCSC
GitHub Repository: ElmerCSC/elmerfem
Path: blob/devel/fem/tests/1sttime/TimeIntegrate.f90
5246 views
1
SUBROUTINE TimeIntTest( Model,Solver,dt,TransientSimulation )
2
USE DefUtils
3
4
IMPLICIT NONE
5
!------------------------------------------------------------------------------
6
TYPE(Solver_t) :: Solver
7
TYPE(Model_t) :: Model
8
9
REAL(KIND=dp) :: dt
10
LOGICAL :: TransientSimulation
11
!------------------------------------------------------------------------------
12
! Local variables
13
!------------------------------------------------------------------------------
14
TYPE(Element_t),POINTER :: Element
15
16
LOGICAL :: Found
17
18
INTEGER :: n
19
REAL(KIND=dp) :: Norm
20
21
TYPE(ValueList_t), POINTER :: BodyForce
22
REAL(KIND=dp) :: STIFF(1,1), MASS(1,1), LOAD(1), FORCE(1)
23
!------------------------------------------------------------------------------
24
25
!Initialize the system and do the assembly:
26
!------------------------------------------
27
CALL DefaultInitialize()
28
29
Element => GetActiveElement(1)
30
n = GetElementNOFNodes()
31
LOAD = 0.0d0
32
33
BodyForce => GetBodyForce()
34
IF ( ASSOCIATED(BodyForce) ) &
35
Load(1:n) = GetReal( BodyForce, 'Source', Found )
36
37
!Get element local matrix and rhs vector:
38
!----------------------------------------
39
STIFF = 0.0d0
40
MASS = 1.0d0
41
FORCE = LOAD
42
43
!Update global matrix and rhs vector from local matrix & vector:
44
!---------------------------------------------------------------
45
CALL Default1stOrderTime( MASS, STIFF, FORCE )
46
CALL DefaultUpdateEquations( STIFF, FORCE )
47
CALL DefaultFinishBulkAssembly()
48
CALL DefaultFinishBoundaryAssembly()
49
CALL DefaultFinishAssembly()
50
!
51
! Solve the system and we are done:
52
! ---------------------------------
53
Norm = DefaultSolve()
54
!------------------------------------------------------------------------------
55
56
!------------------------------------------------------------------------------
57
END SUBROUTINE TimeIntTest
58
!------------------------------------------------------------------------------
59
60