-
Notifications
You must be signed in to change notification settings - Fork 62
/
equations_routines.f90
1841 lines (1468 loc) · 82.6 KB
/
equations_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
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
!> \file
!> \author Chris Bradley
!> \brief This module handles all equations routines.
!>
!> \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 equations routines.
MODULE EquationsRoutines
USE BaseRoutines
USE EquationsAccessRoutines
USE EquationsMappingRoutines
USE EquationsMappingAccessRoutines
USE EquationsMatricesRoutines
USE EquationsMatricesAccessRoutines
USE EquationsSetConstants
USE FIELD_ROUTINES
USE FieldAccessRoutines
USE ISO_VARYING_STRING
USE Kinds
USE Strings
USE Types
#include "macros.h"
IMPLICIT NONE
PRIVATE
!> \addtogroup EquationsRoutines_EquationTypes EquationsRoutines::EquationTypes
!> \brief The types of equations
!> \see EquationsRoutines,OPENCMISS_EquationsTypes
!>@{
INTEGER(INTG), PARAMETER :: EQUATIONS_SCALAR_TYPE=1 !<Single scalar equation. \see EquationsRoutines_EquationTypes,EquationsRoutines
INTEGER(INTG), PARAMETER :: EQUATIONS_VECTOR_TYPE=2 !<Vector of multiple equations. \see EquationsRoutines_EquationsTypes,EquationsRoutines
INTEGER(INTG), PARAMETER :: EQUATIONS_FUNCTIONAL_TYPE=3 !<Vector of functional equations. \see EquationsRoutines_EquationsTypes,EquationsRoutines
!>@}
!> \addtogroup EquationsRoutines_EquationEqualityTypes EquationsRoutines::EquationEqualityTypes
!> \brief The types of equality for the equations
!> \see EquationsRoutines,OPENCMISS_EquationsEqualityTypes
!>@{
INTEGER(INTG), PARAMETER :: EQUATIONS_EQUALS_TYPE=1 !<The equations equal zero \see EquationsRoutines_EquationEqualityTypes,EquationsRoutines
INTEGER(INTG), PARAMETER :: EQUATIONS_LESS_THAN_TYPE=2 !<The equations are less than zero. \see EquationsRoutines_EquationsEqualityTypes,EquationsRoutines
INTEGER(INTG), PARAMETER :: EQUATIONS_LESS_THAN_EQUALS_TYPE=3 !<The equations are less than or equal to zero. \see EquationsRoutines_EquationsEqualityTypes,EquationsRoutines
INTEGER(INTG), PARAMETER :: EQUATIONS_GREATER_THAN_TYPE=4 !<The equations are greater than zero. \see EquationsRoutines_EquationsEqualityTypes,EquationsRoutines
INTEGER(INTG), PARAMETER :: EQUATIONS_GREATER_THAN_EQUALS_TYPE=5 !<The equations are greater than or equal to zero. \see EquationsRoutines_EquationsEqualityTypes,EquationsRoutines
!>@}
!> \addtogroup EquationsRoutines_OutputTypes EquationsRoutines::OutputTypes
!> \brief The equations output types
!> \see EquationsRoutines,OPENCMISS_EquationsConstants
!>@{
INTEGER(INTG), PARAMETER :: EQUATIONS_NO_OUTPUT=0 !<No output. \see EquationsRoutines_OutputTypes,EquationsRoutines
INTEGER(INTG), PARAMETER :: EQUATIONS_TIMING_OUTPUT=1 !<Timing information output. \see EquationsRoutines_OutputTypes,EquationsRoutines
INTEGER(INTG), PARAMETER :: EQUATIONS_MATRIX_OUTPUT=2 !<All below and equation matrices output. \see EquationsRoutines_OutputTypes,EquationsRoutines
INTEGER(INTG), PARAMETER :: EQUATIONS_ELEMENT_MATRIX_OUTPUT=3 !<All below and element matrices output. \see EquationsRoutines_OutputTypes,EquationsRoutines
INTEGER(INTG), PARAMETER :: EQUATIONS_NODAL_MATRIX_OUTPUT=4 !<All below and nodal matrices output. \see EquationsRoutines_OutputTypes,EquationsRoutines
!>@}
!> \addtogroup EquationsRoutines_SparsityTypes EquationsRoutines::SparsityTypes
!> \brief Equations matrices sparsity types
!> \see EquationsRoutines,OPENCMISS_EquationsSparsityTypes
!>@{
INTEGER(INTG), PARAMETER :: EQUATIONS_SPARSE_MATRICES=1 !<Use sparse matrices for the equations. \see EquationsRoutines_SparsityTypes,EquationsRoutines
INTEGER(INTG), PARAMETER :: EQUATIONS_FULL_MATRICES=2 !<Use fully populated matrices for the equations. \see EquationsRoutines_SparsityTypes,EquationsRoutines
!>@}
!> \addtogroup EquationsRoutines_LumpingTypes EquationsRoutines::LumpingTypes
!> \brief Equations matrices lumping types
!> \see EquationsRoutines,OPENCMISS_EquationsLumpingTypes
!>@{
INTEGER(INTG), PARAMETER :: EQUATIONS_UNLUMPED_MATRICES=1 !<The equations matrices are not lumped. \see EquationsRoutines_LumpingTypes,EquationsRoutines
INTEGER(INTG), PARAMETER :: EQUATIONS_LUMPED_MATRICES=2 !<The equations matrices are "mass" lumped. \see EquationsRoutines_LumpingTypes,EquationsRoutines
!>@}
!Module types
!Module variables
!Interfaces
PUBLIC EQUATIONS_SCALAR_TYPE,EQUATIONS_VECTOR_TYPE,EQUATIONS_FUNCTIONAL_TYPE
PUBLIC EQUATIONS_EQUALS_TYPE,EQUATIONS_LESS_THAN_TYPE,EQUATIONS_LESS_THAN_EQUALS_TYPE,EQUATIONS_GREATER_THAN_TYPE, &
& EQUATIONS_GREATER_THAN_EQUALS_TYPE
PUBLIC EQUATIONS_NO_OUTPUT,EQUATIONS_TIMING_OUTPUT,EQUATIONS_MATRIX_OUTPUT,EQUATIONS_ELEMENT_MATRIX_OUTPUT, &
& EQUATIONS_NODAL_MATRIX_OUTPUT
PUBLIC EQUATIONS_SPARSE_MATRICES,EQUATIONS_FULL_MATRICES
PUBLIC EQUATIONS_UNLUMPED_MATRICES,EQUATIONS_LUMPED_MATRICES
PUBLIC Equations_Initialise,Equations_Finalise
PUBLIC Equations_CreateStart,Equations_CreateFinish
PUBLIC Equations_Destroy
PUBLIC Equations_EqualityTypeGet,Equations_EqualityTypeSet
PUBLIC Equations_EquationTypeGet,Equations_EquationTypeSet
PUBLIC Equations_LinearityTypeGet,Equations_LinearityTypeSet
PUBLIC Equations_LumpingTypeGet,Equations_LumpingTypeSet
PUBLIC Equations_OutputTypeGet,Equations_OutputTypeSet
PUBLIC Equations_SparsityTypeGet,Equations_SparsityTypeSet
PUBLIC Equations_TimeDependenceTypeGet,Equations_TimeDependenceTypeSet
PUBLIC Equations_DerivedVariableGet
PUBLIC Equations_NumberOfLinearMatricesGet
PUBLIC Equations_NumberOfJacobianMatricesGet
PUBLIC Equations_NumberOfDynamicMatricesGet
PUBLIC Equations_LinearMatrixGet
PUBLIC Equations_JacobianMatrixGet
PUBLIC Equations_DynamicMatrixGet
PUBLIC Equations_DynamicMatrixGetByType
PUBLIC Equations_DynamicMatrixTypeGet
PUBLIC Equations_RhsVectorGet
PUBLIC Equations_ResidualVectorGet
PUBLIC Equations_ResidualNumberOfVariablesGet
PUBLIC Equations_ResidualVariablesGet
PUBLIC Equations_SourceVectorGet
CONTAINS
!
!================================================================================================================================
!
!>Finish the creation of equations.
SUBROUTINE Equations_CreateFinish(equations,err,error,*)
!Argument variables
TYPE(EquationsType), POINTER :: equations !<A pointer to the equations to finish the creation of.
INTEGER(INTG), INTENT(OUT) :: err !<The error code
TYPE(VARYING_STRING), INTENT(OUT) :: error !<The error string
!Local Variables
ENTERS("Equations_CreateFinish",err,error,*999)
IF(.NOT.ASSOCIATED(equations)) CALL FlagError("Equations is not associated.",err,error,*999)
IF(equations%equationsFinished) CALL FlagError("Equations have already been finished.",err,error,*999)
!Initialise the eqations interpolation
CALL Equations_InterpolationInitialise(equations,err,error,*999)
!Set the finished flag
equations%equationsFinished=.TRUE.
EXITS("Equations_CreateFinish")
RETURN
999 ERRORSEXITS("Equations_CreateFinish",err,error)
RETURN 1
END SUBROUTINE Equations_CreateFinish
!
!================================================================================================================================
!
!>Start the creation of equations for the equation set.
SUBROUTINE Equations_CreateStart(equationsSet,equations,err,error,*)
!Argument variables
TYPE(EQUATIONS_SET_TYPE), POINTER :: equationsSet !<A pointer to the equations set to create equations for
TYPE(EquationsType), POINTER :: equations !<On exit, a pointer to the created equations. Must not be associated on entry.
INTEGER(INTG), INTENT(OUT) :: err !<The error code
TYPE(VARYING_STRING), INTENT(OUT) :: error !<The error string
!Local Variables
ENTERS("Equations_CreateStart",err,error,*998)
IF(ASSOCIATED(equations)) CALL FlagError("Equations is already associated.",err,error,*998)
IF(.NOT.ASSOCIATED(equationsSet)) CALL FlagError("Equations set is not associated.",err,error,*998)
IF(ASSOCIATED(equationsSet%equations)) CALL FlagError("Equations are already associated for the equations set.",err,error,*998)
!Initialise the equations
CALL Equations_Initialise(equationsSet,err,error,*999)
!Return the pointer
equations=>equationsSet%equations
EXITS("Equations_CreateStart")
RETURN
999 NULLIFY(equations)
998 ERRORSEXITS("Equations_CreateStart",err,error)
RETURN 1
END SUBROUTINE Equations_CreateStart
!
!================================================================================================================================
!
!>Destroys equations
SUBROUTINE Equations_Destroy(equations,err,error,*)
!Argument variables
TYPE(EquationsType), POINTER :: equations !<A pointer to the equations to destroy
INTEGER(INTG), INTENT(OUT) :: err !<The error code
TYPE(VARYING_STRING), INTENT(OUT) :: error !<The error string
!Local Variables
ENTERS("Equations_Destroy",err,error,*999)
IF(.NOT.ASSOCIATED(equations)) CALL FlagError("Equations is not associated.",err,error,*999)
CALL Equations_Finalise(equations,err,error,*999)
EXITS("Equations_Destroy")
RETURN
999 ERRORSEXITS("Equations_Destroy",err,error)
RETURN 1
END SUBROUTINE Equations_Destroy
!
!================================================================================================================================
!
!>Gets the equality type for equations.
SUBROUTINE Equations_EqualityTypeGet(equations,equalityType,err,error,*)
!Argument variables
TYPE(EquationsType), POINTER :: equations !<A pointer to the equations to get the equality type for
INTEGER(INTG), INTENT(OUT) :: equalityType !<On exit, the equality type of the equations. \see EquationsRoutines_EquationEqualityTypes,EquationsRoutines
INTEGER(INTG), INTENT(OUT) :: err !<The error code
TYPE(VARYING_STRING), INTENT(OUT) :: error !<The error string
!Local Variables
ENTERS("Equations_EqualityTypeGet",err,error,*999)
IF(.NOT.ASSOCIATED(equations)) CALL FlagError("Equations is not associated.",err,error,*999)
IF(.NOT.equations%equationsFinished) CALL FlagError("Equations has not been finished.",err,error,*999)
equalityType=equations%equalityType
EXITS("Equations_EqualityTypeGet")
RETURN
999 ERRORSEXITS("Equations_EqualityTypeGet",err,error)
RETURN 1
END SUBROUTINE Equations_EqualityTypeGet
!
!================================================================================================================================
!
!>Sets/changes the equality type for equations.
SUBROUTINE Equations_EqualityTypeSet(equations,equalityType,err,error,*)
!Argument variables
TYPE(EquationsType), POINTER :: equations !<A pointer to the equations to set the equality for
INTEGER(INTG), INTENT(IN) :: equalityType !<The equality type to set \see EquationsRoutines_EquationEqualityTypes,EquationsRoutines
INTEGER(INTG), INTENT(OUT) :: err !<The error code
TYPE(VARYING_STRING), INTENT(OUT) :: error !<The error string
!Local Variables
TYPE(VARYING_STRING) :: localError
ENTERS("Equations_EqualityTypeSet",err,error,*999)
IF(.NOT.ASSOCIATED(equations)) CALL FlagError("Equations is not associated.",err,error,*999)
IF(equations%equationsFinished) CALL FlagError("Equations has already been finished.",err,error,*999)
SELECT CASE(equalityType)
CASE(EQUATIONS_EQUALS_TYPE)
equations%equalityType=EQUATIONS_EQUALS_TYPE
CASE(EQUATIONS_LESS_THAN_TYPE)
equations%equalityType=EQUATIONS_LESS_THAN_TYPE
CASE(EQUATIONS_LESS_THAN_EQUALS_TYPE)
equations%equalityType=EQUATIONS_LESS_THAN_EQUALS_TYPE
CASE(EQUATIONS_GREATER_THAN_TYPE)
equations%equalityType=EQUATIONS_GREATER_THAN_TYPE
CASE(EQUATIONS_GREATER_THAN_EQUALS_TYPE)
equations%equalityType=EQUATIONS_GREATER_THAN_EQUALS_TYPE
CASE DEFAULT
localError="The specified equation equality type of "//TRIM(NumberToVString(equalityType,"*",err,error))//" is invalid."
CALL FlagError(localError,err,error,*999)
END SELECT
EXITS("Equations_EqualityTypeSet")
RETURN
999 ERRORSEXITS("Equations_EqualityTypeSet",err,error)
RETURN 1
END SUBROUTINE Equations_EqualityTypeSet
!
!================================================================================================================================
!
!>Gets the equation type for equations.
SUBROUTINE Equations_EquationTypeGet(equations,equationType,err,error,*)
!Argument variables
TYPE(EquationsType), POINTER :: equations !<A pointer to the equations to get the equation type for
INTEGER(INTG), INTENT(OUT) :: equationType !<On exit, the equation type of the equations. \see EquationsRoutines_EquationTypes,EquationsRoutines
INTEGER(INTG), INTENT(OUT) :: err !<The error code
TYPE(VARYING_STRING), INTENT(OUT) :: error !<The error string
!Local Variables
ENTERS("Equations_EquationTypeGet",err,error,*999)
IF(.NOT.ASSOCIATED(equations)) CALL FlagError("Equations is not associated.",err,error,*999)
IF(.NOT.equations%equationsFinished) CALL FlagError("Equations has not been finished.",err,error,*999)
equationType=equations%equationType
EXITS("Equations_EquationTypeGet")
RETURN
999 ERRORSEXITS("Equations_EquaitonTypeGet",err,error)
RETURN 1
END SUBROUTINE Equations_EquationTypeGet
!
!================================================================================================================================
!
!>Sets/changes the equation type for equations.
SUBROUTINE Equations_EquationTypeSet(equations,equationType,err,error,*)
!Argument variables
TYPE(EquationsType), POINTER :: equations !<A pointer to the equations to set the equation for
INTEGER(INTG), INTENT(IN) :: equationType !<The equation type to set \see EquationsRoutines_EquationsTypes,EquationsRoutines
INTEGER(INTG), INTENT(OUT) :: err !<The error code
TYPE(VARYING_STRING), INTENT(OUT) :: error !<The error string
!Local Variables
INTEGER(INTG) :: dummyErr
TYPE(VARYING_STRING) :: dummyError,localError
ENTERS("Equations_EquationTypeSet",err,error,*998)
IF(.NOT.ASSOCIATED(equations)) CALL FlagError("Equations is not associated.",err,error,*998)
IF(equations%equationsFinished) CALL FlagError("Equations has already been finished.",err,error,*998)
IF(equationType/=equations%equationType) THEN
!Initialise the new equation type
SELECT CASE(equationType)
CASE(EQUATIONS_SCALAR_TYPE)
CALL Equations_ScalarInitialise(equations,err,error,*999)
CASE(EQUATIONS_VECTOR_TYPE)
CALL Equations_VectorInitialise(equations,err,error,*999)
CASE(EQUATIONS_FUNCTIONAL_TYPE)
CALL FlagError("Not implemented.",err,error,*999)
CASE DEFAULT
localError="The specified equation type of "//TRIM(NumberToVString(equationType,"*",err,error))//" is invalid."
CALL FlagError(localError,err,error,*999)
END SELECT
!Finalise the old equation type
SELECT CASE(equations%equationType)
CASE(EQUATIONS_SCALAR_TYPE)
CALL Equations_ScalarFinalise(equations%scalarEquations,err,error,*999)
CASE(EQUATIONS_VECTOR_TYPE)
CALL Equations_VectorFinalise(equations%vectorEquations,err,error,*999)
CASE(EQUATIONS_FUNCTIONAL_TYPE)
CALL FlagError("Not implemented.",err,error,*999)
CASE DEFAULT
localError="The specified equation type of "//TRIM(NumberToVString(equationType,"*",err,error))//" is invalid."
CALL FlagError(localError,err,error,*999)
END SELECT
equations%equationType=equationType
ENDIF
EXITS("Equations_EquationTypeSet")
RETURN
999 SELECT CASE(equationType)
CASE(EQUATIONS_SCALAR_TYPE)
CALL Equations_ScalarFinalise(equations%scalarEquations,dummyErr,dummyError,*998)
CASE(EQUATIONS_VECTOR_TYPE)
CALL Equations_VectorFinalise(equations%vectorEquations,dummyErr,dummyError,*998)
END SELECT
998 ERRORSEXITS("Equations_EquationTypeSet",err,error)
RETURN 1
END SUBROUTINE Equations_EquationTypeSet
!
!================================================================================================================================
!
!>Finalise the equations and deallocate all memory.
SUBROUTINE Equations_Finalise(equations,err,error,*)
!Argument variables
TYPE(EquationsType), POINTER :: equations !<A pointer to the equations to finalise
INTEGER(INTG), INTENT(OUT) :: err !<The error code
TYPE(VARYING_STRING), INTENT(OUT) :: error !<The error string
!Local Variables
ENTERS("Equations_Finalise",err,error,*999)
IF(ASSOCIATED(equations)) THEN
CALL Equations_InterpolationFinalise(equations%interpolation,err,error,*999)
CALL Equations_ScalarFinalise(equations%scalarEquations,err,error,*999)
CALL Equations_VectorFinalise(equations%vectorEquations,err,error,*999)
DEALLOCATE(equations)
ENDIF
EXITS("Equations_Finalise")
RETURN
999 ERRORSEXITS("Equations_Finalise",err,error)
RETURN 1
END SUBROUTINE Equations_Finalise
!
!================================================================================================================================
!
!>Initialises the equations for an equations set.
SUBROUTINE Equations_Initialise(equationsSet,err,error,*)
!Argument variables
TYPE(EQUATIONS_SET_TYPE), POINTER :: equationsSet !<A pointer to the equations set to initialise the equations for
INTEGER(INTG), INTENT(OUT) :: err !<The error code
TYPE(VARYING_STRING), INTENT(OUT) :: error !<The error string
!Local Variables
INTEGER(INTG) :: dummyErr
TYPE(VARYING_STRING) :: dummyError
ENTERS("Equations_Initialise",err,error,*998)
IF(.NOT.ASSOCIATED(equationsSet)) CALL FlagError("Equations set is not associated",err,error,*998)
IF(ASSOCIATED(equationsSet%equations)) CALL FlagError("Equations is already associated for this equations set.",err,error,*998)
ALLOCATE(equationsSet%equations,STAT=err)
IF(err/=0) CALL FlagError("Could not allocate equations.",err,error,*999)
equationsSet%equations%equationsSet=>equationsSet
equationsSet%equations%equationsFinished=.FALSE.
equationsSet%equations%equationType=EQUATIONS_VECTOR_TYPE
equationsSet%equations%equalityType=EQUATIONS_EQUALS_TYPE
equationsSet%equations%linearity=EQUATIONS_LINEAR
equationsSet%equations%timeDependence=EQUATIONS_STATIC
equationsSet%equations%outputType=EQUATIONS_NO_OUTPUT
equationsSet%equations%sparsityType=EQUATIONS_SPARSE_MATRICES
equationsSet%equations%lumpingType=EQUATIONS_UNLUMPED_MATRICES
NULLIFY(equationsSet%equations%interpolation)
NULLIFY(equationsSet%equations%scalarEquations)
NULLIFY(equationsSet%equations%vectorEquations)
CALL Equations_VectorInitialise(equationsSet%equations,err,error,*999)
equationsSet%equations%jacobianCalculationType=EQUATIONS_JACOBIAN_FINITE_DIFFERENCE_CALCULATED
equationsSet%equations%jacobianFiniteDifferenceStepSize=1.0E-6_DP
EXITS("Equations_Initialise")
RETURN
999 CALL Equations_Finalise(equationsSet%equations,dummyErr,dummyError,*998)
998 ERRORSEXITS("Equations_Initialise",err,error)
RETURN 1
END SUBROUTINE Equations_Initialise
!
!================================================================================================================================
!
!>Finalises the interpolation information for equations and deallocates all memory
SUBROUTINE Equations_InterpolationFinalise(equationsInterpolation,err,error,*)
!Argument variables
TYPE(EquationsInterpolationType), POINTER :: equationsInterpolation !<A pointer to the equations interpolation to finalise
INTEGER(INTG), INTENT(OUT) :: err !<The error code
TYPE(VARYING_STRING), INTENT(OUT) :: error !<The error string
!Local Variables
ENTERS("Equations_InterpolationFinalise",err,error,*999)
IF(ASSOCIATED(equationsInterpolation)) THEN
CALL Field_InterpolationParametersFinalise(equationsInterpolation%geometricInterpParameters,err,error,*999)
CALL Field_InterpolationParametersFinalise(equationsInterpolation%fibreInterpParameters,err,error,*999)
CALL Field_InterpolationParametersFinalise(equationsInterpolation%dependentInterpParameters,err,error,*999)
CALL Field_InterpolationParametersFinalise(equationsInterpolation%prevDependentInterpParameters,err,error,*999)
CALL Field_InterpolationParametersFinalise(equationsInterpolation%independentInterpParameters,err,error,*999)
CALL Field_InterpolationParametersFinalise(equationsInterpolation%materialsInterpParameters,err,error,*999)
CALL Field_InterpolationParametersFinalise(equationsInterpolation%sourceInterpParameters,err,error,*999)
CALL Field_InterpolatedPointsFinalise(equationsInterpolation%geometricInterpPoint,err,error,*999)
CALL Field_InterpolatedPointsFinalise(equationsInterpolation%dependentInterpPoint,err,error,*999)
CALL Field_InterpolatedPointsFinalise(equationsInterpolation%prevDependentInterpPoint,err,error,*999)
CALL Field_InterpolatedPointsFinalise(equationsInterpolation%independentInterpPoint,err,error,*999)
CALL Field_InterpolatedPointsFinalise(equationsInterpolation%fibreInterpPoint,err,error,*999)
CALL Field_InterpolatedPointsFinalise(equationsInterpolation%materialsInterpPoint,err,error,*999)
CALL Field_InterpolatedPointsFinalise(equationsInterpolation%sourceInterpPoint,err,error,*999)
CALL Field_PhysicalPointsFinalise(equationsInterpolation%dependentPhysicalPoint,err,error,*999)
CALL Field_InterpolatedPointsMetricsFinalise(equationsInterpolation%dependentInterpPointMetrics,err,error,*999)
CALL Field_InterpolatedPointsMetricsFinalise(equationsInterpolation%prevDependentInterpPointMetrics,err,error,*999)
CALL Field_InterpolatedPointsMetricsFinalise(equationsInterpolation%independentInterpPointMetrics,err,error,*999)
CALL Field_InterpolatedPointsMetricsFinalise(equationsInterpolation%geometricInterpPointMetrics,err,error,*999)
CALL Field_InterpolatedPointsMetricsFinalise(equationsInterpolation%fibreInterpPointMetrics,err,error,*999)
DEALLOCATE(equationsInterpolation)
ENDIF
EXITS("Equations_InterpolationFinalise")
RETURN
999 ERRORSEXITS("Equations_InterpolationFinalise",err,error)
RETURN 1
END SUBROUTINE Equations_InterpolationFinalise
!
!================================================================================================================================
!
!>Initialises the interpolation information for equations
SUBROUTINE Equations_InterpolationInitialise(equations,err,error,*)
!Argument variables
TYPE(EquationsType), POINTER :: equations !<The pointer to the equations to initialise the interpolation for
INTEGER(INTG), INTENT(OUT) :: err !<The error code
TYPE(VARYING_STRING), INTENT(OUT) :: error !<The error string
!Local Variables
INTEGER(INTG) :: dummyErr
TYPE(EQUATIONS_SET_TYPE), POINTER :: equationsSet
TYPE(VARYING_STRING) :: dummyError
ENTERS("Equations_InterpolationInitialise",err,error,*998)
IF(.NOT.ASSOCIATED(equations)) CALL FlagError("Equations is not associated",err,error,*998)
IF(ASSOCIATED(equations%interpolation)) &
& CALL FlagError("Interpolation is already associated for these equations.",err,error,*998)
NULLIFY(equationsSet)
CALL Equations_EquationsSetGet(equations,equationsSet,err,error,*999)
ALLOCATE(equations%interpolation,STAT=err)
IF(err/=0) CALL FlagError("Could not allocate equations interpolation",err,error,*999)
equations%interpolation%equations=>equations
NULLIFY(equations%interpolation%geometricInterpParameters)
NULLIFY(equations%interpolation%fibreInterpParameters)
NULLIFY(equations%interpolation%dependentInterpParameters)
NULLIFY(equations%interpolation%prevDependentInterpParameters)
NULLIFY(equations%interpolation%independentInterpParameters)
NULLIFY(equations%interpolation%materialsInterpParameters)
NULLIFY(equations%interpolation%sourceInterpParameters)
NULLIFY(equations%interpolation%geometricInterpPoint)
NULLIFY(equations%interpolation%fibreInterpPoint)
NULLIFY(equations%interpolation%dependentInterpPoint)
NULLIFY(equations%interpolation%prevDependentInterpPoint)
NULLIFY(equations%interpolation%independentInterpPoint)
NULLIFY(equations%interpolation%materialsInterpPoint)
NULLIFY(equations%interpolation%sourceInterpPoint)
NULLIFY(equations%interpolation%dependentPhysicalPoint)
NULLIFY(equations%interpolation%dependentInterpPointMetrics)
NULLIFY(equations%interpolation%prevDependentInterpPointMetrics)
NULLIFY(equations%interpolation%independentInterpPointMetrics)
NULLIFY(equations%interpolation%geometricInterpPointMetrics)
NULLIFY(equations%interpolation%fibreInterpPointMetrics)
equations%interpolation%geometricField=>equationsSet%geometry%GEOMETRIC_FIELD
equations%interpolation%fibreField=>equationsSet%geometry%FIBRE_FIELD
equations%interpolation%dependentField=>equationsSet%dependent%DEPENDENT_FIELD
IF(ASSOCIATED(equationsSet%independent)) THEN
equations%interpolation%independentField=>equationsSet%independent%INDEPENDENT_FIELD
ELSE
NULLIFY(equations%interpolation%independentField)
ENDIF
IF(ASSOCIATED(equationsSet%materials)) THEN
equations%interpolation%materialsField=>equationsSet%materials%MATERIALS_FIELD
ELSE
NULLIFY(equations%interpolation%materialsField)
ENDIF
IF(ASSOCIATED(equationsSet%source)) THEN
equations%interpolation%sourceField=>equationsSet%source%SOURCE_FIELD
ELSE
NULLIFY(equations%interpolation%sourceField)
ENDIF
CALL Field_InterpolationParametersInitialise(equations%interpolation%geometricField, &
& equations%interpolation%geometricInterpParameters,err,error,*999)
CALL Field_InterpolatedPointsInitialise(equations%interpolation%geometricInterpParameters, &
& equations%interpolation%geometricInterpPoint,err,error,*999)
CALL Field_InterpolatedPointsMetricsInitialise(equations%interpolation%geometricInterpPoint, &
& equations%interpolation%geometricInterpPointMetrics,err,error,*999)
CALL Field_InterpolationParametersInitialise(equations%interpolation%dependentField, &
& equations%interpolation%dependentInterpParameters,err,error,*999)
CALL Field_InterpolatedPointsInitialise(equations%interpolation%dependentInterpParameters, &
& equations%interpolation%dependentInterpPoint,err,error,*999)
!CALL Field_PhysicalPointsInitialise(equations%interpolation%dependentInterpPoint, &
! & equations%interpolation%geometricInterpPoint,equations%interpolation%dependentPhysicalPoint, &
! & err,error,*999)
IF(equations%interpolation%dependentField%type==FIELD_GEOMETRIC_TYPE.OR. &
& equations%interpolation%dependentField%type==FIELD_FIBRE_TYPE.OR. &
& equations%interpolation%dependentField%type==FIELD_GEOMETRIC_GENERAL_TYPE) THEN
CALL Field_InterpolatedPointsMetricsInitialise(equations%interpolation%dependentInterpPoint, &
& equations%interpolation%dependentInterpPointMetrics,err,error,*999)
ENDIF
IF(equations%timeDependence/=EQUATIONS_STATIC) THEN
CALL Field_InterpolationParametersInitialise(equations%interpolation%dependentField, &
& equations%interpolation%prevDependentInterpParameters,err,error,*999)
CALL Field_InterpolatedPointsInitialise(equations%interpolation%prevDependentInterpParameters, &
& equations%interpolation%prevDependentInterpPoint,err,error,*999)
IF(equations%interpolation%dependentField%type==FIELD_GEOMETRIC_TYPE.OR. &
& equations%interpolation%dependentField%type==FIELD_FIBRE_TYPE.OR. &
& equations%interpolation%dependentField%type==FIELD_GEOMETRIC_GENERAL_TYPE) THEN
CALL Field_InterpolatedPointsMetricsInitialise(equations%interpolation%prevDependentInterpPoint, &
& equations%interpolation%prevDependentInterpPointMetrics,err,error,*999)
ENDIF
ENDIF
IF(ASSOCIATED(equations%interpolation%fibreField)) THEN
CALL Field_InterpolationParametersInitialise(equations%interpolation%fibreField, &
& equations%interpolation%fibreInterpParameters,err,error,*999)
CALL Field_InterpolatedPointsInitialise(equations%interpolation%fibreInterpParameters, &
& equations%interpolation%fibreInterpPoint,err,error,*999)
CALL Field_InterpolatedPointsMetricsInitialise(equations%interpolation%fibreInterpPoint, &
& equations%interpolation%fibreInterpPointMetrics,err,error,*999)
ENDIF
IF(ASSOCIATED(equations%interpolation%independentField)) THEN
CALL Field_InterpolationParametersInitialise(equations%interpolation%independentField, &
& equations%interpolation%independentInterpParameters,err,error,*999)
CALL Field_InterpolatedPointsInitialise(equations%interpolation%independentInterpParameters, &
& equations%interpolation%independentInterpPoint,err,error,*999)
IF(equations%interpolation%independentField%type==FIELD_GEOMETRIC_TYPE.OR. &
& equations%interpolation%independentField%type==FIELD_FIBRE_TYPE) THEN
CALL Field_InterpolatedPointsMetricsInitialise(equations%interpolation%independentInterpPoint, &
& equations%interpolation%independentInterpPointMetrics,err,error,*999)
END IF
ENDIF
IF(ASSOCIATED(equations%interpolation%materialsField)) THEN
CALL Field_InterpolationParametersInitialise(equations%interpolation%materialsField, &
& equations%interpolation%materialsInterpParameters,err,error,*999)
CALL Field_InterpolatedPointsInitialise(equations%interpolation%materialsInterpParameters, &
& equations%interpolation%materialsInterpPoint,err,error,*999)
ENDIF
IF(ASSOCIATED(equations%interpolation%sourceField)) THEN
CALL Field_InterpolationParametersInitialise(equations%interpolation%sourceField, &
& equations%interpolation%sourceInterpParameters,err,error,*999)
CALL Field_InterpolatedPointsInitialise(equations%interpolation%sourceInterpParameters, &
& equations%interpolation%sourceInterpPoint,err,error,*999)
ENDIF
EXITS("Equations_InterpolationInitialise")
RETURN
999 CALL Equations_InterpolationFinalise(equations%interpolation,dummyErr,dummyError,*998)
998 ERRORSEXITS("Equations_InterpolationInitialise",err,error)
RETURN 1
END SUBROUTINE Equations_InterpolationInitialise
!
!================================================================================================================================
!
!>Gets the linearity type for equations.
SUBROUTINE Equations_LinearityTypeGet(equations,linearityType,err,error,*)
!Argument variables
TYPE(EquationsType), POINTER :: equations !<A pointer to the equations to get the linearity for
INTEGER(INTG), INTENT(OUT) :: linearityType !<On exit, the linearity type of the equations. \see EquationsSetConstants_LinearityTypes,EquationsSetConstants
INTEGER(INTG), INTENT(OUT) :: err !<The error code
TYPE(VARYING_STRING), INTENT(OUT) :: error !<The error string
!Local Variables
ENTERS("Equations_LinearityTypeGet",err,error,*999)
IF(.NOT.ASSOCIATED(equations)) CALL FlagError("Equations is not associated.",err,error,*999)
IF(.NOT.equations%equationsFinished) CALL FlagError("Equations has not been finished.",err,error,*999)
linearityType=equations%linearity
EXITS("Equations_LinearityTypeGet")
RETURN
999 ERRORSEXITS("Equations_LinearityTypeGet",err,error)
RETURN 1
END SUBROUTINE Equations_LinearityTypeGet
!
!================================================================================================================================
!
!>Sets/changes the linearity type for equations.
SUBROUTINE Equations_LinearityTypeSet(equations,linearityType,err,error,*)
!Argument variables
TYPE(EquationsType), POINTER :: equations !<A pointer to the equations to set the linearity for
INTEGER(INTG), INTENT(IN) :: linearityType !<The linearity type to set \see EquationsSetConstants_LinearityTypes,EquationsSetConstants
INTEGER(INTG), INTENT(OUT) :: err !<The error code
TYPE(VARYING_STRING), INTENT(OUT) :: error !<The error string
!Local Variables
TYPE(VARYING_STRING) :: localError
ENTERS("Equations_LinearityTypeSet",err,error,*999)
IF(.NOT.ASSOCIATED(equations)) CALL FlagError("Equations is not associated.",err,error,*999)
IF(equations%equationsFinished) CALL FlagError("Equations has already been finished.",err,error,*999)
SELECT CASE(linearityType)
CASE(EQUATIONS_LINEAR)
equations%linearity=EQUATIONS_LINEAR
CASE(EQUATIONS_NONLINEAR)
equations%linearity=EQUATIONS_NONLINEAR
CASE(EQUATIONS_NONLINEAR_BCS)
equations%linearity=EQUATIONS_NONLINEAR_BCS
CASE DEFAULT
localError="The specified linearity type of "//TRIM(NumberToVString(linearityType,"*",err,error))//" is invalid."
CALL FlagError(localError,err,error,*999)
END SELECT
EXITS("Equations_LinearityTypeSet")
RETURN
999 ERRORSEXITS("Equations_LinearityTypeSet",err,error)
RETURN 1
END SUBROUTINE Equations_LinearityTypeSet
!
!================================================================================================================================
!
!>Gets the lumping type for equations.
SUBROUTINE Equations_LumpingTypeGet(equations,lumpingType,err,error,*)
!Argument variables
TYPE(EquationsType), POINTER :: equations !<A pointer to the equations to get the lumping type for
INTEGER(INTG), INTENT(OUT) :: lumpingType !<On exit, the lumping type of the equations \see EquationsRoutines_LumpingTypes,EquationsRoutines
INTEGER(INTG), INTENT(OUT) :: err !<The error code
TYPE(VARYING_STRING), INTENT(OUT) :: error !<The error string
!Local Variables
ENTERS("Equations_LumpingTypeGet",err,error,*999)
IF(.NOT.ASSOCIATED(equations)) CALL FlagError("Equations is not associated.",err,error,*999)
IF(.NOT.equations%equationsFinished) CALL FlagError("Equations has not been finished.",err,error,*999)
lumpingType=equations%lumpingType
EXITS("Equations_LumpingTypeGet")
RETURN
999 ERRORSEXITS("Equations_LumpingTypeGet",err,error)
RETURN 1
END SUBROUTINE Equations_LumpingTypeGet
!
!================================================================================================================================
!
!>Sets/changes the matrix lumping for the equations.
SUBROUTINE Equations_LumpingTypeSet(equations,lumpingType,err,error,*)
!Argument variables
TYPE(EquationsType), POINTER :: equations !<A pointer to the equations to set the lumping for
INTEGER(INTG), INTENT(IN) :: lumpingType !<The lumping type to set \see EquationsRoutines_LumpingTypes,EquationsRoutines
INTEGER(INTG), INTENT(OUT) :: err !<The error code
TYPE(VARYING_STRING), INTENT(OUT) :: error !<The error string
!Local Variables
TYPE(VARYING_STRING) :: localError
ENTERS("Equations_LumpingTypeSet",err,error,*999)
IF(.NOT.ASSOCIATED(equations)) CALL FlagError("Equations is not associated.",err,error,*999)
IF(equations%equationsFinished) CALL FlagError("Equations has already been finished.",err,error,*999)
IF(equations%timeDependence==EQUATIONS_FIRST_ORDER_DYNAMIC.OR. &
& equations%timeDependence==EQUATIONS_SECOND_ORDER_DYNAMIC) THEN
SELECT CASE(lumpingType)
CASE(EQUATIONS_UNLUMPED_MATRICES)
equations%lumpingType=EQUATIONS_UNLUMPED_MATRICES
CASE(EQUATIONS_LUMPED_MATRICES)
equations%lumpingType=EQUATIONS_LUMPED_MATRICES
CASE DEFAULT
localError="The specified lumping type of "//TRIM(NumberToVString(lumpingType,"*",err,error))//" is invalid."
CALL FlagError(localError,err,error,*999)
END SELECT
ELSE
localError="Invalid equations time dependence. The equations time dependence of "// &
& TRIM(NumberToVString(equations%timeDependence,"*",err,error))// &
& " does not correspond to dynamic equations. You can only set lumping for dynamic equations."
CALL FlagError(localError,err,error,*999)
ENDIF
EXITS("Equations_LumpingTypeSet")
RETURN
999 ERRORSEXITS("Equations_LumpingTypeSet",err,error)
RETURN 1
END SUBROUTINE Equations_LumpingTypeSet
!
!================================================================================================================================
!
!>Gets the output type for equations.
SUBROUTINE Equations_OutputTypeGet(equations,outputType,err,error,*)
!Argument variables
TYPE(EquationsType), POINTER :: equations !<A pointer to the equations to get the output type for
INTEGER(INTG), INTENT(OUT) :: outputType !<On exit, the output type of the equations. \see EquationsRoutines_OutputTypes,EquationsRoutines
INTEGER(INTG), INTENT(OUT) :: err !<The error code
TYPE(VARYING_STRING), INTENT(OUT) :: error !<The error string
!Local Variables
ENTERS("Equations_OutputTypeGet",err,error,*999)
IF(.NOT.ASSOCIATED(equations)) CALL FlagError("Equations is not associated.",err,error,*999)
IF(.NOT.equations%equationsFinished) CALL FlagError("Equations has not been finished.",err,error,*999)
outputType=equations%outputType
EXITS("Equations_OutputTypeGet")
RETURN
999 ERRORSEXITS("Equations_OutputTypeGet",err,error)
RETURN 1
END SUBROUTINE Equations_OutputTypeGet
!
!================================================================================================================================
!
!>Sets/changes the output type for the equations.
SUBROUTINE Equations_OutputTypeSet(equations,outputType,err,error,*)
!Argument variables
TYPE(EquationsType), POINTER :: equations !<A pointer to the equations to set the output type for
INTEGER(INTG), INTENT(IN) :: outputType !<The output type to set \see EquationsRoutines_OutputTypes,EquationsRoutines
INTEGER(INTG), INTENT(OUT) :: err !<The error code
TYPE(VARYING_STRING), INTENT(OUT) :: error !<The error string
!Local Variables
TYPE(VARYING_STRING) :: localError
ENTERS("Equations_OutputTypeSet",err,error,*999)
IF(.NOT.ASSOCIATED(equations)) CALL FlagError("Equations is not associated.",err,error,*999)
IF(equations%equationsFinished) CALL FlagError("Equations has already been finished.",err,error,*999)
SELECT CASE(outputType)
CASE(EQUATIONS_NO_OUTPUT)
equations%outputType=EQUATIONS_NO_OUTPUT
CASE(EQUATIONS_TIMING_OUTPUT)
equations%outputType=EQUATIONS_TIMING_OUTPUT
CASE(EQUATIONS_MATRIX_OUTPUT)
equations%outputType=EQUATIONS_MATRIX_OUTPUT
CASE(EQUATIONS_ELEMENT_MATRIX_OUTPUT)
equations%outputType=EQUATIONS_ELEMENT_MATRIX_OUTPUT
CASE(EQUATIONS_NODAL_MATRIX_OUTPUT)
equations%outputType=EQUATIONS_NODAL_MATRIX_OUTPUT
CASE DEFAULT
localError="The specified output type of "//TRIM(NumberToVString(outputType,"*",err,error))//" is invalid."
CALL FlagError(localError,err,error,*999)
END SELECT
EXITS("Equations_OutputTypeSet")
RETURN
999 ERRORSEXITS("Equations_OutputTypeSet",err,error)
RETURN 1
END SUBROUTINE Equations_OutputTypeSet
!
!================================================================================================================================
!
!>Gets the sparsity type for equations.
SUBROUTINE Equations_SparsityTypeGet(equations,sparsityType,err,error,*)
!Argument variables
TYPE(EquationsType), POINTER :: equations !<A pointer to the equations to get the sparsity type for
INTEGER(INTG), INTENT(OUT) :: sparsityType !<On exit, the sparsity type of the equations. \see EquationsRoutines_SparsityTypes,EquationsRoutines
INTEGER(INTG), INTENT(OUT) :: err !<The error code
TYPE(VARYING_STRING), INTENT(OUT) :: error !<The error string
!Local Variables
ENTERS("Equations_SparsityTypeGet",err,error,*999)
IF(.NOT.ASSOCIATED(equations)) CALL FlagError("Equations is not associated.",err,error,*999)
IF(.NOT.equations%equationsFinished) CALL FlagError("Equations has not been finished.",err,error,*999)
sparsityType=equations%sparsityType
EXITS("Equations_SparsityTypeGet")
RETURN
999 ERRORSEXITS("Equations_SparsityTypeGet",err,error)
RETURN 1
END SUBROUTINE Equations_SparsityTypeGet
!
!================================================================================================================================
!
!>Sets/changes the sparsity type for the equations.
SUBROUTINE Equations_SparsityTypeSet(equations,sparsityType,err,error,*)
!Argument variables
TYPE(EquationsType), POINTER :: equations !<A pointer to the equations to set the sparsity type for
INTEGER(INTG), INTENT(IN) :: sparsityType !<The sparsity type to set \see EquationsRoutines_SparsityTypes,EquationsRoutines
INTEGER(INTG), INTENT(OUT) :: err !<The error code
TYPE(VARYING_STRING), INTENT(OUT) :: error !<The error string
!Local Variables
TYPE(VARYING_STRING) :: localError
ENTERS("Equations_SparsityTypeSet",err,error,*999)
IF(.NOT.ASSOCIATED(equations)) CALL FlagError("Equations is not associated.",err,error,*999)
IF(equations%equationsFinished) CALL FlagError("Equations has already been finished.",err,error,*999)
SELECT CASE(sparsityType)
CASE(EQUATIONS_SPARSE_MATRICES)
equations%sparsityType=EQUATIONS_SPARSE_MATRICES
CASE(EQUATIONS_FULL_MATRICES)
equations%sparsityType=EQUATIONS_FULL_MATRICES
CASE DEFAULT
localError="The specified sparsity type of "//TRIM(NumberToVString(sparsityType,"*",err,error))//" is invalid."
CALL FlagError(localError,err,error,*999)
END SELECT
EXITS("Equations_SparsityTypeSet")
RETURN
999 ERRORSEXITS("Equations_SparsityTypeSet",err,error)
RETURN 1
END SUBROUTINE Equations_SparsityTypeSet
!
!================================================================================================================================
!
!>Gets the time dependence type for equations.
SUBROUTINE Equations_TimeDependenceTypeGet(equations,timeDependenceType,err,error,*)
!Argument variables
TYPE(EquationsType), POINTER :: equations !<A pointer to the equations to get the time dependence type for
INTEGER(INTG), INTENT(OUT) :: timeDependenceType !<On exit, the time dependence type of the equations. \see EquationsRoutines_TimeDependenceTypes,EquationsRoutines
INTEGER(INTG), INTENT(OUT) :: err !<The error code
TYPE(VARYING_STRING), INTENT(OUT) :: error !<The error string
!Local Variables
ENTERS("Equations_TimeDependenceTypeGet",err,error,*999)
IF(.NOT.ASSOCIATED(equations)) CALL FlagError("Equations is not associated.",err,error,*999)
IF(.NOT.equations%equationsFinished) CALL FlagError("Equations has not been finished.",err,error,*999)
timeDependenceType=equations%timeDependence
EXITS("Equations_TimeDependenceTypeGet")
RETURN
999 ERRORSEXITS("Equations_TimeDependenceTypeGet",err,error)
RETURN 1
END SUBROUTINE Equations_TimeDependenceTypeGet
!
!================================================================================================================================
!
!>Sets/changes the time dependence type for equations.
SUBROUTINE Equations_TimeDependenceTypeSet(equations,timeDependenceType,err,error,*)