-
Notifications
You must be signed in to change notification settings - Fork 62
/
reaction_diffusion_IO_routines.f90
611 lines (564 loc) · 31 KB
/
reaction_diffusion_IO_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
!> \file
!> \author Vijay Rajagopal
!> \brief This module handles some mesh/parameter input routines and cmgui output routines for reaction diffusion
!> routines and should be eventually replaces by field_IO_routines.f90
!>
!> \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.
!>
!> Temporary IO routines for fluid mechanics
MODULE REACTION_DIFFUSION_IO_ROUTINES
USE BaseRoutines
USE ComputationEnvironment
USE EquationsSetConstants
USE FIELD_ROUTINES
USE FieldAccessRoutines
USE TYPES
USE INPUT_OUTPUT
USE KINDS
USE MESH_ROUTINES
#ifndef NOMPIMOD
USE MPI
#endif
#include "macros.h"
IMPLICIT NONE
PRIVATE
#ifdef NOMPIMOD
#include "mpif.h"
#endif
PUBLIC REACTION_DIFFUSION_IO_WRITE_CMGUI
CONTAINS
! OK
!================================================================================================================================
!
!> Writes solution into cmgui formats exelem and exnode.
SUBROUTINE REACTION_DIFFUSION_IO_WRITE_CMGUI(REGION, EQUATIONS_SET_GLOBAL_NUMBER, NAME, exportExelem, ERR, ERROR,*)
!Argument variables
TYPE(REGION_TYPE), INTENT(IN), POINTER :: REGION !<A pointer to the region to get the coordinate system for
CHARACTER(30),INTENT(IN) :: NAME !<the prefix name of file.
INTEGER(INTG), INTENT(IN) :: EQUATIONS_SET_GLOBAL_NUMBER
LOGICAL, INTENT(IN) :: exportExelem !<A flag to indicate whether to write an exelem file.
INTEGER(INTG) :: ERR !<The error code
TYPE(VARYING_STRING):: ERROR !<The error string
!Local Variables
TYPE(EQUATIONS_SET_TYPE), POINTER :: EQUATIONS_SET
TYPE(DOMAIN_TYPE), POINTER :: COMPUTATIONAL_DOMAIN
TYPE(FIELD_TYPE), POINTER :: SOURCE_FIELD
REAL(DP) :: NodeXValue,NodeYValue,NodeZValue,NodeUValue
INTEGER(INTG):: myComputationalNodeNumber,NumberOfOutputFields,NumberOfDimensions,NumberOfElements,NumberOfNodes
INTEGER(INTG):: NumberOfVariableComponents,NumberOfSourceComponents,I,J,K,ValueIndex,NODE_GLOBAL_NUMBER
INTEGER(INTG) :: NodesInMeshComponent,BasisType,MaxNodesPerElement,NumberOfFieldComponents(3),ELEMENT_GLOBAL_NUMBER
INTEGER(INTG) :: NODE_LOCAL_NUMBER
INTEGER(INTG),ALLOCATABLE :: ElementNodes(:,:),SimplexOutputHelp(:)
REAL(DP), ALLOCATABLE :: ElementNodesScales(:,:)
LOGICAL :: OUTPUT_SOURCE
TYPE(VARYING_STRING) :: FILENAME !<the prefix name of file.
CHARACTER(50) :: INTG_STRING,INTG_STRING2
ENTERS("REACTION_DIFFUSION_IO_WRITE_CMGUI",ERR,ERROR,*999)
myComputationalNodeNumber = ComputationalEnvironment_NodeNumberGet(err,error)
EQUATIONS_SET => REGION%equations_sets%equations_sets(EQUATIONS_SET_GLOBAL_NUMBER)%ptr
NULLIFY(SOURCE_FIELD)
COMPUTATIONAL_DOMAIN=>REGION%MESHES%MESHES(1) &
& %ptr%DECOMPOSITIONS%DECOMPOSITIONS(1)%ptr%DOMAIN(1)%ptr
myComputationalNodeNumber = ComputationalEnvironment_NodeNumberGet(ERR,ERROR)
NumberOfDimensions = COMPUTATIONAL_DOMAIN%NUMBER_OF_DIMENSIONS
NumberOfNodes = COMPUTATIONAL_DOMAIN%TOPOLOGY%NODES%NUMBER_OF_NODES
NodesInMeshComponent = REGION%meshes%meshes(1)%ptr%topology(1)%ptr%nodes%numberOfNodes
NumberOfElements = COMPUTATIONAL_DOMAIN%TOPOLOGY%ELEMENTS%NUMBER_OF_ELEMENTS
NumberOfVariableComponents=REGION%equations_sets%equations_sets(EQUATIONS_SET_GLOBAL_NUMBER)%ptr%dependent%dependent_field% &
& variables(1)%number_of_components
NumberOfOutputFields=2
!determine if there is a source field
OUTPUT_SOURCE = .FALSE.
IF( (EQUATIONS_SET%SPECIFICATION(1)==EQUATIONS_SET_CLASSICAL_FIELD_CLASS) &
& .AND.(EQUATIONS_SET%SPECIFICATION(2)==EQUATIONS_SET_REACTION_DIFFUSION_EQUATION_TYPE) &
& .AND.(EQUATIONS_SET%SPECIFICATION(3)==EQUATIONS_SET_CONSTANT_REAC_DIFF_SUBTYPE) )THEN
SOURCE_FIELD=>REGION%equations_sets%equations_sets(EQUATIONS_SET_GLOBAL_NUMBER)%ptr%source%source_field
IF( ASSOCIATED(SOURCE_FIELD) ) OUTPUT_SOURCE = .FALSE. !currently set to false to rethink how source is accessed for output
END IF
IF( OUTPUT_SOURCE ) THEN
NumberOfSourceComponents=REGION%equations_sets%equations_sets(EQUATIONS_SET_GLOBAL_NUMBER)%ptr%source%source_field% &
& variables(1)%number_of_components
NumberOfOutputFields = NumberOfOutputFields + 1
! CALL FIELD_INTERPOLATION_PARAMETERS_INITIALISE(SOURCE_FIELD,SOURCE_INTERPOLATION_PARAMETERS,ERR,ERROR,*999)
! CALL FIELD_INTERPOLATED_POINTS_INITIALISE(SOURCE_INTERPOLATION_PARAMETERS,SOURCE_INTERPOLATED_POINT,ERR,ERROR,*999)
END IF
CALL WRITE_STRING(GENERAL_OUTPUT_TYPE,"Writing Nodes...",ERR,ERROR,*999)
FILENAME="./output/"//TRIM(NAME)//".exnode"
OPEN(UNIT=myComputationalNodeNumber, FILE=CHAR(FILENAME),STATUS='unknown')
! WRITING HEADER INFORMATION
WRITE(myComputationalNodeNumber,*) 'Group name: Cell'
WRITE(INTG_STRING,'(I0)') NumberOfOutputFields
WRITE(myComputationalNodeNumber,*) '#Fields=',TRIM(INTG_STRING)
ValueIndex=1
WRITE(INTG_STRING,'(I0)') NumberOfDimensions
WRITE(myComputationalNodeNumber,*) &
& ' 1) coordinates, coordinate, rectangular cartesian, #Components=',TRIM(INTG_STRING)
DO I=1,NumberOfDimensions
IF(I==1) THEN
WRITE(INTG_STRING,'(I0)') ValueIndex
WRITE(myComputationalNodeNumber,*) ' x. Value index= ',TRIM(INTG_STRING),', #Derivatives= 0'
ELSE IF(I==2) THEN
WRITE(INTG_STRING,'(I0)') ValueIndex
WRITE(myComputationalNodeNumber,*) ' y. Value index= ',TRIM(INTG_STRING),', #Derivatives= 0'
ELSE
WRITE(INTG_STRING,'(I0)') ValueIndex
WRITE(myComputationalNodeNumber,*) ' z. Value index= ',TRIM(INTG_STRING),', #Derivatives= 0'
END IF
ValueIndex=ValueIndex+1
END DO
WRITE(INTG_STRING,'(I0)') NumberOfVariableComponents
WRITE(myComputationalNodeNumber,*) ' 2) dependent, field, rectangular cartesian, #Components=', &
& TRIM(INTG_STRING)
DO I=1,NumberOfVariableComponents
WRITE(INTG_STRING,'(I0)') ValueIndex
WRITE(INTG_STRING2,'(I0)') I
WRITE(myComputationalNodeNumber,*) ' ',TRIM(INTG_STRING2),'. Value index= ',TRIM(INTG_STRING), &
& ', #Derivatives= 0'
ValueIndex=ValueIndex+1
END DO
IF( OUTPUT_SOURCE ) THEN !Watch out that no numbering conflict occurs with Analytic: 4.)
WRITE(INTG_STRING,'(I0)') NumberOfSourceComponents
WRITE(myComputationalNodeNumber,*) ' 3) source, field, rectangular cartesian, #Components=', &
& TRIM(INTG_STRING)
DO I=1,NumberOfSourceComponents
WRITE(INTG_STRING,'(I0)') ValueIndex
WRITE(INTG_STRING2,'(I0)') I
WRITE(myComputationalNodeNumber,*) ' ',TRIM(INTG_STRING2),'. Value index= ', &
& TRIM(INTG_STRING),', #Derivatives= 0'
ValueIndex=ValueIndex+1
END DO
END IF
!WRITE OUT NODE VALUES
DO I = 1,NumberOfNodes
NODE_GLOBAL_NUMBER = COMPUTATIONAL_DOMAIN%TOPOLOGY%NODES%NODES(I)%GLOBAL_NUMBER
NodeXValue = REGION%equations_sets%equations_sets(EQUATIONS_SET_GLOBAL_NUMBER)%ptr%geometry%geometric_field%variables(1) &
& %parameter_sets%parameter_sets(1)%ptr%parameters%cmiss%dataDP(I)
IF(NumberOfDimensions==2 .OR. NumberOfDimensions==3) THEN
NodeYValue = REGION%equations_sets%equations_sets(EQUATIONS_SET_GLOBAL_NUMBER)%ptr%geometry%geometric_field%variables(1) &
& %parameter_sets%parameter_sets(1)%ptr%parameters%cmiss%dataDP(I+NumberOfNodes)
ENDIF
IF(NumberOfDimensions==3) THEN
NodeZValue = REGION%equations_sets%equations_sets(EQUATIONS_SET_GLOBAL_NUMBER)%ptr%geometry%geometric_field%variables(1) &
& %parameter_sets%parameter_sets(1)%ptr%parameters%cmiss%dataDP(I+(2*NumberOfNodes))
ENDIF
NodeUValue=REGION%equations_sets%equations_sets(EQUATIONS_SET_GLOBAL_NUMBER)%ptr%dependent%dependent_field% &
& variables(1)%parameter_sets%parameter_sets(1)%ptr%parameters%cmiss%dataDP(I)
WRITE(myComputationalNodeNumber,*) ' Node: ',NODE_GLOBAL_NUMBER
WRITE(myComputationalNodeNumber,'(" ", es25.16 )')NodeXValue
IF(NumberOfDimensions==2 .OR. NumberOfDimensions==3) THEN
WRITE(myComputationalNodeNumber,'(" ", es25.16 )')NodeYValue
END IF
IF(NumberOfDimensions==3) THEN
WRITE(myComputationalNodeNumber,'(" ", es25.16 )')NodeZValue
END IF
WRITE(myComputationalNodeNumber,'(" ", es25.16 )')NodeUValue
IF( (EQUATIONS_SET%SPECIFICATION(1)==EQUATIONS_SET_CLASSICAL_FIELD_CLASS) &
& .AND.(EQUATIONS_SET%SPECIFICATION(2)==EQUATIONS_SET_REACTION_DIFFUSION_EQUATION_TYPE) &
& .AND.(EQUATIONS_SET%SPECIFICATION(3)==EQUATIONS_SET_CONSTANT_REAC_DIFF_SUBTYPE) )THEN
!source field
IF( OUTPUT_SOURCE ) THEN
!NodeSourceValue = SOURCE_INTERPOLATED_POINT(FIELD_U_VARIABLE_TYPE)%ptr%VALUES(1,1)
!WRITE(myComputationalNodeNumber,'(" ", es25.16 )')NodeSourceValue
END IF
END IF
END DO !nodes I
CLOSE(myComputationalNodeNumber)
!OUTPUT ELEMENTS IN CURRENT DOMAIN
MaxNodesPerElement=COMPUTATIONAL_DOMAIN%TOPOLOGY%ELEMENTS%ELEMENTS(1)%basis%number_of_element_parameters
BasisType = 1
IF(NumberOfDimensions==2) THEN
IF(MaxNodesPerElement==4.OR.MaxNodesPerElement==9.OR.MaxNodesPerElement==16) THEN
BasisType=1
ELSEIF(MaxNodesPerElement==3.OR.MaxNodesPerElement==6.OR.MaxNodesPerElement==10) THEN
BasisType=2
ENDIF
ELSEIF(NumberOfDimensions==3) THEN
BasisType=REGION%equations_sets%equations_sets(EQUATIONS_SET_GLOBAL_NUMBER)%ptr%equations% &
& interpolation%geometricInterpParameters(FIELD_U_VARIABLE_TYPE)%ptr%bases(1)%ptr%type
ENDIF
IF(exportExelem) THEN
CALL WRITE_STRING(GENERAL_OUTPUT_TYPE,"Writing Elements...",ERR,ERROR,*999)
FILENAME="./output/"//TRIM(NAME)//".exelem"
OPEN(UNIT=myComputationalNodeNumber, FILE=CHAR(FILENAME),STATUS='unknown')
WRITE(myComputationalNodeNumber,*) 'Group name: Cell'
IF (BasisType==1) THEN !lagrange basis in 1 and 2D
WRITE(INTG_STRING,'(I0)') NumberOfDimensions
WRITE(myComputationalNodeNumber,*) 'Shape. Dimension= ',TRIM(INTG_STRING)
WRITE(myComputationalNodeNumber,*) '#Scale factor sets= 1'
IF(NumberOfDimensions==1) THEN
WRITE(INTG_STRING,'(I0)') MaxNodesPerElement
WRITE(myComputationalNodeNumber,*) 'q.Lagrange, #Scale factors=',TRIM(INTG_STRING)
ELSE IF (NumberOfDimensions==2) THEN
IF(MaxNodesPerElement==4) THEN
WRITE(INTG_STRING,'(I0)') MaxNodesPerElement
WRITE(myComputationalNodeNumber,*) &
& 'l.Lagrange*l.Lagrange, #Scale factors=',TRIM(INTG_STRING) !linear lagrange
ELSE IF(MaxNodesPerElement==9) THEN
WRITE(INTG_STRING,'(I0)') MaxNodesPerElement
WRITE(myComputationalNodeNumber,*) &
& 'q.Lagrange*q.Lagrange, #Scale factors=',TRIM(INTG_STRING) !quadratic lagrange
ELSE IF(MaxNodesPerElement==16) THEN
WRITE(INTG_STRING,'(I0)') MaxNodesPerElement
WRITE(myComputationalNodeNumber,*) &
& 'c.Lagrange*c.Lagrange, #Scale factors=',TRIM(INTG_STRING) !cubic lagrange
END IF
ELSE !three dimensions
IF(MaxNodesPerElement==8) THEN
WRITE(INTG_STRING,'(I0)') MaxNodesPerElement
WRITE(myComputationalNodeNumber,*) &
& 'l.Lagrange*l.Lagrange*l.Lagrange, #Scale factors=',TRIM(INTG_STRING)
ELSE IF(MaxNodesPerElement==27) THEN
WRITE(INTG_STRING,'(I0)') MaxNodesPerElement
WRITE(myComputationalNodeNumber,*) &
& 'q.Lagrange*q.Lagrange*q.Lagrange, #Scale factors=',TRIM(INTG_STRING)
ELSE IF(MaxNodesPerElement==64) THEN
WRITE(INTG_STRING,'(I0)') MaxNodesPerElement
WRITE(myComputationalNodeNumber,*) &
& 'c.Lagrange*c.Lagrange*c.Lagrange, #Scale factors=',TRIM(INTG_STRING)
END IF
END IF
ELSEIF(BasisType==2) THEN
IF(NumberOfDimensions==2) THEN
WRITE(myComputationalNodeNumber,*) 'Shape. Dimension=', &
& NumberOfDimensions,', simplex(2)*simplex'
IF(MaxNodesPerElement==3) THEN
WRITE(myComputationalNodeNumber,*) '#Scale factor sets= 1'
WRITE(INTG_STRING,'(I0)') MaxNodesPerElement
WRITE(myComputationalNodeNumber,*) &
& ' l.simplex(2)*l.simplex, #Scale factors= ', TRIM(INTG_STRING)
ELSE IF(MaxNodesPerElement==6) THEN
WRITE(myComputationalNodeNumber,*) '#Scale factor sets= 1'
WRITE(INTG_STRING,'(I0)') MaxNodesPerElement
WRITE(myComputationalNodeNumber,*) &
& ' l.simplex(2)*l.simplex, #Scale factors= ', TRIM(INTG_STRING)
ELSE IF (MaxNodesPerElement== 10 ) THEN
WRITE(myComputationalNodeNumber,*) '#Scale factor sets= 1'
WRITE(INTG_STRING,'(I0)') MaxNodesPerElement
WRITE(myComputationalNodeNumber,*) &
& ' q.simplex(2)*q.simplex, #Scale factors= ', TRIM(INTG_STRING)
ENDIF
ELSE IF(NumberOfDimensions==3) THEN
WRITE(INTG_STRING2,'(I0)') NumberOfDimensions
WRITE(myComputationalNodeNumber,*) &
& 'Shape. Dimension=',TRIM(INTG_STRING2),', simplex(2;3)*simplex*simplex'
IF(MaxNodesPerElement==4) THEN
WRITE(myComputationalNodeNumber,*) &
& '#Scale factor sets= 1'
WRITE(INTG_STRING,'(I0)') MaxNodesPerElement
WRITE(myComputationalNodeNumber,*) &
& ' l.simplex(2;3)*l.simplex*l.simplex, #Scale factors= ', TRIM(INTG_STRING)
ELSE IF (MaxNodesPerElement== 10 ) THEN
WRITE(myComputationalNodeNumber,*) '#Scale factor sets= 1'
WRITE(INTG_STRING,'(I0)') MaxNodesPerElement
WRITE(myComputationalNodeNumber,*) &
& ' q.simplex(2;3)*q.simplex*q.simplex, #Scale factors= ', TRIM(INTG_STRING)
ELSE IF(MaxNodesPerElement==20) THEN
WRITE(myComputationalNodeNumber,*) '#Scale factor sets= 1'
WRITE(INTG_STRING,'(I0)') MaxNodesPerElement
WRITE(myComputationalNodeNumber,*) &
& ' q.simplex(2;3)*q.simplex*q.simplex, #Scale factors= ', TRIM(INTG_STRING)
ENDIF
ELSE
WRITE(myComputationalNodeNumber,*) '#Scale factor sets= 0'
END IF
END IF
WRITE(INTG_STRING,'(I0)') MaxNodesPerElement
WRITE(myComputationalNodeNumber,*) '#Nodes= ',TRIM(INTG_STRING)
WRITE(INTG_STRING,'(I0)') NumberOfOutputFields
WRITE(myComputationalNodeNumber,*) '#Fields= ',TRIM(INTG_STRING)
NumberOfFieldComponents(1) = NumberOfDimensions
NumberOfFieldComponents(2) = NumberOfVariableComponents
NumberOfFieldComponents(3) = NumberOfSourceComponents
DO I=1,NumberOfOutputFields
IF(I==1)THEN
WRITE(INTG_STRING,'(I0)') NumberOfDimensions
WRITE(myComputationalNodeNumber,*) &
& ' 1) coordinates, coordinate, rectangular cartesian, #Components= ',TRIM(INTG_STRING)
ELSE IF(I==2) THEN
WRITE(INTG_STRING,'(I0)') NumberOfVariableComponents
WRITE(myComputationalNodeNumber,*) &
& ' 2) dependent, field, rectangular cartesian, #Components= ',TRIM(INTG_STRING)
ELSE IF(I==3) THEN
WRITE(INTG_STRING,'(I0)') NumberOfSourceComponents
WRITE(myComputationalNodeNumber,*) &
& ' 3) source, field, rectangular cartesian, #Components= ',TRIM(INTG_STRING)
END IF
DO J=1,NumberOfFieldComponents(I)
IF(NumberOfDimensions==1) THEN
IF(I==1)THEN
IF(J==1) THEN
WRITE(myComputationalNodeNumber,*)' x. l.Lagrange, no modify, standard node based.'
ELSE IF(J==2) THEN
WRITE(myComputationalNodeNumber,*)' y. l.Lagrange, no modify, standard node based.'
ELSE IF(J==3) THEN
WRITE(myComputationalNodeNumber,*)' z. l.Lagrange, no modify, standard node based.'
END IF
ELSE
WRITE(myComputationalNodeNumber,*) &
& ' ',J,'. l.Lagrange, no modify, standard node based.'
END IF
ELSE IF(NumberOfDimensions==2) THEN
IF(I==1)THEN
IF(J==1) THEN
IF(MaxNodesPerElement==4)THEN
WRITE(myComputationalNodeNumber,*) &
& ' x. l.Lagrange*l.Lagrange, no modify, standard node based.'
ELSE IF(MaxNodesPerElement==9) THEN
WRITE(myComputationalNodeNumber,*) &
& ' x. q.Lagrange*q.Lagrange, no modify, standard node based.'
ELSE IF(MaxNodesPerElement==16) THEN
WRITE(myComputationalNodeNumber,*) &
& ' x. c.Lagrange*c.Lagrange, no modify, standard node based.'
ELSE IF(MaxNodesPerElement==3) THEN
WRITE(myComputationalNodeNumber,*) &
& ' x. l.simplex(2)*l.simplex, no modify, standard node based.'
ELSE IF(MaxNodesPerElement==6) THEN
WRITE(myComputationalNodeNumber,*) &
& ' x. q.simplex(2)*q.simplex, no modify, standard node based.'
ELSE IF(MaxNodesPerElement==10) THEN
WRITE(myComputationalNodeNumber,*) &
& ' x. c.simplex(2)*c.simplex, no modify, standard node based.'
END IF
ELSE IF(J==2) THEN
IF(MaxNodesPerElement==4) THEN
WRITE(myComputationalNodeNumber,*) &
& ' y. l.Lagrange*l.Lagrange, no modify, standard node based.'
ELSE IF(MaxNodesPerElement==9) THEN
WRITE(myComputationalNodeNumber,*) &
& ' y. q.Lagrange*q.Lagrange, no modify, standard node based.'
ELSE IF(MaxNodesPerElement==16) THEN
WRITE(myComputationalNodeNumber,*) &
& ' y. c.Lagrange*c.Lagrange, no modify, standard node based.'
ELSE IF(MaxNodesPerElement==3) THEN
WRITE(myComputationalNodeNumber,*) &
& ' y. l.simplex(2)*l.simplex, no modify, standard node based.'
ELSE IF(MaxNodesPerElement==6) THEN
WRITE(myComputationalNodeNumber,*) &
& ' y. q.simplex(2)*q.simplex, no modify, standard node based.'
ELSE IF(MaxNodesPerElement==10) THEN
WRITE(myComputationalNodeNumber,*) &
& ' y. c.simplex(2)*c.simplex, no modify, standard node based.'
END IF
ELSE IF(J==3) THEN
IF(MaxNodesPerElement==4) THEN
WRITE(myComputationalNodeNumber,*) &
& ' z. l.Lagrange*l.Lagrange, no modify, standard node based.'
ELSE IF(MaxNodesPerElement==9) THEN
WRITE(myComputationalNodeNumber,*) &
& ' z. q.Lagrange*q.Lagrange, no modify, standard node based.'
ELSE IF(MaxNodesPerElement==16) THEN
WRITE(myComputationalNodeNumber,*) &
& ' z. c.Lagrange*c.Lagrange, no modify, standard node based.'
ELSE IF(MaxNodesPerElement==3) THEN
WRITE(myComputationalNodeNumber,*) &
& ' z. l.simplex(2)*l.simplex, no modify, standard node based.'
ELSE IF(MaxNodesPerElement==6) THEN
WRITE(myComputationalNodeNumber,*) &
& ' z. q.simplex(2)*q.simplex, no modify, standard node based.'
ELSE IF(MaxNodesPerElement==10) THEN
WRITE(myComputationalNodeNumber,*) &
& ' z. c.simplex(2)*c.simplex, no modify, standard node based.'
END IF
END IF
ELSE
IF(MaxNodesPerElement==4) THEN
WRITE(myComputationalNodeNumber,*) &
& ' ',J,'. l.Lagrange*l.Lagrange, no modify, standard node based.'
ELSE IF(MaxNodesPerElement==9) THEN
WRITE(myComputationalNodeNumber,*) &
& ' ',J,'. q.Lagrange*q.Lagrange, no modify, standard node based.'
ELSE IF(MaxNodesPerElement==16) THEN
WRITE(myComputationalNodeNumber,*) &
& ' ',J,'. c.Lagrange*c.Lagrange, no modify, standard node based.'
ELSE IF(MaxNodesPerElement==3) THEN
WRITE(myComputationalNodeNumber,*) &
& ' ',J,'. l.simplex(2)*l.simplex, no modify, standard node based.'
ELSE IF(MaxNodesPerElement==6) THEN
WRITE(myComputationalNodeNumber,*) &
& ' ',J,'. q.simplex(2)*q.simplex, no modify, standard node based.'
ELSE IF(MaxNodesPerElement==10) THEN
WRITE(myComputationalNodeNumber,*) &
& ' ',J,'. c.simplex(2)*c.simplex, no modify, standard node based.'
END IF
END IF
ELSE IF(NumberOfDimensions==3) THEN
IF(I==1)THEN
IF(J==1) THEN
IF(MaxNodesPerElement==8) THEN
WRITE(myComputationalNodeNumber,*) &
& ' x. l.Lagrange*l.Lagrange*l.Lagrange, no modify, standard node based.'
ELSE IF(MaxNodesPerElement==27) THEN
WRITE(myComputationalNodeNumber,*) &
& ' x. q.Lagrange*q.Lagrange*q.Lagrange, no modify, standard node based.'
ELSE IF(MaxNodesPerElement==64) THEN
WRITE(myComputationalNodeNumber,*) &
& ' x. c.Lagrange*c.Lagrange*c.Lagrange, no modify, standard node based.'
ELSE IF(MaxNodesPerElement==4) THEN
WRITE(myComputationalNodeNumber,*) &
& ' x. l.simplex(2;3)*l.simplex*l.simplex, no modify, standard node based.'
ELSE IF(MaxNodesPerElement==10) THEN
WRITE(myComputationalNodeNumber,*) &
& ' x. q.simplex(2;3)*q.simplex*q.simplex, no modify, standard node based.'
ELSE IF(MaxNodesPerElement==20) THEN
WRITE(myComputationalNodeNumber,*) &
& ' x. c.simplex(2;3)*c.simplex*c.simplex, no modify, standard node based.'
END IF
ELSE IF(J==2) THEN
IF(MaxNodesPerElement==8) THEN
WRITE(myComputationalNodeNumber,*) &
& ' y. l.Lagrange*l.Lagrange*l.Lagrange, no modify, standard node based.'
ELSE IF(MaxNodesPerElement==27) THEN
WRITE(myComputationalNodeNumber,*) &
& ' y. q.Lagrange*q.Lagrange*q.Lagrange, no modify, standard node based.'
ELSE IF(MaxNodesPerElement==64) THEN
WRITE(myComputationalNodeNumber,*) &
& ' y. c.Lagrange*c.Lagrange*c.Lagrange, no modify, standard node based.'
ELSE IF(MaxNodesPerElement==4) THEN
WRITE(myComputationalNodeNumber,*) &
& ' y. l.simplex(2;3)*l.simplex*l.simplex, no modify, standard node based.'
ELSE IF(MaxNodesPerElement==10) THEN
WRITE(myComputationalNodeNumber,*) &
& ' y. q.simplex(2;3)*q.simplex*q.simplex, no modify, standard node based.'
ELSE IF(MaxNodesPerElement==20) THEN
WRITE(myComputationalNodeNumber,*) &
& ' y. c.simplex(2;3)*c.simplex*c.simplex, no modify, standard node based.'
END IF
ELSE IF(J==3) THEN
IF(MaxNodesPerElement==8) THEN
WRITE(myComputationalNodeNumber,*) &
& ' z. l.Lagrange*l.Lagrange*l.Lagrange, no modify, standard node based.'
ELSE IF(MaxNodesPerElement==27) THEN
WRITE(myComputationalNodeNumber,*) &
& ' z. q.Lagrange*q.Lagrange*q.Lagrange, no modify, standard node based.'
ELSE IF(MaxNodesPerElement==64) THEN
WRITE(myComputationalNodeNumber,*) &
& ' z. c.Lagrange*c.Lagrange*c.Lagrange, no modify, standard node based.'
ELSE IF(MaxNodesPerElement==4) THEN
WRITE(myComputationalNodeNumber,*) &
& ' z. l.simplex(2;3)*l.simplex*l.simplex, no modify, standard node based.'
ELSE IF(MaxNodesPerElement==10) THEN
WRITE(myComputationalNodeNumber,*) &
& ' z. q.simplex(2;3)*q.simplex*q.simplex, no modify, standard node based.'
ELSE IF(MaxNodesPerElement==20) THEN
WRITE(myComputationalNodeNumber,*) &
& ' z. c.simplex(2;3)*c.simplex*c.simplex, no modify, standard node based.'
END IF
END IF
ELSE
IF(MaxNodesPerElement==8) THEN
WRITE(myComputationalNodeNumber,*) &
& ' ',J,'. l.Lagrange*l.Lagrange*l.Lagrange, no modify, standard node based.'
ELSE IF(MaxNodesPerElement==27) THEN
WRITE(myComputationalNodeNumber,*) &
& ' ',J,'. q.Lagrange*q.Lagrange*q.Lagrange, no modify, standard node based.'
ELSE IF(MaxNodesPerElement==64) THEN
WRITE(myComputationalNodeNumber,*) &
& ' ',J,'. c.Lagrange*c.Lagrange*c.Lagrange, no modify, standard node based.'
ELSE IF(MaxNodesPerElement==4) THEN
WRITE(myComputationalNodeNumber,*) &
& ' ',J,'. l.simplex(2;3)*l.simplex*l.simplex, no modify, standard node based.'
ELSE IF(MaxNodesPerElement==10) THEN
WRITE(myComputationalNodeNumber,*) &
& ' ',J,'. q.simplex(2;3)*q.simplex*q.simplex, no modify, standard node based.'
ELSE IF(MaxNodesPerElement==20) THEN
WRITE(myComputationalNodeNumber,*) &
& ' ',J,'. c.simplex(2;3)*c.simplex*c.simplex, no modify, standard node based.'
END IF
END IF
END IF
WRITE(INTG_STRING,'(I0)') MaxNodesPerElement
WRITE(myComputationalNodeNumber,*) ' #Nodes= ',TRIM(INTG_STRING)
DO K = 1,MaxNodesPerElement
WRITE(INTG_STRING,'(I0)') K
WRITE(myComputationalNodeNumber,*) ' ',TRIM(INTG_STRING),'. #Values=1'
WRITE(myComputationalNodeNumber,*) ' Value indices: 1'
WRITE(myComputationalNodeNumber,*) ' Scale factor indices: ',TRIM(INTG_STRING)
END DO
END DO !J loop
END DO !I loop
IF(.NOT.ALLOCATED(ElementNodes)) ALLOCATE(ElementNodes(NumberOfElements,MaxNodesPerElement))
IF(.NOT.ALLOCATED(ElementNodesScales)) ALLOCATE(ElementNodesScales(NumberOfElements,MaxNodesPerElement))
DO I=1,NumberOfElements
ELEMENT_GLOBAL_NUMBER=COMPUTATIONAL_DOMAIN%DECOMPOSITION%TOPOLOGY%ELEMENTS%ELEMENTS(K)%GLOBAL_NUMBER
DO J=1,MaxNodesPerElement
NODE_LOCAL_NUMBER=COMPUTATIONAL_DOMAIN%TOPOLOGY%ELEMENTS%ELEMENTS(I)%ELEMENT_NODES(J)
NODE_GLOBAL_NUMBER=COMPUTATIONAL_DOMAIN%MAPPINGS%NODES%LOCAL_TO_GLOBAL_MAP(NODE_LOCAL_NUMBER)
ElementNodes(I,J)=NODE_GLOBAL_NUMBER
ElementNodesScales(I,J)=1.0000000000000000E+00
END DO
END DO
DO K=1,NumberOfElements
ELEMENT_GLOBAL_NUMBER=COMPUTATIONAL_DOMAIN%DECOMPOSITION%TOPOLOGY%ELEMENTS%ELEMENTS(K)%GLOBAL_NUMBER
IF (BasisType==1) THEN
WRITE(INTG_STRING,'(I0)') ELEMENT_GLOBAL_NUMBER
WRITE(myComputationalNodeNumber,*) 'Element: ', TRIM(INTG_STRING),' 0 0'
WRITE(myComputationalNodeNumber,*) ' Nodes:'
WRITE(myComputationalNodeNumber,*) ' ', ElementNodes(K,1:MaxNodesPerElement)
WRITE(myComputationalNodeNumber,*) ' Scale factors:'
WRITE(myComputationalNodeNumber,*) ' ',ElementNodesScales(K,1:MaxNodesPerElement)
ELSEIF(BasisType==2) THEN
IF(.NOT.ALLOCATED(SimplexOutputHelp)) ALLOCATE(SimplexOutputHelp(MaxNodesPerElement))
IF(NumberOfDimensions==2)THEN
SimplexOutputHelp(1)=ElementNodes(K,1)
SimplexOutputHelp(2)=ElementNodes(K,2)
SimplexOutputHelp(3)=ElementNodes(K,3)
ELSE IF(NumberOfDimensions==3) THEN
SimplexOutputHelp(1)=ElementNodes(K,1)
SimplexOutputHelp(2)=ElementNodes(K,4)
SimplexOutputHelp(3)=ElementNodes(K,2)
SimplexOutputHelp(4)=ElementNodes(K,3)
END IF
WRITE(INTG_STRING,'(I0)') ELEMENT_GLOBAL_NUMBER
WRITE(myComputationalNodeNumber,*) 'Element: ', TRIM(INTG_STRING),' 0 0'
WRITE(myComputationalNodeNumber,*) ' Nodes:'
WRITE(myComputationalNodeNumber,*) ' ', SimplexOutputHelp
WRITE(myComputationalNodeNumber,*) ' Scale factors:'
WRITE(myComputationalNodeNumber,*) ' ',ElementNodesScales(K,1:MaxNodesPerElement)
END IF
ENDDO
CLOSE(myComputationalNodeNumber)
END IF !exportExelem flag check
EXITS("REACTION_DIFFUSION_IO_WRITE_CMGUI")
RETURN
999 ERRORSEXITS("REACTION_DIFFUSION_IO_WRITE_CMGUI",ERR,ERROR)
RETURN 1
END SUBROUTINE REACTION_DIFFUSION_IO_WRITE_CMGUI
!================================================================================================================================
!
END MODULE REACTION_DIFFUSION_IO_ROUTINES