PageRenderTime 53ms CodeModel.GetById 15ms app.highlight 34ms RepoModel.GetById 1ms app.codeStats 0ms

/FiniteElasticity/Membrane/MembraneExtension2DSpace/src/MembraneExtension2DSpaceExample.f90

http://github.com/xyan075/examples
FORTRAN Modern | 409 lines | 253 code | 68 blank | 88 comment | 0 complexity | ac4e071c49113dc7bcedc14350f0a184 MD5 | raw file
  1!> \file
  2!> \author Chris Bradley
  3!> \brief This is an example program to solve a finite elasticity membrane 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): Alice Hung, Jessica Jor
 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 FiniteElasticity/Membrane/MembraneExtension2DSpace/src/MembraneExtension2DSpaceExample.f90
 43!! Example program to solve a finite elasticity membrane equation using openCMISS calls.
 44!! \par Latest Builds:
 45!! \li <a href='http://autotest.bioeng.auckland.ac.nz/opencmiss-build/logs_x86_64-linux/FiniteElasticity/UniAxialExtension/build-intel'>Linux Intel Build</a>
 46!! \li <a href='http://autotest.bioeng.auckland.ac.nz/opencmiss-build/logs_x86_64-linux/FiniteElasticity/UniAxialExtension/build-gnu'>Linux GNU Build</a>
 47!<
 48
 49!> Main program
 50PROGRAM MEMBRANEEXTENSION2DSPACE
 51
 52  USE OPENCMISS
 53  USE MPI
 54
 55#ifdef WIN32
 56  USE IFQWIN
 57#endif
 58
 59  IMPLICIT NONE
 60
 61  INTEGER(CMISSIntg), PARAMETER :: EquationsSetFieldUserNumber=1337
 62  TYPE(CMISSFieldType) :: EquationsSetField
 63
 64
 65  !Test program parameters
 66
 67  REAL(CMISSDP), PARAMETER :: HEIGHT=1.0_CMISSDP
 68  REAL(CMISSDP), PARAMETER :: WIDTH=1.0_CMISSDP
 69  REAL(CMISSDP), PARAMETER :: LENGTH=1.0_CMISSDP
 70
 71  INTEGER(CMISSIntg), PARAMETER :: CoordinateSystemUserNumber=1
 72  INTEGER(CMISSIntg), PARAMETER :: NumberOfSpatialCoordinates=2
 73  INTEGER(CMISSIntg), PARAMETER :: RegionUserNumber=1
 74  INTEGER(CMISSIntg), PARAMETER :: BasisUserNumber=1
 75  INTEGER(CMISSIntg), PARAMETER :: MeshUserNumber=1
 76  INTEGER(CMISSIntg), PARAMETER :: DecompositionUserNumber=1
 77
 78  INTEGER(CMISSIntg), PARAMETER :: NumberOfXiCoordinates=2
 79  INTEGER(CMISSIntg), PARAMETER :: TotalNumberOfNodes=4
 80  INTEGER(CMISSIntg), PARAMETER :: NumberOfMeshDimensions=2
 81  INTEGER(CMISSIntg), PARAMETER :: NumberOfMeshComponents=1
 82  INTEGER(CMISSIntg), PARAMETER :: TotalNumberOfElements=1
 83  INTEGER(CMISSIntg), PARAMETER :: MeshComponentNumber=1
 84
 85  INTEGER(CMISSIntg), PARAMETER :: FieldGeometryUserNumber=1
 86  INTEGER(CMISSIntg), PARAMETER :: FieldGeometryNumberOfVariables=1
 87  INTEGER(CMISSIntg), PARAMETER :: FieldGeometryNumberOfComponents=2
 88
 89  INTEGER(CMISSIntg), PARAMETER :: FieldFibreUserNumber=2
 90  INTEGER(CMISSIntg), PARAMETER :: FieldFibreNumberOfVariables=1
 91  ! Should only need 1 component (i.e. 1 angle), the second component is redundant but is required for consistency
 92  INTEGER(CMISSIntg), PARAMETER :: FieldFibreNumberOfComponents=2
 93
 94  !Component 1, 2 are Mooney-Rivlin constants.  Component 3 is membrane thickness.
 95  INTEGER(CMISSIntg), PARAMETER :: FieldMaterialUserNumber=3
 96  INTEGER(CMISSIntg), PARAMETER :: FieldMaterialNumberOfVariables=1
 97  INTEGER(CMISSIntg), PARAMETER :: FieldMaterialNumberOfComponents=2
 98
 99  INTEGER(CMISSIntg), PARAMETER :: FieldDependentUserNumber=4
100  INTEGER(CMISSIntg), PARAMETER :: FieldDependentNumberOfVariables=2
101  INTEGER(CMISSIntg), PARAMETER :: FieldDependentNumberOfComponents=2
102
103  INTEGER(CMISSIntg), PARAMETER :: EquationSetUserNumber=1
104  INTEGER(CMISSIntg), PARAMETER :: ProblemUserNumber=1
105
106  !Program types
107
108
109  !Program variables
110
111  INTEGER(CMISSIntg) :: NumberGlobalXElements,NumberGlobalYElements,NumberGlobalZElements
112  INTEGER(CMISSIntg) :: MPI_IERROR
113  INTEGER(CMISSIntg) :: EquationsSetIndex
114  INTEGER(CMISSIntg) :: NumberOfComputationalNodes,NumberOfDomains,ComputationalNodeNumber
115
116  !CMISS variables
117
118  TYPE(CMISSBasisType) :: Basis
119  TYPE(CMISSBoundaryConditionsType) :: BoundaryConditions
120  TYPE(CMISSCoordinateSystemType) :: CoordinateSystem, WorldCoordinateSystem
121  TYPE(CMISSMeshType) :: Mesh
122  TYPE(CMISSDecompositionType) :: Decomposition
123  TYPE(CMISSEquationsType) :: Equations
124  TYPE(CMISSEquationsSetType) :: EquationsSet
125  TYPE(CMISSFieldType) :: GeometricField,FibreField,MaterialField,DependentField
126  TYPE(CMISSFieldsType) :: Fields
127  TYPE(CMISSProblemType) :: Problem
128  TYPE(CMISSRegionType) :: Region,WorldRegion
129  TYPE(CMISSSolverType) :: Solver
130  TYPE(CMISSSolverEquationsType) :: SolverEquations
131  TYPE(CMISSNodesType) :: Nodes
132  TYPE(CMISSMeshElementsType) :: Elements
133
134  !REAL(CMISSDP), POINTER :: FieldData(:)
135
136#ifdef WIN32
137  !Quickwin type
138  LOGICAL :: QUICKWIN_STATUS=.FALSE.
139  TYPE(WINDOWCONFIG) :: QUICKWIN_WINDOW_CONFIG
140#endif
141
142  !Generic CMISS variables
143  INTEGER(CMISSIntg) :: Err
144
145#ifdef WIN32
146  !Initialise QuickWin
147  QUICKWIN_WINDOW_CONFIG%TITLE="General Output" !Window title
148  QUICKWIN_WINDOW_CONFIG%NUMTEXTROWS=-1 !Max possible number of rows
149  QUICKWIN_WINDOW_CONFIG%MODE=QWIN$SCROLLDOWN
150  !Set the window parameters
151  QUICKWIN_STATUS=SETWINDOWCONFIG(QUICKWIN_WINDOW_CONFIG)
152  !If attempt fails set with system estimated values
153  IF(.NOT.QUICKWIN_STATUS) QUICKWIN_STATUS=SETWINDOWCONFIG(QUICKWIN_WINDOW_CONFIG)
154#endif
155
156  !Intialise cmiss
157  CALL CMISSInitialise(WorldCoordinateSystem,WorldRegion,Err)
158
159  CALL CMISSErrorHandlingModeSet(CMISS_ERRORS_TRAP_ERROR,Err)
160
161  WRITE(*,'(A)') "Program starting."
162
163  !Set all diganostic levels on for testing
164  CALL CMISSDiagnosticsSetOn(CMISS_FROM_DIAG_TYPE,(/1,2,3,4,5/),"Diagnostics",(/"PROBLEM_FINITE_ELEMENT_CALCULATE"/),Err)
165
166  !Get the number of computational nodes and this computational node number
167  CALL CMISSComputationalNumberOfNodesGet(NumberOfComputationalNodes,Err)
168  CALL CMISSComputationalNodeNumberGet(ComputationalNodeNumber,Err)
169
170  NumberGlobalXElements=1
171  NumberGlobalYElements=1
172  NumberGlobalZElements=1
173  NumberOfDomains=1
174
175  !Broadcast the number of elements in the X,Y and Z directions and the number of partitions to the other computational nodes
176  CALL MPI_BCAST(NumberGlobalXElements,1,MPI_INTEGER,0,MPI_COMM_WORLD,MPI_IERROR)
177  CALL MPI_BCAST(NumberGlobalYElements,1,MPI_INTEGER,0,MPI_COMM_WORLD,MPI_IERROR)
178  CALL MPI_BCAST(NumberGlobalZElements,1,MPI_INTEGER,0,MPI_COMM_WORLD,MPI_IERROR)
179  CALL MPI_BCAST(NumberOfDomains,1,MPI_INTEGER,0,MPI_COMM_WORLD,MPI_IERROR)
180
181  !Create a CS - default is 3D rectangular cartesian CS with 0,0,0 as origin
182  CALL CMISSCoordinateSystem_Initialise(CoordinateSystem,Err)
183  CALL CMISSCoordinateSystem_CreateStart(CoordinateSystemUserNumber,CoordinateSystem,Err)
184  CALL CMISSCoordinateSystem_TypeSet(CoordinateSystem,CMISS_COORDINATE_RECTANGULAR_CARTESIAN_TYPE,Err)
185  CALL CMISSCoordinateSystem_DimensionSet(CoordinateSystem,NumberOfSpatialCoordinates,Err)
186  CALL CMISSCoordinateSystem_OriginSet(CoordinateSystem,(/0.0_CMISSDP,0.0_CMISSDP,0.0_CMISSDP/),Err)
187  CALL CMISSCoordinateSystem_CreateFinish(CoordinateSystem,Err)
188
189  !Create a region and assign the CS to the region
190  CALL CMISSRegion_Initialise(Region,Err)
191  CALL CMISSRegion_CreateStart(RegionUserNumber,WorldRegion,Region,Err)
192  CALL CMISSRegion_CoordinateSystemSet(Region,CoordinateSystem,Err)
193  CALL CMISSRegion_CreateFinish(Region,Err)
194
195  !Define basis function - tri-linear Lagrange
196  CALL CMISSBasis_Initialise(Basis,Err)
197  CALL CMISSBasis_CreateStart(BasisUserNumber,Basis,Err)
198  CALL CMISSBasis_TypeSet(Basis,CMISS_BASIS_LAGRANGE_HERMITE_TP_TYPE,Err)
199  CALL CMISSBasis_NumberOfXiSet(Basis,NumberOfXiCoordinates,Err)
200  CALL CMISSBasis_InterpolationXiSet(Basis,(/CMISS_BASIS_LINEAR_LAGRANGE_INTERPOLATION, &
201    &  CMISS_BASIS_LINEAR_LAGRANGE_INTERPOLATION/),Err)
202  CALL CMISSBasis_QuadratureNumberOfGaussXiSet(Basis, (/CMISS_BASIS_MID_QUADRATURE_SCHEME,CMISS_BASIS_MID_QUADRATURE_SCHEME/),Err)
203  CALL CMISSBasis_CreateFinish(Basis,Err)
204
205  !Create a mesh
206  CALL CMISSMesh_Initialise(Mesh,Err)
207  CALL CMISSMesh_CreateStart(MeshUserNumber,Region,NumberOfMeshDimensions,Mesh,Err)
208  CALL CMISSMesh_NumberOfComponentsSet(Mesh,NumberOfMeshComponents,Err)
209  CALL CMISSMesh_NumberOfElementsSet(Mesh,TotalNumberOfElements,Err)
210
211  !Define nodes for the mesh
212  CALL CMISSNodes_Initialise(Nodes,Err)
213  CALL CMISSNodes_CreateStart(Region,TotalNumberOfNodes,Nodes,Err)
214  CALL CMISSNodes_CreateFinish(Nodes,Err)
215
216  CALL CMISSMeshElements_Initialise(Elements,Err)
217  CALL CMISSMeshElements_CreateStart(Mesh,MeshComponentNumber,Basis,Elements,Err)
218  CALL CMISSMeshElements_NodesSet(Elements,1,(/1,2,3,4/),Err)
219  CALL CMISSMeshElements_CreateFinish(Elements,Err)
220
221  CALL CMISSMesh_CreateFinish(Mesh,Err)
222
223  !Create a decomposition
224  CALL CMISSDecomposition_Initialise(Decomposition,Err)
225  CALL CMISSDecomposition_CreateStart(DecompositionUserNumber,Mesh,Decomposition,Err)
226  CALL CMISSDecomposition_TypeSet(Decomposition,CMISS_DECOMPOSITION_CALCULATED_TYPE,Err)
227  CALL CMISSDecomposition_NumberOfDomainsSet(Decomposition,NumberOfDomains,Err)
228  CALL CMISSDecomposition_CreateFinish(Decomposition,Err)
229
230  !Create a field to put the geometry (defualt is geometry)
231  CALL CMISSField_Initialise(GeometricField,Err)
232  CALL CMISSField_CreateStart(FieldGeometryUserNumber,Region,GeometricField,Err)
233  CALL CMISSField_MeshDecompositionSet(GeometricField,Decomposition,Err)
234  CALL CMISSField_TypeSet(GeometricField,CMISS_FIELD_GEOMETRIC_TYPE,Err)
235  CALL CMISSField_NumberOfVariablesSet(GeometricField,FieldGeometryNumberOfVariables,Err)
236  CALL CMISSField_NumberOfComponentsSet(GeometricField,CMISS_FIELD_U_VARIABLE_TYPE,FieldGeometryNumberOfComponents,Err)
237  CALL CMISSField_ComponentMeshComponentSet(GeometricField,CMISS_FIELD_U_VARIABLE_TYPE,1,MeshComponentNumber,Err)
238  CALL CMISSField_ComponentMeshComponentSet(GeometricField,CMISS_FIELD_U_VARIABLE_TYPE,2,MeshComponentNumber,Err)
239  CALL CMISSField_CreateFinish(GeometricField,Err)
240
241  !node 1
242  CALL CMISSField_ParameterSetUpdateNode(GeometricField,CMISS_FIELD_U_VARIABLE_TYPE,CMISS_FIELD_VALUES_SET_TYPE,1,1,1,1, &
243    & 0.4_CMISSDP,Err)
244  CALL CMISSField_ParameterSetUpdateNode(GeometricField,CMISS_FIELD_U_VARIABLE_TYPE,CMISS_FIELD_VALUES_SET_TYPE,1,1,1,2, &
245    & 0.0_CMISSDP,Err)
246  !node 2
247  CALL CMISSField_ParameterSetUpdateNode(GeometricField,CMISS_FIELD_U_VARIABLE_TYPE,CMISS_FIELD_VALUES_SET_TYPE,1,1,2,1, &
248    & 2.1_CMISSDP,Err)
249  CALL CMISSField_ParameterSetUpdateNode(GeometricField,CMISS_FIELD_U_VARIABLE_TYPE,CMISS_FIELD_VALUES_SET_TYPE,1,1,2,2, &
250    & 0.8_CMISSDP,Err)
251  !node 3
252  CALL CMISSField_ParameterSetUpdateNode(GeometricField,CMISS_FIELD_U_VARIABLE_TYPE,CMISS_FIELD_VALUES_SET_TYPE,1,1,3,1, &
253    & 0.5_CMISSDP,Err)
254  CALL CMISSField_ParameterSetUpdateNode(GeometricField,CMISS_FIELD_U_VARIABLE_TYPE,CMISS_FIELD_VALUES_SET_TYPE,1,1,3,2, &
255    & 1.3_CMISSDP,Err)
256  !node 4
257  CALL CMISSField_ParameterSetUpdateNode(GeometricField,CMISS_FIELD_U_VARIABLE_TYPE,CMISS_FIELD_VALUES_SET_TYPE,1,1,4,1, &
258    & 2.0_CMISSDP,Err)
259  CALL CMISSField_ParameterSetUpdateNode(GeometricField,CMISS_FIELD_U_VARIABLE_TYPE,CMISS_FIELD_VALUES_SET_TYPE,1,1,4,2, &
260    & 1.8_CMISSDP,Err)
261
262  !Create a fibre field and attach it to the geometric field
263  CALL CMISSField_Initialise(FibreField,Err)
264  CALL CMISSField_CreateStart(FieldFibreUserNumber,Region,FibreField,Err)
265  CALL CMISSField_TypeSet(FibreField,CMISS_FIELD_FIBRE_TYPE,Err)
266  CALL CMISSField_MeshDecompositionSet(FibreField,Decomposition,Err)
267  CALL CMISSField_GeometricFieldSet(FibreField,GeometricField,Err)
268  CALL CMISSField_NumberOfVariablesSet(FibreField,FieldFibreNumberOfVariables,Err)
269  CALL CMISSField_NumberOfComponentsSet(FibreField,CMISS_FIELD_U_VARIABLE_TYPE,FieldFibreNumberOfComponents,Err)
270  CALL CMISSField_ComponentMeshComponentSet(FibreField,CMISS_FIELD_U_VARIABLE_TYPE,1,MeshComponentNumber,Err)
271  CALL CMISSField_ComponentMeshComponentSet(FibreField,CMISS_FIELD_U_VARIABLE_TYPE,2,MeshComponentNumber,Err)
272  CALL CMISSField_VariableLabelSet(FibreField,CMISS_FIELD_U_VARIABLE_TYPE,"Fibre",Err)
273  CALL CMISSField_CreateFinish(FibreField,Err)
274
275  !Create a material field and attach it to the geometric field
276  CALL CMISSField_Initialise(MaterialField,Err)
277  CALL CMISSField_CreateStart(FieldMaterialUserNumber,Region,MaterialField,Err)
278  CALL CMISSField_TypeSet(MaterialField,CMISS_FIELD_MATERIAL_TYPE,Err)
279  CALL CMISSField_MeshDecompositionSet(MaterialField,Decomposition,Err)
280  CALL CMISSField_GeometricFieldSet(MaterialField,GeometricField,Err)
281  CALL CMISSField_NumberOfVariablesSet(MaterialField,FieldMaterialNumberOfVariables,Err)
282  CALL CMISSField_NumberOfComponentsSet(MaterialField,CMISS_FIELD_U_VARIABLE_TYPE,FieldMaterialNumberOfComponents,Err)
283  CALL CMISSField_ComponentMeshComponentSet(MaterialField,CMISS_FIELD_U_VARIABLE_TYPE,1,MeshComponentNumber,Err)
284  CALL CMISSField_ComponentMeshComponentSet(MaterialField,CMISS_FIELD_U_VARIABLE_TYPE,2,MeshComponentNumber,Err)
285  CALL CMISSField_VariableLabelSet(MaterialField,CMISS_FIELD_U_VARIABLE_TYPE,"Material",Err)
286  CALL CMISSField_CreateFinish(MaterialField,Err)
287
288  !Set Mooney-Rivlin constants c10 and c01 to 2.0 and 3.0 respectively.
289  CALL CMISSField_ComponentValuesInitialise(MaterialField,CMISS_FIELD_U_VARIABLE_TYPE,CMISS_FIELD_VALUES_SET_TYPE,1,2.0_CMISSDP,Err)
290  CALL CMISSField_ComponentValuesInitialise(MaterialField,CMISS_FIELD_U_VARIABLE_TYPE,CMISS_FIELD_VALUES_SET_TYPE,2,3.0_CMISSDP,Err)
291
292  !Create a dependent field
293  CALL CMISSField_Initialise(DependentField,Err)
294  CALL CMISSField_CreateStart(FieldDependentUserNumber,Region,DependentField,Err)
295  CALL CMISSField_TypeSet(DependentField,CMISS_FIELD_GENERAL_TYPE,Err)
296  CALL CMISSField_MeshDecompositionSet(DependentField,Decomposition,Err)
297  CALL CMISSField_GeometricFieldSet(DependentField,GeometricField,Err)
298  CALL CMISSField_DependentTypeSet(DependentField,CMISS_FIELD_DEPENDENT_TYPE,Err)
299  CALL CMISSField_NumberOfVariablesSet(DependentField,FieldDependentNumberOfVariables,Err)
300  CALL CMISSField_NumberOfComponentsSet(DependentField,CMISS_FIELD_U_VARIABLE_TYPE,FieldDependentNumberOfComponents,Err)
301  CALL CMISSField_NumberOfComponentsSet(DependentField,CMISS_FIELD_DELUDELN_VARIABLE_TYPE,FieldDependentNumberOfComponents,Err)
302  CALL CMISSField_ComponentMeshComponentSet(DependentField,CMISS_FIELD_U_VARIABLE_TYPE,1,MeshComponentNumber,Err)
303  CALL CMISSField_ComponentMeshComponentSet(DependentField,CMISS_FIELD_U_VARIABLE_TYPE,2,MeshComponentNumber,Err)
304  CALL CMISSField_ComponentMeshComponentSet(DependentField,CMISS_FIELD_DELUDELN_VARIABLE_TYPE,1,MeshComponentNumber,Err)
305  CALL CMISSField_ComponentMeshComponentSet(DependentField,CMISS_FIELD_DELUDELN_VARIABLE_TYPE,2,MeshComponentNumber,Err)
306  CALL CMISSField_VariableLabelSet(DependentField,CMISS_FIELD_U_VARIABLE_TYPE,"Dependent",Err)
307  CALL CMISSField_CreateFinish(DependentField,Err)
308
309  !Create the equations_set
310  CALL CMISSField_Initialise(EquationsSetField,Err)
311  CALL CMISSEquationsSet_CreateStart(EquationSetUserNumber,Region,FibreField,CMISS_EQUATIONS_SET_ELASTICITY_CLASS, &
312    & CMISS_EQUATIONS_SET_FINITE_ELASTICITY_TYPE,CMISS_EQUATIONS_SET_MEMBRANE_SUBTYPE,EquationsSetFieldUserNumber, &
313      & EquationsSetField, &
314    & EquationsSet,Err)
315  
316  CALL CMISSEquationsSet_CreateFinish(EquationsSet,Err)
317
318  CALL CMISSEquationsSet_DependentCreateStart(EquationsSet,FieldDependentUserNumber,DependentField,Err)
319  CALL CMISSEquationsSet_DependentCreateFinish(EquationsSet,Err)
320
321  CALL CMISSEquationsSet_MaterialsCreateStart(EquationsSet,FieldMaterialUserNumber,MaterialField,Err)
322  CALL CMISSEquationsSet_MaterialsCreateFinish(EquationsSet,Err)
323
324  !Create the equations set equations
325  CALL CMISSEquations_Initialise(Equations,Err)
326  CALL CMISSEquationsSet_EquationsCreateStart(EquationsSet,Equations,Err)
327  CALL CMISSEquations_SparsityTypeSet(Equations,CMISS_EQUATIONS_SPARSE_MATRICES,Err)
328  CALL CMISSEquations_OutputTypeSet(Equations,CMISS_EQUATIONS_NO_OUTPUT,Err)
329  CALL CMISSEquationsSet_EquationsCreateFinish(EquationsSet,Err)
330
331  !Initialise dependent field from undeformed geometry and displacement bcs
332  CALL CMISSField_ParametersToFieldParametersComponentCopy(GeometricField,CMISS_FIELD_U_VARIABLE_TYPE,CMISS_FIELD_VALUES_SET_TYPE, &
333    & 1,DependentField,CMISS_FIELD_U_VARIABLE_TYPE,CMISS_FIELD_VALUES_SET_TYPE,1,Err)
334  CALL CMISSField_ParametersToFieldParametersComponentCopy(GeometricField,CMISS_FIELD_U_VARIABLE_TYPE,CMISS_FIELD_VALUES_SET_TYPE, &
335    & 2,DependentField,CMISS_FIELD_U_VARIABLE_TYPE,CMISS_FIELD_VALUES_SET_TYPE,2,Err)
336
337  !Define the problem
338  CALL CMISSProblem_Initialise(Problem,Err)
339  CALL CMISSProblem_CreateStart(ProblemUserNumber,Problem,Err)
340  CALL CMISSProblem_SpecificationSet(Problem,CMISS_PROBLEM_ELASTICITY_CLASS,CMISS_PROBLEM_FINITE_ELASTICITY_TYPE, &
341    & CMISS_PROBLEM_NO_SUBTYPE,Err)
342  CALL CMISSProblem_CreateFinish(Problem,Err)
343
344  !Create the problem control loop
345  CALL CMISSProblem_ControlLoopCreateStart(Problem,Err)
346  CALL CMISSProblem_ControlLoopCreateFinish(Problem,Err)
347
348  !Create the problem solvers
349  CALL CMISSSolver_Initialise(Solver,Err)
350  CALL CMISSProblem_SolversCreateStart(Problem,Err)
351  CALL CMISSProblem_SolverGet(Problem,CMISS_CONTROL_LOOP_NODE,1,Solver,Err)
352  CALL CMISSSolver_OutputTypeSet(Solver,CMISS_SOLVER_PROGRESS_OUTPUT,Err)
353  CALL CMISSSolver_NewtonJacobianCalculationTypeSet(Solver,CMISS_SOLVER_NEWTON_JACOBIAN_FD_CALCULATED,Err)
354  CALL CMISSProblem_SolversCreateFinish(Problem,Err)
355
356  !Create the problem solver equations
357  CALL CMISSSolver_Initialise(Solver,Err)
358  CALL CMISSSolverEquations_Initialise(SolverEquations,Err)
359  CALL CMISSProblem_SolverEquationsCreateStart(Problem,Err)
360  CALL CMISSProblem_SolverGet(Problem,CMISS_CONTROL_LOOP_NODE,1,Solver,Err)
361  CALL CMISSSolver_SolverEquationsGet(Solver,SolverEquations,Err)
362  CALL CMISSSolverEquations_SparsityTypeSet(SolverEquations,CMISS_SOLVER_SPARSE_MATRICES,Err)
363  CALL CMISSSolverEquations_EquationsSetAdd(SolverEquations,EquationsSet,EquationsSetIndex,Err)
364  CALL CMISSProblem_SolverEquationsCreateFinish(Problem,Err)
365
366  !Prescribe boundary conditions (absolute nodal parameters)
367  CALL CMISSBoundaryConditions_Initialise(BoundaryConditions,Err)
368  CALL CMISSSolverEquations_BoundaryConditionsCreateStart(SolverEquations,BoundaryConditions,Err)
369
370  CALL CMISSBoundaryConditions_SetNode(BoundaryConditions,DependentField,CMISS_FIELD_U_VARIABLE_TYPE,1,1,1,1, &
371    & CMISS_BOUNDARY_CONDITION_FIXED, &
372    & 0.4_CMISSDP,Err)
373  CALL CMISSBoundaryConditions_SetNode(BoundaryConditions,DependentField,CMISS_FIELD_U_VARIABLE_TYPE,1,1,2,1, &
374    & CMISS_BOUNDARY_CONDITION_FIXED, &
375    & 2.3_CMISSDP,Err)
376  CALL CMISSBoundaryConditions_SetNode(BoundaryConditions,DependentField,CMISS_FIELD_U_VARIABLE_TYPE,1,1,3,1, &
377    & CMISS_BOUNDARY_CONDITION_FIXED, &
378    & 0.5_CMISSDP,Err)
379  CALL CMISSBoundaryConditions_SetNode(BoundaryConditions,DependentField,CMISS_FIELD_U_VARIABLE_TYPE,1,1,4,1, &
380    & CMISS_BOUNDARY_CONDITION_FIXED, &
381    & 2.1_CMISSDP,Err)
382
383  CALL CMISSBoundaryConditions_SetNode(BoundaryConditions,DependentField,CMISS_FIELD_U_VARIABLE_TYPE,1,1,1,2, &
384    & CMISS_BOUNDARY_CONDITION_FIXED, &
385    & 0.0_CMISSDP,Err)
386  CALL CMISSBoundaryConditions_SetNode(BoundaryConditions,DependentField,CMISS_FIELD_U_VARIABLE_TYPE,1,1,3,2, &
387    & CMISS_BOUNDARY_CONDITION_FIXED, &
388    & 1.3_CMISSDP,Err)
389
390  CALL CMISSSolverEquations_BoundaryConditionsCreateFinish(SolverEquations,Err)
391
392  !Solve problem
393  CALL CMISSProblem_Solve(Problem,Err)
394
395  !Output solution
396  CALL CMISSFields_Initialise(Fields,Err)
397  CALL CMISSFields_Create(Region,Fields,Err)
398  CALL CMISSFields_NodesExport(Fields,"MembraneExtension2DSpace","FORTRAN",Err)
399  CALL CMISSFields_ElementsExport(Fields,"MembraneExtension2DSpace","FORTRAN",Err)
400  CALL CMISSFields_Finalise(Fields,Err)
401
402  CALL CMISSFinalise(Err)
403
404  WRITE(*,'(A)') "Program successfully completed."
405
406  STOP
407
408END PROGRAM MEMBRANEEXTENSION2DSPACE
409