OpenCMISS-Iron Internal API Documentation
reaction_diffusion_IO_routines.f90
Go to the documentation of this file.
1 
44 
46 
48 
49  USE base_routines
52  USE field_routines
53  USE types
54  USE input_output
55  USE kinds
56  USE mesh_routines
57 
58 #ifndef NOMPIMOD
59  USE mpi
60 #endif
61 
62 #include "macros.h"
63 
64  IMPLICIT NONE
65 
66  PRIVATE
67 
68 #ifdef NOMPIMOD
69 #include "mpif.h"
70 #endif
71 
72  PUBLIC reaction_diffusion_io_write_cmgui
73 
74 CONTAINS
75 
76  ! OK
77  !================================================================================================================================
78  !
79 
81  SUBROUTINE reaction_diffusion_io_write_cmgui(REGION, EQUATIONS_SET_GLOBAL_NUMBER, NAME, ERR, ERROR,*)
82 
83  !Argument variables
84  TYPE(region_type), INTENT(IN), POINTER :: REGION
85  CHARACTER(30),INTENT(IN) :: NAME
86  INTEGER(INTG) :: ERR
87  INTEGER(INTG), INTENT(IN) :: EQUATIONS_SET_GLOBAL_NUMBER
88  TYPE(varying_string):: ERROR
89 
90  !Local Variables
91  TYPE(equations_set_type), POINTER :: EQUATIONS_SET
92  TYPE(domain_type), POINTER :: COMPUTATIONAL_DOMAIN
93  TYPE(field_type), POINTER :: SOURCE_FIELD
94  REAL(DP) :: NodeXValue,NodeYValue,NodeZValue,NodeUValue
95  INTEGER(INTG):: myComputationalNodeNumber,NumberOfOutputFields,NumberOfDimensions,NumberOfElements,NumberOfNodes
96  INTEGER(INTG):: NumberOfVariableComponents,NumberOfSourceComponents,I,J,K,ValueIndex,NODE_GLOBAL_NUMBER
97  INTEGER(INTG) :: NodesInMeshComponent,BasisType,MaxNodesPerElement,NumberOfFieldComponents(3),ELEMENT_GLOBAL_NUMBER
98  INTEGER(INTG) :: NODE_LOCAL_NUMBER
99  INTEGER(INTG),ALLOCATABLE :: ElementNodes(:,:),SimplexOutputHelp(:)
100  REAL(DP), ALLOCATABLE :: ElementNodesScales(:,:)
101  LOGICAL :: OUTPUT_SOURCE
102  TYPE(varying_string) :: FILENAME
103  CHARACTER(50) :: INTG_STRING,INTG_STRING2
104 
105 
106  enters("REACTION_DIFFUSION_IO_WRITE_CMGUI",err,error,*999)
107 
108  mycomputationalnodenumber = computational_node_number_get(err,error)
109 
110  equations_set => region%equations_sets%equations_sets(equations_set_global_number)%ptr
111  NULLIFY(source_field)
112  computational_domain=>region%MESHES%MESHES(1) &
113  & %ptr%DECOMPOSITIONS%DECOMPOSITIONS(1)%ptr%DOMAIN(1)%ptr
114 
115  mycomputationalnodenumber = computational_node_number_get(err,error)
116  numberofdimensions = computational_domain%NUMBER_OF_DIMENSIONS
117  numberofnodes = computational_domain%TOPOLOGY%NODES%NUMBER_OF_NODES
118  nodesinmeshcomponent = region%meshes%meshes(1)%ptr%topology(1)%ptr%nodes%numberOfNodes
119  numberofelements = computational_domain%TOPOLOGY%ELEMENTS%NUMBER_OF_ELEMENTS
120  numberofvariablecomponents=region%equations_sets%equations_sets(equations_set_global_number)%ptr%dependent%dependent_field% &
121  & variables(1)%number_of_components
122  numberofoutputfields=2
123  !determine if there is a source field
124  output_source = .false.
125  IF( (equations_set%SPECIFICATION(1)==equations_set_classical_field_class) &
126  & .AND.(equations_set%SPECIFICATION(2)==equations_set_reaction_diffusion_equation_type) &
127  & .AND.(equations_set%SPECIFICATION(3)==equations_set_constant_reac_diff_subtype) )THEN
128  source_field=>region%equations_sets%equations_sets(equations_set_global_number)%ptr%source%source_field
129  IF( ASSOCIATED(source_field) ) output_source = .false. !currently set to false to rethink how source is accessed for output
130  END IF
131 
132  IF( output_source ) THEN
133  numberofsourcecomponents=region%equations_sets%equations_sets(equations_set_global_number)%ptr%source%source_field% &
134  & variables(1)%number_of_components
135  numberofoutputfields = numberofoutputfields + 1
136  ! CALL FIELD_INTERPOLATION_PARAMETERS_INITIALISE(SOURCE_FIELD,SOURCE_INTERPOLATION_PARAMETERS,ERR,ERROR,*999)
137  ! CALL FIELD_INTERPOLATED_POINTS_INITIALISE(SOURCE_INTERPOLATION_PARAMETERS,SOURCE_INTERPOLATED_POINT,ERR,ERROR,*999)
138  END IF
139 
140  CALL write_string(general_output_type,"Writing Nodes...",err,error,*999)
141 
142  filename="./output/"//trim(name)//".exnode"
143 
144  OPEN(unit=mycomputationalnodenumber, file=char(filename),status='unknown')
145  ! WRITING HEADER INFORMATION
146  WRITE(mycomputationalnodenumber,*) 'Group name: Cell'
147  WRITE(intg_string,'(I0)') numberofoutputfields
148  WRITE(mycomputationalnodenumber,*) '#Fields=',trim(intg_string)
149 
150  valueindex=1
151  WRITE(intg_string,'(I0)') numberofdimensions
152  WRITE(mycomputationalnodenumber,*) &
153  & ' 1) coordinates, coordinate, rectangular cartesian, #Components=',trim(intg_string)
154  DO i=1,numberofdimensions
155  IF(i==1) THEN
156  WRITE(intg_string,'(I0)') valueindex
157  WRITE(mycomputationalnodenumber,*) ' x. Value index= ',trim(intg_string),', #Derivatives= 0'
158  ELSE IF(i==2) THEN
159  WRITE(intg_string,'(I0)') valueindex
160  WRITE(mycomputationalnodenumber,*) ' y. Value index= ',trim(intg_string),', #Derivatives= 0'
161  ELSE
162  WRITE(intg_string,'(I0)') valueindex
163  WRITE(mycomputationalnodenumber,*) ' z. Value index= ',trim(intg_string),', #Derivatives= 0'
164  END IF
165  valueindex=valueindex+1
166  END DO
167 
168  WRITE(intg_string,'(I0)') numberofvariablecomponents
169  WRITE(mycomputationalnodenumber,*) ' 2) dependent, field, rectangular cartesian, #Components=', &
170  & trim(intg_string)
171 
172  DO i=1,numberofvariablecomponents
173  WRITE(intg_string,'(I0)') valueindex
174  WRITE(intg_string2,'(I0)') i
175  WRITE(mycomputationalnodenumber,*) ' ',trim(intg_string2),'. Value index= ',trim(intg_string), &
176  & ', #Derivatives= 0'
177  valueindex=valueindex+1
178  END DO
179 
180  IF( output_source ) THEN !Watch out that no numbering conflict occurs with Analytic: 4.)
181  WRITE(intg_string,'(I0)') numberofsourcecomponents
182  WRITE(mycomputationalnodenumber,*) ' 3) source, field, rectangular cartesian, #Components=', &
183  & trim(intg_string)
184  DO i=1,numberofsourcecomponents
185  WRITE(intg_string,'(I0)') valueindex
186  WRITE(intg_string2,'(I0)') i
187  WRITE(mycomputationalnodenumber,*) ' ',trim(intg_string2),'. Value index= ', &
188  & trim(intg_string),', #Derivatives= 0'
189  valueindex=valueindex+1
190  END DO
191  END IF
192 
193  !WRITE OUT NODE VALUES
194  DO i = 1,numberofnodes
195  node_global_number = computational_domain%TOPOLOGY%NODES%NODES(i)%GLOBAL_NUMBER
196  nodexvalue = region%equations_sets%equations_sets(equations_set_global_number)%ptr%geometry%geometric_field%variables(1) &
197  & %parameter_sets%parameter_sets(1)%ptr%parameters%cmiss%data_dp(i)
198  IF(numberofdimensions==2 .OR. numberofdimensions==3) THEN
199  nodeyvalue = region%equations_sets%equations_sets(equations_set_global_number)%ptr%geometry%geometric_field%variables(1) &
200  & %parameter_sets%parameter_sets(1)%ptr%parameters%cmiss%data_dp(i+numberofnodes)
201  ENDIF
202  IF(numberofdimensions==3) THEN
203  nodezvalue = region%equations_sets%equations_sets(equations_set_global_number)%ptr%geometry%geometric_field%variables(1) &
204  & %parameter_sets%parameter_sets(1)%ptr%parameters%cmiss%data_dp(i+(2*numberofnodes))
205  ENDIF
206  nodeuvalue=region%equations_sets%equations_sets(equations_set_global_number)%ptr%dependent%dependent_field% &
207  & variables(1)%parameter_sets%parameter_sets(1)%ptr%parameters%cmiss%data_dp(i)
208 
209  WRITE(mycomputationalnodenumber,*) ' Node: ',node_global_number
210  WRITE(mycomputationalnodenumber,'(" ", es25.16 )')nodexvalue
211 
212  IF(numberofdimensions==2 .OR. numberofdimensions==3) THEN
213  WRITE(mycomputationalnodenumber,'(" ", es25.16 )')nodeyvalue
214  END IF
215 
216  IF(numberofdimensions==3) THEN
217  WRITE(mycomputationalnodenumber,'(" ", es25.16 )')nodezvalue
218  END IF
219  WRITE(mycomputationalnodenumber,'(" ", es25.16 )')nodeuvalue
220 
221  IF( (equations_set%SPECIFICATION(1)==equations_set_classical_field_class) &
222  & .AND.(equations_set%SPECIFICATION(2)==equations_set_reaction_diffusion_equation_type) &
223  & .AND.(equations_set%SPECIFICATION(3)==equations_set_constant_reac_diff_subtype) )THEN
224  !source field
225  IF( output_source ) THEN
226  !NodeSourceValue = SOURCE_INTERPOLATED_POINT(FIELD_U_VARIABLE_TYPE)%ptr%VALUES(1,1)
227  !WRITE(myComputationalNodeNumber,'(" ", es25.16 )')NodeSourceValue
228  END IF
229  END IF
230  END DO !nodes I
231  CLOSE(mycomputationalnodenumber)
232 
233  !OUTPUT ELEMENTS IN CURRENT DOMAIN
234  maxnodesperelement=computational_domain%TOPOLOGY%ELEMENTS%ELEMENTS(1)%basis%number_of_element_parameters
235  basistype = 1
236  IF(numberofdimensions==2) THEN
237  IF(maxnodesperelement==4.OR.maxnodesperelement==9.OR.maxnodesperelement==16) THEN
238  basistype=1
239  ELSEIF(maxnodesperelement==3.OR.maxnodesperelement==6.OR.maxnodesperelement==10) THEN
240  basistype=2
241  ENDIF
242  ELSEIF(numberofdimensions==3) THEN
243  basistype=region%equations_sets%equations_sets(equations_set_global_number)%ptr%equations% &
244  & interpolation%geometric_interp_parameters(field_u_variable_type)%ptr%bases(1)%ptr%type
245  ENDIF
246  CALL write_string(general_output_type,"Writing Elements...",err,error,*999)
247  filename="./output/"//trim(name)//".exelem"
248  OPEN(unit=mycomputationalnodenumber, file=char(filename),status='unknown')
249  WRITE(mycomputationalnodenumber,*) 'Group name: Cell'
250  IF (basistype==1) THEN !lagrange basis in 1 and 2D
251  WRITE(intg_string,'(I0)') numberofdimensions
252  WRITE(mycomputationalnodenumber,*) 'Shape. Dimension= ',trim(intg_string)
253  WRITE(mycomputationalnodenumber,*) '#Scale factor sets= 1'
254  IF(numberofdimensions==1) THEN
255  WRITE(intg_string,'(I0)') maxnodesperelement
256  WRITE(mycomputationalnodenumber,*) 'q.Lagrange, #Scale factors=',trim(intg_string)
257  ELSE IF (numberofdimensions==2) THEN
258  IF(maxnodesperelement==4) THEN
259 
260  WRITE(intg_string,'(I0)') maxnodesperelement
261  WRITE(mycomputationalnodenumber,*) &
262  & 'l.Lagrange*l.Lagrange, #Scale factors=',trim(intg_string) !linear lagrange
263  ELSE IF(maxnodesperelement==9) THEN
264  WRITE(intg_string,'(I0)') maxnodesperelement
265  WRITE(mycomputationalnodenumber,*) &
266  & 'q.Lagrange*q.Lagrange, #Scale factors=',trim(intg_string) !quadratic lagrange
267  ELSE IF(maxnodesperelement==16) THEN
268  WRITE(intg_string,'(I0)') maxnodesperelement
269  WRITE(mycomputationalnodenumber,*) &
270  & 'c.Lagrange*c.Lagrange, #Scale factors=',trim(intg_string) !cubic lagrange
271  END IF
272  ELSE !three dimensions
273  IF(maxnodesperelement==8) THEN
274  WRITE(intg_string,'(I0)') maxnodesperelement
275  WRITE(mycomputationalnodenumber,*) &
276  & 'l.Lagrange*l.Lagrange*l.Lagrange, #Scale factors=',trim(intg_string)
277  ELSE IF(maxnodesperelement==27) THEN
278  WRITE(intg_string,'(I0)') maxnodesperelement
279  WRITE(mycomputationalnodenumber,*) &
280  & 'q.Lagrange*q.Lagrange*q.Lagrange, #Scale factors=',trim(intg_string)
281  ELSE IF(maxnodesperelement==64) THEN
282  WRITE(intg_string,'(I0)') maxnodesperelement
283  WRITE(mycomputationalnodenumber,*) &
284  & 'c.Lagrange*c.Lagrange*c.Lagrange, #Scale factors=',trim(intg_string)
285  END IF
286  END IF
287  ELSEIF(basistype==2) THEN
288  IF(numberofdimensions==2) THEN
289  WRITE(mycomputationalnodenumber,*) 'Shape. Dimension=', &
290  & numberofdimensions,', simplex(2)*simplex'
291  IF(maxnodesperelement==3) THEN
292  WRITE(mycomputationalnodenumber,*) '#Scale factor sets= 1'
293  WRITE(intg_string,'(I0)') maxnodesperelement
294  WRITE(mycomputationalnodenumber,*) &
295  & ' l.simplex(2)*l.simplex, #Scale factors= ', trim(intg_string)
296  ELSE IF(maxnodesperelement==6) THEN
297  WRITE(mycomputationalnodenumber,*) '#Scale factor sets= 1'
298  WRITE(intg_string,'(I0)') maxnodesperelement
299  WRITE(mycomputationalnodenumber,*) &
300  & ' l.simplex(2)*l.simplex, #Scale factors= ', trim(intg_string)
301  ELSE IF (maxnodesperelement== 10 ) THEN
302  WRITE(mycomputationalnodenumber,*) '#Scale factor sets= 1'
303  WRITE(intg_string,'(I0)') maxnodesperelement
304  WRITE(mycomputationalnodenumber,*) &
305  & ' q.simplex(2)*q.simplex, #Scale factors= ', trim(intg_string)
306  ENDIF
307  ELSE IF(numberofdimensions==3) THEN
308  WRITE(intg_string2,'(I0)') numberofdimensions
309  WRITE(mycomputationalnodenumber,*) &
310  & 'Shape. Dimension=',trim(intg_string2),', simplex(2;3)*simplex*simplex'
311  IF(maxnodesperelement==4) THEN
312  WRITE(mycomputationalnodenumber,*) &
313  & '#Scale factor sets= 1'
314  WRITE(intg_string,'(I0)') maxnodesperelement
315  WRITE(mycomputationalnodenumber,*) &
316  & ' l.simplex(2;3)*l.simplex*l.simplex, #Scale factors= ', trim(intg_string)
317  ELSE IF (maxnodesperelement== 10 ) THEN
318  WRITE(mycomputationalnodenumber,*) '#Scale factor sets= 1'
319  WRITE(intg_string,'(I0)') maxnodesperelement
320  WRITE(mycomputationalnodenumber,*) &
321  & ' q.simplex(2;3)*q.simplex*q.simplex, #Scale factors= ', trim(intg_string)
322  ELSE IF(maxnodesperelement==20) THEN
323  WRITE(mycomputationalnodenumber,*) '#Scale factor sets= 1'
324  WRITE(intg_string,'(I0)') maxnodesperelement
325  WRITE(mycomputationalnodenumber,*) &
326  & ' q.simplex(2;3)*q.simplex*q.simplex, #Scale factors= ', trim(intg_string)
327  ENDIF
328  ELSE
329  WRITE(mycomputationalnodenumber,*) '#Scale factor sets= 0'
330  END IF
331 
332  END IF
333  WRITE(intg_string,'(I0)') maxnodesperelement
334  WRITE(mycomputationalnodenumber,*) '#Nodes= ',trim(intg_string)
335  WRITE(intg_string,'(I0)') numberofoutputfields
336  WRITE(mycomputationalnodenumber,*) '#Fields= ',trim(intg_string)
337  numberoffieldcomponents(1) = numberofdimensions
338  numberoffieldcomponents(2) = numberofvariablecomponents
339  numberoffieldcomponents(3) = numberofsourcecomponents
340  DO i=1,numberofoutputfields
341  IF(i==1)THEN
342  WRITE(intg_string,'(I0)') numberofdimensions
343  WRITE(mycomputationalnodenumber,*) &
344  & ' 1) coordinates, coordinate, rectangular cartesian, #Components= ',trim(intg_string)
345  ELSE IF(i==2) THEN
346  WRITE(intg_string,'(I0)') numberofvariablecomponents
347  WRITE(mycomputationalnodenumber,*) &
348  & ' 2) dependent, field, rectangular cartesian, #Components= ',trim(intg_string)
349  ELSE IF(i==3) THEN
350  WRITE(intg_string,'(I0)') numberofsourcecomponents
351  WRITE(mycomputationalnodenumber,*) &
352  & ' 3) source, field, rectangular cartesian, #Components= ',trim(intg_string)
353  END IF
354 
355  DO j=1,numberoffieldcomponents(i)
356  IF(numberofdimensions==1) THEN
357  IF(i==1)THEN
358  IF(j==1) THEN
359  WRITE(mycomputationalnodenumber,*)' x. l.Lagrange, no modify, standard node based.'
360  ELSE IF(j==2) THEN
361  WRITE(mycomputationalnodenumber,*)' y. l.Lagrange, no modify, standard node based.'
362  ELSE IF(j==3) THEN
363  WRITE(mycomputationalnodenumber,*)' z. l.Lagrange, no modify, standard node based.'
364  END IF
365  ELSE
366  WRITE(mycomputationalnodenumber,*) &
367  & ' ',j,'. l.Lagrange, no modify, standard node based.'
368  END IF
369  ELSE IF(numberofdimensions==2) THEN
370  IF(i==1)THEN
371  IF(j==1) THEN
372  IF(maxnodesperelement==4)THEN
373  WRITE(mycomputationalnodenumber,*) &
374  & ' x. l.Lagrange*l.Lagrange, no modify, standard node based.'
375  ELSE IF(maxnodesperelement==9) THEN
376  WRITE(mycomputationalnodenumber,*) &
377  & ' x. q.Lagrange*q.Lagrange, no modify, standard node based.'
378  ELSE IF(maxnodesperelement==16) THEN
379  WRITE(mycomputationalnodenumber,*) &
380  & ' x. c.Lagrange*c.Lagrange, no modify, standard node based.'
381 
382  ELSE IF(maxnodesperelement==3) THEN
383  WRITE(mycomputationalnodenumber,*) &
384  & ' x. l.simplex(2)*l.simplex, no modify, standard node based.'
385  ELSE IF(maxnodesperelement==6) THEN
386  WRITE(mycomputationalnodenumber,*) &
387  & ' x. q.simplex(2)*q.simplex, no modify, standard node based.'
388  ELSE IF(maxnodesperelement==10) THEN
389  WRITE(mycomputationalnodenumber,*) &
390  & ' x. c.simplex(2)*c.simplex, no modify, standard node based.'
391  END IF
392  ELSE IF(j==2) THEN
393  IF(maxnodesperelement==4) THEN
394  WRITE(mycomputationalnodenumber,*) &
395  & ' y. l.Lagrange*l.Lagrange, no modify, standard node based.'
396  ELSE IF(maxnodesperelement==9) THEN
397  WRITE(mycomputationalnodenumber,*) &
398  & ' y. q.Lagrange*q.Lagrange, no modify, standard node based.'
399  ELSE IF(maxnodesperelement==16) THEN
400  WRITE(mycomputationalnodenumber,*) &
401  & ' y. c.Lagrange*c.Lagrange, no modify, standard node based.'
402  ELSE IF(maxnodesperelement==3) THEN
403  WRITE(mycomputationalnodenumber,*) &
404  & ' y. l.simplex(2)*l.simplex, no modify, standard node based.'
405  ELSE IF(maxnodesperelement==6) THEN
406  WRITE(mycomputationalnodenumber,*) &
407  & ' y. q.simplex(2)*q.simplex, no modify, standard node based.'
408  ELSE IF(maxnodesperelement==10) THEN
409  WRITE(mycomputationalnodenumber,*) &
410  & ' y. c.simplex(2)*c.simplex, no modify, standard node based.'
411  END IF
412  ELSE IF(j==3) THEN
413  IF(maxnodesperelement==4) THEN
414  WRITE(mycomputationalnodenumber,*) &
415  & ' z. l.Lagrange*l.Lagrange, no modify, standard node based.'
416  ELSE IF(maxnodesperelement==9) THEN
417  WRITE(mycomputationalnodenumber,*) &
418  & ' z. q.Lagrange*q.Lagrange, no modify, standard node based.'
419  ELSE IF(maxnodesperelement==16) THEN
420  WRITE(mycomputationalnodenumber,*) &
421  & ' z. c.Lagrange*c.Lagrange, no modify, standard node based.'
422  ELSE IF(maxnodesperelement==3) THEN
423  WRITE(mycomputationalnodenumber,*) &
424  & ' z. l.simplex(2)*l.simplex, no modify, standard node based.'
425  ELSE IF(maxnodesperelement==6) THEN
426  WRITE(mycomputationalnodenumber,*) &
427  & ' z. q.simplex(2)*q.simplex, no modify, standard node based.'
428  ELSE IF(maxnodesperelement==10) THEN
429  WRITE(mycomputationalnodenumber,*) &
430  & ' z. c.simplex(2)*c.simplex, no modify, standard node based.'
431  END IF
432  END IF
433  ELSE
434  IF(maxnodesperelement==4) THEN
435  WRITE(mycomputationalnodenumber,*) &
436  & ' ',j,'. l.Lagrange*l.Lagrange, no modify, standard node based.'
437  ELSE IF(maxnodesperelement==9) THEN
438  WRITE(mycomputationalnodenumber,*) &
439  & ' ',j,'. q.Lagrange*q.Lagrange, no modify, standard node based.'
440  ELSE IF(maxnodesperelement==16) THEN
441  WRITE(mycomputationalnodenumber,*) &
442  & ' ',j,'. c.Lagrange*c.Lagrange, no modify, standard node based.'
443  ELSE IF(maxnodesperelement==3) THEN
444  WRITE(mycomputationalnodenumber,*) &
445  & ' ',j,'. l.simplex(2)*l.simplex, no modify, standard node based.'
446  ELSE IF(maxnodesperelement==6) THEN
447  WRITE(mycomputationalnodenumber,*) &
448  & ' ',j,'. q.simplex(2)*q.simplex, no modify, standard node based.'
449  ELSE IF(maxnodesperelement==10) THEN
450  WRITE(mycomputationalnodenumber,*) &
451  & ' ',j,'. c.simplex(2)*c.simplex, no modify, standard node based.'
452  END IF
453  END IF
454  ELSE IF(numberofdimensions==3) THEN
455  IF(i==1)THEN
456  IF(j==1) THEN
457  IF(maxnodesperelement==8) THEN
458  WRITE(mycomputationalnodenumber,*) &
459  & ' x. l.Lagrange*l.Lagrange*l.Lagrange, no modify, standard node based.'
460  ELSE IF(maxnodesperelement==27) THEN
461  WRITE(mycomputationalnodenumber,*) &
462  & ' x. q.Lagrange*q.Lagrange*q.Lagrange, no modify, standard node based.'
463  ELSE IF(maxnodesperelement==64) THEN
464  WRITE(mycomputationalnodenumber,*) &
465  & ' x. c.Lagrange*c.Lagrange*c.Lagrange, no modify, standard node based.'
466  ELSE IF(maxnodesperelement==4) THEN
467  WRITE(mycomputationalnodenumber,*) &
468  & ' x. l.simplex(2;3)*l.simplex*l.simplex, no modify, standard node based.'
469  ELSE IF(maxnodesperelement==10) THEN
470  WRITE(mycomputationalnodenumber,*) &
471  & ' x. q.simplex(2;3)*q.simplex*q.simplex, no modify, standard node based.'
472  ELSE IF(maxnodesperelement==20) THEN
473  WRITE(mycomputationalnodenumber,*) &
474  & ' x. c.simplex(2;3)*c.simplex*c.simplex, no modify, standard node based.'
475  END IF
476  ELSE IF(j==2) THEN
477  IF(maxnodesperelement==8) THEN
478  WRITE(mycomputationalnodenumber,*) &
479  & ' y. l.Lagrange*l.Lagrange*l.Lagrange, no modify, standard node based.'
480  ELSE IF(maxnodesperelement==27) THEN
481  WRITE(mycomputationalnodenumber,*) &
482  & ' y. q.Lagrange*q.Lagrange*q.Lagrange, no modify, standard node based.'
483  ELSE IF(maxnodesperelement==64) THEN
484  WRITE(mycomputationalnodenumber,*) &
485  & ' y. c.Lagrange*c.Lagrange*c.Lagrange, no modify, standard node based.'
486  ELSE IF(maxnodesperelement==4) THEN
487  WRITE(mycomputationalnodenumber,*) &
488  & ' y. l.simplex(2;3)*l.simplex*l.simplex, no modify, standard node based.'
489  ELSE IF(maxnodesperelement==10) THEN
490  WRITE(mycomputationalnodenumber,*) &
491  & ' y. q.simplex(2;3)*q.simplex*q.simplex, no modify, standard node based.'
492  ELSE IF(maxnodesperelement==20) THEN
493  WRITE(mycomputationalnodenumber,*) &
494  & ' y. c.simplex(2;3)*c.simplex*c.simplex, no modify, standard node based.'
495  END IF
496  ELSE IF(j==3) THEN
497  IF(maxnodesperelement==8) THEN
498  WRITE(mycomputationalnodenumber,*) &
499  & ' z. l.Lagrange*l.Lagrange*l.Lagrange, no modify, standard node based.'
500  ELSE IF(maxnodesperelement==27) THEN
501  WRITE(mycomputationalnodenumber,*) &
502  & ' z. q.Lagrange*q.Lagrange*q.Lagrange, no modify, standard node based.'
503  ELSE IF(maxnodesperelement==64) THEN
504  WRITE(mycomputationalnodenumber,*) &
505  & ' z. c.Lagrange*c.Lagrange*c.Lagrange, no modify, standard node based.'
506  ELSE IF(maxnodesperelement==4) THEN
507  WRITE(mycomputationalnodenumber,*) &
508  & ' z. l.simplex(2;3)*l.simplex*l.simplex, no modify, standard node based.'
509  ELSE IF(maxnodesperelement==10) THEN
510  WRITE(mycomputationalnodenumber,*) &
511  & ' z. q.simplex(2;3)*q.simplex*q.simplex, no modify, standard node based.'
512  ELSE IF(maxnodesperelement==20) THEN
513  WRITE(mycomputationalnodenumber,*) &
514  & ' z. c.simplex(2;3)*c.simplex*c.simplex, no modify, standard node based.'
515  END IF
516  END IF
517  ELSE
518  IF(maxnodesperelement==8) THEN
519  WRITE(mycomputationalnodenumber,*) &
520  & ' ',j,'. l.Lagrange*l.Lagrange*l.Lagrange, no modify, standard node based.'
521  ELSE IF(maxnodesperelement==27) THEN
522  WRITE(mycomputationalnodenumber,*) &
523  & ' ',j,'. q.Lagrange*q.Lagrange*q.Lagrange, no modify, standard node based.'
524  ELSE IF(maxnodesperelement==64) THEN
525  WRITE(mycomputationalnodenumber,*) &
526  & ' ',j,'. c.Lagrange*c.Lagrange*c.Lagrange, no modify, standard node based.'
527  ELSE IF(maxnodesperelement==4) THEN
528  WRITE(mycomputationalnodenumber,*) &
529  & ' ',j,'. l.simplex(2;3)*l.simplex*l.simplex, no modify, standard node based.'
530  ELSE IF(maxnodesperelement==10) THEN
531  WRITE(mycomputationalnodenumber,*) &
532  & ' ',j,'. q.simplex(2;3)*q.simplex*q.simplex, no modify, standard node based.'
533  ELSE IF(maxnodesperelement==20) THEN
534  WRITE(mycomputationalnodenumber,*) &
535  & ' ',j,'. c.simplex(2;3)*c.simplex*c.simplex, no modify, standard node based.'
536  END IF
537  END IF
538  END IF
539  WRITE(intg_string,'(I0)') maxnodesperelement
540  WRITE(mycomputationalnodenumber,*) ' #Nodes= ',trim(intg_string)
541 
542  DO k = 1,maxnodesperelement
543  WRITE(intg_string,'(I0)') k
544  WRITE(mycomputationalnodenumber,*) ' ',trim(intg_string),'. #Values=1'
545  WRITE(mycomputationalnodenumber,*) ' Value indices: 1'
546  WRITE(mycomputationalnodenumber,*) ' Scale factor indices: ',trim(intg_string)
547  END DO
548  END DO !J loop
549  END DO !I loop
550  IF(.NOT.ALLOCATED(elementnodes)) ALLOCATE(elementnodes(numberofelements,maxnodesperelement))
551  IF(.NOT.ALLOCATED(elementnodesscales)) ALLOCATE(elementnodesscales(numberofelements,maxnodesperelement))
552  DO i=1,numberofelements
553  element_global_number=computational_domain%DECOMPOSITION%TOPOLOGY%ELEMENTS%ELEMENTS(k)%GLOBAL_NUMBER
554  DO j=1,maxnodesperelement
555  node_local_number=computational_domain%TOPOLOGY%ELEMENTS%ELEMENTS(i)%ELEMENT_NODES(j)
556  node_global_number=computational_domain%MAPPINGS%NODES%LOCAL_TO_GLOBAL_MAP(node_local_number)
557  elementnodes(i,j)=node_global_number
558  elementnodesscales(i,j)=1.0000000000000000e+00
559  END DO
560  END DO
561 
562 
563  DO k=1,numberofelements
564  element_global_number=computational_domain%DECOMPOSITION%TOPOLOGY%ELEMENTS%ELEMENTS(k)%GLOBAL_NUMBER
565  IF (basistype==1) THEN
566  WRITE(intg_string,'(I0)') element_global_number
567  WRITE(mycomputationalnodenumber,*) 'Element: ', trim(intg_string),' 0 0'
568  WRITE(mycomputationalnodenumber,*) ' Nodes:'
569  WRITE(mycomputationalnodenumber,*) ' ', elementnodes(k,1:maxnodesperelement)
570  WRITE(mycomputationalnodenumber,*) ' Scale factors:'
571  WRITE(mycomputationalnodenumber,*) ' ',elementnodesscales(k,1:maxnodesperelement)
572 
573  ELSEIF(basistype==2) THEN
574  IF(.NOT.ALLOCATED(simplexoutputhelp)) ALLOCATE(simplexoutputhelp(maxnodesperelement))
575  IF(numberofdimensions==2)THEN
576  simplexoutputhelp(1)=elementnodes(k,1)
577  simplexoutputhelp(2)=elementnodes(k,2)
578  simplexoutputhelp(3)=elementnodes(k,3)
579  ELSE IF(numberofdimensions==3) THEN
580  simplexoutputhelp(1)=elementnodes(k,1)
581  simplexoutputhelp(2)=elementnodes(k,4)
582  simplexoutputhelp(3)=elementnodes(k,2)
583  simplexoutputhelp(4)=elementnodes(k,3)
584  END IF
585  WRITE(intg_string,'(I0)') element_global_number
586  WRITE(mycomputationalnodenumber,*) 'Element: ', trim(intg_string),' 0 0'
587  WRITE(mycomputationalnodenumber,*) ' Nodes:'
588  WRITE(mycomputationalnodenumber,*) ' ', simplexoutputhelp
589  WRITE(mycomputationalnodenumber,*) ' Scale factors:'
590  WRITE(mycomputationalnodenumber,*) ' ',elementnodesscales(k,1:maxnodesperelement)
591  END IF
592  ENDDO
593  CLOSE(mycomputationalnodenumber)
594 
595  exits("REACTION_DIFFUSION_IO_WRITE_CMGUI")
596  RETURN
597 999 errorsexits("REACTION_DIFFUSION_IO_WRITE_CMGUI",err,error)
598  RETURN 1
599 
600  END SUBROUTINE reaction_diffusion_io_write_cmgui
601 
602  !================================================================================================================================
603  !
604 
605 
subroutine, public enters(NAME, ERR, ERROR,)
Records the entry into the named procedure and initialises the error code.
Contains information for a region.
Definition: types.f90:3252
Contains information on an equations set.
Definition: types.f90:1941
Contains information for a field defined on a region.
Definition: types.f90:1346
subroutine, public exits(NAME)
Records the exit out of the named procedure.
This module contains all type definitions in order to avoid cyclic module references.
Definition: types.f90:70
Temporary IO routines for fluid mechanics.
Write a string to a given output stream.
This module contains all the low-level base routines e.g., all debug, control, and low-level communic...
integer(intg), parameter, public general_output_type
General output type.
This module contains all computational environment variables.
integer(intg), parameter equations_set_classical_field_class
integer(intg), parameter equations_set_reaction_diffusion_equation_type
A pointer to the domain decomposition for this domain.
Definition: types.f90:938
This module defines all constants shared across equations set routines.
integer(intg), parameter equations_set_constant_reac_diff_subtype
integer(intg) function, public computational_node_number_get(ERR, ERROR)
Returns the number/rank of the computational nodes.
This module contains all kind definitions.
Definition: kinds.f90:45
This module handles all formating and input and output.