OpenCMISS-Iron Internal API Documentation
classical_field_routines.f90
Go to the documentation of this file.
1 
43 
46 
49  USE base_routines
54  USE kinds
60  USE strings
61  USE types
62 
63 #include "macros.h"
64 
65  IMPLICIT NONE
66 
67  PRIVATE
68 
69  !Module parameters
70 
71  !Module types
72 
73  !Module variables
74 
75  !Interfaces
76 
78 
80 
82 
84 
86 
88 
90 
92 
94 
96 
98 
99 CONTAINS
100 
101  !
102  !================================================================================================================================
103  !
104 
106  SUBROUTINE classical_field_analytic_functions_evaluate(EQUATIONS_SET,EQUATIONS_TYPE,ANALYTIC_FUNCTION_TYPE,POSITION,TANGENTS, &
107  & normal,time,variable_type,global_derivative,component_number,analytic_parameters,materials_parameters,VALUE,err,error,*)
109  !Argument variables
110  TYPE(equations_set_type), POINTER :: EQUATIONS_SET
111  INTEGER(INTG), INTENT(IN) :: EQUATIONS_TYPE
112  INTEGER(INTG), INTENT(IN) :: ANALYTIC_FUNCTION_TYPE
113  REAL(DP), INTENT(IN) :: POSITION(:)
114  REAL(DP), INTENT(IN) :: TANGENTS(:,:)
115  REAL(DP), INTENT(IN) :: NORMAL(:)
116  REAL(DP), INTENT(IN) :: TIME
117  INTEGER(INTG), INTENT(IN) :: VARIABLE_TYPE
118  INTEGER(INTG), INTENT(IN) :: GLOBAL_DERIVATIVE
119  INTEGER(INTG), INTENT(IN) :: COMPONENT_NUMBER
120  REAL(DP), INTENT(IN) :: ANALYTIC_PARAMETERS(:)
121  REAL(DP), INTENT(IN) :: MATERIALS_PARAMETERS(:)
122  REAL(DP), INTENT(OUT) :: VALUE
123  INTEGER(INTG), INTENT(OUT) :: ERR
124  TYPE(varying_string), INTENT(OUT) :: ERROR
125  !Local Variables
126  TYPE(varying_string) :: LOCAL_ERROR
127 
128  enters("CLASSICAL_FIELD_ANALYTIC_FUNCTIONS_EVALUATE",err,error,*999)
129 
130  IF(ASSOCIATED(equations_set)) THEN
131  SELECT CASE(equations_type)
133  CALL flagerror("Not implemented.",err,error,*999)
135  CALL flagerror("Not implemented.",err,error,*999)
137  CALL flagerror("Not implemented.",err,error,*999)
139  CALL flagerror("Not implemented.",err,error,*999)
141  CALL flagerror("Not implemented.",err,error,*999)
143  CALL diffusion_analyticfunctionsevaluate(equations_set,analytic_function_type,position, &
144  & tangents,normal,time,variable_type,global_derivative,component_number,analytic_parameters, &
145  & materials_parameters,VALUE,err,error,*999)
147  CALL flagerror("Not implemented.",err,error,*999)
149  CALL flagerror("Not implemented.",err,error,*999)
151  CALL flagerror("Not implemented.",err,error,*999)
153  CALL flagerror("Not implemented.",err,error,*999)
154  CASE DEFAULT
155  local_error="Equations set equation type "//trim(number_to_vstring(equations_type,"*",err,error))// &
156  & " is not valid for a classical field equations set class."
157  CALL flagerror(local_error,err,error,*999)
158  END SELECT
159  ELSE
160  CALL flagerror("Equations set is not associated.",err,error,*999)
161  ENDIF
162 
163  exits("CLASSICAL_FIELD_ANALYTIC_FUNCTIONS_EVALUATE")
164  RETURN
165 999 errorsexits("CLASSICAL_FIELD_ANALYTIC_FUNCTIONS_EVALUATE",err,error)
166  RETURN 1
168 
169  !
170  !================================================================================================================================
171  !
172 
174  SUBROUTINE classical_field_control_loop_post_loop(CONTROL_LOOP,ERR,ERROR,*)
176  !Argument variables
177  TYPE(control_loop_type), POINTER :: CONTROL_LOOP
178  INTEGER(INTG), INTENT(OUT) :: ERR
179  TYPE(varying_string), INTENT(OUT) :: ERROR
180  !Local Variables
181  TYPE(problem_type), POINTER :: PROBLEM
182  TYPE(varying_string) :: LOCAL_ERROR
183 
184  enters("CLASSICAL_FIELD_CONTROL_LOOP_POST_LOOP",err,error,*999)
185 
186  IF(ASSOCIATED(control_loop)) THEN
187  problem=>control_loop%PROBLEM
188  IF(ASSOCIATED(problem)) THEN
189  SELECT CASE(control_loop%LOOP_TYPE)
191  SELECT CASE(problem%specification(2))
193  CALL diffusion_equation_control_loop_post_loop(control_loop,err,error,*999)
195  CALL reaction_diffusion_control_loop_post_loop(control_loop,err,error,*999)
196  CASE DEFAULT
197  local_error="The second problem specification of "// &
198  & trim(number_to_vstring(problem%specification(2),"*",err,error))// &
199  & " is not valid for a classical field problem."
200  CALL flagerror(local_error,err,error,*999)
201  END SELECT
202  CASE DEFAULT
203  !do nothing
204  END SELECT
205  ELSE
206  CALL flagerror("Control loop problem is not associated.",err,error,*999)
207  ENDIF
208  ELSE
209  CALL flagerror("Control loop is not associated.",err,error,*999)
210  ENDIF
211 
212  exits("CLASSICAL_FIELD_CONTROL_LOOP_POST_LOOP")
213  RETURN
214 999 errorsexits("CLASSICAL_FIELD_LOOP_POST_LOOP",err,error)
215  RETURN 1
216 
218 
219  !
220  !================================================================================================================================
221  !
222 
224  SUBROUTINE classicalfield_equationssetspecificationset(equationsSet,specification,err,error,*)
226  !Argument variables
227  TYPE(equations_set_type), POINTER :: equationsSet
228  INTEGER(INTG), INTENT(IN) :: specification(:)
229  INTEGER(INTG), INTENT(OUT) :: err
230  TYPE(varying_string), INTENT(OUT) :: error
231  !Local Variables
232  TYPE(varying_string) :: localError
233 
234  enters("ClassicalField_EquationsSetSpecificationSet",err,error,*999)
235 
236  IF(ASSOCIATED(equationsset)) THEN
237  IF(SIZE(specification,1)<2) THEN
238  CALL flagerror("Equations set specification must have at least two entries for a classical field class equations set.", &
239  & err,error,*999)
240  END IF
241  SELECT CASE(specification(2))
243  CALL laplace_equationssetspecificationset(equationsset,specification,err,error,*999)
245  CALL hjequation_equationssetspecificationset(equationsset,specification,err,error,*999)
247  CALL poisson_equationssetspecificationset(equationsset,specification,err,error,*999)
249  CALL helmholtz_equationssetspecificationset(equationsset,specification,err,error,*999)
251  CALL flagerror("Not implemented.",err,error,*999)
253  CALL diffusion_equationssetspecificationset(equationsset,specification,err,error,*999)
255  CALL advection_equationssetspecificationset(equationsset,specification,err,error,*999)
257  CALL advectiondiffusion_equationssetspecificationset(equationsset,specification,err,error,*999)
259  CALL reactiondiffusion_equationssetspecificationset(equationsset,specification,err,error,*999)
261  CALL flagerror("Not implemented.",err,error,*999)
262  CASE DEFAULT
263  localerror="The second equations set specification of "//trim(numbertovstring(specification(2),"*",err,error))// &
264  & " is not valid for a classical field equations set."
265  CALL flagerror(localerror,err,error,*999)
266  END SELECT
267  ELSE
268  CALL flagerror("Equations set is not associated",err,error,*999)
269  END IF
270 
271  exits("ClassicalField_EquationsSetSpecificationSet")
272  RETURN
273 999 errors("ClassicalField_EquationsSetSpecificationSet",err,error)
274  exits("ClassicalField_EquationsSetSpecificationSet")
275  RETURN 1
276 
278 
279  !
280  !================================================================================================================================
281  !
282 
284  SUBROUTINE classical_field_finite_element_calculate(EQUATIONS_SET,ELEMENT_NUMBER,ERR,ERROR,*)
286  !Argument variables
287  TYPE(equations_set_type), POINTER :: EQUATIONS_SET
288  INTEGER(INTG), INTENT(IN) :: ELEMENT_NUMBER
289  INTEGER(INTG), INTENT(OUT) :: ERR
290  TYPE(varying_string), INTENT(OUT) :: ERROR
291  !Local Variables
292  TYPE(varying_string) :: LOCAL_ERROR
293 
294  enters("CLASSICAL_FIELD_FINITE_ELEMENT_CALCULATE",err,error,*999)
295 
296  IF(ASSOCIATED(equations_set)) THEN
297  IF(.NOT.ALLOCATED(equations_set%SPECIFICATION)) THEN
298  CALL flagerror("Equations set specification is not allocated.",err,error,*999)
299  ELSE IF(SIZE(equations_set%SPECIFICATION,1)<2) THEN
300  CALL flagerror("Equations set specification must have at least two entries for a classical field class equations set.", &
301  & err,error,*999)
302  END IF
303  SELECT CASE(equations_set%SPECIFICATION(2))
305  CALL laplaceequation_finiteelementcalculate(equations_set,element_number,err,error,*999)
307  CALL hj_equation_finite_element_calculate(equations_set,element_number,err,error,*999)
309  CALL poisson_equation_finite_element_calculate(equations_set,element_number,err,error,*999)
311  CALL helmholtz_equation_finite_element_calculate(equations_set,element_number,err,error,*999)
313  CALL flagerror("Not implemented.",err,error,*999)
315  CALL diffusion_equation_finite_element_calculate(equations_set,element_number,err,error,*999)
317  CALL advectiondiffusion_finiteelementcalculate(equations_set,element_number,err,error,*999)
319  CALL advection_equation_finite_element_calculate(equations_set,element_number,err,error,*999)
321  CALL reactiondiffusion_finiteelementcalculate(equations_set,element_number,err,error,*999)
323  CALL flagerror("Not implemented.",err,error,*999)
324  CASE DEFAULT
325  local_error="Equations set type "//trim(number_to_vstring(equations_set%SPECIFICATION(2),"*",err,error))// &
326  & " is not valid for a classical field equation set class."
327  CALL flagerror(local_error,err,error,*999)
328  END SELECT
329  ELSE
330  CALL flagerror("Equations set is not associated",err,error,*999)
331  ENDIF
332 
333  exits("CLASSICAL_FIELD_FINITE_ELEMENT_CALCULATE")
334  RETURN
335 999 errorsexits("CLASSICAL_FIELD_FINITE_ELEMENT_CALCULATE",err,error)
336  RETURN 1
338 
339  !
340  !================================================================================================================================
341  !
342 
344  SUBROUTINE classicalfield_finiteelementjacobianevaluate(EQUATIONS_SET,ELEMENT_NUMBER,ERR,ERROR,*)
346  !Argument variables
347  TYPE(equations_set_type), POINTER :: EQUATIONS_SET
348  INTEGER(INTG), INTENT(IN) :: ELEMENT_NUMBER
349  INTEGER(INTG), INTENT(OUT) :: ERR
350  TYPE(varying_string), INTENT(OUT) :: ERROR
351  !Local Variables
352  TYPE(varying_string) :: LOCAL_ERROR
353 
354  enters("ClassicalField_FiniteElementJacobianEvaluate",err,error,*999)
355 
356  IF(ASSOCIATED(equations_set)) THEN
357  IF(.NOT.ALLOCATED(equations_set%SPECIFICATION)) THEN
358  CALL flagerror("Equations set specification is not allocated.",err,error,*999)
359  ELSE IF(SIZE(equations_set%SPECIFICATION,1)<2) THEN
360  CALL flagerror("Equations set specification must have at least two entries for a classical field class equations set.", &
361  & err,error,*999)
362  END IF
363  SELECT CASE(equations_set%SPECIFICATION(2))
365  CALL flagerror("Not implemented.",err,error,*999)
367  CALL flagerror("Not implemented.",err,error,*999)
369  CALL poisson_finiteelementjacobianevaluate(equations_set,element_number,err,error,*999)
371  CALL flagerror("Not implemented.",err,error,*999)
373  CALL flagerror("Not implemented.",err,error,*999)
375  CALL diffusion_finiteelementjacobianevaluate(equations_set,element_number,err,error,*999)
377  CALL flagerror("Not implemented.",err,error,*999)
379  CALL flagerror("Not implemented.",err,error,*999)
381  CALL flagerror("Not implemented.",err,error,*999)
383  CALL flagerror("Not implemented.",err,error,*999)
384  CASE DEFAULT
385  local_error="Equations set type "//trim(number_to_vstring(equations_set%SPECIFICATION(2),"*",err,error))// &
386  & " is not valid for a classical field equation set class."
387  CALL flagerror(local_error,err,error,*999)
388  END SELECT
389  ELSE
390  CALL flagerror("Equations set is not associated",err,error,*999)
391  ENDIF
392 
393  exits("ClassicalField_FiniteElementJacobianEvaluate")
394  RETURN
395 999 errors("ClassicalField_FiniteElementJacobianEvaluate",err,error)
396  exits("ClassicalField_FiniteElementJacobianEvaluate")
397  RETURN 1
398 
400 
401  !
402  !================================================================================================================================
403  !
404 
406  SUBROUTINE classicalfield_finiteelementresidualevaluate(EQUATIONS_SET,ELEMENT_NUMBER,ERR,ERROR,*)
408  !Argument variables
409  TYPE(equations_set_type), POINTER :: EQUATIONS_SET
410  INTEGER(INTG), INTENT(IN) :: ELEMENT_NUMBER
411  INTEGER(INTG), INTENT(OUT) :: ERR
412  TYPE(varying_string), INTENT(OUT) :: ERROR
413  !Local Variables
414  TYPE(varying_string) :: LOCAL_ERROR
415 
416  enters("ClassicalField_FiniteElementResidualEvaluate",err,error,*999)
417 
418  IF(ASSOCIATED(equations_set)) THEN
419  IF(.NOT.ALLOCATED(equations_set%SPECIFICATION)) THEN
420  CALL flagerror("Equations set specification is not allocated.",err,error,*999)
421  ELSE IF(SIZE(equations_set%SPECIFICATION,1)<2) THEN
422  CALL flagerror("Equations set specification must have at least two entries for a classical field class equations set.", &
423  & err,error,*999)
424  END IF
425  SELECT CASE(equations_set%SPECIFICATION(2))
427  CALL flagerror("Not implemented.",err,error,*999)
429  CALL flagerror("Not implemented.",err,error,*999)
431  CALL poisson_finiteelementresidualevaluate(equations_set,element_number,err,error,*999)
433  CALL flagerror("Not implemented.",err,error,*999)
435  CALL flagerror("Not implemented.",err,error,*999)
437  CALL diffusion_finiteelementresidualevaluate(equations_set,element_number,err,error,*999)
439  CALL flagerror("Not implemented.",err,error,*999)
441  CALL advection_equation_finite_element_calculate(equations_set,element_number,err,error,*999)
443  CALL flagerror("Not implemented.",err,error,*999)
445  CALL flagerror("Not implemented.",err,error,*999)
446  CASE DEFAULT
447  local_error="Equations set type "//trim(number_to_vstring(equations_set%SPECIFICATION(2),"*",err,error))// &
448  & " is not valid for a classical field equation set class."
449  CALL flagerror(local_error,err,error,*999)
450  END SELECT
451  ELSE
452  CALL flagerror("Equations set is not associated",err,error,*999)
453  ENDIF
454 
455  exits("ClassicalField_FiniteElementResidualEvaluate")
456  RETURN
457 999 errors("ClassicalField_FiniteElementResidualEvaluate",err,error)
458  exits("ClassicalField_FiniteElementResidualEvaluate")
459  RETURN 1
460 
462 
463  !
464  !================================================================================================================================
465  !
466 
468  SUBROUTINE classical_field_equations_set_setup(EQUATIONS_SET,EQUATIONS_SET_SETUP,ERR,ERROR,*)
470  !Argument variables
471  TYPE(equations_set_type), POINTER :: EQUATIONS_SET
472  TYPE(equations_set_setup_type), INTENT(INOUT) :: EQUATIONS_SET_SETUP
473  INTEGER(INTG), INTENT(OUT) :: ERR
474  TYPE(varying_string), INTENT(OUT) :: ERROR
475  !Local Variables
476  TYPE(varying_string) :: LOCAL_ERROR
477 
478  enters("CLASSICAL_FIELD_EQUATIONS_SET_SETUP",err,error,*999)
479 
480  IF(ASSOCIATED(equations_set)) THEN
481  IF(.NOT.ALLOCATED(equations_set%SPECIFICATION)) THEN
482  CALL flagerror("Equations set specification is not allocated.",err,error,*999)
483  ELSE IF(SIZE(equations_set%SPECIFICATION,1)<2) THEN
484  CALL flagerror("Equations set specification must have at least two entries for a classical field class equations set.", &
485  & err,error,*999)
486  END IF
487  SELECT CASE(equations_set%SPECIFICATION(2))
489  CALL laplace_equation_equations_set_setup(equations_set,equations_set_setup,err,error,*999)
491  CALL hj_equation_equations_set_setup(equations_set,equations_set_setup,err,error,*999)
493  CALL poisson_equation_equations_set_setup(equations_set,equations_set_setup,err,error,*999)
495  CALL helmholtz_equation_equations_set_setup(equations_set,equations_set_setup,err,error,*999)
497  CALL flagerror("Not implemented.",err,error,*999)
499  CALL diffusion_equation_equations_set_setup(equations_set,equations_set_setup,err,error,*999)
501  CALL advectiondiffusion_equationssetsetup(equations_set,equations_set_setup,err,error,*999)
503  CALL advection_equationssetsetup(equations_set,equations_set_setup,err,error,*999)
505  CALL reactiondiffusion_equationssetsetup(equations_set,equations_set_setup,err,error,*999)
507  CALL flagerror("Not implemented.",err,error,*999)
508  CASE DEFAULT
509  local_error="Equation set type "//trim(number_to_vstring(equations_set%SPECIFICATION(2),"*",err,error))// &
510  & " is not valid for a classical field equation set class."
511  CALL flagerror(local_error,err,error,*999)
512  END SELECT
513  ELSE
514  CALL flagerror("Equations set is not associated.",err,error,*999)
515  ENDIF
516 
517  exits("CLASSICAL_FIELD_EQUATIONS_SET_SETUP")
518  RETURN
519 999 errorsexits("CLASSICAL_FIELD_EQUATIONS_SET_SETUP",err,error)
520  RETURN 1
522 
523  !
524  !================================================================================================================================
525  !
526 
528  SUBROUTINE classicalfield_equationssetsolutionmethodset(EQUATIONS_SET,SOLUTION_METHOD,ERR,ERROR,*)
530  !Argument variables
531  TYPE(equations_set_type), POINTER :: EQUATIONS_SET
532  INTEGER(INTG), INTENT(IN) :: SOLUTION_METHOD
533  INTEGER(INTG), INTENT(OUT) :: ERR
534  TYPE(varying_string), INTENT(OUT) :: ERROR
535  !Local Variables
536  TYPE(varying_string) :: LOCAL_ERROR
537 
538  enters("CLASSICAL_FIELD_EQUATIONS_SOLUTION_METHOD_SET",err,error,*999)
539 
540  IF(ASSOCIATED(equations_set)) THEN
541  IF(.NOT.ALLOCATED(equations_set%SPECIFICATION)) THEN
542  CALL flagerror("Equations set specification is not allocated.",err,error,*999)
543  ELSE IF(SIZE(equations_set%SPECIFICATION,1)<2) THEN
544  CALL flagerror("Equations set specification must have at least two entries for a classical field class equations set.", &
545  & err,error,*999)
546  END IF
547  SELECT CASE(equations_set%SPECIFICATION(2))
549  CALL laplace_equationssetsolutionmethodset(equations_set,solution_method,err,error,*999)
551  CALL hjequation_equationssetsolutionmethodset(equations_set,solution_method,err,error,*999)
553  CALL poisson_equationssetsolutionmethodset(equations_set,solution_method,err,error,*999)
555  CALL helmholtz_equationssetsolutionmethodset(equations_set,solution_method,err,error,*999)
557  CALL flagerror("Not implemented.",err,error,*999)
559  CALL diffusion_equationssetsolutionmethodset(equations_set,solution_method,err,error,*999)
561  CALL advectiondiffusion_equationssetsolnmethodset(equations_set,solution_method,err,error,*999)
563  CALL advection_equationssetsolutionmethodset(equations_set,solution_method,err,error,*999)
565  CALL reactiondiffusion_equationssetsolutionmethodset(equations_set,solution_method,err,error,*999)
567  CALL flagerror("Not implemented.",err,error,*999)
568  CASE DEFAULT
569  local_error="Equations set equation type of "//trim(number_to_vstring(equations_set%SPECIFICATION(2),"*",err,error))// &
570  & " is not valid for a classical field equations set class."
571  CALL flagerror(local_error,err,error,*999)
572  END SELECT
573  ELSE
574  CALL flagerror("Equations set is not associated",err,error,*999)
575  ENDIF
576 
577  exits("ClassicalField_EquationsSetSolutionMethodSet")
578  RETURN
579 999 errors("ClassicalField_EquationsSetSolutionMethodSet",err,error)
580  exits("ClassicalField_EquationsSetSolutionMethodSet")
581  RETURN 1
582 
584 
585  !
586  !================================================================================================================================
587  !
588 
590  SUBROUTINE classicalfield_boundaryconditionsanalyticcalculate(EQUATIONS_SET,BOUNDARY_CONDITIONS,ERR,ERROR,*)
592  !Argument variables
593  TYPE(equations_set_type), POINTER :: EQUATIONS_SET
594  TYPE(boundary_conditions_type), POINTER :: BOUNDARY_CONDITIONS
595  INTEGER(INTG), INTENT(OUT) :: ERR
596  TYPE(varying_string), INTENT(OUT) :: ERROR
597  !Local Variables
598  TYPE(varying_string) :: LOCAL_ERROR
599 
600  enters("ClassicalField_BoundaryConditionsAnalyticCalculate",err,error,*999)
601 
602  IF(ASSOCIATED(equations_set)) THEN
603  IF(.NOT.ALLOCATED(equations_set%SPECIFICATION)) THEN
604  CALL flagerror("Equations set specification is not allocated.",err,error,*999)
605  ELSE IF(SIZE(equations_set%SPECIFICATION,1)<2) THEN
606  CALL flagerror("Equations set specification must have at least two entries for a classical field class equations set.", &
607  & err,error,*999)
608  END IF
609  SELECT CASE(equations_set%SPECIFICATION(2))
611  CALL laplace_boundaryconditionsanalyticcalculate(equations_set,boundary_conditions,err,error,*999)
613  CALL hj_boundaryconditionsanalyticcalculate(equations_set,boundary_conditions,err,error,*999)
615  CALL poisson_boundaryconditionsanalyticcalculate(equations_set,boundary_conditions,err,error,*999)
617  CALL helmholtz_boundaryconditionsanalyticcalculate(equations_set,boundary_conditions,err,error,*999)
619  CALL flagerror("Not implemented.",err,error,*999)
621  CALL diffusion_boundaryconditionanalyticcalculate(equations_set,boundary_conditions,err,error,*999)
623  CALL advectiondiffusion_boundaryconditionsanalyticcalculate(equations_set,boundary_conditions,err,error,*999)
625  CALL flagerror("Not implemented.",err,error,*999)
627  CALL flagerror("Not implemented.",err,error,*999)
628  CASE DEFAULT
629  local_error="Equations set equation type of "//trim(number_to_vstring(equations_set%SPECIFICATION(2),"*",err,error))// &
630  & " is not valid for a classical field equations set class."
631  CALL flagerror(local_error,err,error,*999)
632  END SELECT
633  ELSE
634  CALL flagerror("Equations set is not associated",err,error,*999)
635  ENDIF
636 
637  exits("ClassicalField_BoundaryConditionsAnalyticCalculate")
638  RETURN
639 999 errors("ClassicalField_BoundaryConditionsAnalyticCalculate",err,error)
640  exits("ClassicalField_BoundaryConditionsAnalyticCalculate")
641  RETURN 1
642 
644 
645  !
646  !================================================================================================================================
647  !
648 
650  SUBROUTINE classicalfield_problemspecificationset(problem,problemSpecification,err,error,*)
652  !Argument variables
653  TYPE(problem_type), POINTER :: problem
654  INTEGER(INTG), INTENT(IN) :: problemSpecification(:)
655  INTEGER(INTG), INTENT(OUT) :: err
656  TYPE(varying_string), INTENT(OUT) :: error
657  !Local Variables
658  TYPE(varying_string) :: localError
659  INTEGER(INTG) :: problemType
660 
661  enters("ClassicalField_ProblemSpecificationSet",err,error,*999)
662 
663  IF(ASSOCIATED(problem)) THEN
664  IF(SIZE(problemspecification,1)>=2) THEN
665  problemtype=problemspecification(2)
666  SELECT CASE(problemtype)
668  CALL laplace_problemspecificationset(problem,problemspecification,err,error,*999)
670  CALL hjequation_problemspecificationset(problem,problemspecification,err,error,*999)
672  CALL poisson_problemspecificationset(problem,problemspecification,err,error,*999)
674  CALL helmholtz_problemspecificationset(problem,problemspecification,err,error,*999)
676  CALL flagerror("Not implemented.",err,error,*999)
678  CALL diffusion_problemspecificationset(problem,problemspecification,err,error,*999)
680  CALL advection_problemspecificationset(problem,problemspecification,err,error,*999)
682  CALL advectiondiffusion_problemspecificationset(problem,problemspecification,err,error,*999)
684  CALL reactiondiffusion_problemspecificationset(problem,problemspecification,err,error,*999)
686  CALL flagerror("Not implemented.",err,error,*999)
687  CASE DEFAULT
688  localerror="The second problem specification of "//trim(numbertovstring(problemtype,"*",err,error))// &
689  & " is not valid for a classical field problem."
690  CALL flagerror(localerror,err,error,*999)
691  END SELECT
692  ELSE
693  CALL flagerror("Classical field problem specification must have a type set.",err,error,*999)
694  END IF
695  ELSE
696  CALL flagerror("Problem is not associated.",err,error,*999)
697  END IF
698 
699  exits("ClassicalField_ProblemSpecificationSet")
700  RETURN
701 999 errors("ClassicalField_ProblemSpecificationSet",err,error)
702  exits("ClassicalField_ProblemSpecificationSet")
703  RETURN 1
704 
706 
707  !
708  !================================================================================================================================
709  !
710 
712  SUBROUTINE classical_field_problem_setup(PROBLEM,PROBLEM_SETUP,ERR,ERROR,*)
714  !Argument variables
715  TYPE(problem_type), POINTER :: PROBLEM
716  TYPE(problem_setup_type), INTENT(INOUT) :: PROBLEM_SETUP
717  INTEGER(INTG), INTENT(OUT) :: ERR
718  TYPE(varying_string), INTENT(OUT) :: ERROR
719  !Local Variables
720  TYPE(varying_string) :: LOCAL_ERROR
721 
722  enters("CLASSICAL_FIELD_PROBLEM_SETUP",err,error,*999)
723 
724  IF(ASSOCIATED(problem)) THEN
725  IF(.NOT.ALLOCATED(problem%SPECIFICATION)) THEN
726  CALL flagerror("Problem specification is not allocated.",err,error,*999)
727  ELSE IF(SIZE(problem%SPECIFICATION,1)<2) THEN
728  CALL flagerror("Problem specification must have at least two entries for a classical field problem.",err,error,*999)
729  END IF
730  SELECT CASE(problem%SPECIFICATION(2))
732  CALL laplace_equation_problem_setup(problem,problem_setup,err,error,*999)
734  CALL hj_equation_problem_setup(problem,problem_setup,err,error,*999)
736  CALL poisson_equation_problem_setup(problem,problem_setup,err,error,*999)
738  CALL helmholtz_equation_problem_setup(problem,problem_setup,err,error,*999)
740  CALL flagerror("Not implemented.",err,error,*999)
742  CALL diffusion_equation_problem_setup(problem,problem_setup,err,error,*999)
744  CALL advection_equation_problem_setup(problem,problem_setup,err,error,*999)
746  CALL advection_diffusion_equation_problem_setup(problem,problem_setup,err,error,*999)
748  CALL reaction_diffusion_equation_problem_setup(problem,problem_setup,err,error,*999)
750  CALL flagerror("Not implemented.",err,error,*999)
751  CASE DEFAULT
752  local_error="Problem type "//trim(number_to_vstring(problem%SPECIFICATION(2),"*",err,error))// &
753  & " is not valid for a classical field problem class."
754  CALL flagerror(local_error,err,error,*999)
755  END SELECT
756  ELSE
757  CALL flagerror("Problem is not associated.",err,error,*999)
758  ENDIF
759 
760  exits("CLASSICAL_FIELD_PROBLEM_SETUP")
761  RETURN
762 999 errorsexits("CLASSICAL_FIELD_PROBLEM_SETUP",err,error)
763  RETURN 1
764  END SUBROUTINE classical_field_problem_setup
765 
766  !
767  !================================================================================================================================
768  !
769 
771  SUBROUTINE classical_field_pre_solve(CONTROL_LOOP,SOLVER,ERR,ERROR,*)
773  !Argument variables
774  TYPE(control_loop_type), POINTER :: CONTROL_LOOP
775  TYPE(solver_type), POINTER :: SOLVER
776  INTEGER(INTG), INTENT(OUT) :: ERR
777  TYPE(varying_string), INTENT(OUT) :: ERROR
778  !Local Variables
779  TYPE(varying_string) :: LOCAL_ERROR
780 
781  enters("CLASSICAL_FIELD_PRE_SOLVE",err,error,*999)
782 
783  IF(ASSOCIATED(control_loop%PROBLEM)) THEN
784  IF(.NOT.ALLOCATED(control_loop%PROBLEM%SPECIFICATION)) THEN
785  CALL flagerror("Problem specification is not allocated.",err,error,*999)
786  ELSE IF(SIZE(control_loop%PROBLEM%SPECIFICATION,1)<2) THEN
787  CALL flagerror("Problem specification must have at least two entries for a classical field problem.",err,error,*999)
788  END IF
789  SELECT CASE(control_loop%PROBLEM%SPECIFICATION(2))
791  !CALL LAPLACE_PRE_SOLVE(CONTROL_LOOP,SOLVER,ERR,ERROR,*999)
793  !CALL HJ_PRE_SOLVE(CONTROL_LOOP,SOLVER,ERR,ERROR,*999)
795  CALL poisson_pre_solve(control_loop,solver,err,error,*999)
797  !CALL HELMHOLTZ_PRE_SOLVE(CONTROL_LOOP,SOLVER,ERR,ERROR,*999)
799  !CALL WAVE_EQUATION_PRE_SOLVE(CONTROL_LOOP,SOLVER,ERR,ERROR,*999)
801  CALL diffusion_equation_pre_solve(control_loop,solver,err,error,*999)
803  CALL advection_pre_solve(solver,err,error,*999)
805  CALL advection_diffusion_pre_solve(control_loop,solver,err,error,*999)
807  CALL reaction_diffusion_pre_solve(solver,err,error,*999)
809  !CALL BIHARMONIC_EQUATION_PRE_SOLVE(CONTROL_LOOP,SOLVER,ERR,ERROR,*999)
810  CASE DEFAULT
811  local_error="Problem type "//trim(number_to_vstring(control_loop%PROBLEM%SPECIFICATION(2),"*",err,error))// &
812  & " is not valid for a classical field problem class."
813  CALL flagerror(local_error,err,error,*999)
814  END SELECT
815  ELSE
816  CALL flagerror("Problem is not associated.",err,error,*999)
817  ENDIF
818 
819  exits("CLASSICAL_FIELD_PRE_SOLVE")
820  RETURN
821 999 errorsexits("CLASSICAL_FIELD_PRE_SOLVE",err,error)
822  RETURN 1
823  END SUBROUTINE classical_field_pre_solve
824 
825  !
826  !================================================================================================================================
827  !
828 
830  SUBROUTINE classical_field_post_solve(CONTROL_LOOP,SOLVER,ERR,ERROR,*)
832  !Argument variables
833  TYPE(control_loop_type), POINTER :: CONTROL_LOOP
834  TYPE(solver_type), POINTER :: SOLVER
835  INTEGER(INTG), INTENT(OUT) :: ERR
836  TYPE(varying_string), INTENT(OUT) :: ERROR
837  !Local Variables
838  TYPE(varying_string) :: LOCAL_ERROR
839 
840  enters("CLASSICAL_FIELD_POST_SOLVE",err,error,*999)
841 
842  IF(ASSOCIATED(control_loop%PROBLEM)) THEN
843  IF(.NOT.ALLOCATED(control_loop%PROBLEM%SPECIFICATION)) THEN
844  CALL flagerror("Problem specification is not allocated.",err,error,*999)
845  ELSE IF(SIZE(control_loop%PROBLEM%SPECIFICATION,1)<2) THEN
846  CALL flagerror("Problem specification must have at least two entries for a classical field problem.",err,error,*999)
847  END IF
848  SELECT CASE(control_loop%PROBLEM%SPECIFICATION(2))
850  !CALL LAPLACE_POST_SOLVE(CONTROL_LOOP,SOLVER,ERR,ERROR,*999)
852  !CALL HJ_POST_SOLVE(CONTROL_LOOP,SOLVER,ERR,ERROR,*999)
854  CALL poisson_post_solve(control_loop,solver,err,error,*999)
856  !CALL HELMHOLTZ_POST_SOLVE(CONTROL_LOOP,SOLVER,ERR,ERROR,*999)
858  !CALL WAVE_EQUATION_POST_SOLVE(CONTROL_LOOP,SOLVER,ERR,ERROR,*999)
860  CALL diffusion_equation_post_solve(control_loop,solver,err,error,*999)
862  !CALL ADVECTION_POST_SOLVE(CONTROL_LOOP,SOLVER,ERR,ERROR,*999)
864  CALL advection_diffusion_post_solve(control_loop,solver,err,error,*999)
866  CALL reaction_diffusion_post_solve(control_loop,solver,err,error,*999)
868  !CALL BIHARMONIC_EQUATION_POST_SOLVE(CONTROL_LOOP,SOLVER,ERR,ERROR,*999)
869  CASE DEFAULT
870  local_error="Problem type "//trim(number_to_vstring(control_loop%PROBLEM%SPECIFICATION(2),"*",err,error))// &
871  & " is not valid for a classical field problem class."
872  CALL flagerror(local_error,err,error,*999)
873  END SELECT
874  ELSE
875  CALL flagerror("Problem is not associated.",err,error,*999)
876  ENDIF
877 
878  exits("CLASSICAL_FIELD_POST_SOLVE")
879  RETURN
880 999 errorsexits("CLASSICAL_FIELD_POST_SOLVE",err,error)
881  RETURN 1
882  END SUBROUTINE classical_field_post_solve
883 
884 
885  !
886  !================================================================================================================================
887 
888 END MODULE classical_field_routines
889 
Contains information on the boundary conditions for the solver equations.
Definition: types.f90:1780
subroutine, public enters(NAME, ERR, ERROR,)
Records the entry into the named procedure and initialises the error code.
subroutine, public advectiondiffusion_finiteelementcalculate(EQUATIONS_SET, ELEMENT_NUMBER, ERR, ERROR,)
Calculates the element stiffness matrices and RHS for a diffusion equation finite element equations s...
subroutine, public diffusion_equation_control_loop_post_loop(CONTROL_LOOP, ERR, ERROR,)
Runs after each control loop iteration.
This module handles pure advection equation routines.
Contains information about the equations in an equations set.
Definition: types.f90:1735
integer(intg), parameter problem_control_time_loop_type
Time control loop.
integer(intg), parameter problem_laplace_equation_type
integer(intg), parameter problem_biharmonic_equation_type
This module handles all problem wide constants.
subroutine, public advection_pre_solve(SOLVER, ERR, ERROR,)
Sets up the Poisson problem pre solve.
Converts a number to its equivalent varying string representation.
Definition: strings.f90:161
subroutine, public poisson_equationssetsolutionmethodset(EQUATIONS_SET, SOLUTION_METHOD, ERR, ERROR,)
Sets/changes the solution method for a Poisson equation type of an classical field equations set clas...
subroutine, public classical_field_finite_element_calculate(EQUATIONS_SET, ELEMENT_NUMBER, ERR, ERROR,)
Calculates the element stiffness matries and rhs vector for the given element number for a clasical f...
Contains information on the type of solver to be used.
Definition: types.f90:2777
This module handles all Hamilton-Jacobi equations routines.
subroutine, public classical_field_pre_solve(CONTROL_LOOP, SOLVER, ERR, ERROR,)
Sets up the output type for a classical field problem class.
subroutine, public advectiondiffusion_equationssetsetup(EQUATIONS_SET, EQUATIONS_SET_SETUP, ERR, ERROR,)
Sets up the diffusion equation type of a classical field equations set class.
subroutine, public diffusion_equation_pre_solve(CONTROL_LOOP, SOLVER, ERR, ERROR,)
Sets up the diffusion problem pre-solve.
This module handles all Laplace equations routines.
subroutine, public diffusion_boundaryconditionanalyticcalculate(EQUATIONS_SET, BOUNDARY_CONDITIONS, ERR, ERROR,)
Calculates the analytic solution and sets the boundary conditions for an analytic problem...
subroutine, public classicalfield_problemspecificationset(problem, problemSpecification, err, error,)
Sets the problem specification for a classical field problem class.
Contains information on an equations set.
Definition: types.f90:1941
This module contains all string manipulation and transformation routines.
Definition: strings.f90:45
subroutine, public laplace_equationssetspecificationset(equationsSet, specification, err, error,)
Sets the equation specification for a Laplace type of a classical field equations set...
subroutine, public classical_field_problem_setup(PROBLEM, PROBLEM_SETUP, ERR, ERROR,)
Sets up the problem for a classical field problem class.
subroutine, public classical_field_post_solve(CONTROL_LOOP, SOLVER, ERR, ERROR,)
Sets up the output type for a classical field problem class.
subroutine, public poisson_pre_solve(CONTROL_LOOP, SOLVER, ERR, ERROR,)
Sets up the Poisson problem pre solve.
integer(intg), parameter equations_set_poisson_equation_type
integer(intg), parameter equations_set_laplace_equation_type
integer(intg), parameter problem_hj_equation_type
subroutine, public diffusion_problemspecificationset(problem, problemSpecification, err, error,)
Sets the problem specification for a diffusion equation problem.
subroutine, public advectiondiffusion_boundaryconditionsanalyticcalculate(EQUATIONS_SET, BOUNDARY_CONDITIONS, ERR, ERROR,)
Calculates the analytic solution and sets the boundary conditions for an analytic problem...
Contains information on a control loop.
Definition: types.f90:3185
subroutine, public laplace_equation_problem_setup(PROBLEM, PROBLEM_SETUP, ERR, ERROR,)
Sets up the Laplace problem.
subroutine, public advectiondiffusion_problemspecificationset(problem, problemSpecification, err, error,)
Sets the problem specification for an advection diffusion problem type.
This module provides an iso_varying_string module, conformant to the API specified in ISO/IEC 1539-2:...
subroutine, public classicalfield_finiteelementjacobianevaluate(EQUATIONS_SET, ELEMENT_NUMBER, ERR, ERROR,)
Evaluates the element Jacobian matrix for the given element number for a clasical field class finite ...
This module handles all classical field class routines.
subroutine, public poisson_equationssetspecificationset(equationsSet, specification, err, error,)
Sets the equation specification for a Poisson equation type of a classical field equations set class...
subroutine, public poisson_problemspecificationset(problem, problemSpecification, err, error,)
Sets the problem specification for a Poisson equation type.
subroutine, public advection_equationssetspecificationset(equationsSet, specification, err, error,)
Sets the equation specification for an advection type of a classical field equations set...
subroutine, public diffusion_finiteelementjacobianevaluate(EQUATIONS_SET, ELEMENT_NUMBER, ERR, ERROR,)
Evaluates the Jacobian element stiffness matrices for a diffusion equation finite element equations s...
This module handles all Poisson equations routines.
subroutine, public laplace_equationssetsolutionmethodset(EQUATIONS_SET, SOLUTION_METHOD, ERR, ERROR,)
Sets/changes the solution method for a Laplace equation type of an classical field equations set clas...
This module handles all advection-diffusion equation routines.
subroutine, public exits(NAME)
Records the exit out of the named procedure.
subroutine, public classicalfield_boundaryconditionsanalyticcalculate(EQUATIONS_SET, BOUNDARY_CONDITIONS, ERR, ERROR,)
Sets the analytic boundary conditions for a classical field equation set class.
This module contains all type definitions in order to avoid cyclic module references.
Definition: types.f90:70
subroutine, public advectiondiffusion_equationssetspecificationset(equationsSet, specification, err, error,)
Sets the equation specification for a diffusion equation type of a classical field equations set clas...
integer(intg), parameter equations_set_helmholtz_equation_type
subroutine, public advection_equationssetsetup(EQUATIONS_SET, EQUATIONS_SET_SETUP, ERR, ERROR,)
Sets up the diffusion equation type of a classical field equations set class.
integer(intg), parameter equations_set_advection_equation_type
subroutine, public diffusion_analyticfunctionsevaluate(EQUATIONS_SET, ANALYTIC_FUNCTION_TYPE, X, TANGENTS, NORMAL, TIME, VARIABLE_TYPE, GLOBAL_DERIVATIVE, COMPONENT_NUMBER, ANALYTIC_PARAMETERS, MATERIALS_PARAMETERS, VALUE, ERR, ERROR,)
Evaluate the analytic solutions for a diffusion equation.
This module contains all the low-level base routines e.g., all debug, control, and low-level communic...
subroutine, public advection_diffusion_pre_solve(CONTROL_LOOP, SOLVER, ERR, ERROR,)
Sets up the diffusion equations.
subroutine, public classicalfield_finiteelementresidualevaluate(EQUATIONS_SET, ELEMENT_NUMBER, ERR, ERROR,)
Evaluates the element residual and rhs vectors for the given element number for a clasical field clas...
subroutine, public classicalfield_equationssetspecificationset(equationsSet, specification, err, error,)
Sets the equations set specification for a classical field equation set.
This module handles all Helmholtz equations routines.
subroutine, public poisson_equation_problem_setup(PROBLEM, PROBLEM_SETUP, ERR, ERROR,)
Sets up the Poisson problem.
subroutine, public poisson_post_solve(CONTROL_LOOP, SOLVER, ERR, ERROR,)
Sets up the Poisson problem post solve.
subroutine, public poisson_equation_equations_set_setup(EQUATIONS_SET, EQUATIONS_SET_SETUP, ERR, ERROR,)
Sets up the Poisson equation type of a classical field equations set class.
subroutine, public diffusion_equation_equations_set_setup(EQUATIONS_SET, EQUATIONS_SET_SETUP, ERR, ERROR,)
Sets up the diffusion equation type of a classical field equations set class.
subroutine, public poisson_equation_finite_element_calculate(EQUATIONS_SET, ELEMENT_NUMBER, ERR, ERROR,)
Calculates the element stiffness matrices and RHS for a Poisson equation finite element equations set...
subroutine, public classical_field_control_loop_post_loop(CONTROL_LOOP, ERR, ERROR,)
Executes after each loop of a control loop for bioelectric problems, i.e., after each time step for a...
subroutine, public diffusion_equation_finite_element_calculate(EQUATIONS_SET, ELEMENT_NUMBER, ERR, ERROR,)
Calculates the element stiffness matrices and RHS for a diffusion equation finite element equations s...
Contains information for a problem.
Definition: types.f90:3221
subroutine, public classical_field_analytic_functions_evaluate(EQUATIONS_SET, EQUATIONS_TYPE, ANALYTIC_FUNCTION_TYPE, POSITION, TANGENTS, NORMAL, TIME, VARIABLE_TYPE, GLOBAL_DERIVATIVE, COMPONENT_NUMBER, ANALYTIC_PARAMETERS, MATERIALS_PARAMETERS, VALUE, ERR, ERROR,)
Evaluate the analytic solution for a classical field equations set.
integer(intg), parameter equations_set_hj_equation_type
integer(intg), parameter equations_set_biharmonic_equation_type
subroutine, public diffusion_equationssetsolutionmethodset(EQUATIONS_SET, SOLUTION_METHOD, ERR, ERROR,)
Sets/changes the solution method for a diffusion equation type of an classical field equations set cl...
subroutine, public laplace_equation_equations_set_setup(EQUATIONS_SET, EQUATIONS_SET_SETUP, ERR, ERROR,)
Sets up the Laplace equation type of a classical field equations set class.
integer(intg), parameter problem_helmholtz_equation_type
subroutine, public laplace_problemspecificationset(problem, problemSpecification, err, error,)
Sets the problem specification for a Laplace equation type.
integer(intg), parameter equations_set_diffusion_equation_type
integer(intg), parameter problem_advection_diffusion_equation_type
integer(intg), parameter problem_poisson_equation_type
This module handles all reaction diffusion equation routines.
subroutine, public classicalfield_equationssetsolutionmethodset(EQUATIONS_SET, SOLUTION_METHOD, ERR, ERROR,)
Sets/changes the solution method for a classical field equation set class.
integer(intg), parameter equations_set_reaction_diffusion_equation_type
integer(intg), parameter problem_wave_equation_type
subroutine, public diffusion_equation_problem_setup(PROBLEM, PROBLEM_SETUP, ERR, ERROR,)
Sets up the diffusion problem.
subroutine, public advection_diffusion_equation_problem_setup(PROBLEM, PROBLEM_SETUP, ERR, ERROR,)
Sets up the diffusion problem.
subroutine, public advection_equation_finite_element_calculate(EQUATIONS_SET, ELEMENT_NUMBER, ERR, ERROR,)
Calculates the element stiffness matrices for an advection equation finite element equations set...
integer(intg), parameter equations_set_advection_diffusion_equation_type
subroutine, public laplaceequation_finiteelementcalculate(equationsSet, elementNumber, err, error,)
Calculates the element stiffness matrices and RHS for a Laplace equation finite element equations set...
Contains information on the setup information for an equations set.
Definition: types.f90:1866
subroutine, public advection_equationssetsolutionmethodset(EQUATIONS_SET, SOLUTION_METHOD, ERR, ERROR,)
Sets/changes the solution method for an advection equation type of an classical field equations set c...
subroutine, public laplace_boundaryconditionsanalyticcalculate(EQUATIONS_SET, BOUNDARY_CONDITIONS, ERR, ERROR,)
Calculates the analytic solution and sets the boundary conditions for an analytic problem...
subroutine, public poisson_finiteelementjacobianevaluate(EQUATIONS_SET, ELEMENT_NUMBER, ERR, ERROR,)
Evaluates the Jacobian element stiffness matrices and RHS for a Poisson equation finite element equat...
subroutine, public errors(NAME, ERR, ERROR)
Records the exiting error of the subroutine.
This module defines all constants shared across equations set routines.
subroutine, public advectiondiffusion_equationssetsolnmethodset(EQUATIONS_SET, SOLUTION_METHOD, ERR, ERROR,)
Sets/changes the solution method for a diffusion equation type of an classical field equations set cl...
subroutine, public diffusion_finiteelementresidualevaluate(EQUATIONS_SET, ELEMENT_NUMBER, ERR, ERROR,)
Evaluates the residual element stiffness matrices and RHS for a Diffusion equation finite element equ...
subroutine, public advection_diffusion_post_solve(CONTROL_LOOP, SOLVER, ERR, ERROR,)
integer(intg), parameter equations_set_wave_equation_type
subroutine, public poisson_finiteelementresidualevaluate(EQUATIONS_SET, ELEMENT_NUMBER, ERR, ERROR,)
Evaluates the residual element stiffness matrices and RHS for a Poisson equation finite element equat...
subroutine, public advection_equation_problem_setup(PROBLEM, PROBLEM_SETUP, ERR, ERROR,)
Sets up the diffusion problem.
integer(intg), parameter problem_advection_equation_type
subroutine, public advection_problemspecificationset(problem, problemSpecification, err, error,)
Sets the problem specification for an advection problem.
Flags an error condition.
subroutine, public poisson_boundaryconditionsanalyticcalculate(EQUATIONS_SET, BOUNDARY_CONDITIONS, ERR, ERROR,)
Calculates the analytic solution and sets the boundary conditions for an analytic problem...
subroutine, public diffusion_equation_post_solve(CONTROL_LOOP, SOLVER, ERR, ERROR,)
Sets up the diffusion problem post solve.
This module handles all diffusion equation routines.
subroutine, public diffusion_equationssetspecificationset(equationsSet, specification, err, error,)
Sets the equation specification for a diffusion equation type of a classical field equations set clas...
integer(intg), parameter problem_reaction_diffusion_equation_type
This module contains all kind definitions.
Definition: kinds.f90:45
integer(intg), parameter problem_diffusion_equation_type
subroutine, public classical_field_equations_set_setup(EQUATIONS_SET, EQUATIONS_SET_SETUP, ERR, ERROR,)
Sets up the equations set for a classical field equations set class.