-
Notifications
You must be signed in to change notification settings - Fork 62
/
finite_elasticity_fluid_pressure_routines.f90
591 lines (508 loc) · 27.3 KB
/
finite_elasticity_fluid_pressure_routines.f90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
!> \file
!> \authors Adam Reeve
!> \brief This module handles all routines pertaining to finite elasticity coupled with fluid pressure for poroelasticity.
!>
!> \section LICENSE
!>
!> Version: MPL 1.1/GPL 2.0/LGPL 2.1
!>
!> The contents of this file are subject to the Mozilla Public License
!> Version 1.1 (the "License"); you may not use this file except in
!> compliance with the License. You may obtain a copy of the License at
!> http://www.mozilla.org/MPL/
!>
!> Software distributed under the License is distributed on an "AS IS"
!> basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
!> License for the specific language governing rights and limitations
!> under the License.
!>
!> The Original Code is OpenCMISS
!>
!> The Initial Developer of the Original Code is University of Auckland,
!> Auckland, New Zealand, the University of Oxford, Oxford, United
!> Kingdom and King's College, London, United Kingdom. Portions created
!> by the University of Auckland, the University of Oxford and King's
!> College, London are Copyright (C) 2007-2010 by the University of
!> Auckland, the University of Oxford and King's College, London.
!> All Rights Reserved.
!>
!> Contributor(s):
!>
!> Alternatively, the contents of this file may be used under the terms of
!> either the GNU General Public License Version 2 or later (the "GPL"), or
!> the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
!> in which case the provisions of the GPL or the LGPL are applicable instead
!> of those above. If you wish to allow use of your version of this file only
!> under the terms of either the GPL or the LGPL, and not to allow others to
!> use your version of this file under the terms of the MPL, indicate your
!> decision by deleting the provisions above and replace them with the notice
!> and other provisions required by the GPL or the LGPL. If you do not delete
!> the provisions above, a recipient may use your version of this file under
!> the terms of any one of the MPL, the GPL or the LGPL.
!>
!>This module handles all routines pertaining to finite elasticity coupled with fluid pressure for poroelasticity.
MODULE FINITE_ELASTICITY_FLUID_PRESSURE_ROUTINES
USE BaseRoutines
USE BasisRoutines
USE CONSTANTS
USE CONTROL_LOOP_ROUTINES
USE ControlLoopAccessRoutines
USE EquationsRoutines
USE EquationsSetConstants
USE FINITE_ELASTICITY_ROUTINES
USE INPUT_OUTPUT
USE ISO_VARYING_STRING
USE KINDS
USE PROBLEM_CONSTANTS
USE STRINGS
USE SOLVER_ROUTINES
USE SolverAccessRoutines
USE TYPES
#include "macros.h"
IMPLICIT NONE
PUBLIC FinElasticityFluidPressure_EquationsSetSetup
PUBLIC FinElasticityFluidPressure_EquationsSetSolnMethodSet
PUBLIC FinElasticityFluidPressure_EquationsSetSpecificationSet
PUBLIC ELASTICITY_FLUID_PRESSURE_PROBLEM_SETUP
PUBLIC FinElasticityFluidPressure_ProblemSpecificationSet
PUBLIC FinElasticityFluidPressure_FiniteElementCalculate
PUBLIC ELASTICITY_FLUID_PRESSURE_PRE_SOLVE
PUBLIC ELASTICITY_FLUID_PRESSURE_POST_SOLVE
PUBLIC FinElasticityFluidPressure_ControlLoopPreLoop
CONTAINS
!
!================================================================================================================================
!
!>Sets/changes the solution method for a finite elasticity fluid pressure equation type of a multi physics equations set class.
SUBROUTINE FinElasticityFluidPressure_EquationsSetSolnMethodSet(EQUATIONS_SET,SOLUTION_METHOD,ERR,ERROR,*)
!Argument variables
TYPE(EQUATIONS_SET_TYPE), POINTER :: EQUATIONS_SET !<A pointer to the equations set to set the solution method for
INTEGER(INTG), INTENT(IN) :: SOLUTION_METHOD !<The solution method to set
INTEGER(INTG), INTENT(OUT) :: ERR !<The error code
TYPE(VARYING_STRING), INTENT(OUT) :: ERROR !<The error string
!Local Variables
TYPE(VARYING_STRING) :: LOCAL_ERROR
ENTERS("FinElasticityFluidPressure_EquationsSetSolnMethodSet",ERR,ERROR,*999)
IF(ASSOCIATED(EQUATIONS_SET)) THEN
IF(.NOT.ALLOCATED(EQUATIONS_SET%SPECIFICATION)) THEN
CALL FlagError("Equations set specification is not allocated.",err,error,*999)
ELSE IF(SIZE(EQUATIONS_SET%SPECIFICATION,1)/=3) THEN
CALL FlagError("Equations set specification must have three entries for a "// &
& "finite elasticity-fluid pressure class equations set.",err,error,*999)
END IF
SELECT CASE(EQUATIONS_SET%SPECIFICATION(3))
CASE(EQUATIONS_SET_ELASTICITY_FLUID_PRESSURE_STATIC_INRIA_SUBTYPE, &
& EQUATIONS_SET_ELASTICITY_FLUID_PRESSURE_HOLMES_MOW_SUBTYPE, &
& EQUATIONS_SET_ELASTICITY_FLUID_PRES_HOLMES_MOW_ACTIVE_SUBTYPE)
SELECT CASE(SOLUTION_METHOD)
CASE(EQUATIONS_SET_FEM_SOLUTION_METHOD)
EQUATIONS_SET%SOLUTION_METHOD=EQUATIONS_SET_FEM_SOLUTION_METHOD
CASE(EQUATIONS_SET_BEM_SOLUTION_METHOD)
CALL FlagError("Not implemented.",ERR,ERROR,*999)
CASE(EQUATIONS_SET_FD_SOLUTION_METHOD)
CALL FlagError("Not implemented.",ERR,ERROR,*999)
CASE(EQUATIONS_SET_FV_SOLUTION_METHOD)
CALL FlagError("Not implemented.",ERR,ERROR,*999)
CASE(EQUATIONS_SET_GFEM_SOLUTION_METHOD)
CALL FlagError("Not implemented.",ERR,ERROR,*999)
CASE(EQUATIONS_SET_GFV_SOLUTION_METHOD)
CALL FlagError("Not implemented.",ERR,ERROR,*999)
CASE DEFAULT
LOCAL_ERROR="The specified solution method of "//TRIM(NUMBER_TO_VSTRING(SOLUTION_METHOD,"*",ERR,ERROR))//" is invalid."
CALL FlagError(LOCAL_ERROR,ERR,ERROR,*999)
END SELECT
CASE DEFAULT
LOCAL_ERROR="Equations set subtype of "//TRIM(NUMBER_TO_VSTRING(EQUATIONS_SET%SPECIFICATION(3),"*",ERR,ERROR))// &
& " is not valid for a finite elasticity fluid pressure equation type of a multi physics equations set class."
CALL FlagError(LOCAL_ERROR,ERR,ERROR,*999)
END SELECT
ELSE
CALL FlagError("Equations set is not associated.",ERR,ERROR,*999)
ENDIF
EXITS("FinElasticityFluidPressure_EquationsSetSolnMethodSet")
RETURN
999 ERRORS("FinElasticityFluidPressure_EquationsSetSolnMethodSet",ERR,ERROR)
EXITS("FinElasticityFluidPressure_EquationsSetSolnMethodSet")
RETURN 1
END SUBROUTINE FinElasticityFluidPressure_EquationsSetSolnMethodSet
!
!================================================================================================================================
!
!>Sets the equation specification for a finite elasticity fluid pressure equation type of a fluid mechanics equations set class.
SUBROUTINE FinElasticityFluidPressure_EquationsSetSpecificationSet(equationsSet,specification,err,error,*)
!Argument variables
TYPE(EQUATIONS_SET_TYPE), POINTER :: equationsSet !<A pointer to the equations set to set the specification for
INTEGER(INTG), INTENT(IN) :: specification(:) !<The equations set specification to set
INTEGER(INTG), INTENT(OUT) :: err !<The error code
TYPE(VARYING_STRING), INTENT(OUT) :: error !<The error string
!Local Variables
ENTERS("FinElasticityFluidPressure_EquationsSetSpecificationSet",ERR,ERROR,*999)
CALL FlagError("FinElasticityFluidPressure_EquationsSetSpecificationSet is not implemented.",ERR,ERROR,*999)
EXITS("FinElasticityFluidPressure_EquationsSetSpecificationSet")
RETURN
999 ERRORS("FinElasticityFluidPressure_EquationsSetSpecificationSet",ERR,ERROR)
EXITS("FinElasticityFluidPressure_EquationsSetSpecificationSet")
RETURN 1
END SUBROUTINE FinElasticityFluidPressure_EquationsSetSpecificationSet
!
!================================================================================================================================
!
!>Sets up the finite elasticity fluid pressure equation.
SUBROUTINE FinElasticityFluidPressure_EquationsSetSetup(EQUATIONS_SET,EQUATIONS_SET_SETUP,ERR,ERROR,*)
!Argument variables
TYPE(EQUATIONS_SET_TYPE), POINTER :: EQUATIONS_SET !<A pointer to the equations set to setup
TYPE(EQUATIONS_SET_SETUP_TYPE), INTENT(INOUT) :: EQUATIONS_SET_SETUP !<The equations set setup information
INTEGER(INTG), INTENT(OUT) :: ERR !<The error code
TYPE(VARYING_STRING), INTENT(OUT) :: ERROR !<The error string
ENTERS("FinElasticityFluidPressure_EquationsSetSetup",ERR,ERROR,*999)
CALL FlagError("FinElasticityFluidPressure_EquationsSetSetup is not implemented.",ERR,ERROR,*999)
EXITS("FinElasticityFluidPressure_EquationsSetSetup")
RETURN
999 ERRORS("FinElasticityFluidPressure_EquationsSetSetup",ERR,ERROR)
EXITS("FinElasticityFluidPressure_EquationsSetSetup")
RETURN 1
END SUBROUTINE FinElasticityFluidPressure_EquationsSetSetup
!
!================================================================================================================================
!
!>Calculates the element stiffness matrices and RHS for a finite elasticity fluid pressure equation finite element equations set.
SUBROUTINE FinElasticityFluidPressure_FiniteElementCalculate(EQUATIONS_SET,ELEMENT_NUMBER,ERR,ERROR,*)
!Argument variables
TYPE(EQUATIONS_SET_TYPE), POINTER :: EQUATIONS_SET !<A pointer to the equations set to perform the finite element calculations on
INTEGER(INTG), INTENT(IN) :: ELEMENT_NUMBER !<The element number to calculate
INTEGER(INTG), INTENT(OUT) :: ERR !<The error code
TYPE(VARYING_STRING), INTENT(OUT) :: ERROR !<The error string
ENTERS("FinElasticityFluidPressure_FiniteElementCalculate",ERR,ERROR,*999)
CALL FlagError("FinElasticityFluidPressure_FiniteElementCalculate is not implemented.",ERR,ERROR,*999)
EXITS("FinElasticityFluidPressure_FiniteElementCalculate")
RETURN
999 ERRORS("FinElasticityFluidPressure_FiniteElementCalculate",ERR,ERROR)
EXITS("FinElasticityFluidPressure_FiniteElementCalculate")
RETURN 1
END SUBROUTINE FinElasticityFluidPressure_FiniteElementCalculate
!
!================================================================================================================================
!
!>Sets the problem specification for a finite elasticity fluid pressure equation type.
SUBROUTINE FinElasticityFluidPressure_ProblemSpecificationSet(problem,problemSpecification,err,error,*)
!Argument variables
TYPE(PROBLEM_TYPE), POINTER :: problem !<A pointer to the problem to set the specification for
INTEGER(INTG), INTENT(IN) :: problemSpecification(:) !<The problem specification to set
INTEGER(INTG), INTENT(OUT) :: err !<The error code
TYPE(VARYING_STRING), INTENT(OUT) :: error !<The error string
!Local Variables
TYPE(VARYING_STRING) :: localError
INTEGER(INTG) :: problemSubtype
ENTERS("FinElasticityFluidPressure_ProblemSpecificationSet",err,error,*999)
IF(ASSOCIATED(PROBLEM)) THEN
IF(SIZE(problemSpecification,1)==3) THEN
problemSubtype=problemSpecification(3)
SELECT CASE(problemSubtype)
CASE(PROBLEM_STANDARD_ELASTICITY_FLUID_PRESSURE_SUBTYPE)
!ok
CASE DEFAULT
localError="The third problem specification of "//TRIM(NumberToVstring(problemSubtype,"*",err,error))// &
& " is not valid for a finite elasticity fluid pressure type of a multi physics problem."
CALL FlagError(localError,err,error,*999)
END SELECT
IF(ALLOCATED(problem%specification)) THEN
CALL FlagError("Problem specification is already allocated.",err,error,*999)
ELSE
ALLOCATE(problem%specification(3),stat=err)
IF(err/=0) CALL FlagError("Could not allocate problem specification.",err,error,*999)
END IF
problem%specification(1:3)=[PROBLEM_MULTI_PHYSICS_CLASS,PROBLEM_FINITE_ELASTICITY_FLUID_PRESSURE_TYPE, &
& problemSubtype]
ELSE
CALL FlagError("Finite elasticity fluid pressure problem specificaion must have three entries.",err,error,*999)
END IF
ELSE
CALL FlagError("Problem is not associated.",err,error,*999)
END IF
EXITS("FinElasticityFluidPressure_ProblemSpecificationSet")
RETURN
999 ERRORS("FinElasticityFluidPressure_ProblemSpecificationSet",err,error)
EXITS("FinElasticityFluidPressure_ProblemSpecificationSet")
RETURN 1
END SUBROUTINE FinElasticityFluidPressure_ProblemSpecificationSet
!
!================================================================================================================================
!
!>Sets up the finite elasticity fluid pressure equations problem.
SUBROUTINE ELASTICITY_FLUID_PRESSURE_PROBLEM_SETUP(PROBLEM,PROBLEM_SETUP,ERR,ERROR,*)
!Argument variables
TYPE(PROBLEM_TYPE), POINTER :: PROBLEM !<A pointer to the problem to setup
TYPE(PROBLEM_SETUP_TYPE), INTENT(INOUT) :: PROBLEM_SETUP !<The problem setup information
INTEGER(INTG), INTENT(OUT) :: ERR !<The error code
TYPE(VARYING_STRING), INTENT(OUT) :: ERROR !<The error string
!Local Variables
TYPE(CONTROL_LOOP_TYPE), POINTER :: CONTROL_LOOP,CONTROL_LOOP_ROOT
TYPE(SOLVER_TYPE), POINTER :: SOLVER
TYPE(SOLVER_EQUATIONS_TYPE), POINTER :: SOLVER_EQUATIONS
TYPE(SOLVERS_TYPE), POINTER :: SOLVERS
TYPE(VARYING_STRING) :: LOCAL_ERROR
ENTERS("ELASTICITY_FLUID_PRESSURE_PROBLEM_SETUP",ERR,ERROR,*999)
NULLIFY(CONTROL_LOOP)
NULLIFY(SOLVER)
NULLIFY(SOLVERS)
NULLIFY(SOLVER_EQUATIONS)
IF(ASSOCIATED(PROBLEM)) THEN
IF(ALLOCATED(problem%specification)) THEN
IF(.NOT.ALLOCATED(problem%specification)) THEN
CALL FlagError("Problem specification is not allocated.",err,error,*999)
ELSE IF(SIZE(problem%specification,1)<3) THEN
CALL FlagError("Problem specification must have three entries for a finite elasticity-Darcy problem.", &
& err,error,*999)
END IF
ELSE
CALL FlagError("Problem specification is not allocated.",err,error,*999)
END IF
SELECT CASE(PROBLEM%SPECIFICATION(3))
!--------------------------------------------------------------------
! Standard finite elasticity fluid pressure
!--------------------------------------------------------------------
CASE(PROBLEM_STANDARD_ELASTICITY_FLUID_PRESSURE_SUBTYPE)
SELECT CASE(PROBLEM_SETUP%SETUP_TYPE)
CASE(PROBLEM_SETUP_INITIAL_TYPE)
SELECT CASE(PROBLEM_SETUP%ACTION_TYPE)
CASE(PROBLEM_SETUP_START_ACTION)
!Do nothing
CASE(PROBLEM_SETUP_FINISH_ACTION)
!Do nothing
CASE DEFAULT
LOCAL_ERROR="The action type of "//TRIM(NUMBER_TO_VSTRING(PROBLEM_SETUP%ACTION_TYPE,"*",ERR,ERROR))// &
& " for a setup type of "//TRIM(NUMBER_TO_VSTRING(PROBLEM_SETUP%SETUP_TYPE,"*",ERR,ERROR))// &
& " is invalid for an finite elasticity ALE fluid pressure equation."
CALL FlagError(LOCAL_ERROR,ERR,ERROR,*999)
END SELECT
CASE(PROBLEM_SETUP_CONTROL_TYPE)
SELECT CASE(PROBLEM_SETUP%ACTION_TYPE)
CASE(PROBLEM_SETUP_START_ACTION)
!Set up a load increment loop
CALL CONTROL_LOOP_CREATE_START(PROBLEM,CONTROL_LOOP,ERR,ERROR,*999)
CALL CONTROL_LOOP_TYPE_SET(CONTROL_LOOP,PROBLEM_CONTROL_LOAD_INCREMENT_LOOP_TYPE,ERR,ERROR,*999)
CASE(PROBLEM_SETUP_FINISH_ACTION)
!Finish the control loops
CONTROL_LOOP_ROOT=>PROBLEM%CONTROL_LOOP
CALL CONTROL_LOOP_GET(CONTROL_LOOP_ROOT,CONTROL_LOOP_NODE,CONTROL_LOOP,ERR,ERROR,*999)
CALL CONTROL_LOOP_CREATE_FINISH(CONTROL_LOOP,ERR,ERROR,*999)
CASE DEFAULT
LOCAL_ERROR="The action type of "//TRIM(NUMBER_TO_VSTRING(PROBLEM_SETUP%ACTION_TYPE,"*",ERR,ERROR))// &
& " for a setup type of "//TRIM(NUMBER_TO_VSTRING(PROBLEM_SETUP%SETUP_TYPE,"*",ERR,ERROR))// &
& " is invalid for a finite elasticity fluid pressure equation."
CALL FlagError(LOCAL_ERROR,ERR,ERROR,*999)
END SELECT
CASE(PROBLEM_SETUP_SOLVERS_TYPE)
!Get the control loop
CONTROL_LOOP_ROOT=>PROBLEM%CONTROL_LOOP
CALL CONTROL_LOOP_GET(CONTROL_LOOP_ROOT,CONTROL_LOOP_NODE,CONTROL_LOOP,ERR,ERROR,*999)
SELECT CASE(PROBLEM_SETUP%ACTION_TYPE)
CASE(PROBLEM_SETUP_START_ACTION)
!Start the solvers creation for the solver
CALL SOLVERS_CREATE_START(CONTROL_LOOP,SOLVERS,ERR,ERROR,*999)
CALL SOLVERS_NUMBER_SET(SOLVERS,1,ERR,ERROR,*999)
!
!Set the first solver to be a nonlinear solver
CALL SOLVERS_SOLVER_GET(SOLVERS,1,SOLVER,ERR,ERROR,*999)
CALL SOLVER_TYPE_SET(SOLVER,SOLVER_NONLINEAR_TYPE,ERR,ERROR,*999)
CALL SOLVER_LIBRARY_TYPE_SET(SOLVER,SOLVER_PETSC_LIBRARY,ERR,ERROR,*999)
CASE(PROBLEM_SETUP_FINISH_ACTION)
CALL CONTROL_LOOP_SOLVERS_GET(CONTROL_LOOP,SOLVERS,ERR,ERROR,*999)
!Finish the solvers creation
CALL SOLVERS_CREATE_FINISH(SOLVERS,ERR,ERROR,*999)
CASE DEFAULT
LOCAL_ERROR="The action type of "//TRIM(NUMBER_TO_VSTRING(PROBLEM_SETUP%ACTION_TYPE,"*",ERR,ERROR))// &
& " for a setup type of "//TRIM(NUMBER_TO_VSTRING(PROBLEM_SETUP%SETUP_TYPE,"*",ERR,ERROR))// &
& " is invalid for a finite elasticity fluid pressure equation."
CALL FlagError(LOCAL_ERROR,ERR,ERROR,*999)
END SELECT
CASE(PROBLEM_SETUP_SOLVER_EQUATIONS_TYPE)
SELECT CASE(PROBLEM_SETUP%ACTION_TYPE)
CASE(PROBLEM_SETUP_START_ACTION)
!Get the control loop and solvers
CONTROL_LOOP_ROOT=>PROBLEM%CONTROL_LOOP
CALL CONTROL_LOOP_GET(CONTROL_LOOP_ROOT,CONTROL_LOOP_NODE,CONTROL_LOOP,ERR,ERROR,*999)
CALL CONTROL_LOOP_SOLVERS_GET(CONTROL_LOOP,SOLVERS,ERR,ERROR,*999)
!
!Get the nonlinear solver and create the solver equations
CALL SOLVERS_SOLVER_GET(SOLVERS,1,SOLVER,ERR,ERROR,*999)
CALL SOLVER_EQUATIONS_CREATE_START(SOLVER,SOLVER_EQUATIONS,ERR,ERROR,*999)
CALL SOLVER_EQUATIONS_LINEARITY_TYPE_SET(SOLVER_EQUATIONS,SOLVER_EQUATIONS_NONLINEAR,ERR,ERROR,*999)
CALL SOLVER_EQUATIONS_TIME_DEPENDENCE_TYPE_SET(SOLVER_EQUATIONS,SOLVER_EQUATIONS_STATIC,ERR,ERROR,*999)
CALL SOLVER_EQUATIONS_SPARSITY_TYPE_SET(SOLVER_EQUATIONS,SOLVER_SPARSE_MATRICES,ERR,ERROR,*999)
CASE(PROBLEM_SETUP_FINISH_ACTION)
!Get the control loop
CONTROL_LOOP_ROOT=>PROBLEM%CONTROL_LOOP
CALL CONTROL_LOOP_GET(CONTROL_LOOP_ROOT,CONTROL_LOOP_NODE,CONTROL_LOOP,ERR,ERROR,*999)
CALL CONTROL_LOOP_SOLVERS_GET(CONTROL_LOOP,SOLVERS,ERR,ERROR,*999)
!
!Finish the creation of the solver equations
CALL SOLVERS_SOLVER_GET(SOLVERS,1,SOLVER,ERR,ERROR,*999)
CALL SOLVER_SOLVER_EQUATIONS_GET(SOLVER,SOLVER_EQUATIONS,ERR,ERROR,*999)
CALL SOLVER_EQUATIONS_CREATE_FINISH(SOLVER_EQUATIONS,ERR,ERROR,*999)
CASE DEFAULT
LOCAL_ERROR="The action type of "//TRIM(NUMBER_TO_VSTRING(PROBLEM_SETUP%ACTION_TYPE,"*",ERR,ERROR))// &
& " for a setup type of "//TRIM(NUMBER_TO_VSTRING(PROBLEM_SETUP%SETUP_TYPE,"*",ERR,ERROR))// &
& " is invalid for a finite elasticity fluid pressure equation."
CALL FlagError(LOCAL_ERROR,ERR,ERROR,*999)
END SELECT
CASE DEFAULT
LOCAL_ERROR="The setup type of "//TRIM(NUMBER_TO_VSTRING(PROBLEM_SETUP%SETUP_TYPE,"*",ERR,ERROR))// &
& " is invalid for a finite elasticity ALE fluid pressure equation."
CALL FlagError(LOCAL_ERROR,ERR,ERROR,*999)
END SELECT
CASE DEFAULT
LOCAL_ERROR="The problem subtype of "//TRIM(NUMBER_TO_VSTRING(PROBLEM%SPECIFICATION(3),"*",ERR,ERROR))// &
& " does not equal a standard finite elasticity fluid pressure equation subtype."
CALL FlagError(LOCAL_ERROR,ERR,ERROR,*999)
END SELECT
ELSE
CALL FlagError("Problem is not associated.",ERR,ERROR,*999)
ENDIF
EXITS("ELASTICITY_FLUID_PRESSURE_PROBLEM_SETUP")
RETURN
999 ERRORSEXITS("ELASTICITY_FLUID_PRESSURE_PROBLEM_SETUP",ERR,ERROR)
RETURN 1
END SUBROUTINE ELASTICITY_FLUID_PRESSURE_PROBLEM_SETUP
!
!================================================================================================================================
!
!>Sets up the finite elasticity fluid pressure problem pre-solve.
SUBROUTINE ELASTICITY_FLUID_PRESSURE_PRE_SOLVE(CONTROL_LOOP,SOLVER,ERR,ERROR,*)
!Argument variables
TYPE(CONTROL_LOOP_TYPE), POINTER :: CONTROL_LOOP !<A pointer to the control loop to solve.
TYPE(SOLVER_TYPE), POINTER :: SOLVER !<A pointer to the solver
INTEGER(INTG), INTENT(OUT) :: ERR !<The error code
TYPE(VARYING_STRING), INTENT(OUT) :: ERROR !<The error string
!Local Variables
TYPE(VARYING_STRING) :: LOCAL_ERROR
ENTERS("ELASTICITY_FLUID_PRESSURE_PRE_SOLVE",ERR,ERROR,*999)
IF(ASSOCIATED(CONTROL_LOOP)) THEN
IF(ASSOCIATED(SOLVER)) THEN
IF(ASSOCIATED(CONTROL_LOOP%PROBLEM)) THEN
IF(.NOT.ALLOCATED(CONTROL_LOOP%PROBLEM%SPECIFICATION)) THEN
CALL FlagError("Problem specification is not allocated.",err,error,*999)
ELSE IF(SIZE(CONTROL_LOOP%PROBLEM%SPECIFICATION,1)<3) THEN
CALL FlagError("Problem specification must have three entries for an elasticity fluid pressure problem.",err,error,*999)
END IF
SELECT CASE(CONTROL_LOOP%PROBLEM%SPECIFICATION(3))
CASE(PROBLEM_STANDARD_ELASTICITY_FLUID_PRESSURE_SUBTYPE)
IF(CONTROL_LOOP%LOOP_TYPE==PROBLEM_CONTROL_LOAD_INCREMENT_LOOP_TYPE) THEN
CALL FiniteElasticity_PreSolve(solver,err,error,*999)
ENDIF
CASE DEFAULT
LOCAL_ERROR="Problem subtype "//TRIM(NUMBER_TO_VSTRING(CONTROL_LOOP%PROBLEM%SPECIFICATION(3),"*",ERR,ERROR))// &
& " is not valid for a fluid pressure fluid type of a multi physics problem class."
CALL FlagError(LOCAL_ERROR,ERR,ERROR,*999)
END SELECT
ELSE
CALL FlagError("Problem is not associated.",ERR,ERROR,*999)
ENDIF
ELSE
CALL FlagError("Solver is not associated.",ERR,ERROR,*999)
ENDIF
ELSE
CALL FlagError("Control loop is not associated.",ERR,ERROR,*999)
ENDIF
EXITS("ELASTICITY_FLUID_PRESSURE_PRE_SOLVE")
RETURN
999 ERRORSEXITS("ELASTICITY_FLUID_PRESSURE_PRE_SOLVE",ERR,ERROR)
RETURN 1
END SUBROUTINE ELASTICITY_FLUID_PRESSURE_PRE_SOLVE
!
!================================================================================================================================
!
!>Sets up the finite elasticity fluid pressure problem post solve.
SUBROUTINE ELASTICITY_FLUID_PRESSURE_POST_SOLVE(CONTROL_LOOP,SOLVER,ERR,ERROR,*)
!Argument variables
TYPE(CONTROL_LOOP_TYPE), POINTER :: CONTROL_LOOP !<A pointer to the control loop to solve.
TYPE(SOLVER_TYPE), POINTER :: SOLVER!<A pointer to the solver
INTEGER(INTG), INTENT(OUT) :: ERR !<The error code
TYPE(VARYING_STRING), INTENT(OUT) :: ERROR !<The error string
!Local Variables
TYPE(VARYING_STRING) :: LOCAL_ERROR
ENTERS("ELASTICITY_FLUID_PRESSURE_POST_SOLVE",ERR,ERROR,*999)
IF(ASSOCIATED(CONTROL_LOOP)) THEN
IF(ASSOCIATED(SOLVER)) THEN
IF(ASSOCIATED(CONTROL_LOOP%PROBLEM)) THEN
IF(.NOT.ALLOCATED(CONTROL_LOOP%PROBLEM%SPECIFICATION)) THEN
CALL FlagError("Problem specification is not allocated.",err,error,*999)
ELSE IF(SIZE(CONTROL_LOOP%PROBLEM%SPECIFICATION,1)<3) THEN
CALL FlagError("Problem specification must have three entries for an elasticity fluid pressure problem.",err,error,*999)
END IF
SELECT CASE(CONTROL_LOOP%PROBLEM%SPECIFICATION(3))
CASE(PROBLEM_STANDARD_ELASTICITY_FLUID_PRESSURE_SUBTYPE)
CALL FiniteElasticity_PostSolve(solver,err,error,*999)
CASE DEFAULT
LOCAL_ERROR="Problem subtype "//TRIM(NUMBER_TO_VSTRING(CONTROL_LOOP%PROBLEM%SPECIFICATION(3),"*",ERR,ERROR))// &
& " is not valid for a finite elasticity fluid pressure type of a multi physics problem class."
CALL FlagError(LOCAL_ERROR,ERR,ERROR,*999)
END SELECT
ELSE
CALL FlagError("Problem is not associated.",ERR,ERROR,*999)
ENDIF
ELSE
CALL FlagError("Solver is not associated.",ERR,ERROR,*999)
ENDIF
ELSE
CALL FlagError("Control loop is not associated.",ERR,ERROR,*999)
ENDIF
EXITS("ELASTICITY_FLUID_PRESSURE_POST_SOLVE")
RETURN
999 ERRORSEXITS("ELASTICITY_FLUID_PRESSURE_POST_SOLVE",ERR,ERROR)
RETURN 1
END SUBROUTINE ELASTICITY_FLUID_PRESSURE_POST_SOLVE
!
!================================================================================================================================
!
!>Runs before each control loop iteration
SUBROUTINE FinElasticityFluidPressure_ControlLoopPreLoop(CONTROL_LOOP,ERR,ERROR,*)
!Argument variables
TYPE(CONTROL_LOOP_TYPE), POINTER :: CONTROL_LOOP !<A pointer to the control loop to solve.
INTEGER(INTG), INTENT(OUT) :: ERR !<The error code
TYPE(VARYING_STRING), INTENT(OUT) :: ERROR !<The error string
!Local Variables
TYPE(SOLVER_TYPE), POINTER :: SOLVER_FLUID_PRESSURE
TYPE(CONTROL_LOOP_TYPE), POINTER :: CONTROL_LOOP_FLUID_PRESSURE
ENTERS("FinElasticityFluidPressure_ControlLoopPreLoop",ERR,ERROR,*999)
NULLIFY(CONTROL_LOOP_FLUID_PRESSURE)
NULLIFY(SOLVER_FLUID_PRESSURE)
IF(ASSOCIATED(CONTROL_LOOP)) THEN
IF(ASSOCIATED(CONTROL_LOOP%PROBLEM)) THEN
! Eventually we may want to do different things depending on problem type/subtype
! too but for now we can just check the loop type.
SELECT CASE(CONTROL_LOOP%LOOP_TYPE)
CASE(PROBLEM_CONTROL_LOAD_INCREMENT_LOOP_TYPE)
IF(CONTROL_LOOP%outputType>=CONTROL_LOOP_PROGRESS_OUTPUT) THEN
CALL WRITE_STRING(GENERAL_OUTPUT_TYPE,"------------------------------------",ERR,ERROR,*999)
CALL WRITE_STRING(GENERAL_OUTPUT_TYPE,"-- Starting load increment --",ERR,ERROR,*999)
CALL WRITE_STRING_VALUE(GENERAL_OUTPUT_TYPE,"LOAD INCREMENT NUMBER = ", &
& CONTROL_LOOP%LOAD_INCREMENT_LOOP%ITERATION_NUMBER,ERR,ERROR,*999)
CALL WRITE_STRING(GENERAL_OUTPUT_TYPE,"------------------------------------",ERR,ERROR,*999)
ENDIF
IF(DIAGNOSTICS1) THEN
CALL WRITE_STRING(DIAGNOSTIC_OUTPUT_TYPE,"------------------------------------",ERR,ERROR,*999)
CALL WRITE_STRING(DIAGNOSTIC_OUTPUT_TYPE,"-- Starting load increment --",ERR,ERROR,*999)
CALL WRITE_STRING_VALUE(DIAGNOSTIC_OUTPUT_TYPE,"LOAD INCREMENT NUMBER = ", &
& CONTROL_LOOP%LOAD_INCREMENT_LOOP%ITERATION_NUMBER,ERR,ERROR,*999)
CALL WRITE_STRING(DIAGNOSTIC_OUTPUT_TYPE,"------------------------------------",ERR,ERROR,*999)
ENDIF
CASE DEFAULT
!do nothing
END SELECT
ELSE
CALL FlagError("Problem is not associated.",ERR,ERROR,*999)
ENDIF
ELSE
CALL FlagError("Control loop is not associated.",ERR,ERROR,*999)
ENDIF
EXITS("FinElasticityFluidPressure_ControlLoopPreLoop")
RETURN
999 ERRORS("FinElasticityFluidPressure_ControlLoopPreLoop",ERR,ERROR)
EXITS("FinElasticityFluidPressure_ControlLoopPreLoop")
RETURN 1
END SUBROUTINE FinElasticityFluidPressure_ControlLoopPreLoop
!
!================================================================================================================================
!
END MODULE FINITE_ELASTICITY_FLUID_PRESSURE_ROUTINES