OpenCMISS-Iron Internal API Documentation
Helmholtz_TEMPLATE_equations_routines.f90
Go to the documentation of this file.
1 
43 
46 
47  USE base_routines
48  USE basis_routines
50  USE constants
53  USE domain_mappings
58  USE field_routines
59  USE input_output
61  USE kinds
62  USE matrix_vector
63  USE node_routines
65  USE strings
66  USE solver_routines
67  USE timer
68  USE types
69 
70 #include "macros.h"
71 
72  IMPLICIT NONE
73 
74  PRIVATE
75 
76  !Module parameters
77 
78  !Module types
79 
80  !Module variables
81 
82  !Interfaces
83 
84  PUBLIC helmholtz_equation_finite_element_calculate,helmholtz_equation_equations_set_setup, &
85  & helmholtz_equation_equations_set_solution_method_set,helmholtzequation_equationssetspecificationset, &
86  & helmholtz_equation_problem_subtype_set,helmholtz_equation_problem_setup
87 
88 CONTAINS
89 
90  !
91  !================================================================================================================================
92  !
93 
95  SUBROUTINE helmholtz_equation_finite_element_calculate(EQUATIONS_SET,ELEMENT_NUMBER,ERR,ERROR,*)
96 
97  !Argument variables
98  TYPE(equations_set_type), POINTER :: EQUATIONS_SET
99  INTEGER(INTG), INTENT(IN) :: ELEMENT_NUMBER
100  INTEGER(INTG), INTENT(OUT) :: ERR
101  TYPE(varying_string), INTENT(OUT) :: ERROR
102  !Local Variables
103  TYPE(equations_type), POINTER :: EQUATIONS
104  TYPE(varying_string) :: LOCAL_ERROR
105 
106  enters("HELMHOLTZ_EQUATION_FINITE_ELEMENT_CALCULATE",err,error,*999)
107 
108  IF(ASSOCIATED(equations_set)) THEN
109  equations=>equations_set%EQUATIONS
110  IF(ASSOCIATED(equations)) THEN
111  SELECT CASE(equations_set%SUBTYPE)
112  CASE(equations_set_no_source_helmholtz_subtype)
113 
114 
115 
116  CASE DEFAULT
117  local_error="Equations set subtype "//trim(number_to_vstring(equations_set%SUBTYPE,"*",err,error))// &
118  & " is not valid for a Helmholtz equation type of a classical field equations set class."
119  CALL flag_error(local_error,err,error,*999)
120  END SELECT
121  ELSE
122  CALL flag_error("Equations set equations is not associated.",err,error,*999)
123  ENDIF
124  ELSE
125  CALL flag_error("Equations set is not associated.",err,error,*999)
126  ENDIF
127 
128  exits("HELMHOLTZ_EQUATION_FINITE_ELEMENT_CALCULATE")
129  RETURN
130 999 errorsexits("HELMHOLTZ_EQUATION_FINITE_ELEMENT_CALCULATE",err,error)
131  RETURN 1
132  END SUBROUTINE helmholtz_equation_finite_element_calculate
133 
134  !
135  !================================================================================================================================
136  !
137 
139  SUBROUTINE helmholtz_equation_equations_set_setup(EQUATIONS_SET,EQUATIONS_SET_SETUP,ERR,ERROR,*)
141  !Argument variables
142  TYPE(equations_set_type), POINTER :: EQUATIONS_SET
143  TYPE(equations_set_setup_type), INTENT(INOUT) :: EQUATIONS_SET_SETUP
144  INTEGER(INTG), INTENT(OUT) :: ERR
145  TYPE(varying_string), INTENT(OUT) :: ERROR
146  !Local Variables
147  TYPE(varying_string) :: LOCAL_ERROR
148 
149  enters("HELMHOLTZ_EQUATION_EQUATIONS_SET_SETUP",err,error,*999)
150 
151  IF(ASSOCIATED(equations_set)) THEN
152  SELECT CASE(equations_set%SUBTYPE)
153  CASE(equations_set_no_source_helmholtz_subtype)
154  CALL helmholtz_equation_equations_set_linear_setup(equations_set,equations_set_setup,err,error,*999)
155  CASE DEFAULT
156  local_error="Equations set subtype "//trim(number_to_vstring(equations_set%SUBTYPE,"*",err,error))// &
157  & " is not valid for a Helmholtz equation type of a classical field equation set class."
158  CALL flag_error(local_error,err,error,*999)
159  END SELECT
160  ELSE
161  CALL flag_error("Equations set is not associated.",err,error,*999)
162  ENDIF
163 
164  exits("HELMHOLTZ_EQUATION_EQUATIONS_SET_SETUP")
165  RETURN
166 999 errorsexits("HELMHOLTZ_EQUATION_EQUATIONS_SET_SETUP",err,error)
167  RETURN 1
168  END SUBROUTINE helmholtz_equation_equations_set_setup
169 
170  !
171  !================================================================================================================================
172  !
173 
175  SUBROUTINE helmholtz_equation_equations_set_solution_method_set(EQUATIONS_SET,SOLUTION_METHOD,ERR,ERROR,*)
177  !Argument variables
178  TYPE(equations_set_type), POINTER :: EQUATIONS_SET
179  INTEGER(INTG), INTENT(IN) :: SOLUTION_METHOD
180  INTEGER(INTG), INTENT(OUT) :: ERR
181  TYPE(varying_string), INTENT(OUT) :: ERROR
182  !Local Variables
183  TYPE(varying_string) :: LOCAL_ERROR
184 
185  enters("HELMHOLTZ_EQUATIONS_SET_SOLUTION_METHOD_SET",err,error,*999)
186 
187  IF(ASSOCIATED(equations_set)) THEN
188  SELECT CASE(equations_set%SUBTYPE)
190  SELECT CASE(solution_method)
192  equations_set%SOLUTION_METHOD=equations_set_fem_solution_method
194  CALL flag_error("Not implemented.",err,error,*999)
196  CALL flag_error("Not implemented.",err,error,*999)
198  CALL flag_error("Not implemented.",err,error,*999)
200  CALL flag_error("Not implemented.",err,error,*999)
202  CALL flag_error("Not implemented.",err,error,*999)
203  CASE DEFAULT
204  local_error="The specified solution method of "//trim(number_to_vstring(solution_method,"*",err,error))//" is invalid."
205  CALL flag_error(local_error,err,error,*999)
206  END SELECT
207  CASE DEFAULT
208  local_error="Equations set subtype of "//trim(number_to_vstring(equations_set%SUBTYPE,"*",err,error))// &
209  & " is not valid for a Helmholtz equation type of an classical field equations set class."
210  CALL flag_error(local_error,err,error,*999)
211  END SELECT
212  ELSE
213  CALL flag_error("Equations set is not associated.",err,error,*999)
214  ENDIF
215 
216  exits("HELMHOLTZ_EQUATION_EQUATIONS_SET_SOLUTION_METHOD_SET")
217  RETURN
218 999 errorsexits("HELMHOLTZ_EQUATION_EQUATIONS_SET_SOLUTION_METHOD_SET",err,error)
219  RETURN 1
220  END SUBROUTINE helmholtz_equation_equations_set_solution_method_set
221 
222  !
223  !================================================================================================================================
224  !
225 
227  SUBROUTINE helmholtzequation_equationssetspecificationset(equationsSet,specification,err,error,*)
229  !Argument variables
230  TYPE(equations_set_type), POINTER :: equationsSet
231  INTEGER(INTG), INTENT(IN) :: specification(:)
232  INTEGER(INTG), INTENT(OUT) :: err
233  TYPE(varying_string), INTENT(OUT) :: error
234  !Local Variables
235  TYPE(varying_string) :: localError
236  INTEGER(INTG) :: subtype
237 
238  enters("HelmholtzEquation_EquationsSetSpecificationSet",err,error,*999)
239 
240  IF(ASSOCIATED(equationsset)) THEN
241  IF(SIZE(specification,1)/=3) THEN
242  CALL flagerror("Equations set specification must have three entries for a Helmholtz type equations set.", &
243  & err,error,*999)
244  END IF
245  subtype=specification(3)
246  SELECT CASE(subtype)
247  CASE(equations_set_no_source_helmholtz_subtype)
248  !ok
249  CASE DEFAULT
250  localerror="The third equations set specification of "//trim(numbertovstring(subtype,"*",err,error))// &
251  & " is not valid for a Helmholtz type of a classical field equations set."
252  CALL flagerror(localerror,err,error,*999)
253  END SELECT
254  !Set full specification
255  IF(ALLOCATED(equationsset%specification)) THEN
256  CALL flagerror("Equations set specification is already allocated.",err,error,*999)
257  ELSE
258  ALLOCATE(equationsset%specification(3),stat=err)
259  IF(err/=0) CALL flagerror("Could not allocate equations set specification.",err,error,*999)
260  END IF
261  equationsset%specification(1:3)=[equations_set_classical_field_class,equations_set_helmholtz_equation_type,subtype]
262  ELSE
263  CALL flagerror("Equations set is not associated.",err,error,*999)
264  END IF
265 
266  exits("HelmholtzEquation_EquationsSetSpecificationSet")
267  RETURN
268 999 errors("HelmholtzEquation_EquationsSetSpecificationSet",err,error)
269  exits("HelmholtzEquation_EquationsSetSpecificationSet")
270  RETURN 1
271 
272  END SUBROUTINE helmholtzequation_equationssetspecificationset
273 
274  !
275  !================================================================================================================================
276  !
277 
279  SUBROUTINE helmholtz_equation_equations_set_linear_setup(EQUATIONS_SET,EQUATIONS_SET_SETUP,ERR,ERROR,*)
281  !Argument variables
282  TYPE(equations_set_type), POINTER :: EQUATIONS_SET
283  TYPE(equations_set_setup_type), INTENT(INOUT) :: EQUATIONS_SET_SETUP
284  INTEGER(INTG), INTENT(OUT) :: ERR
285  TYPE(varying_string), INTENT(OUT) :: ERROR
286  !Local Variables
287  TYPE(varying_string) :: LOCAL_ERROR
288 
289  enters("HELMHOLTZ_EQUATION_EQUATION_SET_LINEAR_SETUP",err,error,*999)
290 
291  IF(ASSOCIATED(equations_set)) THEN
292  IF(equations_set%SUBTYPE==equations_set_no_source_helmholtz_subtype) THEN
293  SELECT CASE(equations_set_setup%SETUP_TYPE)
301  CASE DEFAULT
302  local_error="The setup type of "//trim(number_to_vstring(equations_set_setup%SETUP_TYPE,"*",err,error))// &
303  & " is invalid for a standard Helmholtz equation."
304  CALL flag_error(local_error,err,error,*999)
305  END SELECT
306  ELSE
307  local_error="The equations set subtype of "//trim(number_to_vstring(equations_set%SUBTYPE,"*",err,error))// &
308  & " does not equal a linear Helmholtz equation subtype."
309  CALL flag_error(local_error,err,error,*999)
310  ENDIF
311  ELSE
312  CALL flag_error("Equations set is not associated.",err,error,*999)
313  ENDIF
314 
315  exits("HELMHOLTZ_EQUATION_EQUATIONS_SET_LINEAR_SETUP")
316  RETURN
317 999 errorsexits("HELMHOLTZ_EQUATION_EQUATIONS_SET_LINEAR_SETUP",err,error)
318  RETURN 1
319  END SUBROUTINE helmholtz_equation_equations_set_linear_setup
320 
321  !
322  !================================================================================================================================
323  !
324 
326  SUBROUTINE helmholtz_equation_problem_setup(PROBLEM,PROBLEM_SETUP,ERR,ERROR,*)
327 
328  !Argument variables
329  TYPE(problem_type), POINTER :: PROBLEM
330  TYPE(problem_setup_type), INTENT(INOUT) :: PROBLEM_SETUP
331  INTEGER(INTG), INTENT(OUT) :: ERR
332  TYPE(varying_string), INTENT(OUT) :: ERROR
333  !Local Variables
334  TYPE(varying_string) :: LOCAL_ERROR
335 
336  enters("HELMHOLTZ_EQUATION_PROBLEM_SETUP",err,error,*999)
337 
338  IF(ASSOCIATED(problem)) THEN
339  SELECT CASE(problem%SUBTYPE)
340  CASE(problem_no_source_helmholtz_subtype)
341  CALL helmholtz_equation_problem_linear_setup(problem,problem_setup,err,error,*999)
342  CASE DEFAULT
343  local_error="Problem subtype "//trim(number_to_vstring(problem%SUBTYPE,"*",err,error))// &
344  & " is not valid for a Helmholtz equation type of a classical field problem class."
345  CALL flag_error(local_error,err,error,*999)
346  END SELECT
347  ELSE
348  CALL flag_error("Problem is not associated.",err,error,*999)
349  ENDIF
350 
351  exits("HELMHOLTZ_EQUATION_PROBLEM_SETUP")
352  RETURN
353 999 errorsexits("HELMHOLTZ_EQUATION_PROBLEM_SETUP",err,error)
354  RETURN 1
355  END SUBROUTINE helmholtz_equation_problem_setup
356 
357  !
358  !================================================================================================================================
359  !
360 
362  SUBROUTINE helmholtz_equation_problem_subtype_set(PROBLEM,PROBLEM_SUBTYPE,ERR,ERROR,*)
364  !Argument variables
365  TYPE(problem_type), POINTER :: PROBLEM
366  INTEGER(INTG), INTENT(IN) :: PROBLEM_SUBTYPE
367  INTEGER(INTG), INTENT(OUT) :: ERR
368  TYPE(varying_string), INTENT(OUT) :: ERROR
369  !Local Variables
370  TYPE(varying_string) :: LOCAL_ERROR
371 
372  enters("HELMHOLTZ_EQUATION_PROBLEM_SUBTYPE_SET",err,error,*999)
373 
374  IF(ASSOCIATED(problem)) THEN
375  SELECT CASE(problem_subtype)
376  CASE(problem_no_source_helmholtz_subtype)
377  problem%CLASS=problem_classical_field_class
379  problem%SUBTYPE=problem_no_source_helmholtz_subtype
380  CASE DEFAULT
381  local_error="Problem subtype "//trim(number_to_vstring(problem_subtype,"*",err,error))// &
382  & " is not valid for a Helmholtz equation type of a classical field problem class."
383  CALL flag_error(local_error,err,error,*999)
384  END SELECT
385  ELSE
386  CALL flag_error("Problem is not associated.",err,error,*999)
387  ENDIF
388 
389  exits("HELMHOLTZ_EQUATION_PROBLEM_SUBTYPE_SET")
390  RETURN
391 999 errorsexits("HELMHOLTZ_EQUATION_PROBLEM_SUBTYPE_SET",err,error)
392  RETURN 1
393  END SUBROUTINE helmholtz_equation_problem_subtype_set
394 
395  !
396  !================================================================================================================================
397  !
398 
400  SUBROUTINE helmholtz_equation_problem_linear_setup(PROBLEM,PROBLEM_SETUP,ERR,ERROR,*)
402  !Argument variables
403  TYPE(problem_type), POINTER :: PROBLEM
404  TYPE(problem_setup_type), INTENT(INOUT) :: PROBLEM_SETUP
405  INTEGER(INTG), INTENT(OUT) :: ERR
406  TYPE(varying_string), INTENT(OUT) :: ERROR
407  !Local Variables
408  TYPE(varying_string) :: LOCAL_ERROR
409 
410  enters("HELMHOLTZ_EQUATION_PROBLEM_LINEAR_SETUP",err,error,*999)
411 
412  IF(ASSOCIATED(problem)) THEN
413  IF(problem%SUBTYPE==problem_no_source_helmholtz_subtype) THEN
414  SELECT CASE(problem_setup%SETUP_TYPE)
419  CASE DEFAULT
420  local_error="The setup type of "//trim(number_to_vstring(problem_setup%SETUP_TYPE,"*",err,error))// &
421  & " is invalid for a linear Helmholtz equation."
422  CALL flag_error(local_error,err,error,*999)
423  END SELECT
424  ELSE
425  local_error="The problem subtype of "//trim(number_to_vstring(problem%SUBTYPE,"*",err,error))// &
426  & " does not equal a linear Helmholtz equation subtype."
427  CALL flag_error(local_error,err,error,*999)
428  ENDIF
429  ELSE
430  CALL flag_error("Problem is not associated.",err,error,*999)
431  ENDIF
432 
433  exits("HELMHOLTZ_EQUATION_PROBLEM_LINEAR_SETUP")
434  RETURN
435 999 errorsexits("HELMHOLTZ_EQUATION_PROBLEM_LINEAR_SETUP",err,error)
436  RETURN 1
437  END SUBROUTINE helmholtz_equation_problem_linear_setup
438 
439  !
440  !================================================================================================================================
441  !
442 
integer(intg), parameter equations_set_setup_dependent_type
Dependent variables.
integer(intg), parameter equations_set_fem_solution_method
Finite Element Method solution method.
This module contains all basis function routines.
integer(intg), parameter equations_set_setup_materials_type
Materials setup.
subroutine, public enters(NAME, ERR, ERROR,)
Records the entry into the named procedure and initialises the error code.
Contains information about the equations in an equations set.
Definition: types.f90:1735
integer(intg), parameter equations_set_gfem_solution_method
Grid-based Finite Element Method solution method.
integer(intg), parameter problem_setup_control_type
Solver setup for a problem.
This module handles all problem wide constants.
Converts a number to its equivalent varying string representation.
Definition: strings.f90:161
This module handles all equations matrix and rhs routines.
Contains information on an equations set.
Definition: types.f90:1941
This module handles all equations routines.
integer(intg), parameter equations_set_setup_source_type
Source setup.
integer(intg), parameter equations_set_no_subtype
This module contains all string manipulation and transformation routines.
Definition: strings.f90:45
This module contains routines for timing the program.
Definition: timer_f.f90:45
This module provides an iso_varying_string module, conformant to the API specified in ISO/IEC 1539-2:...
integer(intg), parameter problem_setup_solvers_type
Solver setup for a problem.
integer(intg), parameter equations_set_setup_equations_type
Equations setup.
This module contains all program wide constants.
Definition: constants.f90:45
integer(intg), parameter problem_setup_initial_type
Initial setup for a problem.
integer(intg), parameter problem_classical_field_class
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
integer(intg), parameter equations_set_helmholtz_equation_type
This module contains all the low-level base routines e.g., all debug, control, and low-level communic...
This module handles all Helmholtz equations routines.
This module handles all domain mappings routines.
This module handles all equations mapping routines.
integer(intg), parameter equations_set_gfv_solution_method
Grid-based Finite Volume solution method.
integer(intg), parameter equations_set_setup_geometry_type
Geometry setup.
Contains information for a problem.
Definition: types.f90:3221
integer(intg), parameter equations_set_classical_field_class
This module handles all distributed matrix vector routines.
This module handles all boundary conditions routines.
This module handles all solver routines.
integer(intg), parameter problem_helmholtz_equation_type
This module contains all routines dealing with (non-distributed) matrix and vectors types...
integer(intg), parameter problem_setup_solver_equations_type
Solver equations setup for a problem.
integer(intg), parameter equations_set_fd_solution_method
Finite Difference solution method.
Contains information on the setup information for an equations set.
Definition: types.f90:1866
This module handles all control loop routines.
subroutine, public errors(NAME, ERR, ERROR)
Records the exiting error of the subroutine.
This module defines all constants shared across equations set routines.
integer(intg), parameter equations_set_bem_solution_method
Boundary Element Method solution method.
integer(intg), parameter equations_set_fv_solution_method
Finite Volume solution method.
Flags an error condition.
integer(intg), parameter equations_set_setup_initial_type
Initial setup.
integer(intg), parameter equations_set_setup_analytic_type
Analytic setup.
Flags an error condition.
This module contains all kind definitions.
Definition: kinds.f90:45
This module handles all formating and input and output.