OpenCMISS-Iron Internal API Documentation
fieldml_util_routines.f90
Go to the documentation of this file.
1 
43 
45 
47 
48  USE base_routines
49  USE basis_routines
50  USE constants
52  USE field_routines
53  USE fieldml_api
54  USE fieldml_types
56  USE kinds
57  USE lists
58  USE region_routines
59  USE strings
60  USE types
61 
62 #include "macros.h"
63 
64  IMPLICIT NONE
65 
66  PRIVATE
67 
68  !Interfaces
69 
74 
76 
77 CONTAINS
78 
79  !
80  !================================================================================================================================
81  !
82 
83  SUBROUTINE fieldmlutil_checkfieldmlsessionerrorvs( ERROR_DESCRIPTION, FML_HANDLE, ERR, ERROR, * )
84  TYPE(varying_string), INTENT(IN) :: ERROR_DESCRIPTION
85  INTEGER(INTG), INTENT(IN) :: FML_HANDLE
86  INTEGER(INTG), INTENT(OUT) :: ERR
87  TYPE(varying_string), INTENT(OUT) :: ERROR
88 
89  INTEGER(INTG) :: FML_ERR
90 
91  enters( "FieldMLUtil_CheckFieldMLSessionErrorVS", err, error, *999 )
92  fml_err = fieldml_getlasterror( fml_handle )
93 
94  IF( fml_err == fml_err_no_error ) THEN
95  exits( "FieldMLUtil_CheckFieldMLSessionErrorVS" )
96  RETURN
97  ENDIF
98 
99  CALL flagerror( error_description // " (error number " // trim(number_to_vstring(fml_err,"*",err,error)) // ")", &
100  & err, error, *999 )
101 
102 999 errorsexits( "FieldMLUtil_CheckFieldMLSessionErrorVS", err, error )
103  RETURN 1
104 
106 
107  !
108  !================================================================================================================================
109  !
110 
111  SUBROUTINE fieldml_util_check_fieldml_session_errorc( ERROR_DESCRIPTION, FML_HANDLE, ERR, ERROR, * )
112  CHARACTER(LEN=*), INTENT(IN) :: ERROR_DESCRIPTION
113  INTEGER(INTG), INTENT(IN) :: FML_HANDLE
114  INTEGER(INTG), INTENT(OUT) :: ERR
115  TYPE(varying_string), INTENT(OUT) :: ERROR
116 
117  INTEGER(INTG) :: FML_ERR
118 
119  enters( "FIELDML_UTIL_CHECK_FIELDML_SESSION_ERRORC", err, error, *999 )
120  fml_err = fieldml_getlasterror( fml_handle )
121 
122  IF( fml_err == fml_err_no_error ) THEN
123  exits( "FIELDML_UTIL_CHECK_FIELDML_SESSION_ERRORC" )
124  RETURN
125  ENDIF
126 
127  CALL flagerror( error_description // " (error number " // trim(number_to_vstring(fml_err,"*",err,error)) // ")", &
128  & err, error, *999 )
129 
130 999 errorsexits( "FIELDML_UTIL_CHECK_FIELDML_SESSION_ERRORC", err, error )
131  RETURN 1
132 
134 
135  !
136  !================================================================================================================================
137  !
138 
139 
140  SUBROUTINE fieldml_io_initialise( FIELDML_INFO, IS_OUT, ERR, ERROR, * )
141  !Argument variables
142  TYPE(fieldml_io_type), POINTER :: FIELDML_INFO
143  LOGICAL, INTENT(IN) :: IS_OUT
144  INTEGER(INTG), INTENT(OUT) :: ERR
145  TYPE(varying_string), INTENT(OUT) :: ERROR
146  !Local Variables
147  INTEGER(INTG) :: DUMMY_ERR
148  TYPE(varying_string) :: DUMMY_ERROR
149 
150  enters( "FIELDML_IO_INITIALISE", err, error, *998 )
151 
152  IF(ASSOCIATED(fieldml_info)) THEN
153  CALL flagerror("FieldML info is already associated",err,error,*998)
154  ENDIF
155 
156  ALLOCATE(fieldml_info, stat = err)
157  IF(err /= 0) THEN
158  CALL flagerror("Could not allocate FieldML info",err,error,*998)
159  ENDIF
160 
161  fieldml_info%IS_OUT = is_out
162  fieldml_info%FML_HANDLE = fml_invalid_handle
163  fieldml_info%NODES_HANDLE = fml_invalid_handle
164  fieldml_info%MESH_HANDLE = fml_invalid_handle
165  fieldml_info%ELEMENTS_HANDLE = fml_invalid_handle
166  fieldml_info%XI_HANDLE = fml_invalid_handle
167  fieldml_info%NODE_DOFS_HANDLE = fml_invalid_handle
168  !fieldmlInfo%elementDofsHandle = FML_INVALID_HANDLE
169  !fieldmlInfo%constantDofsHandle = FML_INVALID_HANDLE
170  NULLIFY( fieldml_info%COMPONENT_HANDLES )
171  NULLIFY( fieldml_info%BASIS_HANDLES )
172  NULLIFY( fieldml_info%BASIS_CONNECTIVITY_HANDLES )
173  NULLIFY( fieldml_info%BASIS_LAYOUT_HANDLES )
174 
175  CALL list_create_start( fieldml_info%COMPONENT_HANDLES, err, error, *999 )
176  CALL list_data_type_set( fieldml_info%COMPONENT_HANDLES, list_intg_type, err, error, *999 )
177  CALL list_mutable_set( fieldml_info%COMPONENT_HANDLES, .true., err, error, *999 )
178  CALL list_create_finish( fieldml_info%COMPONENT_HANDLES, err, error, *999 )
179 
180  CALL list_create_start( fieldml_info%BASIS_HANDLES, err, error, *999 )
181  CALL list_data_type_set( fieldml_info%BASIS_HANDLES, list_intg_type, err, error, *999 )
182  CALL list_create_finish( fieldml_info%BASIS_HANDLES, err, error, *999 )
183 
184  CALL list_create_start( fieldml_info%BASIS_CONNECTIVITY_HANDLES, err, error, *999 )
185  CALL list_data_type_set( fieldml_info%BASIS_CONNECTIVITY_HANDLES, list_intg_type, err, error, *999 )
186  CALL list_create_finish( fieldml_info%BASIS_CONNECTIVITY_HANDLES, err, error, *999 )
187 
188  CALL list_create_start( fieldml_info%BASIS_LAYOUT_HANDLES, err, error, *999 )
189  CALL list_data_type_set( fieldml_info%BASIS_LAYOUT_HANDLES, list_intg_type, err, error, *999 )
190  CALL list_create_finish( fieldml_info%BASIS_LAYOUT_HANDLES, err, error, *999 )
191 
192  exits( "FIELDML_IO_INITIALISE" )
193  RETURN
194 
195 999 CALL fieldml_io_finalise(fieldml_info, dummy_err, dummy_error, *998)
196 998 errorsexits( "FIELDML_IO_INITIALISE", err, error )
197  RETURN 1
198 
199  END SUBROUTINE fieldml_io_initialise
200 
201  !
202  !================================================================================================================================
203  !
204 
205 
206  SUBROUTINE fieldml_io_finalise( FIELDML_INFO, ERR, ERROR, * )
207  !Argument variables
208  TYPE(fieldml_io_type), POINTER :: FIELDML_INFO
209  INTEGER(INTG), INTENT(OUT) :: ERR
210  TYPE(varying_string), INTENT(OUT) :: ERROR
211 
212  !Locals
213  INTEGER(INTG) :: FML_ERR
214 
215  enters( "FIELDML_IO_FINALISE", err, error, *999 )
216 
217  IF(ASSOCIATED(fieldml_info)) THEN
218  fml_err = fieldml_destroy( fieldml_info%FML_HANDLE )
219  CALL list_destroy( fieldml_info%COMPONENT_HANDLES, err, error, *999 )
220  CALL list_destroy( fieldml_info%BASIS_HANDLES, err, error, *999 )
221  CALL list_destroy( fieldml_info%BASIS_CONNECTIVITY_HANDLES, err, error, *999 )
222  CALL list_destroy( fieldml_info%BASIS_LAYOUT_HANDLES, err, error, *999 )
223  DEALLOCATE(fieldml_info)
224  ENDIF
225 
226  exits( "FIELDML_IO_FINALISE" )
227  RETURN
228 999 errorsexits( "FIELDML_IO_FINALISE", err, error )
229  RETURN 1
230 
231  END SUBROUTINE fieldml_io_finalise
232 
233  !
234  !================================================================================================================================
235  !
236 
237 END MODULE fieldml_util_routines
This module contains all basis function routines.
subroutine, public enters(NAME, ERR, ERROR,)
Records the entry into the named procedure and initialises the error code.
This module contains all coordinate transformation and support routines.
Converts a number to its equivalent varying string representation.
Definition: strings.f90:161
subroutine, public fieldml_io_finalise(FIELDML_INFO, ERR, ERROR,)
This module contains all region routines.
subroutine fieldml_util_check_fieldml_session_errorc(ERROR_DESCRIPTION, FML_HANDLE, ERR, ERROR,)
Contains information on the current FieldML parsing state.
This module contains all string manipulation and transformation routines.
Definition: strings.f90:45
Utility routines for FieldML.
integer(intg), parameter, public list_intg_type
Integer data type for a list.
Definition: lists.f90:67
This module provides an iso_varying_string module, conformant to the API specified in ISO/IEC 1539-2:...
subroutine fieldmlutil_checkfieldmlsessionerrorvs(ERROR_DESCRIPTION, FML_HANDLE, ERR, ERROR,)
This module contains all program wide constants.
Definition: constants.f90:45
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
This module contains all the low-level base routines e.g., all debug, control, and low-level communic...
subroutine, public list_create_finish(LIST, ERR, ERROR,)
Finishes the creation of a list created with LIST_CREATE_START.
Definition: lists.f90:419
Types for FieldML.
subroutine, public fieldml_io_initialise(FIELDML_INFO, IS_OUT, ERR, ERROR,)
subroutine, public list_mutable_set(LIST, MUTABLE, ERR, ERROR,)
Sets/changes the data dimension for a list.
Definition: lists.f90:548
subroutine, public list_create_start(LIST, ERR, ERROR,)
Starts the creation of a list and returns a pointer to the created list.
Definition: lists.f90:486
Implements lists of base types.
Definition: lists.f90:46
subroutine, public list_data_type_set(LIST, DATA_TYPE, ERR, ERROR,)
Sets/changes the data type for a list.
Definition: lists.f90:579
subroutine, public list_destroy(LIST, ERR, ERROR,)
Destroys a list.
Definition: lists.f90:622
Flags an error condition.
This module contains all kind definitions.
Definition: kinds.f90:45