PageRenderTime 46ms CodeModel.GetById 16ms app.highlight 26ms RepoModel.GetById 1ms app.codeStats 0ms

/ClassicalField/Diffusion/DiffusionConstantSource/src/DiffusionConstantSourceExample.f90

http://github.com/xyan075/examples
FORTRAN Modern | 398 lines | 186 code | 69 blank | 143 comment | 0 complexity | fb20d79f0c50f6f46fd90f11906906f0 MD5 | raw file
  1!> \file
  2!> \author Chris Bradley
  3!> \brief This is an example program to solve a diffusion equation using openCMISS calls.
  4!>
  5!> \section LICENSE
  6!>
  7!> Version: MPL 1.1/GPL 2.0/LGPL 2.1
  8!>
  9!> The contents of this file are subject to the Mozilla Public License
 10!> Version 1.1 (the "License"); you may not use this file except in
 11!> compliance with the License. You may obtain a copy of the License at
 12!> http://www.mozilla.org/MPL/
 13!>
 14!> Software distributed under the License is distributed on an "AS IS"
 15!> basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
 16!> License for the specific language governing rights and limitations
 17!> under the License.
 18!>
 19!> The Original Code is openCMISS
 20!>
 21!> The Initial Developer of the Original Code is University of Auckland,
 22!> Auckland, New Zealand and University of Oxford, Oxford, United
 23!> Kingdom. Portions created by the University of Auckland and University
 24!> of Oxford are Copyright (C) 2007 by the University of Auckland and
 25!> the University of Oxford. All Rights Reserved.
 26!>
 27!> Contributor(s):
 28!>
 29!> Alternatively, the contents of this file may be used under the terms of
 30!> either the GNU General Public License Version 2 or later (the "GPL"), or
 31!> the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 32!> in which case the provisions of the GPL or the LGPL are applicable instead
 33!> of those above. If you wish to allow use of your version of this file only
 34!> under the terms of either the GPL or the LGPL, and not to allow others to
 35!> use your version of this file under the terms of the MPL, indicate your
 36!> decision by deleting the provisions above and replace them with the notice
 37!> and other provisions required by the GPL or the LGPL. If you do not delete
 38!> the provisions above, a recipient may use your version of this file under
 39!> the terms of any one of the MPL, the GPL or the LGPL.
 40!>
 41
 42!> \example ClassicalField/Diffusion/DiffusionConstantSource/src/DiffusionConstantSourceExample.f90
 43!! Example program to solve a diffusion equation using openCMISS calls.
 44!! \htmlinclude ClassicalField/Diffusion/DiffusionConstantSource/history.html
 45!<
 46
 47!> Main program
 48PROGRAM DIFFUSIONCONSTANTSOURCEEXAMPLE
 49
 50
 51
 52  USE OPENCMISS
 53  USE MPI
 54
 55
 56#ifdef WIN32
 57  USE IFQWIN
 58#endif
 59
 60  IMPLICIT NONE
 61
 62  INTEGER(CMISSIntg), PARAMETER :: EquationsSetFieldUserNumber=1337
 63  TYPE(CMISSFieldType) :: EquationsSetField
 64
 65
 66  !Test program parameters
 67
 68  REAL(CMISSDP), PARAMETER :: HEIGHT=1.0_CMISSDP
 69  REAL(CMISSDP), PARAMETER :: WIDTH=1.0_CMISSDP
 70  REAL(CMISSDP), PARAMETER :: LENGTH=1.0_CMISSDP
 71  
 72  INTEGER(CMISSIntg), PARAMETER :: CoordinateSystemUserNumber=1
 73  INTEGER(CMISSIntg), PARAMETER :: RegionUserNumber=2
 74  INTEGER(CMISSIntg), PARAMETER :: BasisUserNumber=3
 75  INTEGER(CMISSIntg), PARAMETER :: GeneratedMeshUserNumber=4
 76  INTEGER(CMISSIntg), PARAMETER :: MeshUserNumber=5
 77  INTEGER(CMISSIntg), PARAMETER :: DecompositionUserNumber=6
 78  INTEGER(CMISSIntg), PARAMETER :: GeometricFieldUserNumber=7
 79  INTEGER(CMISSIntg), PARAMETER :: DependentFieldUserNumber=8
 80  INTEGER(CMISSIntg), PARAMETER :: MaterialsFieldUserNumber=9
 81  INTEGER(CMISSIntg), PARAMETER :: EquationsSetUserNumber=10
 82  INTEGER(CMISSIntg), PARAMETER :: ProblemUserNumber=11
 83  INTEGER(CMISSIntg), PARAMETER :: ControlLoopNode=0
 84  INTEGER(CMISSIntg), PARAMETER :: SourceFieldUserNumber=12
 85  INTEGER(CMISSIntg), PARAMETER :: AnalyticFieldUserNumber=13
 86
 87  !Program types
 88  
 89  !Program variables
 90
 91  INTEGER(CMISSIntg) :: NUMBER_GLOBAL_X_ELEMENTS,NUMBER_GLOBAL_Y_ELEMENTS,NUMBER_GLOBAL_Z_ELEMENTS
 92  INTEGER(CMISSIntg) :: NUMBER_OF_DOMAINS
 93  
 94  INTEGER(CMISSIntg) :: MPI_IERROR
 95  
 96    !CMISS variables
 97
 98  TYPE(CMISSBasisType) :: Basis
 99  TYPE(CMISSBoundaryConditionsType) :: BoundaryConditions
100  TYPE(CMISSCoordinateSystemType) :: CoordinateSystem,WorldCoordinateSystem
101  TYPE(CMISSDecompositionType) :: Decomposition
102  TYPE(CMISSEquationsType) :: Equations
103  TYPE(CMISSEquationsSetType) :: EquationsSet
104  TYPE(CMISSFieldType) :: GeometricField,DependentField,MaterialsField,SourceField,AnalyticField
105  TYPE(CMISSFieldsType) :: Fields
106  TYPE(CMISSGeneratedMeshType) :: GeneratedMesh  
107  TYPE(CMISSMeshType) :: Mesh
108  TYPE(CMISSProblemType) :: Problem
109  TYPE(CMISSControlLoopType) :: ControlLoop
110  TYPE(CMISSRegionType) :: Region,WorldRegion
111  TYPE(CMISSSolverType) :: Solver, LinearSolver
112  TYPE(CMISSSolverEquationsType) :: SolverEquations
113
114  LOGICAL :: EXPORT_FIELD,IMPORT_FIELD
115 
116
117#ifdef WIN32
118  !Quickwin type
119  LOGICAL :: QUICKWIN_STATUS=.FALSE.
120  TYPE(WINDOWCONFIG) :: QUICKWIN_WINDOW_CONFIG
121#endif
122  
123  !Generic CMISS variables
124  
125  INTEGER(CMISSIntg) :: EquationsSetIndex
126  INTEGER(CMISSIntg) :: FirstNodeNumber,LastNodeNumber
127  INTEGER(CMISSIntg) :: Err
128  
129#ifdef WIN32
130  !Initialise QuickWin
131  QUICKWIN_WINDOW_CONFIG%TITLE="General Output" !Window title
132  QUICKWIN_WINDOW_CONFIG%NUMTEXTROWS=-1 !Max possible number of rows
133  QUICKWIN_WINDOW_CONFIG%MODE=QWIN$SCROLLDOWN
134  !Set the window parameters
135  QUICKWIN_STATUS=SETWINDOWCONFIG(QUICKWIN_WINDOW_CONFIG)
136  !If attempt fails set with system estimated values
137  IF(.NOT.QUICKWIN_STATUS) QUICKWIN_STATUS=SETWINDOWCONFIG(QUICKWIN_WINDOW_CONFIG)
138#endif
139
140  !Intialise OpenCMISS
141  CALL CMISSInitialise(WorldCoordinateSystem,WorldRegion,Err)
142
143  CALL CMISSErrorHandlingModeSet(CMISS_ERRORS_TRAP_ERROR,Err)
144
145  NUMBER_GLOBAL_X_ELEMENTS=10
146  NUMBER_GLOBAL_Y_ELEMENTS=10
147  NUMBER_GLOBAL_Z_ELEMENTS=10
148  NUMBER_OF_DOMAINS=1
149
150
151  CALL MPI_BCAST(NUMBER_GLOBAL_X_ELEMENTS,1,MPI_INTEGER,0,MPI_COMM_WORLD,MPI_IERROR)
152  CALL MPI_BCAST(NUMBER_GLOBAL_Y_ELEMENTS,1,MPI_INTEGER,0,MPI_COMM_WORLD,MPI_IERROR)
153  CALL MPI_BCAST(NUMBER_GLOBAL_Z_ELEMENTS,1,MPI_INTEGER,0,MPI_COMM_WORLD,MPI_IERROR)
154  CALL MPI_BCAST(NUMBER_OF_DOMAINS,1,MPI_INTEGER,0,MPI_COMM_WORLD,MPI_IERROR)
155
156    !Start the creation of a new RC coordinate system
157    CALL CMISSCoordinateSystem_Initialise(CoordinateSystem,Err)
158    CALL CMISSCoordinateSystem_CreateStart(CoordinateSystemUserNumber,CoordinateSystem,Err)
159    IF(NUMBER_GLOBAL_Z_ELEMENTS==0) THEN
160      !Set the coordinate system to be 2D
161      CALL CMISSCoordinateSystem_DimensionSet(CoordinateSystem,2,Err)
162    ELSE
163      !Set the coordinate system to be 3D
164      CALL CMISSCoordinateSystem_DimensionSet(CoordinateSystem,3,Err)
165    ENDIF
166    !Finish the creation of the coordinate system
167    CALL CMISSCoordinateSystem_CreateFinish(CoordinateSystem,Err)
168
169
170    !Start the creation of the region
171    CALL CMISSRegion_Initialise(Region,Err)
172    CALL CMISSRegion_CreateStart(RegionUserNumber,WorldRegion,Region,Err)
173    !Set the regions coordinate system to the 2D RC coordinate system that we have created
174    CALL CMISSRegion_CoordinateSystemSet(Region,CoordinateSystem,Err)
175    !Finish the creation of the region
176    CALL CMISSRegion_CreateFinish(Region,Err)
177
178    !Start the creation of a basis (default is trilinear lagrange)
179    CALL CMISSBasis_Initialise(Basis,Err)
180    CALL CMISSBasis_CreateStart(BasisUserNumber,Basis,Err)
181    IF(NUMBER_GLOBAL_Z_ELEMENTS==0) THEN
182      !Set the basis to be a bilinear Lagrange basis
183      CALL CMISSBasis_NumberOfXiSet(Basis,2,Err)
184    ELSE
185      !Set the basis to be a trilinear Lagrange basis
186      CALL CMISSBasis_NumberOfXiSet(Basis,3,Err)
187    ENDIF
188    !Finish the creation of the basis
189    CALL CMISSBasis_CreateFinish(BASIS,Err)
190
191    !Start the creation of a generated mesh in the region
192    CALL CMISSGeneratedMesh_Initialise(GeneratedMesh,Err)
193    CALL CMISSGeneratedMesh_CreateStart(GeneratedMeshUserNumber,Region,GeneratedMesh,Err)
194    !Set up a regular x*y*z mesh
195    CALL CMISSGeneratedMesh_TypeSet(GeneratedMesh,CMISS_GENERATED_MESH_REGULAR_MESH_TYPE,Err)
196    !Set the default basis
197    CALL CMISSGeneratedMesh_BasisSet(GeneratedMesh,Basis,Err)   
198    !Define the mesh on the region
199    IF(NUMBER_GLOBAL_Z_ELEMENTS==0) THEN
200      CALL CMISSGeneratedMesh_ExtentSet(GeneratedMesh,(/WIDTH,HEIGHT/),Err)
201      CALL CMISSGeneratedMesh_NumberOfElementsSet(GeneratedMesh,(/NUMBER_GLOBAL_X_ELEMENTS,NUMBER_GLOBAL_Y_ELEMENTS/),Err)
202    ELSE
203      CALL CMISSGeneratedMesh_ExtentSet(GeneratedMesh,(/WIDTH,HEIGHT,LENGTH/),Err)
204      CALL CMISSGeneratedMesh_NumberOfElementsSet(GeneratedMesh,(/NUMBER_GLOBAL_X_ELEMENTS,NUMBER_GLOBAL_Y_ELEMENTS, &
205        & NUMBER_GLOBAL_Z_ELEMENTS/),Err)
206    ENDIF    
207    !Finish the creation of a generated mesh in the region
208    CALL CMISSMesh_Initialise(Mesh,Err)
209    CALL CMISSGeneratedMesh_CreateFinish(GeneratedMesh,MeshUserNumber,Mesh,Err)
210
211    !Create a decomposition
212    CALL CMISSDecomposition_Initialise(Decomposition,Err)
213    CALL CMISSDecomposition_CreateStart(DecompositionUserNumber,Mesh,Decomposition,Err)
214    !Set the decomposition to be a general decomposition with the specified number of domains
215    CALL CMISSDecomposition_TypeSet(Decomposition,CMISS_DECOMPOSITION_CALCULATED_TYPE,Err)
216    CALL CMISSDecomposition_NumberOfDomainsSet(Decomposition,NUMBER_OF_DOMAINS,Err)
217    !Finish the decomposition
218    CALL CMISSDecomposition_CreateFinish(Decomposition,Err)
219
220  !Start to create a default (geometric) field on the region
221  CALL CMISSField_Initialise(GeometricField,Err)
222  CALL CMISSField_CreateStart(GeometricFieldUserNumber,Region,GeometricField,Err)
223  !Set the decomposition to use
224  CALL CMISSField_MeshDecompositionSet(GeometricField,Decomposition,Err)
225  !Set the domain to be used by the field components.
226  CALL CMISSField_ComponentMeshComponentSet(GeometricField,CMISS_FIELD_U_VARIABLE_TYPE,1,1,Err)
227  CALL CMISSField_ComponentMeshComponentSet(GeometricField,CMISS_FIELD_U_VARIABLE_TYPE,2,1,Err)
228  IF(NUMBER_GLOBAL_Z_ELEMENTS/=0) THEN
229    CALL CMISSField_ComponentMeshComponentSet(GeometricField,CMISS_FIELD_U_VARIABLE_TYPE,3,1,Err)
230  ENDIF
231  !Finish creating the field
232  CALL CMISSField_CreateFinish(GeometricField,Err)
233
234       
235    !Update the geometric field parameters
236    CALL CMISSGeneratedMesh_GeometricParametersCalculate(GeneratedMesh,GeometricField,Err)
237!  ENDIF
238
239  !IF(.NOT.ASSOCIATED(GEOMETRIC_FIELD)) GEOMETRIC_FIELD=>REGION%FIELDS%FIELDS(1)%PTR
240  
241  !Create the equations_set
242  CALL CMISSEquationsSet_Initialise(EquationsSet,Err)
243    CALL CMISSField_Initialise(EquationsSetField,Err)
244CALL CMISSEquationsSet_CreateStart(EquationsSetUserNumber,Region,GeometricField,CMISS_EQUATIONS_SET_CLASSICAL_FIELD_CLASS, &
245    & CMISS_EQUATIONS_SET_DIFFUSION_EQUATION_TYPE,CMISS_EQUATIONS_SET_CONSTANT_SOURCE_DIFFUSION_SUBTYPE, &
246      & EquationsSetFieldUserNumber, &
247    & EquationsSetField,EquationsSet,Err)
248  !Set the equations set to be a standard Laplace problem
249  
250  !Finish creating the equations set
251  CALL CMISSEquationsSet_CreateFinish(EquationsSet,Err)
252
253  !Create the equations set dependent field variables
254  CALL CMISSField_Initialise(DependentField,Err)
255  CALL CMISSEquationsSet_DependentCreateStart(EquationsSet,DependentFieldUserNumber,DependentField,Err)
256  !Finish the equations set dependent field variables
257  CALL CMISSEquationsSet_DependentCreateFinish(EquationsSet,Err)
258
259  !Create the equations set material field variables
260  CALL CMISSField_Initialise(MaterialsField,Err)
261  CALL CMISSEquationsSet_MaterialsCreateStart(EquationsSet,MaterialsFieldUserNumber,MaterialsField,Err)
262  !Finish the equations set dependent field variables
263  CALL CMISSEquationsSet_MaterialsCreateFinish(EquationsSet,Err)
264
265  !Create the equations set source field variables
266  CALL CMISSField_Initialise(SourceField,Err)
267  CALL CMISSEquationsSet_SourceCreateStart(EquationsSet,SourceFieldUserNumber,SourceField,Err)
268  !Finish the equations set dependent field variables
269  CALL CMISSEquationsSet_SourceCreateFinish(EquationsSet,Err)
270
271  !Create the equations set analytic field variables
272  CALL CMISSField_Initialise(AnalyticField,Err)
273  CALL CMISSEquationsSet_AnalyticCreateStart(EquationsSet,CMISS_EQUATIONS_SET_DIFFUSION_EQUATION_THREE_DIM_1, &
274    & AnalyticFieldUserNumber, &
275    & AnalyticField,Err)
276  !Finish the equations set analytic field variables
277  CALL CMISSEquationsSet_AnalyticCreateFinish(EquationsSet,Err)
278
279  !Create the equations set equations
280  CALL CMISSEquations_Initialise(Equations,Err)
281  CALL CMISSEquationsSet_EquationsCreateStart(EquationsSet,Equations,Err)
282  !Set the equations matrices sparsity type
283  CALL CMISSEquations_SparsityTypeSet(Equations,CMISS_EQUATIONS_SPARSE_MATRICES,Err)
284  !Set the equations set output
285  CALL CMISSEquations_OutputTypeSet(Equations,CMISS_EQUATIONS_NO_OUTPUT,Err)
286  !CALL CMISSEquations_OutputTypeSet(Equations,CMISS_EQUATIONS_TIMING_OUTPUT,Err)
287  !CALL CMISSEquations_OutputTypeSet(Equations,CMISS_EQUATIONS_MATRIX_OUTPUT,Err)
288  !CALL CMISSEquations_OutputTypeSet(Equations,CMISS_EQUATIONS_ELEMENT_MATRIX_OUTPUT,Err)
289  !Finish the equations set equations
290  CALL CMISSEquationsSet_EquationsCreateFinish(EquationsSet,Err)
291  
292  !Create the equations set boundary conditions
293!   CALL CMISSBoundaryConditions_Initialise(BoundaryConditions,Err)
294!   CALL CMISSEquationsSetBoundaryConditionsCreateStart(EquationsSet,BoundaryConditions,Err)
295!   !Set the first node to 0.0 and the last node to 1.0
296! !   FirstNodeNumber=1
297! !   IF(NUMBER_GLOBAL_Z_ELEMENTS==0) THEN
298! !     LastNodeNumber=(NUMBER_GLOBAL_X_ELEMENTS+1)*(NUMBER_GLOBAL_Y_ELEMENTS+1)
299! !   ELSE
300! !     LastNodeNumber=(NUMBER_GLOBAL_X_ELEMENTS+1)*(NUMBER_GLOBAL_Y_ELEMENTS+1)*(NUMBER_GLOBAL_Z_ELEMENTS+1)
301! !   ENDIF
302! !   CALL CMISSBoundaryConditions_SetNode(BoundaryConditions,CMISS_FIELD_U_VARIABLE_TYPE,1,FirstNodeNumber,1, &
303! !     & CMISS_BOUNDARY_CONDITION_FIXED,0.0_CMISSDP,Err)
304! !   CALL CMISSBoundaryConditions_SetNode(BoundaryConditions,CMISS_FIELD_DELUDELN_VARIABLE_TYPE,1,LastNodeNumber,1, &
305! !     & CMISS_BOUNDARY_CONDITION_FIXED,1.0_CMISSDP,Err)
306!   !Finish the creation of the equations set boundary conditions
307!   CALL CMISSEquationsSetBoundaryConditionsCreateFinish(EquationsSet,Err)
308
309
310
311
312  !Create the problem
313  CALL CMISSProblem_Initialise(Problem,Err)
314  CALL CMISSProblem_CreateStart(ProblemUserNumber,Problem,Err)
315  !Set the problem to be a linear source Diffusion problem
316  CALL CMISSProblem_SpecificationSet(Problem,CMISS_PROBLEM_CLASSICAL_FIELD_CLASS,CMISS_PROBLEM_DIFFUSION_EQUATION_TYPE, &
317    & CMISS_PROBLEM_LINEAR_SOURCE_DIFFUSION_SUBTYPE,Err)
318  !Finish the creation of a problem.
319  CALL CMISSProblem_CreateFinish(Problem,Err)
320
321
322  !Create the problem control
323  CALL CMISSProblem_ControlLoopCreateStart(Problem,Err)
324  CALL CMISSControlLoop_Initialise(ControlLoop,Err)
325  !Get the control loop
326  CALL CMISSProblem_ControlLoopGet(Problem,ControlLoopNode,ControlLoop,Err)
327  !Set the times
328  CALL CMISSControlLoop_TimesSet(ControlLoop,0.0_CMISSDP,1.0001_CMISSDP,0.01_CMISSDP,Err)
329  !Finish creating the problem control loop
330  CALL CMISSProblem_ControlLoopCreateFinish(Problem,Err)
331
332
333  !Start the creation of the problem solvers
334!  
335! !   !For the Direct Solver MUMPS, uncomment the below two lines and comment out the above five
336! !   CALL SOLVER_LINEAR_TYPE_SET(LINEAR_SOLVER,SOLVER_LINEAR_DIRECT_SOLVE_TYPE,ERR,ERROR,*999)
337! !   CALL SOLVER_LINEAR_DIRECT_TYPE_SET(LINEAR_SOLVER,SOLVER_DIRECT_MUMPS,ERR,ERROR,*999) 
338! 
339
340  CALL CMISSSolver_Initialise(Solver,Err)
341  CALL CMISSSolver_Initialise(LinearSolver,Err)
342  CALL CMISSProblem_SolversCreateStart(Problem,Err)
343  CALL CMISSProblem_SolverGet(Problem,CMISS_CONTROL_LOOP_NODE,1,Solver,Err)
344  !CALL CMISSSolver_OutputTypeSet(Solver,CMISS_SOLVER_NO_OUTPUT,Err)
345  !CALL CMISSSolver_OutputTypeSet(Solver,CMISS_SOLVER_PROGRESS_OUTPUT,Err)
346  !CALL CMISSSolver_OutputTypeSet(Solver,CMISS_SOLVER_TIMING_OUTPUT,Err)
347  !CALL CMISSSolver_OutputTypeSet(Solver,CMISS_SOLVER_MATRIX_OUTPUT,Err)
348  CALL CMISSSolver_OutputTypeSet(Solver,CMISS_SOLVER_PROGRESS_OUTPUT,Err)
349  CALL CMISSSolver_DynamicLinearSolverGet(Solver,LinearSolver,Err)
350  CALL CMISSSolver_LinearIterativeMaximumIterationsSet(LinearSolver,10000,Err)
351  !Finish the creation of the problem solver
352  CALL CMISSProblem_SolversCreateFinish(Problem,Err)
353
354
355  !Create the problem solver equations
356  CALL CMISSSolver_Initialise(Solver,Err)
357  CALL CMISSSolverEquations_Initialise(SolverEquations,Err)
358  CALL CMISSProblem_SolverEquationsCreateStart(Problem,Err)
359  !Get the solve equations
360  CALL CMISSProblem_SolverGet(Problem,CMISS_CONTROL_LOOP_NODE,1,Solver,Err)
361  CALL CMISSSolver_SolverEquationsGet(Solver,SolverEquations,Err)
362  !Set the solver equations sparsity
363  !CALL CMISSSolverEquations_SparsityTypeSet(SolverEquations,CMISS_SOLVER_SPARSE_MATRICES,Err)
364  !CALL CMISSSolverEquations_SparsityTypeSet(SolverEquations,CMISS_SOLVER_FULL_MATRICES,Err)  
365  !Add in the equations set
366  CALL CMISSSolverEquations_EquationsSetAdd(SolverEquations,EquationsSet,EquationsSetIndex,Err)
367  !Finish the creation of the problem solver equations
368  CALL CMISSProblem_SolverEquationsCreateFinish(Problem,Err)
369
370  CALL CMISSBoundaryConditions_Initialise(BoundaryConditions,Err)
371  CALL CMISSSolverEquations_BoundaryConditionsCreateStart(SolverEquations,BoundaryConditions,Err)
372  CALL CMISSSolverEquations_BoundaryConditionsAnalytic(SolverEquations,Err)
373  CALL CMISSSolverEquations_BoundaryConditionsCreateFinish(SolverEquations,Err)
374
375  !Solve the problem
376  CALL CMISSProblem_Solve(Problem,Err)
377
378  !Output Analytic analysis
379  CALL CMISSAnalyticAnalysisOutput(DependentField,"DiffusionAnalytics_x10_y10_z10_L_T1",Err)
380
381
382  EXPORT_FIELD=.TRUE.
383  IF(EXPORT_FIELD) THEN
384    CALL CMISSFields_Initialise(Fields,Err)
385    CALL CMISSFields_Create(Region,Fields,Err)
386    CALL CMISSFields_NodesExport(Fields,"DiffusionConstantSourceAnalytic_x10_y10_z10_L_T1","FORTRAN",Err)
387    CALL CMISSFields_ElementsExport(Fields,"DiffusionConstantSourceAnalytic_x10_y10_z10_L_T1","FORTRAN",Err)
388    CALL CMISSFields_Finalise(Fields,Err)
389
390  ENDIF
391
392  !CALL CMISSFinalise(Err)
393  WRITE(*,'(A)') "Program successfully completed."
394  
395
396  STOP
397 
398END PROGRAM DIFFUSIONCONSTANTSOURCEEXAMPLE