OpenCMISS-Iron Internal API Documentation
interface_equations_routines.f90
Go to the documentation of this file.
1 
43 
46 
47  USE base_routines
49  USE field_routines
52  USE interface_matrices_routines
54  USE kinds
55  USE strings
56  USE types
57 
58 #include "macros.h"
59 
60  IMPLICIT NONE
61 
62  PRIVATE
63 
64  !Module parameters
65 
70  INTEGER(INTG), PARAMETER :: interface_equations_no_output=0
71  INTEGER(INTG), PARAMETER :: interface_equations_timing_output=1
72  INTEGER(INTG), PARAMETER :: interface_equations_matrix_output=2
73  INTEGER(INTG), PARAMETER :: interface_equations_element_matrix_output=3
75 
80  INTEGER(INTG), PARAMETER :: interface_equations_sparse_matrices=1
81  INTEGER(INTG), PARAMETER :: interface_equations_full_matrices=2
83 
84  !Module types
85 
86  !Module variables
87 
88  !Interfaces
89 
92 
94 
95  PUBLIC interface_equations_create_finish,interface_equations_create_start
96 
97  PUBLIC interface_equations_destroy
98 
99  PUBLIC interfaceequations_interfaceinterpsetsnumberset
100 
101  PUBLIC interface_equations_output_type_get,interface_equations_output_type_set
102 
103  PUBLIC interface_equations_sparsity_type_get,interface_equations_sparsity_type_set
104 
105  PUBLIC interfaceequations_variableinterpsetsnumberset
106 
107  PUBLIC interface_equations_linearity_type_get,interface_equations_linearity_type_set
108 
109  PUBLIC interfaceequations_timedependencetypeget,interfaceequationstimedependencetypeset
110 
111  PUBLIC interface_condition_equations_get
112 
113 CONTAINS
114 
115  !
116  !================================================================================================================================
117  !
118 
120  SUBROUTINE interface_equations_create_finish(INTERFACE_EQUATIONS,ERR,ERROR,*)
122  !Argument variables
123  TYPE(interface_equations_type), POINTER :: INTERFACE_EQUATIONS
124  INTEGER(INTG), INTENT(OUT) :: ERR
125  TYPE(varying_string), INTENT(OUT) :: ERROR
126  !Local Variables
127  INTEGER(INTG) :: variable_idx
128  TYPE(field_type), POINTER :: DEPENDENT_FIELD,GEOMETRIC_FIELD,LAGRANGE_FIELD,PENALTY_FIELD
129  TYPE(field_variable_type), POINTER :: DEPENDENT_VARIABLE
130  TYPE(interface_condition_type), POINTER :: INTERFACE_CONDITION
131  TYPE(interface_dependent_type), POINTER :: INTERFACE_DEPENDENT
132  TYPE(varying_string) :: LOCAL_ERROR
133 
134  enters("INTERFACE_EQUATIONS_CREATE_FINISH",err,error,*999)
135 
136  IF(ASSOCIATED(interface_equations)) THEN
137  IF(interface_equations%INTERFACE_EQUATIONS_FINISHED) THEN
138  CALL flagerror("Interface equations have already been finished.",err,error,*999)
139  ELSE
140  !Create the interpolation sets
141  interface_condition=>interface_equations%INTERFACE_CONDITION
142  IF(ASSOCIATED(interface_condition)) THEN
143  SELECT CASE(interface_condition%METHOD)
145  IF(ASSOCIATED(interface_condition%LAGRANGE)) THEN
146  interface_dependent=>interface_condition%DEPENDENT
147  IF(ASSOCIATED(interface_dependent)) THEN
148  IF(ASSOCIATED(interface_equations%INTERPOLATION)) THEN
149  geometric_field=>interface_condition%GEOMETRY%GEOMETRIC_FIELD
150  lagrange_field=>interface_condition%LAGRANGE%LAGRANGE_FIELD
151  NULLIFY(penalty_field)
152  IF(ASSOCIATED(interface_condition%PENALTY)) THEN
153  penalty_field=>interface_condition%PENALTY%PENALTY_FIELD
154  ENDIF
155  !\todo Truncating subroutine name from INTERFACE_EQUATIONS_DOMAIN_INTERFACE_INTERPOLATION_SETUP until bug in gfortran 4.6 is fixed http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46971
156  CALL interface_equations_domain_interface_interpolation_(interface_equations%INTERPOLATION% &
157  & interface_interpolation,geometric_field,lagrange_field,penalty_field,err,error,*999)
158  DO variable_idx=1,interface_dependent%NUMBER_OF_DEPENDENT_VARIABLES
159  dependent_variable=>interface_dependent%FIELD_VARIABLES(variable_idx)%PTR
160  IF(ASSOCIATED(dependent_variable)) THEN
161  dependent_field=>dependent_variable%FIELD
162  IF(ASSOCIATED(dependent_field)) THEN
163  geometric_field=>dependent_field%GEOMETRIC_FIELD
164  CALL interfaceequations_domainvariableinterpolationsetup(interface_equations%INTERPOLATION% &
165  & variable_interpolation(variable_idx),geometric_field,dependent_field,err,error,*999)
166  ELSE
167  CALL flagerror("Dependent variable field is not associated.",err,error,*999)
168  ENDIF
169  ELSE
170  local_error="Dependent variable is not associated for variable index "// &
171  & trim(number_to_vstring(variable_idx,"*",err,error))//"."
172  CALL flagerror(local_error,err,error,*999)
173  ENDIF
174  ENDDO !variable_idx
175  ELSE
176  CALL flagerror("Interface equations interpolation is not associated.",err,error,*999)
177  ENDIF
178  ELSE
179  CALL flagerror("Interface condition dependent is not associated.",err,error,*999)
180  ENDIF
181  ELSE
182  CALL flagerror("Interface condition Lagrange is not associated.",err,error,*999)
183  ENDIF
185  CALL flagerror("Not implemented.",err,error,*999)
187  CALL flagerror("Not implemented.",err,error,*999)
188  CASE DEFAULT
189  local_error="The interface condition method of "// &
190  & trim(number_to_vstring(interface_condition%METHOD,"*",err,error))// &
191  & " is invalid."
192  CALL flagerror(local_error,err,error,*999)
193  END SELECT
194  !Set the finished flag
195  interface_equations%INTERFACE_EQUATIONS_FINISHED=.true.
196  ELSE
197  CALL flagerror("Interface equations interface condition is not associated.",err,error,*999)
198  ENDIF
199  ENDIF
200  ELSE
201  CALL flagerror("Interface equations is not associated.",err,error,*999)
202  ENDIF
203 
204  exits("INTERFACE_EQUATIONS_CREATE_FINISH")
205  RETURN
206 999 errorsexits("INTERFACE_EQUATIONS_CREATE_FINISH",err,error)
207  RETURN 1
208 
209  END SUBROUTINE interface_equations_create_finish
210 
211  !
212  !================================================================================================================================
213  !
214 
216  SUBROUTINE interface_equations_create_start(INTERFACE_CONDITION,INTERFACE_EQUATIONS,ERR,ERROR,*)
218  !Argument variables
219  TYPE(interface_condition_type), POINTER :: INTERFACE_CONDITION
220  TYPE(interface_equations_type), POINTER :: INTERFACE_EQUATIONS
221  INTEGER(INTG), INTENT(OUT) :: ERR
222  TYPE(varying_string), INTENT(OUT) :: ERROR
223  !Local Variables
224 
225  enters("INTERFACE_EQUATIONS_CREATE_START",err,error,*999)
226 
227  IF(ASSOCIATED(interface_condition)) THEN
228  IF(ASSOCIATED(interface_condition%INTERFACE_EQUATIONS)) THEN
229  CALL flagerror("Interface equations are already associated for the interface condition.",err,error,*999)
230  ELSE
231  IF(ASSOCIATED(interface_equations)) THEN
232  CALL flagerror("Interface equations is already associated.",err,error,*999)
233  ELSE
234  !Initialise the equations
235  CALL interface_equations_initialise(interface_condition,err,error,*999)
236  !Return the pointer
237  interface_equations=>interface_condition%INTERFACE_EQUATIONS
238  ENDIF
239  ENDIF
240  ELSE
241  CALL flagerror("Interface condition is not associated.",err,error,*999)
242  ENDIF
243 
244  exits("INTERFACE_EQUATIONS_CREATE_START")
245  RETURN
246 999 errorsexits("INTERFACE_EQUATIONS_CREATE_START",err,error)
247  RETURN 1
248 
249  END SUBROUTINE interface_equations_create_start
250 
251  !
252  !================================================================================================================================
253  !
254 
256  SUBROUTINE interface_equations_destroy(INTERFACE_EQUATIONS,ERR,ERROR,*)
258  !Argument variables
259  TYPE(interface_equations_type), POINTER :: INTERFACE_EQUATIONS
260  INTEGER(INTG), INTENT(OUT) :: ERR
261  TYPE(varying_string), INTENT(OUT) :: ERROR
262  !Local Variables
263 
264  enters("INTERFACE_EQUATIONS_DESTROY",err,error,*999)
265 
266  IF(ASSOCIATED(interface_equations)) THEN
267  CALL interface_equations_finalise(interface_equations,err,error,*999)
268  ELSE
269  CALL flagerror("Interface equations is not associated.",err,error,*999)
270  ENDIF
271 
272  exits("INTERFACE_EQUATIONS_DESTROY")
273  RETURN
274 999 errorsexits("INTERFACE_EQUATIONS_DESTROY",err,error)
275  RETURN 1
276 
277  END SUBROUTINE interface_equations_destroy
278 
279  !
280  !================================================================================================================================
281  !
282 
284  SUBROUTINE interfaceequations_domaininterpolationfinalise(DOMAIN_INTERPOLATION,ERR,ERROR,*)
286  !Argument variables
287  TYPE(interface_equations_domain_interpolation_type) :: DOMAIN_INTERPOLATION
288  INTEGER(INTG), INTENT(OUT) :: ERR
289  TYPE(varying_string), INTENT(OUT) :: ERROR
290  !Local Variables
291  INTEGER(INTG) :: interpolation_set_idx
292 
293  enters("InterfaceEquations_DomainInterpolationFinalise",err,error,*999)
294 
295  NULLIFY(domain_interpolation%GEOMETRIC_FIELD)
296  IF(ALLOCATED(domain_interpolation%GEOMETRIC_INTERPOLATION)) THEN
297  DO interpolation_set_idx=1,SIZE(domain_interpolation%GEOMETRIC_INTERPOLATION,1)
298  CALL interfaceequations_interpolationsetfinalise(domain_interpolation%GEOMETRIC_INTERPOLATION(interpolation_set_idx), &
299  & err,error,*999)
300  ENDDO !interpolation_set_idx
301  DEALLOCATE(domain_interpolation%GEOMETRIC_INTERPOLATION)
302  ENDIF
303  domain_interpolation%NUMBER_OF_GEOMETRIC_INTERPOLATION_SETS=0
304  NULLIFY(domain_interpolation%DEPENDENT_FIELD)
305  IF(ALLOCATED(domain_interpolation%DEPENDENT_INTERPOLATION)) THEN
306  DO interpolation_set_idx=1,SIZE(domain_interpolation%DEPENDENT_INTERPOLATION,1)
307  CALL interfaceequations_interpolationsetfinalise(domain_interpolation%DEPENDENT_INTERPOLATION(interpolation_set_idx), &
308  & err,error,*999)
309  ENDDO !interpolation_set_idx
310  DEALLOCATE(domain_interpolation%DEPENDENT_INTERPOLATION)
311  ENDIF
312  domain_interpolation%NUMBER_OF_DEPENDENT_INTERPOLATION_SETS=0
313 
314  exits("InterfaceEquations_DomainInterpolationFinalise")
315  RETURN
316 999 errors("InterfaceEquations_DomainInterpolationFinalise",err,error)
317  exits("InterfaceEquations_DomainInterpolationFinalise")
318  RETURN 1
319 
320  END SUBROUTINE interfaceequations_domaininterpolationfinalise
321 
322  !
323  !================================================================================================================================
324  !
325 
327  SUBROUTINE interfaceequations_domaininterpolationinitialise(DOMAIN_INTERPOLATION,ERR,ERROR,*)
329  !Argument variables
330  TYPE(interface_equations_domain_interpolation_type) :: DOMAIN_INTERPOLATION
331  INTEGER(INTG), INTENT(OUT) :: ERR
332  TYPE(varying_string), INTENT(OUT) :: ERROR
333  !Local Variables
334 
335  enters("InterfaceEquations_DomainInterpolationInitialise",err,error,*999)
336 
337  NULLIFY(domain_interpolation%PENALTY_FIELD)
338  domain_interpolation%NUMBER_OF_PENALTY_INTERPOLATION_SETS=1
339  NULLIFY(domain_interpolation%GEOMETRIC_FIELD)
340  domain_interpolation%NUMBER_OF_GEOMETRIC_INTERPOLATION_SETS=1
341  NULLIFY(domain_interpolation%DEPENDENT_FIELD)
342  domain_interpolation%NUMBER_OF_DEPENDENT_INTERPOLATION_SETS=1
343 
344  exits("InterfaceEquations_DomainInterpolationInitialise")
345  RETURN
346 999 errors("InterfaceEquations_DomainInterpolationInitialise",err,error)
347  exits("InterfaceEquations_DomainInterpolationInitialise")
348  RETURN 1
349 
350  END SUBROUTINE interfaceequations_domaininterpolationinitialise
351 
352  !
353  !================================================================================================================================
354  !
355 
357  SUBROUTINE interface_equations_domain_interface_interpolation_(DOMAIN_INTERPOLATION,GEOMETRIC_FIELD,LAGRANGE_FIELD, &
358  & penalty_field,err,error,*)
360  !Argument variables
361  TYPE(interface_equations_domain_interpolation_type) :: DOMAIN_INTERPOLATION
362  TYPE(field_type), POINTER :: GEOMETRIC_FIELD
363  TYPE(field_type), POINTER :: LAGRANGE_FIELD
364  TYPE(field_type), POINTER :: PENALTY_FIELD
365  INTEGER(INTG), INTENT(OUT) :: ERR
366  TYPE(varying_string), INTENT(OUT) :: ERROR
367  !Local Variables
368  INTEGER(INTG) :: DUMMY_ERR,interpolation_set_idx
369  TYPE(varying_string) :: DUMMY_ERROR
370 
371  enters("InterfaceEquations_DomainInterpolationSet",err,error,*998)
372 
373  IF(ASSOCIATED(geometric_field)) THEN
374  IF(ASSOCIATED(lagrange_field)) THEN
375  domain_interpolation%GEOMETRIC_FIELD=>geometric_field
376  ALLOCATE(domain_interpolation%GEOMETRIC_INTERPOLATION(domain_interpolation%NUMBER_OF_GEOMETRIC_INTERPOLATION_SETS), &
377  & stat=err)
378  IF(err/=0) CALL flagerror("Could not allocate domain interpolation geometric interpolation.",err,error,*999)
379  DO interpolation_set_idx=1,domain_interpolation%NUMBER_OF_GEOMETRIC_INTERPOLATION_SETS
380  CALL interfaceequations_interpolationsetinitialise(domain_interpolation%GEOMETRIC_INTERPOLATION( &
381  & interpolation_set_idx),err,error,*999)
382  CALL field_interpolation_parameters_initialise(domain_interpolation%GEOMETRIC_FIELD,domain_interpolation% &
383  & geometric_interpolation(interpolation_set_idx)%INTERPOLATION_PARAMETERS,err,error,*999)
384  CALL field_interpolated_points_initialise(domain_interpolation%GEOMETRIC_INTERPOLATION(interpolation_set_idx)% &
385  & interpolation_parameters,domain_interpolation%GEOMETRIC_INTERPOLATION(interpolation_set_idx)%INTERPOLATED_POINT, &
386  & err,error,*999)
387  IF(domain_interpolation%GEOMETRIC_FIELD%TYPE==field_geometric_type.OR. &
388  & domain_interpolation%GEOMETRIC_FIELD%TYPE==field_fibre_type) THEN
389  CALL field_interpolatedpointsmetricsinitialise(domain_interpolation%GEOMETRIC_INTERPOLATION( &
390  & interpolation_set_idx)%INTERPOLATED_POINT,domain_interpolation%GEOMETRIC_INTERPOLATION(interpolation_set_idx)% &
391  & interpolated_point_metrics,err,error,*999)
392  ENDIF
393  ENDDO !interpolation_set_idx
394  domain_interpolation%DEPENDENT_FIELD=>lagrange_field
395  ALLOCATE(domain_interpolation%DEPENDENT_INTERPOLATION(domain_interpolation%NUMBER_OF_DEPENDENT_INTERPOLATION_SETS), &
396  & stat=err)
397  IF(err/=0) CALL flagerror("Could not allocate domain interpolation dependent interpolation.",err,error,*999)
398  DO interpolation_set_idx=1,domain_interpolation%NUMBER_OF_DEPENDENT_INTERPOLATION_SETS
399  CALL interfaceequations_interpolationsetinitialise(domain_interpolation%DEPENDENT_INTERPOLATION( &
400  & interpolation_set_idx),err,error,*999)
401  CALL field_interpolation_parameters_initialise(domain_interpolation%DEPENDENT_FIELD,domain_interpolation% &
402  & dependent_interpolation(interpolation_set_idx)%INTERPOLATION_PARAMETERS,err,error,*999)
403  CALL field_interpolated_points_initialise(domain_interpolation%DEPENDENT_INTERPOLATION(interpolation_set_idx)% &
404  & interpolation_parameters,domain_interpolation%DEPENDENT_INTERPOLATION(interpolation_set_idx)%INTERPOLATED_POINT, &
405  & err,error,*999)
406  ENDDO !interpolation_set_idx
407  IF(ASSOCIATED(penalty_field)) THEN
408  domain_interpolation%PENALTY_FIELD=>penalty_field
409  ALLOCATE(domain_interpolation%PENALTY_INTERPOLATION(domain_interpolation%NUMBER_OF_PENALTY_INTERPOLATION_SETS), &
410  & stat=err)
411  IF(err/=0) CALL flagerror("Could not allocate domain interpolation dependent interpolation.",err,error,*999)
412  DO interpolation_set_idx=1,domain_interpolation%NUMBER_OF_PENALTY_INTERPOLATION_SETS
413  CALL interfaceequations_interpolationsetinitialise(domain_interpolation%PENALTY_INTERPOLATION( &
414  & interpolation_set_idx),err,error,*999)
415  CALL field_interpolation_parameters_initialise(domain_interpolation%PENALTY_FIELD,domain_interpolation% &
416  & penalty_interpolation(interpolation_set_idx)%INTERPOLATION_PARAMETERS,err,error,*999)
417  CALL field_interpolated_points_initialise(domain_interpolation%PENALTY_INTERPOLATION(interpolation_set_idx)% &
418  & interpolation_parameters,domain_interpolation%PENALTY_INTERPOLATION(interpolation_set_idx)%INTERPOLATED_POINT, &
419  & err,error,*999)
420  ENDDO !interpolation_set_idx
421  ENDIF
422  ELSE
423  CALL flagerror("Lagrange field is not associated.",err,error,*998)
424  ENDIF
425  ELSE
426  CALL flagerror("Geometric field is not associated.",err,error,*998)
427  ENDIF
428 
429  exits("InterfaceEquations_DomainInterpolationSet")
430  RETURN
431 999 CALL interfaceequations_domaininterpolationfinalise(domain_interpolation,dummy_err,dummy_error,*998)
432 998 errorsexits("InterfaceEquations_DomainInterpolationSet",err,error)
433  RETURN 1
434 
435  END SUBROUTINE interface_equations_domain_interface_interpolation_
436 
437  !
438  !================================================================================================================================
439  !
440 
442  SUBROUTINE interfaceequations_domainvariableinterpolationsetup(DOMAIN_INTERPOLATION,GEOMETRIC_FIELD,DEPENDENT_FIELD, &
443  & err,error,*)
445  !Argument variables
446  TYPE(interface_equations_domain_interpolation_type) :: DOMAIN_INTERPOLATION
447  TYPE(field_type), POINTER :: GEOMETRIC_FIELD
448  TYPE(field_type), POINTER :: DEPENDENT_FIELD
449  INTEGER(INTG), INTENT(OUT) :: ERR
450  TYPE(varying_string), INTENT(OUT) :: ERROR
451  !Local Variables
452  INTEGER(INTG) :: DUMMY_ERR,interpolation_set_idx
453  TYPE(varying_string) :: DUMMY_ERROR
454 
455  enters("InterfaceEquations_DomainVariableInterpolationSetup",err,error,*998)
456 
457  IF(ASSOCIATED(geometric_field)) THEN
458  IF(ASSOCIATED(dependent_field)) THEN
459  domain_interpolation%GEOMETRIC_FIELD=>geometric_field
460  ALLOCATE(domain_interpolation%GEOMETRIC_INTERPOLATION(domain_interpolation%NUMBER_OF_GEOMETRIC_INTERPOLATION_SETS), &
461  & stat=err)
462  IF(err/=0) CALL flagerror("Could not allocate domain interpolation geometric interpolation.",err,error,*999)
463  DO interpolation_set_idx=1,domain_interpolation%NUMBER_OF_GEOMETRIC_INTERPOLATION_SETS
464  CALL interfaceequations_interpolationsetinitialise(domain_interpolation%GEOMETRIC_INTERPOLATION( &
465  & interpolation_set_idx),err,error,*999)
466  CALL field_interpolation_parameters_initialise(domain_interpolation%GEOMETRIC_FIELD,domain_interpolation% &
467  & geometric_interpolation(interpolation_set_idx)%INTERPOLATION_PARAMETERS,err,error,*999)
468  CALL field_interpolated_points_initialise(domain_interpolation%GEOMETRIC_INTERPOLATION(interpolation_set_idx)% &
469  & interpolation_parameters,domain_interpolation%GEOMETRIC_INTERPOLATION(interpolation_set_idx)%INTERPOLATED_POINT, &
470  & err,error,*999)
471  IF(domain_interpolation%GEOMETRIC_FIELD%TYPE==field_geometric_type.OR. &
472  & domain_interpolation%GEOMETRIC_FIELD%TYPE==field_fibre_type) THEN
473  CALL field_interpolatedpointsmetricsinitialise(domain_interpolation%GEOMETRIC_INTERPOLATION( &
474  & interpolation_set_idx)%INTERPOLATED_POINT,domain_interpolation%GEOMETRIC_INTERPOLATION(interpolation_set_idx)% &
475  & interpolated_point_metrics,err,error,*999)
476  ENDIF
477  ENDDO !interpolation_set_idx
478  domain_interpolation%DEPENDENT_FIELD=>dependent_field
479  ALLOCATE(domain_interpolation%DEPENDENT_INTERPOLATION(domain_interpolation%NUMBER_OF_DEPENDENT_INTERPOLATION_SETS), &
480  & stat=err)
481  IF(err/=0) CALL flagerror("Could not allocate domain interpolation dependent interpolation.",err,error,*999)
482  DO interpolation_set_idx=1,domain_interpolation%NUMBER_OF_DEPENDENT_INTERPOLATION_SETS
483  CALL interfaceequations_interpolationsetinitialise(domain_interpolation%DEPENDENT_INTERPOLATION( &
484  & interpolation_set_idx),err,error,*999)
485  CALL field_interpolation_parameters_initialise(domain_interpolation%DEPENDENT_FIELD,domain_interpolation% &
486  & dependent_interpolation(interpolation_set_idx)%INTERPOLATION_PARAMETERS,err,error,*999)
487  CALL field_interpolated_points_initialise(domain_interpolation%DEPENDENT_INTERPOLATION(interpolation_set_idx)% &
488  & interpolation_parameters,domain_interpolation%DEPENDENT_INTERPOLATION(interpolation_set_idx)%INTERPOLATED_POINT, &
489  & err,error,*999)
490  IF(domain_interpolation%DEPENDENT_FIELD%TYPE==field_geometric_type.OR. &
491  & domain_interpolation%DEPENDENT_FIELD%TYPE==field_fibre_type) THEN
492  CALL field_interpolatedpointsmetricsinitialise(domain_interpolation%DEPENDENT_INTERPOLATION( &
493  & interpolation_set_idx)%INTERPOLATED_POINT,domain_interpolation%DEPENDENT_INTERPOLATION(interpolation_set_idx)% &
494  & interpolated_point_metrics,err,error,*999)
495  ENDIF
496  ENDDO !interpolation_set_idx
497  ELSE
498  CALL flagerror("Dependent field is not associated.",err,error,*998)
499  ENDIF
500  ELSE
501  CALL flagerror("Geometric field is not associated.",err,error,*998)
502  ENDIF
503 
504  exits("InterfaceEquations_DomainVariableInterpolationSetup")
505  RETURN
506 999 CALL interfaceequations_domaininterpolationfinalise(domain_interpolation,dummy_err,dummy_error,*998)
507 998 errors("InterfaceEquations_DomainVariableInterpolationSetup",err,error)
508  exits("InterfaceEquations_DomainVariableInterpolationSetup")
509  RETURN 1
510 
511  END SUBROUTINE interfaceequations_domainvariableinterpolationsetup
512 
513  !
514  !================================================================================================================================
515  !
516 
517  SUBROUTINE interfaceequations_interfaceinterpsetsnumberset(INTERFACE_EQUATIONS,NUMBER_OF_GEOMETRIC_SETS, &
518  & number_of_dependent_sets,number_of_penalty_sets,err,error,*)
520  !Argument variables
521  TYPE(interface_equations_type), POINTER :: INTERFACE_EQUATIONS
522  INTEGER(INTG), INTENT(IN) :: NUMBER_OF_GEOMETRIC_SETS
523  INTEGER(INTG), INTENT(IN) :: NUMBER_OF_DEPENDENT_SETS
524  INTEGER(INTG), INTENT(IN) :: NUMBER_OF_PENALTY_SETS
525  INTEGER(INTG), INTENT(OUT) :: ERR
526  TYPE(varying_string), INTENT(OUT) :: ERROR
527  !Local Variables
528  TYPE(varying_string) :: LOCAL_ERROR
529 
530  enters("InterfaceEquations_InterfaceInterpSetsNumberSet",err,error,*999)
531 
532  IF(ASSOCIATED(interface_equations)) THEN
533  IF(interface_equations%INTERFACE_EQUATIONS_FINISHED) THEN
534  CALL flagerror("Interface equations have already been finished.",err,error,*999)
535  ELSE
536  IF(ASSOCIATED(interface_equations%INTERPOLATION)) THEN
537  IF(number_of_geometric_sets>0) THEN
538  IF(number_of_dependent_sets>0) THEN
539  IF(number_of_penalty_sets>=0) THEN
540  interface_equations%INTERPOLATION%INTERFACE_INTERPOLATION%NUMBER_OF_GEOMETRIC_INTERPOLATION_SETS= &
541  & number_of_geometric_sets
542  interface_equations%INTERPOLATION%INTERFACE_INTERPOLATION%NUMBER_OF_DEPENDENT_INTERPOLATION_SETS= &
543  & number_of_dependent_sets
544  interface_equations%INTERPOLATION%INTERFACE_INTERPOLATION%NUMBER_OF_PENALTY_INTERPOLATION_SETS= &
545  & number_of_penalty_sets
546  ELSE
547  local_error="The specified number of penalty sets of "// &
548  & trim(number_to_vstring(number_of_penalty_sets,"*",err,error))// &
549  & " is invalid. The number of penalty sets must be > 0."
550  CALL flagerror(local_error,err,error,*999)
551  ENDIF
552  ELSE
553  local_error="The specified number of dependent sets of "// &
554  & trim(number_to_vstring(number_of_dependent_sets,"*",err,error))// &
555  & " is invalid. The number of dependent sets must be > 0."
556  CALL flagerror(local_error,err,error,*999)
557  ENDIF
558  ELSE
559  local_error="The specified number of geometric sets of "// &
560  & trim(number_to_vstring(number_of_geometric_sets,"*",err,error))// &
561  & " is invalid. The number of geometric sets must be > 0."
562  CALL flagerror(local_error,err,error,*999)
563  ENDIF
564  ELSE
565  CALL flagerror("Interface equations interpolation is not associated.",err,error,*999)
566  ENDIF
567  ENDIF
568  ELSE
569  CALL flagerror("Interface equations is not associated.",err,error,*999)
570  ENDIF
571 
572  exits("InterfaceEquations_InterfaceInterpSetsNumberSet")
573  RETURN
574 999 errors("InterfaceEquations_InterfaceInterpSetsNumberSet",err,error)
575  exits("InterfaceEquations_InterfaceInterpSetsNumberSet")
576  RETURN 1
577 
578  END SUBROUTINE interfaceequations_interfaceinterpsetsnumberset
579 
580  !
581  !================================================================================================================================
582  !
583 
585  SUBROUTINE interface_equations_finalise(INTERFACE_EQUATIONS,ERR,ERROR,*)
587  !Argument variables
588  TYPE(interface_equations_type), POINTER :: INTERFACE_EQUATIONS
589  INTEGER(INTG), INTENT(OUT) :: ERR
590  TYPE(varying_string), INTENT(OUT) :: ERROR
591  !Local Variables
592 
593  enters("INTERFACE_EQUATIONS_FINALISE",err,error,*999)
594 
595  IF(ASSOCIATED(interface_equations)) THEN
596  CALL interface_equations_interpolation_finalise(interface_equations%INTERPOLATION,err,error,*999)
597  IF(ASSOCIATED(interface_equations%INTERFACE_MAPPING)) &
598  & CALL interface_mapping_destroy(interface_equations%INTERFACE_MAPPING,err,error,*999)
599  IF(ASSOCIATED(interface_equations%INTERFACE_MATRICES)) &
600  & CALL interface_matrices_destroy(interface_equations%INTERFACE_MATRICES,err,error,*999)
601  DEALLOCATE(interface_equations)
602  ENDIF
603 
604  exits("INTERFACE_EQUATIONS_FINALISE")
605  RETURN
606 999 errorsexits("INTERFACE_EQUATIONS_FINALISE",err,error)
607  RETURN 1
608  END SUBROUTINE interface_equations_finalise
609 
610  !
611  !================================================================================================================================
612  !
613 
615  SUBROUTINE interface_equations_initialise(INTERFACE_CONDITION,ERR,ERROR,*)
617  !Argument variables
618  TYPE(interface_condition_type), POINTER :: INTERFACE_CONDITION
619  INTEGER(INTG), INTENT(OUT) :: ERR
620  TYPE(varying_string), INTENT(OUT) :: ERROR
621  !Local Variables
622  INTEGER(INTG) :: DUMMY_ERR
623  TYPE(varying_string) :: DUMMY_ERROR
624 
625  enters("INTERFACE_EQUATIONS_INITIALISE",err,error,*998)
626 
627  IF(ASSOCIATED(interface_condition)) THEN
628  IF(ASSOCIATED(interface_condition%INTERFACE_EQUATIONS)) THEN
629  CALL flagerror("Interface equations is already associated for this interface condition.",err,error,*998)
630  ELSE
631  ALLOCATE(interface_condition%INTERFACE_EQUATIONS,stat=err)
632  IF(err/=0) CALL flagerror("Could not allocate interface equations.",err,error,*999)
633  interface_condition%INTERFACE_EQUATIONS%INTERFACE_CONDITION=>interface_condition
634  interface_condition%INTERFACE_EQUATIONS%LINEARITY=interface_condition_linear
635  interface_condition%INTERFACE_EQUATIONS%TIME_DEPENDENCE=interface_condition_static
636  interface_condition%INTERFACE_EQUATIONS%OUTPUT_TYPE=interface_equations_no_output
637  interface_condition%INTERFACE_EQUATIONS%SPARSITY_TYPE=interface_equations_sparse_matrices
638  NULLIFY(interface_condition%INTERFACE_EQUATIONS%INTERPOLATION)
639  NULLIFY(interface_condition%INTERFACE_EQUATIONS%INTERFACE_MAPPING)
640  NULLIFY(interface_condition%INTERFACE_EQUATIONS%INTERFACE_MATRICES)
641  interface_condition%INTERFACE_EQUATIONS%INTERFACE_EQUATIONS_FINISHED=.false.
642  CALL interfaceequations_interpolationinitialise(interface_condition%INTERFACE_EQUATIONS,err,error,*999)
643  ENDIF
644  ELSE
645  CALL flagerror("Interface condition is not associated.",err,error,*998)
646  ENDIF
647 
648  exits("INTERFACE_EQUATIONS_INITIALISE")
649  RETURN
650 999 CALL interface_equations_finalise(interface_condition%INTERFACE_EQUATIONS,dummy_err,dummy_error,*998)
651 998 errorsexits("INTERFACE_EQUATIONS_INITIALISE",err,error)
652  RETURN 1
653 
654  END SUBROUTINE interface_equations_initialise
655 
656  !
657  !================================================================================================================================
658  !
659 
661  SUBROUTINE interface_equations_interpolation_finalise(INTERFACE_EQUATIONS_INTERPOLATION,ERR,ERROR,*)
663  !Argument variables
664  TYPE(interface_equations_interpolation_type), POINTER :: INTERFACE_EQUATIONS_INTERPOLATION
665  INTEGER(INTG), INTENT(OUT) :: ERR
666  TYPE(varying_string), INTENT(OUT) :: ERROR
667  !Local Variables
668  INTEGER(INTG) :: variable_idx
669 
670  enters("INTERFACE_EQUATIONS_INTERPOLATION_FINALISE",err,error,*999)
671 
672  IF(ASSOCIATED(interface_equations_interpolation)) THEN
673  CALL interfaceequations_domaininterpolationfinalise(interface_equations_interpolation%INTERFACE_INTERPOLATION, &
674  & err,error,*999)
675  IF(ALLOCATED(interface_equations_interpolation%VARIABLE_INTERPOLATION)) THEN
676  DO variable_idx=1,SIZE(interface_equations_interpolation%VARIABLE_INTERPOLATION,1)
677  CALL interfaceequations_domaininterpolationfinalise(interface_equations_interpolation% &
678  & variable_interpolation(variable_idx),err,error,*999)
679  ENDDO !variable_idx
680  DEALLOCATE(interface_equations_interpolation%VARIABLE_INTERPOLATION)
681  ENDIF
682  ENDIF
683 
684  exits("INTERFACE_EQUATIONS_INTERPOLATION_FINALISE")
685  RETURN
686 999 errorsexits("INTERFACE_EQUATIONS_INTERPOLATION_FINALISE",err,error)
687  RETURN 1
688 
689  END SUBROUTINE interface_equations_interpolation_finalise
690 
691  !
692  !================================================================================================================================
693  !
694 
696  SUBROUTINE interfaceequations_interpolationinitialise(INTERFACE_EQUATIONS,ERR,ERROR,*)
698  !Argument variables
699  TYPE(interface_equations_type), POINTER :: INTERFACE_EQUATIONS
700  INTEGER(INTG), INTENT(OUT) :: ERR
701  TYPE(varying_string), INTENT(OUT) :: ERROR
702  !Local Variables
703  INTEGER(INTG) :: DUMMY_ERR,variable_idx
704  TYPE(interface_condition_type), POINTER :: INTERFACE_CONDITION
705  TYPE(interface_dependent_type), POINTER :: INTERFACE_DEPENDENT
706  TYPE(varying_string) :: DUMMY_ERROR
707 
708  enters("InterfaceEquations_InterpolationInitialise",err,error,*998)
709 
710  IF(ASSOCIATED(interface_equations)) THEN
711  interface_condition=>interface_equations%INTERFACE_CONDITION
712  IF(ASSOCIATED(interface_condition)) THEN
713  IF(ASSOCIATED(interface_equations%INTERPOLATION)) THEN
714  CALL flagerror("Interface equations interpolation is already associated.",err,error,*998)
715  ELSE
716  interface_dependent=>interface_condition%DEPENDENT
717  IF(ASSOCIATED(interface_dependent)) THEN
718  ALLOCATE(interface_equations%INTERPOLATION,stat=err)
719  IF(err/=0) CALL flagerror("Could not allocate interface equations interpolation.",err,error,*999)
720  interface_equations%INTERPOLATION%INTERFACE_EQUATIONS=>interface_equations
721  CALL interfaceequations_domaininterpolationinitialise(interface_equations%INTERPOLATION%INTERFACE_INTERPOLATION, &
722  & err,error,*999)
723  interface_equations%INTERPOLATION%INTERFACE_INTERPOLATION%INTERPOLATION=>interface_equations%INTERPOLATION
724  ALLOCATE(interface_equations%INTERPOLATION%VARIABLE_INTERPOLATION(interface_dependent%NUMBER_OF_DEPENDENT_VARIABLES), &
725  & stat=err)
726  IF(err/=0) CALL flagerror("Could not allocate interface equations interpolation mesh interpolation.",err,error,*999)
727  DO variable_idx=1,interface_dependent%NUMBER_OF_DEPENDENT_VARIABLES
728  CALL interfaceequations_domaininterpolationinitialise(interface_equations%INTERPOLATION% &
729  & variable_interpolation(variable_idx),err,error,*999)
730  interface_equations%INTERPOLATION%VARIABLE_INTERPOLATION(variable_idx)%INTERPOLATION=> &
731  & interface_equations%INTERPOLATION
732  ENDDO !variable_idx
733  ELSE
734  CALL flagerror("Interface condition dependent is not associated.",err,error,*999)
735  ENDIF
736  ENDIF
737  ELSE
738  CALL flagerror("Interface equations interface condition is not associated.",err,error,*998)
739  ENDIF
740  ELSE
741  CALL flagerror("Interface equations is not associated.",err,error,*998)
742  ENDIF
743 
744  exits("InterfaceEquations_InterpolationInitialise")
745  RETURN
746 999 CALL interface_equations_interpolation_finalise(interface_equations%INTERPOLATION,dummy_err,dummy_error,*998)
747 998 errorsexits("InterfaceEquations_InterpolationInitialise",err,error)
748  RETURN 1
749 
750  END SUBROUTINE interfaceequations_interpolationinitialise
751 
752  !
753  !================================================================================================================================
754  !
755 
757  SUBROUTINE interfaceequations_interpolationsetfinalise(INTERPOLATION_SET,ERR,ERROR,*)
759  !Argument variables
760  TYPE(interface_equations_interpolation_set_type) :: INTERPOLATION_SET
761  INTEGER(INTG), INTENT(OUT) :: ERR
762  TYPE(varying_string), INTENT(OUT) :: ERROR
763  !Local Variables
764 
765  enters("InterfaceEquations_InterpolationSetFinalise",err,error,*999)
766 
767  CALL field_interpolation_parameters_finalise(interpolation_set%INTERPOLATION_PARAMETERS,err,error,*999)
768  CALL field_interpolated_points_finalise(interpolation_set%INTERPOLATED_POINT,err,error,*999)
769  CALL field_interpolatedpointsmetricsfinalise(interpolation_set%INTERPOLATED_POINT_METRICS,err,error,*999)
770 
771  exits("InterfaceEquations_InterpolationSetFinalise")
772  RETURN
773 999 errorsexits("InterfaceEquations_InterpolationSetFinalise",err,error)
774  RETURN 1
775 
776  END SUBROUTINE interfaceequations_interpolationsetfinalise
777 
778  !
779  !================================================================================================================================
780  !
781 
783  SUBROUTINE interfaceequations_interpolationsetinitialise(INTERPOLATION_SET,ERR,ERROR,*)
785  !Argument variables
786  TYPE(interface_equations_interpolation_set_type) :: INTERPOLATION_SET
787  INTEGER(INTG), INTENT(OUT) :: ERR
788  TYPE(varying_string), INTENT(OUT) :: ERROR
789  !Local Variables
790 
791  enters("InterfaceEquations_InterpolationSetInitialise",err,error,*999)
792 
793  NULLIFY(interpolation_set%INTERPOLATION_PARAMETERS)
794  NULLIFY(interpolation_set%INTERPOLATED_POINT)
795  NULLIFY(interpolation_set%INTERPOLATED_POINT_METRICS)
796 
797  exits("InterfaceEquations_InterpolationSetInitialise")
798  RETURN
799 999 errors("InterfaceEquations_InterpolationSetInitialise",err,error)
800  exits("InterfaceEquations_InterpolationSetInitialise")
801  RETURN 1
802 
803  END SUBROUTINE interfaceequations_interpolationsetinitialise
804 
805  !
806  !================================================================================================================================
807  !
808 
810  SUBROUTINE interface_equations_output_type_get(INTERFACE_EQUATIONS,OUTPUT_TYPE,ERR,ERROR,*)
812  !Argument variables
813  TYPE(interface_equations_type), POINTER :: INTERFACE_EQUATIONS
814  INTEGER(INTG), INTENT(OUT) :: OUTPUT_TYPE
815  INTEGER(INTG), INTENT(OUT) :: ERR
816  TYPE(varying_string), INTENT(OUT) :: ERROR
817  !Local Variables
818 
819  enters("INTERFACE_EQUATIONS_OUTPUT_TYPE_GET",err,error,*999)
820 
821  IF(ASSOCIATED(interface_equations)) THEN
822  IF(interface_equations%INTERFACE_EQUATIONS_FINISHED) THEN
823  output_type=interface_equations%OUTPUT_TYPE
824  ELSE
825  CALL flagerror("Interface equations has not been finished.",err,error,*999)
826  ENDIF
827  ELSE
828  CALL flagerror("Interface equations is not associated.",err,error,*999)
829  ENDIF
830 
831  exits("INTERFACE_EQUATIONS_OUTPUT_TYPE_GET")
832  RETURN
833 999 errorsexits("INTERFACE_EQUATIONS_OUTPUT_TYPE_GET",err,error)
834  RETURN 1
835  END SUBROUTINE interface_equations_output_type_get
836 
837  !
838  !================================================================================================================================
839  !
840 
842  SUBROUTINE interface_equations_output_type_set(INTERFACE_EQUATIONS,OUTPUT_TYPE,ERR,ERROR,*)
844  !Argument variables
845  TYPE(interface_equations_type), POINTER :: INTERFACE_EQUATIONS
846  INTEGER(INTG), INTENT(IN) :: OUTPUT_TYPE
847  INTEGER(INTG), INTENT(OUT) :: ERR
848  TYPE(varying_string), INTENT(OUT) :: ERROR
849  !Local Variables
850  TYPE(varying_string) :: LOCAL_ERROR
851 
852  enters("INTERFACE_EQUATIONS_OUTPUT_TYPE_SET",err,error,*999)
853 
854  IF(ASSOCIATED(interface_equations)) THEN
855  IF(interface_equations%INTERFACE_EQUATIONS_FINISHED) THEN
856  CALL flagerror("Interface equations has already been finished.",err,error,*999)
857  ELSE
858  SELECT CASE(output_type)
860  interface_equations%OUTPUT_TYPE=interface_equations_no_output
862  interface_equations%OUTPUT_TYPE=interface_equations_timing_output
864  interface_equations%OUTPUT_TYPE=interface_equations_matrix_output
866  interface_equations%OUTPUT_TYPE=interface_equations_element_matrix_output
867  CASE DEFAULT
868  local_error="The specified output type of "//trim(number_to_vstring(output_type,"*",err,error))//" is invalid"
869  CALL flagerror(local_error,err,error,*999)
870  END SELECT
871  ENDIF
872  ELSE
873  CALL flagerror("Interface equations is not associated.",err,error,*999)
874  ENDIF
875 
876  exits("INTERFACE_EQUATIONS_OUTPUT_TYPE_SET")
877  RETURN
878 999 errorsexits("INTERFACE_EQUATIONS_OUTPUT_TYPE_SET",err,error)
879  RETURN 1
880 
881  END SUBROUTINE interface_equations_output_type_set
882 
883  !
884  !================================================================================================================================
885  !
886 
888  SUBROUTINE interface_equations_sparsity_type_get(INTERFACE_EQUATIONS,SPARSITY_TYPE,ERR,ERROR,*)
890  !Argument variables
891  TYPE(interface_equations_type), POINTER :: INTERFACE_EQUATIONS
892  INTEGER(INTG), INTENT(OUT) :: SPARSITY_TYPE
893  INTEGER(INTG), INTENT(OUT) :: ERR
894  TYPE(varying_string), INTENT(OUT) :: ERROR
895  !Local Variables
896 
897  enters("INTERFACE_EQUATIONS_SPARSITY_TYPE_GET",err,error,*999)
898 
899  IF(ASSOCIATED(interface_equations)) THEN
900  IF(interface_equations%INTERFACE_EQUATIONS_FINISHED) THEN
901  sparsity_type=interface_equations%SPARSITY_TYPE
902  ELSE
903  CALL flagerror("Interface equations has not been finished.",err,error,*999)
904  ENDIF
905  ELSE
906  CALL flagerror("Interface equations is not associated.",err,error,*999)
907  ENDIF
908 
909  exits("INTERFACE_EQUATIONS_SPARSITY_TYPE_GET")
910  RETURN
911 999 errorsexits("INTERFACE_EQUATIONS_SPARSITY_TYPE_GET",err,error)
912  RETURN 1
913  END SUBROUTINE interface_equations_sparsity_type_get
914 
915  !
916  !================================================================================================================================
917  !
918 
920  SUBROUTINE interface_equations_sparsity_type_set(INTERFACE_EQUATIONS,SPARSITY_TYPE,ERR,ERROR,*)
922  !Argument variables
923  TYPE(interface_equations_type), POINTER :: INTERFACE_EQUATIONS
924  INTEGER(INTG), INTENT(IN) :: SPARSITY_TYPE
925  INTEGER(INTG), INTENT(OUT) :: ERR
926  TYPE(varying_string), INTENT(OUT) :: ERROR
927  !Local Variables
928  TYPE(varying_string) :: LOCAL_ERROR
929 
930  enters("INTERFACE_EQUATIONS_SPARSITY_TYPE_SET",err,error,*999)
931 
932  IF(ASSOCIATED(interface_equations)) THEN
933  IF(interface_equations%INTERFACE_EQUATIONS_FINISHED) THEN
934  CALL flagerror("Interface equations has already been finished.",err,error,*999)
935  ELSE
936  SELECT CASE(sparsity_type)
938  interface_equations%SPARSITY_TYPE=interface_equations_sparse_matrices
940  interface_equations%SPARSITY_TYPE=interface_equations_full_matrices
941  CASE DEFAULT
942  local_error="The specified sparsity type of "//trim(number_to_vstring(sparsity_type,"*",err,error))// &
943  & " is invalid."
944  CALL flagerror(local_error,err,error,*999)
945  END SELECT
946  ENDIF
947  ELSE
948  CALL flagerror("Interface equations is not associated.",err,error,*999)
949  ENDIF
950 
951  exits("INTERFACE_EQUATIONS_SPARSITY_TYPE_SET")
952  RETURN
953 999 errorsexits("INTERFACE_EQUATIONS_SPARSITY_TYPE_SET",err,error)
954  RETURN 1
955  END SUBROUTINE interface_equations_sparsity_type_set
956 
957  !
958  !================================================================================================================================
959  !
960 
962  SUBROUTINE interface_equations_linearity_type_get(INTERFACE_EQUATIONS,LINEARITY_TYPE,ERR,ERROR,*)
964  !Argument variables
965  TYPE(interface_equations_type), POINTER :: INTERFACE_EQUATIONS
966  INTEGER(INTG), INTENT(OUT) :: LINEARITY_TYPE
967  INTEGER(INTG), INTENT(OUT) :: ERR
968  TYPE(varying_string), INTENT(OUT) :: ERROR
969  !Local Variables
970 
971  enters("INTERFACE_EQUATIONS_LINEARITY_TYPE_GET",err,error,*999)
972 
973  IF(ASSOCIATED(interface_equations)) THEN
974  IF(interface_equations%INTERFACE_EQUATIONS_FINISHED) THEN
975  linearity_type=interface_equations%LINEARITY
976  ELSE
977  CALL flagerror("Interface equations has not been finished.",err,error,*999)
978  ENDIF
979  ELSE
980  CALL flagerror("Interface equations is not associated.",err,error,*999)
981  ENDIF
982 
983  exits("INTERFACE_EQUATIONS_LINEARITY_TYPE_GET")
984  RETURN
985 999 errorsexits("INTERFACE_EQUATIONS_LINEARITY_TYPE_GET",err,error)
986  RETURN 1
987  END SUBROUTINE interface_equations_linearity_type_get
988 
989  !
990  !================================================================================================================================
991  !
992 
994  SUBROUTINE interface_equations_linearity_type_set(INTERFACE_EQUATIONS,LINEARITY_TYPE,ERR,ERROR,*)
996  !Argument variables
997  TYPE(interface_equations_type), POINTER :: INTERFACE_EQUATIONS
998  INTEGER(INTG), INTENT(IN) :: LINEARITY_TYPE
999  INTEGER(INTG), INTENT(OUT) :: ERR
1000  TYPE(varying_string), INTENT(OUT) :: ERROR
1001  !Local Variables
1002  TYPE(varying_string) :: LOCAL_ERROR
1003 
1004  enters("INTERFACE_EQUATIONS_LINEARITY_TYPE_SET",err,error,*999)
1005 
1006  IF(ASSOCIATED(interface_equations)) THEN
1007  IF(interface_equations%INTERFACE_EQUATIONS_FINISHED) THEN
1008  CALL flagerror("Interface equations has already been finished.",err,error,*999)
1009  ELSE
1010  SELECT CASE(linearity_type)
1012  interface_equations%LINEARITY=interface_condition_linear
1014  interface_equations%LINEARITY=interface_condition_nonlinear
1016  interface_equations%LINEARITY=interface_condition_nonlinear_bcs
1017  CASE DEFAULT
1018  local_error="The specified linearity type of "//trim(number_to_vstring(linearity_type,"*",err,error))// &
1019  & " is invalid."
1020  CALL flagerror(local_error,err,error,*999)
1021  END SELECT
1022  ENDIF
1023  ELSE
1024  CALL flagerror("Interface equations is not associated.",err,error,*999)
1025  ENDIF
1026 
1027  exits("INTERFACE_EQUATIONS_LINEARITY_TYPE_SET")
1028  RETURN
1029 999 errorsexits("INTERFACE_EQUATIONS_LINEARITY_TYPE_SET",err,error)
1030  RETURN 1
1031  END SUBROUTINE interface_equations_linearity_type_set
1032 
1033  !
1034  !================================================================================================================================
1035  !
1036 
1038  SUBROUTINE interfaceequations_timedependencetypeget(INTERFACE_EQUATIONS,TIME_DEPENDENCE_TYPE,ERR,ERROR,*)
1040  !Argument variables
1041  TYPE(interface_equations_type), POINTER :: INTERFACE_EQUATIONS
1042  INTEGER(INTG), INTENT(OUT) :: TIME_DEPENDENCE_TYPE
1043  INTEGER(INTG), INTENT(OUT) :: ERR
1044  TYPE(varying_string), INTENT(OUT) :: ERROR
1045  !Local Variables
1046 
1047  enters("InterfaceEquations_TimeDependenceTypeGet",err,error,*999)
1048 
1049  IF(ASSOCIATED(interface_equations)) THEN
1050  IF(interface_equations%INTERFACE_EQUATIONS_FINISHED) THEN
1051  time_dependence_type=interface_equations%TIME_DEPENDENCE
1052  ELSE
1053  CALL flagerror("Interface equations has not been finished.",err,error,*999)
1054  ENDIF
1055  ELSE
1056  CALL flagerror("Interface equations is not associated.",err,error,*999)
1057  ENDIF
1058 
1059  exits("InterfaceEquations_TimeDependenceTypeGet")
1060  RETURN
1061 999 errorsexits("InterfaceEquations_TimeDependenceTypeGet",err,error)
1062  RETURN 1
1063 
1064  END SUBROUTINE interfaceequations_timedependencetypeget
1065 
1066  !
1067  !================================================================================================================================
1068  !
1069 
1071  SUBROUTINE interfaceequationstimedependencetypeset(INTERFACE_EQUATIONS,TIME_DEPENDENCE_TYPE,ERR,ERROR,*)
1073  !Argument variables
1074  TYPE(interface_equations_type), POINTER :: INTERFACE_EQUATIONS
1075  INTEGER(INTG), INTENT(IN) :: TIME_DEPENDENCE_TYPE
1076  INTEGER(INTG), INTENT(OUT) :: ERR
1077  TYPE(varying_string), INTENT(OUT) :: ERROR
1078  !Local Variables
1079  TYPE(varying_string) :: LOCAL_ERROR
1080 
1081  enters("InterfaceEquationsTimeDependenceTypeSet",err,error,*999)
1082 
1083  IF(ASSOCIATED(interface_equations)) THEN
1084  IF(interface_equations%INTERFACE_EQUATIONS_FINISHED) THEN
1085  CALL flagerror("Interface equations has already been finished.",err,error,*999)
1086  ELSE
1087  SELECT CASE(time_dependence_type)
1089  interface_equations%TIME_DEPENDENCE=interface_condition_static
1091  interface_equations%TIME_DEPENDENCE=interface_condition_quasistatic
1093  interface_equations%TIME_DEPENDENCE=interface_condition_first_order_dynamic
1095  interface_equations%TIME_DEPENDENCE=interface_condition_second_order_dynamic
1096  CASE DEFAULT
1097  local_error="The specified time dependence type of "//trim(number_to_vstring(time_dependence_type,"*",err,error))// &
1098  & " is invalid."
1099  CALL flagerror(local_error,err,error,*999)
1100  END SELECT
1101  ENDIF
1102  ELSE
1103  CALL flagerror("Interface equations is not associated.",err,error,*999)
1104  ENDIF
1105 
1106  exits("InterfaceEquationsTimeDependenceTypeSet")
1107  RETURN
1108 999 errorsexits("InterfaceEquationsTimeDependenceTypeSet",err,error)
1109  RETURN 1
1110 
1111  END SUBROUTINE interfaceequationstimedependencetypeset
1112 
1113  !
1114  !================================================================================================================================
1115  !
1116 
1117  SUBROUTINE interfaceequations_variableinterpsetsnumberset(INTERFACE_EQUATIONS,VARIABLE_INDEX, &
1118  & number_of_geometric_sets,number_of_dependent_sets,number_of_penalty_sets,err,error,*)
1120  !Argument variables
1121  TYPE(interface_equations_type), POINTER :: INTERFACE_EQUATIONS
1122  INTEGER(INTG), INTENT(IN) :: VARIABLE_INDEX
1123  INTEGER(INTG), INTENT(IN) :: NUMBER_OF_GEOMETRIC_SETS
1124  INTEGER(INTG), INTENT(IN) :: NUMBER_OF_DEPENDENT_SETS
1125  INTEGER(INTG), INTENT(IN) :: NUMBER_OF_PENALTY_SETS
1126  INTEGER(INTG), INTENT(OUT) :: ERR
1127  TYPE(varying_string), INTENT(OUT) :: ERROR
1128  !Local Variables
1129  TYPE(interface_condition_type), POINTER :: INTERFACE_CONDITION
1130  TYPE(interface_dependent_type), POINTER :: INTERFACE_DEPENDENT
1131  TYPE(varying_string) :: LOCAL_ERROR
1132 
1133  enters("InterfaceEquations_VariableInterpSetsNumberSet",err,error,*999)
1134 
1135  IF(ASSOCIATED(interface_equations)) THEN
1136  IF(interface_equations%INTERFACE_EQUATIONS_FINISHED) THEN
1137  CALL flagerror("Interface equations have already been finished.",err,error,*999)
1138  ELSE
1139  IF(ASSOCIATED(interface_equations%INTERPOLATION)) THEN
1140  IF(ALLOCATED(interface_equations%INTERPOLATION%VARIABLE_INTERPOLATION)) THEN
1141  interface_condition=>interface_equations%INTERFACE_CONDITION
1142  IF(ASSOCIATED(interface_condition)) THEN
1143  interface_dependent=>interface_condition%DEPENDENT
1144  IF(ASSOCIATED(interface_dependent)) THEN
1145  IF(variable_index>0.AND.variable_index<=interface_dependent%NUMBER_OF_DEPENDENT_VARIABLES) THEN
1146  IF(number_of_geometric_sets>0) THEN
1147  IF(number_of_dependent_sets>0) THEN
1148  interface_equations%INTERPOLATION%VARIABLE_INTERPOLATION(variable_index)% &
1149  & number_of_geometric_interpolation_sets=number_of_geometric_sets
1150  interface_equations%INTERPOLATION%VARIABLE_INTERPOLATION(variable_index)% &
1151  & number_of_dependent_interpolation_sets=number_of_dependent_sets
1152  interface_equations%INTERPOLATION%VARIABLE_INTERPOLATION(variable_index)% &
1153  & number_of_penalty_interpolation_sets=number_of_penalty_sets
1154  ELSE
1155  local_error="The specified number of dependent sets of "// &
1156  & trim(number_to_vstring(number_of_dependent_sets,"*",err,error))// &
1157  & " is invalid. The number of dependent sets must be > 0."
1158  CALL flagerror(local_error,err,error,*999)
1159  ENDIF
1160  ELSE
1161  local_error="The specified number of geometric sets of "// &
1162  & trim(number_to_vstring(number_of_geometric_sets,"*",err,error))// &
1163  & " is invalid. The number of geometric sets must be > 0."
1164  CALL flagerror(local_error,err,error,*999)
1165  ENDIF
1166  ELSE
1167  local_error="The specified variable index of "//trim(number_to_vstring(variable_index,"*",err,error))// &
1168  & " is invalid. The index needs to be > 0 and <= "// &
1169  & trim(number_to_vstring(interface_dependent%NUMBER_OF_DEPENDENT_VARIABLES,"*",err,error))//"."
1170  CALL flagerror(local_error,err,error,*999)
1171  ENDIF
1172  ELSE
1173  CALL flagerror("Interface condition dependent is not associated.",err,error,*999)
1174  ENDIF
1175  ELSE
1176  CALL flagerror("Interface equations interface condition is not associated.",err,error,*999)
1177  ENDIF
1178  ELSE
1179  CALL flagerror("Interface equations interpolation variable interpolation is not allocated.",err,error,*999)
1180  ENDIF
1181  ELSE
1182  CALL flagerror("Interface equations interpolation is not associated.",err,error,*999)
1183  ENDIF
1184  ENDIF
1185  ELSE
1186  CALL flagerror("Interface equations is not associated.",err,error,*999)
1187  ENDIF
1188 
1189  exits("InterfaceEquations_VariableInterpSetsNumberSet")
1190  RETURN
1191 999 errors("InterfaceEquations_VariableInterpSetsNumberSet",err,error)
1192  exits("InterfaceEquations_VariableInterpSetsNumberSet")
1193  RETURN 1
1194 
1195  END SUBROUTINE interfaceequations_variableinterpsetsnumberset
1196 
1197  !
1198  !================================================================================================================================
1199  !
1200 
1202  SUBROUTINE interface_condition_equations_get(INTERFACE_CONDITION,INTERFACE_EQUATIONS,ERR,ERROR,*)
1204  !Argument variables
1205  TYPE(interface_condition_type), POINTER :: INTERFACE_CONDITION
1206  TYPE(interface_equations_type), POINTER :: INTERFACE_EQUATIONS
1207  INTEGER(INTG), INTENT(OUT) :: ERR
1208  TYPE(varying_string), INTENT(OUT) :: ERROR
1209  !Local Variables
1210 
1211  enters("INTERFACE_CONDITION_EQUATIONS_GET",err,error,*999)
1212 
1213  IF(ASSOCIATED(interface_condition)) THEN
1214  IF(interface_condition%INTERFACE_CONDITION_FINISHED) THEN
1215  IF(ASSOCIATED(interface_equations)) THEN
1216  CALL flagerror("Interface equations is already associated.",err,error,*999)
1217  ELSE
1218  interface_equations=>interface_condition%INTERFACE_EQUATIONS
1219  IF(.NOT.ASSOCIATED(interface_equations)) &
1220  & CALL flagerror("Interface equations set equations is not associated.",err,error,*999)
1221  ENDIF
1222  ELSE
1223  CALL flagerror("Interface equations set has not been finished.",err,error,*999)
1224  ENDIF
1225  ELSE
1226  CALL flagerror("Interface equations set is not associated.",err,error,*999)
1227  ENDIF
1228 
1229  exits("INTERFACE_CONDITION_EQUATIONS_GET")
1230  RETURN
1231 999 errorsexits("INTERFACE_CONDITION_EQUATIONS_GET",err,error)
1232  RETURN 1
1233 
1234  END SUBROUTINE interface_condition_equations_get
1235 
1236 
1237 
1238 
1239 
1240  !
1241  !================================================================================================================================
1242  !
1243 
subroutine, public enters(NAME, ERR, ERROR,)
Records the entry into the named procedure and initialises the error code.
Contains information on the interpolation for the interface equations.
Definition: types.f90:2103
Converts a number to its equivalent varying string representation.
Definition: strings.f90:161
integer(intg), parameter interface_condition_lagrange_multipliers_method
Lagrange multipliers interface condition method.
This module handles all equations routines.
integer(intg), parameter interface_condition_linear
The interface conditions are linear.
This module contains all string manipulation and transformation routines.
Definition: strings.f90:45
Contains information for the interface condition data.
Definition: types.f90:2155
Contains information for a field defined on a region.
Definition: types.f90:1346
integer(intg), parameter, public interface_equations_full_matrices
Use fully populated matrices for the interface equations.
This module provides an iso_varying_string module, conformant to the API specified in ISO/IEC 1539-2:...
integer(intg), parameter interface_condition_augmented_lagrange_method
Augmented Lagrange multiplers interface condition method.
This module contains all interface mapping routines.
integer(intg), parameter, public interface_equations_sparse_matrices
Use sparse matrices for the interface equations.
Contains information about the dependent field information for an interface condition.
Definition: types.f90:2146
integer(intg), parameter, public interface_equations_timing_output
Timing information output.
subroutine, public exits(NAME)
Records the exit out of the named procedure.
integer(intg), parameter interface_condition_quasistatic
The interface conditions are quasi-static.
This module contains all type definitions in order to avoid cyclic module references.
Definition: types.f90:70
Contains information about the interpolation for a parameter set in interface equations.
Definition: types.f90:2082
integer(intg), parameter, public interface_equations_element_matrix_output
All below and element matrices output .
This module contains all the low-level base routines e.g., all debug, control, and low-level communic...
integer(intg), parameter interface_condition_penalty_method
Penalty interface condition method.
integer(intg), parameter interface_condition_first_order_dynamic
The interface conditions are first order dynamic.
Contains information about the interpolation for a domain (interface or coupled mesh) in the interfac...
Definition: types.f90:2089
This module defines all constants shared across interface condition routines.
integer(intg), parameter interface_condition_point_to_point_method
Point to point interface condition method.
This module handles all interface equations routines.
integer(intg), parameter, public interface_equations_no_output
No output.
Contains information for a field variable defined on a field.
Definition: types.f90:1289
integer(intg), parameter interface_condition_nonlinear_bcs
The interface conditions have non-linear boundary conditions.
subroutine, public errors(NAME, ERR, ERROR)
Records the exiting error of the subroutine.
integer(intg), parameter interface_condition_second_order_dynamic
The interface conditions are a second order dynamic.
integer(intg), parameter interface_condition_nonlinear
The interface conditions are non-linear.
Flags an error condition.
integer(intg), parameter, public interface_equations_matrix_output
All below and equation matrices output.
This module contains all kind definitions.
Definition: kinds.f90:45
integer(intg), parameter interface_condition_static
The interface conditions are static and have no time dependence.
Contains information about the interface equations for an interface condition.
Definition: types.f90:2110