93 PUBLIC reactiondiffusion_equationssetsetup
95 PUBLIC reactiondiffusion_equationssetsolutionmethodset
97 PUBLIC reactiondiffusion_equationssetspecificationset
99 PUBLIC reactiondiffusion_finiteelementcalculate
101 PUBLIC reaction_diffusion_pre_solve
103 PUBLIC reaction_diffusion_equation_problem_setup
105 PUBLIC reactiondiffusion_problemspecificationset
107 PUBLIC reaction_diffusion_post_solve
109 PUBLIC reaction_diffusion_control_loop_post_loop
119 SUBROUTINE reactiondiffusion_equationssetsetup(EQUATIONS_SET,EQUATIONS_SET_SETUP,ERR,ERROR,*)
124 INTEGER(INTG),
INTENT(OUT) :: ERR
127 INTEGER(INTG) :: component_idx,DIMENSION_MULTIPLIER,GEOMETRIC_COMPONENT_NUMBER,GEOMETRIC_SCALING_TYPE, &
128 & NUMBER_OF_DIMENSIONS,NUMBER_OF_MATERIALS_COMPONENTS,GEOMETRIC_MESH_COMPONENT
136 enters(
"ReactionDiffusion_EquationsSetSetup",err,error,*999)
139 NULLIFY(equations_mapping)
140 NULLIFY(equations_matrices)
141 NULLIFY(geometric_decomposition)
143 IF(
ASSOCIATED(equations_set))
THEN 144 IF(.NOT.
ALLOCATED(equations_set%SPECIFICATION))
THEN 145 CALL flagerror(
"Equations set specification is not allocated.",err,error,*999)
146 ELSE IF(
SIZE(equations_set%SPECIFICATION,1)/=3)
THEN 147 CALL flagerror(
"Equations set specification must have three entries for a reaction-diffusion type equations set.", &
150 SELECT CASE(equations_set_setup%SETUP_TYPE)
152 SELECT CASE(equations_set_setup%ACTION_TYPE)
154 CALL reactiondiffusion_equationssetsolutionmethodset(equations_set, &
159 local_error=
"The action type of "//
trim(
number_to_vstring(equations_set_setup%ACTION_TYPE,
"*",err,error))// &
161 &
" is invalid for a reaction diffusion domain equation." 162 CALL flagerror(local_error,err,error,*999)
167 SELECT CASE(equations_set_setup%ACTION_TYPE)
169 SELECT CASE(equations_set%SPECIFICATION(3))
172 IF(equations_set%DEPENDENT%DEPENDENT_FIELD_AUTO_CREATED)
THEN 174 CALL field_create_start(equations_set_setup%FIELD_USER_NUMBER,equations_set%REGION,equations_set%DEPENDENT% &
175 & dependent_field,err,error,*999)
176 CALL field_label_set(equations_set%DEPENDENT%DEPENDENT_FIELD,
"Dependent Field",err,error,*999)
177 CALL field_type_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_general_type,err,error,*999)
178 CALL field_dependent_type_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_dependent_type,err,error,*999)
179 CALL field_mesh_decomposition_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_decomposition,err,error,*999)
180 CALL field_mesh_decomposition_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,geometric_decomposition, &
182 CALL field_geometric_field_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,equations_set%GEOMETRY% &
183 & geometric_field,err,error,*999)
184 CALL field_number_of_variables_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,2,err,error,*999)
185 CALL field_variable_types_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,[field_u_variable_type, &
186 & field_deludeln_variable_type],err,error,*999)
188 CALL field_dimension_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type, &
189 & field_scalar_dimension_type,err,error,*999)
190 CALL field_dimension_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_deludeln_variable_type, &
191 & field_scalar_dimension_type,err,error,*999)
192 CALL field_data_type_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type, &
193 & field_dp_type,err,error,*999)
194 CALL field_data_type_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_deludeln_variable_type, &
195 & field_dp_type,err,error,*999)
196 CALL field_number_of_components_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type,1, &
198 CALL field_number_of_components_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_deludeln_variable_type,1, &
201 CALL field_component_mesh_component_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type,1, &
202 & geometric_mesh_component,err,error,*999)
203 CALL field_component_mesh_component_set(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type,1, &
204 & geometric_mesh_component,err,error,*999)
205 CALL field_component_mesh_component_set(equations_set%DEPENDENT%DEPENDENT_FIELD,field_deludeln_variable_type,1, &
206 & geometric_mesh_component,err,error,*999)
207 SELECT CASE(equations_set%SOLUTION_METHOD)
209 CALL field_component_interpolation_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD, &
210 & field_u_variable_type,1,field_node_based_interpolation,err,error,*999)
211 CALL field_component_interpolation_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD, &
212 & field_deludeln_variable_type,1,field_node_based_interpolation,err,error,*999)
214 CALL field_scaling_type_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_scaling_type,err,error,*999)
215 CALL field_scaling_type_set(equations_set%DEPENDENT%DEPENDENT_FIELD,geometric_scaling_type,err,error,*999)
217 CALL flagerror(
"Not implemented.",err,error,*999)
219 CALL flagerror(
"Not implemented.",err,error,*999)
221 CALL flagerror(
"Not implemented.",err,error,*999)
223 CALL flagerror(
"Not implemented.",err,error,*999)
225 CALL flagerror(
"Not implemented.",err,error,*999)
227 local_error=
"The solution method of "//
trim(
number_to_vstring(equations_set%SOLUTION_METHOD,
"*",err,error))// &
229 CALL flagerror(local_error,err,error,*999)
233 CALL field_type_check(equations_set_setup%FIELD,field_general_type,err,error,*999)
234 CALL field_dependent_type_check(equations_set_setup%FIELD,field_dependent_type,err,error,*999)
235 CALL field_number_of_variables_check(equations_set_setup%FIELD,2,err,error,*999)
236 CALL field_variable_types_check(equations_set_setup%FIELD,[field_u_variable_type,field_deludeln_variable_type], &
238 CALL field_dimension_check(equations_set_setup%FIELD,field_u_variable_type,field_scalar_dimension_type,err,error,*999)
239 CALL field_dimension_check(equations_set_setup%FIELD,field_deludeln_variable_type,field_scalar_dimension_type, &
241 CALL field_data_type_check(equations_set_setup%FIELD,field_u_variable_type,field_dp_type,err,error,*999)
242 CALL field_data_type_check(equations_set_setup%FIELD,field_deludeln_variable_type,field_dp_type,err,error,*999)
243 CALL field_number_of_components_check(equations_set_setup%FIELD,field_u_variable_type,1,err,error,*999)
244 CALL field_number_of_components_check(equations_set_setup%FIELD,field_deludeln_variable_type,1,err,error,*999)
245 SELECT CASE(equations_set%SOLUTION_METHOD)
247 CALL field_component_interpolation_check(equations_set_setup%FIELD,field_u_variable_type,1, &
248 & field_node_based_interpolation,err,error,*999)
249 CALL field_component_interpolation_check(equations_set_setup%FIELD,field_deludeln_variable_type,1, &
250 & field_node_based_interpolation,err,error,*999)
252 CALL flagerror(
"Not implemented.",err,error,*999)
254 CALL flagerror(
"Not implemented.",err,error,*999)
256 CALL flagerror(
"Not implemented.",err,error,*999)
258 CALL flagerror(
"Not implemented.",err,error,*999)
260 CALL flagerror(
"Not implemented.",err,error,*999)
262 local_error=
"The solution method of "//
trim(
number_to_vstring(equations_set%SOLUTION_METHOD,
"*",err,error))// &
264 CALL flagerror(local_error,err,error,*999)
268 CALL flagerror(
"Not implemented.",err,error,*999)
270 local_error=
"The equation set subtype of "//
trim(
number_to_vstring(equations_set%SPECIFICATION(3),
"*",err,error))// &
271 &
" is invalid for a reaction diffusion equation set class." 272 CALL flagerror(local_error,err,error,*999)
275 IF(equations_set%DEPENDENT%DEPENDENT_FIELD_AUTO_CREATED)
THEN 276 CALL field_create_finish(equations_set%DEPENDENT%DEPENDENT_FIELD,err,error,*999)
279 local_error=
"The action type of "//
trim(
number_to_vstring(equations_set_setup%ACTION_TYPE,
"*",err,error))// &
281 &
" is invalid for a reaction diffusion equation" 282 CALL flagerror(local_error,err,error,*999)
285 SELECT CASE(equations_set_setup%ACTION_TYPE)
287 IF(equations_set%DEPENDENT%DEPENDENT_FINISHED)
THEN 288 equations_materials=>equations_set%MATERIALS
289 IF(
ASSOCIATED(equations_materials))
THEN 290 IF(equations_materials%MATERIALS_FIELD_AUTO_CREATED)
THEN 292 CALL field_create_start(equations_set_setup%FIELD_USER_NUMBER,equations_set%REGION,equations_materials% &
293 & materials_field,err,error,*999)
294 CALL field_type_set_and_lock(equations_materials%MATERIALS_FIELD,field_material_type,err,error,*999)
295 CALL field_dependent_type_set_and_lock(equations_materials%MATERIALS_FIELD,field_independent_type,err,error,*999)
296 CALL field_mesh_decomposition_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_decomposition,err,error,*999)
297 CALL field_mesh_decomposition_set_and_lock(equations_materials%MATERIALS_FIELD,geometric_decomposition, &
299 CALL field_geometric_field_set_and_lock(equations_materials%MATERIALS_FIELD,equations_set%GEOMETRY% &
300 & geometric_field,err,error,*999)
301 CALL field_number_of_variables_set_and_lock(equations_materials%MATERIALS_FIELD,1,err,error,*999)
302 CALL field_variable_types_set_and_lock(equations_materials%MATERIALS_FIELD,[field_u_variable_type], &
304 CALL field_dimension_set_and_lock(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
305 & field_vector_dimension_type,err,error,*999)
306 CALL field_data_type_set_and_lock(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
307 & field_dp_type,err,error,*999)
308 CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
309 & number_of_dimensions,err,error,*999)
313 number_of_materials_components=number_of_dimensions+1
314 dimension_multiplier=1
318 number_of_materials_components=number_of_dimensions+1
319 dimension_multiplier=1
322 CALL field_number_of_components_set_and_lock(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
323 & number_of_materials_components,err,error,*999)
325 DO component_idx=1,number_of_dimensions
326 CALL field_component_mesh_component_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
327 & 1,geometric_component_number,err,error,*999)
328 CALL field_component_mesh_component_set(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
329 & component_idx,geometric_component_number,err,error,*999)
330 CALL field_component_interpolation_set(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
331 & component_idx,field_constant_interpolation,err,error,*999)
335 component_idx=number_of_materials_components
336 CALL field_component_mesh_component_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
337 & 1,geometric_component_number,err,error,*999)
338 CALL field_component_mesh_component_set(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
339 & component_idx,geometric_component_number,err,error,*999)
340 CALL field_component_interpolation_set(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
341 & component_idx,field_constant_interpolation,err,error,*999)
344 CALL field_scaling_type_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_scaling_type,err,error,*999)
345 CALL field_scaling_type_set(equations_materials%MATERIALS_FIELD,geometric_scaling_type,err,error,*999)
348 CALL field_type_check(equations_set_setup%FIELD,field_material_type,err,error,*999)
349 CALL field_dependent_type_check(equations_set_setup%FIELD,field_independent_type,err,error,*999)
350 CALL field_number_of_variables_check(equations_set_setup%FIELD,1,err,error,*999)
351 CALL field_variable_types_check(equations_set_setup%FIELD,[field_u_variable_type],err,error,*999)
352 CALL field_dimension_check(equations_set_setup%FIELD,field_u_variable_type,field_vector_dimension_type, &
354 CALL field_data_type_check(equations_set_setup%FIELD,field_u_variable_type,field_dp_type,err,error,*999)
355 CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
356 & number_of_dimensions,err,error,*999)
360 CALL field_number_of_components_check(equations_set_setup%FIELD,field_u_variable_type,number_of_dimensions+1, &
365 CALL flagerror(
"Equations set materials is not associated.",err,error,*999)
368 CALL flagerror(
"Equations set dependent field has not been finished.",err,error,*999)
371 equations_materials=>equations_set%MATERIALS
372 IF(
ASSOCIATED(equations_materials))
THEN 373 IF(equations_materials%MATERIALS_FIELD_AUTO_CREATED)
THEN 375 CALL field_create_finish(equations_materials%MATERIALS_FIELD,err,error,*999)
377 CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
378 & number_of_dimensions,err,error,*999)
382 number_of_materials_components=number_of_dimensions+1
383 dimension_multiplier=1
386 DO component_idx=1,number_of_dimensions
387 CALL field_component_values_initialise(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
388 & field_values_set_type,component_idx,1.0_dp,err,error,*999)
391 component_idx=number_of_dimensions+1
392 CALL field_component_values_initialise(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
393 & field_values_set_type,component_idx,1.0_dp,err,error,*999)
396 CALL flagerror(
"Equations set materials is not associated.",err,error,*999)
399 local_error=
"The action type of "//
trim(
number_to_vstring(equations_set_setup%ACTION_TYPE,
"*",err,error))// &
401 &
" is invalid for a reaction diffusion equation." 402 CALL flagerror(local_error,err,error,*999)
405 SELECT CASE(equations_set_setup%ACTION_TYPE)
407 IF(
ASSOCIATED(equations_set%MATERIALS))
THEN 408 IF(equations_set%MATERIALS%MATERIALS_FINISHED)
THEN 409 IF(
ASSOCIATED(equations_set%SOURCE))
THEN 410 IF(equations_set%SOURCE%SOURCE_FIELD_AUTO_CREATED)
THEN 413 CALL field_create_start(equations_set_setup%FIELD_USER_NUMBER,equations_set%REGION, &
414 & equations_set%SOURCE%SOURCE_FIELD,err,error,*999)
416 CALL field_type_set_and_lock(equations_set%SOURCE%SOURCE_FIELD,field_general_type,err,error,*999)
418 CALL field_label_set_and_lock(equations_set%SOURCE%SOURCE_FIELD,
"Source Field",err,error,*999)
420 CALL field_dependent_type_set_and_lock(equations_set%SOURCE%SOURCE_FIELD,field_independent_type,err,error,*999)
422 CALL field_mesh_decomposition_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_decomposition,err,error,*999)
423 CALL field_mesh_decomposition_set_and_lock(equations_set%SOURCE%SOURCE_FIELD,geometric_decomposition, &
426 CALL field_geometric_field_set_and_lock(equations_set%SOURCE%SOURCE_FIELD,equations_set% &
427 & geometry%GEOMETRIC_FIELD,err,error,*999)
429 CALL field_number_of_variables_set_and_lock(equations_set%SOURCE%SOURCE_FIELD,1,err,error,*999)
430 CALL field_variable_types_set_and_lock(equations_set%SOURCE%SOURCE_FIELD,[field_u_variable_type],err,error,*999)
432 CALL field_dimension_set_and_lock(equations_set%SOURCE%SOURCE_FIELD,field_u_variable_type, &
433 & field_scalar_dimension_type,err,error,*999)
435 CALL field_data_type_set_and_lock(equations_set%SOURCE%SOURCE_FIELD,field_u_variable_type, &
436 & field_dp_type,err,error,*999)
438 CALL field_number_of_components_set_and_lock(equations_set%SOURCE%SOURCE_FIELD,field_u_variable_type,1, &
441 CALL field_component_mesh_component_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
442 & 1,geometric_mesh_component,err,error,*999)
444 CALL field_component_mesh_component_set(equations_set%SOURCE%SOURCE_FIELD,field_u_variable_type,1, &
445 & geometric_mesh_component,err,error,*999)
447 SELECT CASE(equations_set%SOLUTION_METHOD)
449 CALL field_component_interpolation_set_and_lock(equations_set%SOURCE%SOURCE_FIELD,field_u_variable_type,1, &
450 & field_node_based_interpolation,err,error,*999)
452 CALL flagerror(
"Not implemented.",err,error,*999)
454 CALL flagerror(
"Not implemented.",err,error,*999)
456 CALL flagerror(
"Not implemented.",err,error,*999)
458 CALL flagerror(
"Not implemented.",err,error,*999)
460 CALL flagerror(
"Not implemented.",err,error,*999)
462 local_error=
"The solution method of " &
464 CALL flagerror(local_error,err,error,*999)
467 CALL field_scaling_type_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_scaling_type, &
469 CALL field_scaling_type_set(equations_set%SOURCE%SOURCE_FIELD,geometric_scaling_type, &
473 CALL field_type_check(equations_set_setup%FIELD,field_general_type,err,error,*999)
474 CALL field_dependent_type_check(equations_set_setup%FIELD,field_independent_type,err,error,*999)
475 CALL field_number_of_variables_check(equations_set_setup%FIELD,1,err,error,*999)
476 CALL field_variable_types_check(equations_set_setup%FIELD,[field_u_variable_type],err,error,*999)
477 CALL field_dimension_check(equations_set_setup%FIELD,field_u_variable_type,field_scalar_dimension_type, &
479 CALL field_data_type_check(equations_set_setup%FIELD,field_u_variable_type,field_dp_type,err,error,*999)
480 CALL field_number_of_components_check(equations_set_setup%FIELD,field_u_variable_type,1,err,error,*999)
482 SELECT CASE(equations_set%SOLUTION_METHOD)
484 CALL field_component_interpolation_check(equations_set_setup%FIELD,field_u_variable_type,1, &
485 & field_node_based_interpolation,err,error,*999)
487 CALL flagerror(
"Not implemented.",err,error,*999)
489 CALL flagerror(
"Not implemented.",err,error,*999)
491 CALL flagerror(
"Not implemented.",err,error,*999)
493 CALL flagerror(
"Not implemented.",err,error,*999)
495 CALL flagerror(
"Not implemented.",err,error,*999)
498 &
"*",err,error))//
" is invalid." 499 CALL flagerror(local_error,err,error,*999)
504 CALL flagerror(
"Equations set source is not associated.",err,error,*999)
507 CALL flagerror(
"Equations set materials field has not been finished.",err,error,*999)
510 CALL flagerror(
"Equations set materials is not associated.",err,error,*999)
513 IF(equations_set%SOURCE%SOURCE_FIELD_AUTO_CREATED)
THEN 514 CALL field_create_finish(equations_set%SOURCE%SOURCE_FIELD,err,error,*999)
517 local_error=
"The action type of "//
trim(
number_to_vstring(equations_set_setup%ACTION_TYPE,
"*",err,error))// &
519 &
" is invalid for a reaction diffusion equation." 520 CALL flagerror(local_error,err,error,*999)
523 SELECT CASE(equations_set_setup%ACTION_TYPE)
525 CALL flagerror(
"Not implemented.",err,error,*999)
527 CALL flagerror(
"Not implemented.",err,error,*999)
529 local_error=
"The action type of "//
trim(
number_to_vstring(equations_set_setup%ACTION_TYPE,
"*",err,error))// &
531 &
" is invalid for a reaction diffusion equation." 532 CALL flagerror(local_error,err,error,*999)
535 SELECT CASE(equations_set_setup%ACTION_TYPE)
537 IF(
ASSOCIATED(equations_set%SOURCE))
THEN 538 IF(equations_set%SOURCE%SOURCE_FINISHED)
THEN 541 SELECT CASE(equations_set%SPECIFICATION(3))
549 local_error=
"The equations matrices linearity set up of "// &
551 CALL flagerror(local_error,err,error,*999)
555 CALL flagerror(
"Equations set source field has not been finished.",err,error,*999)
558 CALL flagerror(
"Equations set source is not associated.",err,error,*999)
561 SELECT CASE(equations_set%SOLUTION_METHOD)
587 SELECT CASE(equations%SPARSITY_TYPE)
599 local_error=
"The equations matrices sparsity type of "// &
601 CALL flagerror(local_error,err,error,*999)
606 CALL flagerror(
"Not implemented.",err,error,*999)
608 CALL flagerror(
"Not implemented.",err,error,*999)
610 CALL flagerror(
"Not implemented.",err,error,*999)
612 CALL flagerror(
"Not implemented.",err,error,*999)
614 CALL flagerror(
"Not implemented.",err,error,*999)
616 local_error=
"The solution method of "//
trim(
number_to_vstring(equations_set%SOLUTION_METHOD,
"*",err,error))// &
618 CALL flagerror(local_error,err,error,*999)
621 local_error=
"The action type of "//
trim(
number_to_vstring(equations_set_setup%ACTION_TYPE,
"*",err,error))// &
623 &
" is invalid for a bioelectric domain equation." 624 CALL flagerror(local_error,err,error,*999)
627 local_error=
"The setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
628 &
" is invalid for reaction diffusion equation." 629 CALL flagerror(local_error,err,error,*999)
632 CALL flagerror(
"Equations set is not associated.",err,error,*999)
635 exits(
"ReactionDiffusion_EquationsSetSetup")
637 999 errorsexits(
"ReactionDiffusion_EquationsSetSetup",err,error)
640 END SUBROUTINE reactiondiffusion_equationssetsetup
647 SUBROUTINE reactiondiffusion_equationssetsolutionmethodset(EQUATIONS_SET,SOLUTION_METHOD,ERR,ERROR,*)
651 INTEGER(INTG),
INTENT(IN) :: SOLUTION_METHOD
652 INTEGER(INTG),
INTENT(OUT) :: ERR
657 enters(
"ReactionDiffusion_EquationsSetSolutionMethodSet",err,error,*999)
659 IF(
ASSOCIATED(equations_set))
THEN 660 IF(.NOT.
ALLOCATED(equations_set%SPECIFICATION))
THEN 661 CALL flagerror(
"Equations set specification is not allocated.",err,error,*999)
662 ELSE IF(
SIZE(equations_set%SPECIFICATION,1)/=3)
THEN 663 CALL flagerror(
"Equations set specification must have three entries for a reaction-diffusion type equations set.", &
666 SELECT CASE(equations_set%SPECIFICATION(3))
670 SELECT CASE(solution_method)
674 CALL flagerror(
"Not implemented.",err,error,*999)
676 CALL flagerror(
"Not implemented.",err,error,*999)
678 CALL flagerror(
"Not implemented.",err,error,*999)
680 CALL flagerror(
"Not implemented.",err,error,*999)
682 CALL flagerror(
"Not implemented.",err,error,*999)
684 local_error=
"The specified solution method of "//
trim(
number_to_vstring(solution_method,
"*",err,error))//
" is invalid." 685 CALL flagerror(local_error,err,error,*999)
688 local_error=
"Equations set subtype of "//
trim(
number_to_vstring(equations_set%SPECIFICATION(3),
"*",err,error))// &
689 &
" is not valid for a reaction diffusion equation type of classical equations set class." 690 CALL flagerror(local_error,err,error,*999)
694 CALL flagerror(
"Equations set is not associated.",err,error,*999)
697 exits(
"ReactionDiffusion_EquationsSetSolutionMethodSet")
699 999
errors(
"ReactionDiffusion_EquationsSetSolutionMethodSet",err,error)
700 exits(
"ReactionDiffusion_EquationsSetSolutionMethodSet")
703 END SUBROUTINE reactiondiffusion_equationssetsolutionmethodset
710 SUBROUTINE reactiondiffusion_equationssetspecificationset(equationsSet,specification,err,error,*)
714 INTEGER(INTG),
INTENT(IN) :: specification(:)
715 INTEGER(INTG),
INTENT(OUT) :: err
719 INTEGER(INTG) :: subtype
721 enters(
"ReactionDiffusion_EquationsSetSpecificationSet",err,error,*999)
723 IF(
ASSOCIATED(equationsset))
THEN 724 IF(
SIZE(specification,1)>3)
THEN 725 CALL flagerror(
"Equations set specification must have 3 entries for a reaction-diffusion type equations set.", &
728 subtype=specification(3)
733 CALL flagerror(
"Not implemented.",err,error,*999)
737 localerror=
"The specified equations set subtype of "//
trim(
numbertovstring(subtype,
"*",err,error))// &
738 &
" is not valid for reaction diffusion equation type of a classical equations set class." 739 CALL flagerror(localerror,err,error,*999)
742 IF(
ALLOCATED(equationsset%specification))
THEN 743 CALL flagerror(
"Equations set specification is already allocated.",err,error,*999)
745 ALLOCATE(equationsset%specification(3),stat=err)
746 IF(err/=0)
CALL flagerror(
"Could not allocate equations set specification.",err,error,*999)
750 CALL flagerror(
"Equations set is not associated.",err,error,*999)
753 exits(
"ReactionDiffusion_EquationsSetSpecificationSet")
755 999
errors(
"ReactionDiffusion_EquationsSetSpecificationSet",err,error)
756 exits(
"ReactionDiffusion_EquationsSetSpecificationSet")
759 END SUBROUTINE reactiondiffusion_equationssetspecificationset
765 SUBROUTINE reactiondiffusion_finiteelementcalculate(EQUATIONS_SET,ELEMENT_NUMBER,ERR,ERROR,*)
769 INTEGER(INTG),
INTENT(IN) :: ELEMENT_NUMBER
770 INTEGER(INTG),
INTENT(OUT) :: ERR
773 INTEGER(INTG) FIELD_VAR_TYPE,mh,mhs,ms,ng,nh,nhs,ni,nj,ns,component_idx
774 LOGICAL :: USE_FIBRES
775 REAL(DP) :: DIFFUSIVITY(3,3),DPHIDX(3,64),RWG,SUM,STORAGE_COEFFICIENT,C_PARAM
776 TYPE(
basis_type),
POINTER :: DEPENDENT_BASIS,GEOMETRIC_BASIS,FIBRE_BASIS
785 TYPE(
field_type),
POINTER :: DEPENDENT_FIELD,GEOMETRIC_FIELD,FIBRE_FIELD,MATERIALS_FIELD,SOURCE_FIELD
789 enters(
"ReactionDiffusion_FiniteElementCalculate",err,error,*999)
791 IF(
ASSOCIATED(equations_set))
THEN 792 IF(.NOT.
ALLOCATED(equations_set%SPECIFICATION))
THEN 793 CALL flagerror(
"Equations set specification is not allocated.",err,error,*999)
794 ELSE IF(
SIZE(equations_set%SPECIFICATION,1)/=3)
THEN 795 CALL flagerror(
"Equations set specification must have three entries for a reaction-diffusion type equations set.", &
798 equations=>equations_set%EQUATIONS
799 IF(
ASSOCIATED(equations))
THEN 801 dependent_field=>equations%INTERPOLATION%DEPENDENT_FIELD
802 geometric_field=>equations%INTERPOLATION%GEOMETRIC_FIELD
803 materials_field=>equations%INTERPOLATION%MATERIALS_FIELD
806 source_field=>equations%INTERPOLATION%SOURCE_FIELD
808 fibre_field=>equations%INTERPOLATION%FIBRE_FIELD
809 use_fibres=
ASSOCIATED(fibre_field)
810 equations_mapping=>equations%EQUATIONS_MAPPING
811 equations_matrices=>equations%EQUATIONS_MATRICES
812 dependent_basis=>dependent_field%DECOMPOSITION%DOMAIN(dependent_field%DECOMPOSITION%MESH_COMPONENT_NUMBER)%PTR% &
813 & topology%ELEMENTS%ELEMENTS(element_number)%BASIS
814 geometric_basis=>geometric_field%DECOMPOSITION%DOMAIN(geometric_field%DECOMPOSITION%MESH_COMPONENT_NUMBER)%PTR% &
815 & topology%ELEMENTS%ELEMENTS(element_number)%BASIS
816 geometric_variable=>geometric_field%VARIABLE_TYPE_MAP(field_u_variable_type)%PTR
817 IF(use_fibres) fibre_basis=>fibre_field%DECOMPOSITION%DOMAIN(geometric_field%DECOMPOSITION%MESH_COMPONENT_NUMBER)%PTR% &
818 & topology%ELEMENTS%ELEMENTS(element_number)%BASIS
820 CALL field_interpolation_parameters_element_get(field_values_set_type,element_number,equations%INTERPOLATION% &
821 & geometric_interp_parameters(field_u_variable_type)%PTR,err,error,*999)
822 CALL field_interpolation_parameters_element_get(field_values_set_type,element_number,equations%INTERPOLATION% &
823 & materials_interp_parameters(field_u_variable_type)%PTR,err,error,*999)
824 IF(use_fibres)
CALL field_interpolation_parameters_element_get(field_values_set_type,element_number,equations% &
825 & interpolation%FIBRE_INTERP_PARAMETERS(field_u_variable_type)%PTR,err,error,*999)
828 CALL field_interpolation_parameters_element_get(field_values_set_type,element_number,equations%INTERPOLATION% &
829 & source_interp_parameters(field_u_variable_type)%PTR,err,error,*999)
831 dynamic_matrices=>equations_matrices%DYNAMIC_MATRICES
832 stiffness_matrix=>dynamic_matrices%MATRICES(1)%PTR
833 damping_matrix=>dynamic_matrices%MATRICES(2)%PTR
834 rhs_vector=>equations_matrices%RHS_VECTOR
837 source_vector=>equations_matrices%SOURCE_VECTOR
839 dynamic_mapping=>equations_mapping%DYNAMIC_MAPPING
840 field_variable=>dynamic_mapping%EQUATIONS_MATRIX_TO_VAR_MAPS(1)%VARIABLE
841 field_var_type=field_variable%VARIABLE_TYPE
842 IF(stiffness_matrix%UPDATE_MATRIX.OR.damping_matrix%UPDATE_MATRIX.OR.rhs_vector%UPDATE_VECTOR)
THEN 844 DO ng=1,quadrature_scheme%NUMBER_OF_GAUSS
846 & geometric_interp_point(field_u_variable_type)%PTR,err,error,*999)
847 CALL field_interpolated_point_metrics_calculate(geometric_basis%NUMBER_OF_XI,equations%INTERPOLATION% &
848 & geometric_interp_point_metrics(field_u_variable_type)%PTR,err,error,*999)
850 & materials_interp_point(field_u_variable_type)%PTR,err,error,*999)
853 & fibre_interp_point(field_u_variable_type)%PTR,err,error,*999)
854 CALL field_interpolated_point_metrics_calculate(fibre_basis%NUMBER_OF_XI,equations%INTERPOLATION% &
855 & fibre_interp_point_metrics(field_u_variable_type)%PTR,err,error,*999)
860 & source_interp_point(field_u_variable_type)%PTR,err,error,*999)
863 rwg=equations%INTERPOLATION%GEOMETRIC_INTERP_POINT_METRICS(field_u_variable_type)%PTR%JACOBIAN* &
864 & quadrature_scheme%GAUSS_WEIGHTS(ng)
869 CALL flagerror(
"Not implemented.",err,error,*999)
872 DO nj=1,geometric_variable%NUMBER_OF_COMPONENTS
873 diffusivity(nj,nj)=equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_u_variable_type)%PTR%VALUES(nj,1)
877 component_idx=geometric_variable%NUMBER_OF_COMPONENTS+1
878 storage_coefficient=equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_u_variable_type)%PTR%VALUES(component_idx,1)
880 DO nj=1,geometric_variable%NUMBER_OF_COMPONENTS
881 DO ms=1,dependent_basis%NUMBER_OF_ELEMENT_PARAMETERS
883 DO ni=1,dependent_basis%NUMBER_OF_XI
884 dphidx(nj,ms)=dphidx(nj,ms)+ &
886 & equations%INTERPOLATION%GEOMETRIC_INTERP_POINT_METRICS(field_u_variable_type)%PTR%DXI_DX(ni,nj)
892 DO mh=1,field_variable%NUMBER_OF_COMPONENTS
894 DO ms=1,dependent_basis%NUMBER_OF_ELEMENT_PARAMETERS
898 DO nh=1,field_variable%NUMBER_OF_COMPONENTS
899 DO ns=1,dependent_basis%NUMBER_OF_ELEMENT_PARAMETERS
902 IF(stiffness_matrix%UPDATE_MATRIX)
THEN 903 DO ni=1,geometric_variable%NUMBER_OF_COMPONENTS
904 DO nj=1,geometric_variable%NUMBER_OF_COMPONENTS
905 sum=sum+diffusivity(ni,nj)*dphidx(ni,mhs)*dphidx(nj,nhs)
908 stiffness_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)=stiffness_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)+(sum*rwg)
910 IF(damping_matrix%UPDATE_MATRIX)
THEN 911 damping_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)=damping_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)+ &
913 & quadrature_scheme%GAUSS_BASIS_FNS(ns,
no_part_deriv,ng)*storage_coefficient*rwg
918 IF(rhs_vector%UPDATE_VECTOR) rhs_vector%ELEMENT_VECTOR%VECTOR(mhs)=0.0_dp
922 IF(source_vector%UPDATE_VECTOR)
THEN 923 c_param=equations%INTERPOLATION%SOURCE_INTERP_POINT(field_u_variable_type)%PTR%VALUES(1,
no_part_deriv)
925 DO mh=1,field_variable%NUMBER_OF_COMPONENTS
927 DO ms=1,dependent_basis%NUMBER_OF_ELEMENT_PARAMETERS
929 source_vector%ELEMENT_VECTOR%VECTOR(mhs)=source_vector%ELEMENT_VECTOR%VECTOR(mhs)+ &
930 & quadrature_scheme%GAUSS_BASIS_FNS(ms,
no_part_deriv,ng)*c_param*rwg
935 IF(rhs_vector%UPDATE_VECTOR) rhs_vector%ELEMENT_VECTOR%VECTOR(mhs)=0.0_dp
939 IF(dependent_field%SCALINGS%SCALING_TYPE/=field_no_scaling)
THEN 940 CALL field_interpolationparametersscalefactorselementget(element_number,equations%INTERPOLATION% &
941 & dependent_interp_parameters(field_var_type)%PTR,err,error,*999)
943 DO mh=1,field_variable%NUMBER_OF_COMPONENTS
945 DO ms=1,dependent_basis%NUMBER_OF_ELEMENT_PARAMETERS
948 IF(stiffness_matrix%UPDATE_MATRIX.OR.damping_matrix%UPDATE_MATRIX)
THEN 950 DO nh=1,field_variable%NUMBER_OF_COMPONENTS
951 DO ns=1,dependent_basis%NUMBER_OF_ELEMENT_PARAMETERS
953 IF(stiffness_matrix%UPDATE_MATRIX)
THEN 954 stiffness_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)=stiffness_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)* &
955 & equations%INTERPOLATION%DEPENDENT_INTERP_PARAMETERS(field_var_type)%PTR%SCALE_FACTORS(ms,mh)* &
956 & equations%INTERPOLATION%DEPENDENT_INTERP_PARAMETERS(field_var_type)%PTR%SCALE_FACTORS(ns,nh)
958 IF(damping_matrix%UPDATE_MATRIX)
THEN 959 damping_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)=damping_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)* &
960 & equations%INTERPOLATION%DEPENDENT_INTERP_PARAMETERS(field_var_type)%PTR%SCALE_FACTORS(ms,mh)* &
961 & equations%INTERPOLATION%DEPENDENT_INTERP_PARAMETERS(field_var_type)%PTR%SCALE_FACTORS(ns,nh)
966 IF(rhs_vector%UPDATE_VECTOR) rhs_vector%ELEMENT_VECTOR%VECTOR(mhs)=rhs_vector%ELEMENT_VECTOR%VECTOR(mhs)* &
967 & equations%INTERPOLATION%DEPENDENT_INTERP_PARAMETERS(field_var_type)%PTR%SCALE_FACTORS(ms,mh)
969 IF(source_vector%UPDATE_VECTOR) source_vector%ELEMENT_VECTOR%VECTOR(mhs)= &
970 & source_vector%ELEMENT_VECTOR%VECTOR(mhs)* &
971 & equations%INTERPOLATION%DEPENDENT_INTERP_PARAMETERS(field_var_type)%PTR%SCALE_FACTORS(ms,mh)
977 CALL flagerror(
"Equations set equations is not associated.",err,error,*999)
980 CALL flagerror(
"Equations set is not associated.",err,error,*999)
983 exits(
"ReactionDiffusion_FiniteElementCalculate")
985 999
errors(
"ReactionDiffusion_FiniteElementCalculate",err,error)
986 exits(
"ReactionDiffusion_FiniteElementCalculate")
989 END SUBROUTINE reactiondiffusion_finiteelementcalculate
995 SUBROUTINE reactiondiffusion_problemspecificationset(problem,problemSpecification,err,error,*)
999 INTEGER(INTG),
INTENT(IN) :: problemSpecification(:)
1000 INTEGER(INTG),
INTENT(OUT) :: err
1004 INTEGER(INTG) :: problemSubtype
1006 enters(
"ReactionDiffusion_ProblemSpecificationSet",err,error,*999)
1008 IF(
ASSOCIATED(problem))
THEN 1009 IF(
SIZE(problemspecification,1)>=3)
THEN 1010 problemsubtype=problemspecification(3)
1011 SELECT CASE(problemsubtype)
1017 localerror=
"The specified problem subtype of "//
trim(
numbertovstring(problemsubtype,
"*",err,error))// &
1018 &
" is not valid for a reaction-diffusion problem type of a classical problem class." 1019 CALL flagerror(localerror,err,error,*999)
1021 IF(
ALLOCATED(problem%specification))
THEN 1022 CALL flagerror(
"Problem specification is already allocated.",err,error,*999)
1024 ALLOCATE(problem%specification(3),stat=err)
1025 IF(err/=0)
CALL flagerror(
"Could not allocate problem specification.",err,error,*999)
1029 CALL flagerror(
"Reaction-diffusion problem specification must have >=3 entries.",err,error,*999)
1032 CALL flagerror(
"Problem is not associated.",err,error,*999)
1035 exits(
"ReactionDiffusion_ProblemSpecificationSet")
1037 999
errors(
"ReactionDiffusion_ProblemSpecificationSet",err,error)
1038 exits(
"ReactionDiffusion_ProblemSpecificationSet")
1041 END SUBROUTINE reactiondiffusion_problemspecificationset
1047 SUBROUTINE reaction_diffusion_equation_problem_setup(PROBLEM,PROBLEM_SETUP,ERR,ERROR,*)
1052 INTEGER(INTG),
INTENT(OUT) :: ERR
1062 NULLIFY(cellml_equations)
1063 NULLIFY(control_loop)
1066 NULLIFY(solver_equations)
1068 enters(
"REACTION_DIFFUSION_EQUATION_PROBLEM_SETUP",err,error,*999)
1070 IF(
ASSOCIATED(problem))
THEN 1071 IF(.NOT.
ALLOCATED(problem%SPECIFICATION))
THEN 1072 CALL flagerror(
"Problem specification is not allocated.",err,error,*999)
1073 ELSE IF(
SIZE(problem%SPECIFICATION,1)<3)
THEN 1074 CALL flagerror(
"Problem specification must have three entries for a reaction diffusion problem.",err,error,*999)
1076 SELECT CASE(problem_setup%SETUP_TYPE)
1078 SELECT CASE(problem_setup%ACTION_TYPE)
1084 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
1086 &
" is invalid for a reaction diffusion equation." 1087 CALL flagerror(local_error,err,error,*999)
1090 SELECT CASE(problem_setup%ACTION_TYPE)
1098 control_loop_root=>problem%CONTROL_LOOP
1102 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
1104 &
" is invalid for a reaction-diffusion equation." 1105 CALL flagerror(local_error,err,error,*999)
1109 control_loop_root=>problem%CONTROL_LOOP
1111 SELECT CASE(problem_setup%ACTION_TYPE)
1115 SELECT CASE(problem%SPECIFICATION(3))
1174 local_error=
"The problem subtype of "//
trim(
number_to_vstring(problem%SPECIFICATION(3),
"*",err,error))// &
1175 &
" is invalid for a reaction-diffusion problem type of a classical problem class." 1176 CALL flagerror(local_error,err,error,*999)
1184 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
1186 &
" is invalid for a classical equation." 1187 CALL flagerror(local_error,err,error,*999)
1190 SELECT CASE(problem_setup%ACTION_TYPE)
1193 control_loop_root=>problem%CONTROL_LOOP
1195 SELECT CASE(problem%SPECIFICATION(3))
1224 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
1226 &
" is invalid for a reaction-diffusion equation." 1227 CALL flagerror(local_error,err,error,*999)
1232 control_loop_root=>problem%CONTROL_LOOP
1235 SELECT CASE(problem%SPECIFICATION(3))
1255 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
1257 &
" is invalid for a reaction-diffusion equation." 1258 CALL flagerror(local_error,err,error,*999)
1261 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
1263 &
" is invalid for a reaction-diffusion equation." 1264 CALL flagerror(local_error,err,error,*999)
1267 SELECT CASE(problem_setup%ACTION_TYPE)
1270 control_loop_root=>problem%CONTROL_LOOP
1277 NULLIFY(cellml_equations)
1283 NULLIFY(cellml_equations)
1286 ELSEIF(problem%SPECIFICATION(3)== &
1290 NULLIFY(cellml_equations)
1297 control_loop_root=>problem%CONTROL_LOOP
1300 SELECT CASE(problem%SPECIFICATION(3))
1309 NULLIFY(cellml_equations)
1321 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
1323 &
" is invalid for reaction-diffusion equation." 1324 CALL flagerror(local_error,err,error,*999)
1327 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
1329 &
" is invalid for reaction-diffusion equation." 1330 CALL flagerror(local_error,err,error,*999)
1333 local_error=
"The setup type of "//
trim(
number_to_vstring(problem_setup%SETUP_TYPE,
"*",err,error))// &
1334 &
" is invalid for areaction-diffusion equation." 1335 CALL flagerror(local_error,err,error,*999)
1338 CALL flagerror(
"Problem is not associated.",err,error,*999)
1341 exits(
"REACTION_DIFFUSION_EQUATION_PROBLEM_SETUP")
1343 999 errorsexits(
"REACTION_DIFFUSION_EQUATION_PROBLEM_SETUP",err,error)
1345 END SUBROUTINE reaction_diffusion_equation_problem_setup
1351 SUBROUTINE reaction_diffusion_pre_solve(SOLVER,ERR,ERROR,*)
1355 INTEGER(INTG),
INTENT(OUT) :: ERR
1358 REAL(DP) :: CURRENT_TIME,TIME_INCREMENT
1364 enters(
"REACTION_DIFFUSION_PRE_SOLVE",err,error,*999)
1366 IF(
ASSOCIATED(solver))
THEN 1367 solvers=>solver%SOLVERS
1368 IF(
ASSOCIATED(solvers))
THEN 1369 control_loop=>solvers%CONTROL_LOOP
1370 IF(
ASSOCIATED(control_loop))
THEN 1372 problem=>control_loop%PROBLEM
1373 IF(
ASSOCIATED(problem))
THEN 1374 SELECT CASE(problem%SPECIFICATION(3))
1376 SELECT CASE(solver%GLOBAL_NUMBER)
1378 CALL solver_dae_times_set(solver,current_time,current_time+time_increment/2.0_dp,err,error,*999)
1385 local_error=
"The solver global number of "//
trim(
number_to_vstring(solver%GLOBAL_NUMBER,
"*",err,error))// &
1386 &
" is invalid for a Strang split reaction-diffusion problem." 1387 CALL flagerror(local_error,err,error,*999)
1394 local_error=
"The problem subtype of "//
trim(
number_to_vstring(problem%SPECIFICATION(3),
"*",err,error))// &
1395 &
" is invalid for a reaction-diffusion problem type." 1396 CALL flagerror(local_error,err,error,*999)
1399 CALL flagerror(
"Control loop problem is not associated.",err,error,*999)
1402 CALL flagerror(
"Solvers control loop is not associated.",err,error,*999)
1405 CALL flagerror(
"Solver solvers is not associated.",err,error,*999)
1408 CALL flagerror(
"Solver is not associated.",err,error,*999)
1411 exits(
"REACTION_DIFFUSION_PRE_SOLVE")
1413 999 errorsexits(
"REACTION_DIFFUSION_PRE_SOLVE",err,error)
1416 END SUBROUTINE reaction_diffusion_pre_solve
1423 SUBROUTINE reaction_diffusion_post_solve(CONTROL_LOOP,SOLVER,ERR,ERROR,*)
1428 INTEGER(INTG),
INTENT(OUT) :: ERR
1435 enters(
"REACTION_DIFFUSION_POST_SOLVE",err,error,*999)
1437 IF(
ASSOCIATED(control_loop))
THEN 1438 IF(
ASSOCIATED(solver))
THEN 1439 IF(
ASSOCIATED(control_loop%PROBLEM))
THEN 1440 IF(.NOT.
ALLOCATED(control_loop%PROBLEM%SPECIFICATION))
THEN 1441 CALL flagerror(
"Problem specification is not allocated.",err,error,*999)
1442 ELSE IF(
SIZE(control_loop%PROBLEM%SPECIFICATION,1)<3)
THEN 1443 CALL flagerror(
"Problem specification must have three entries for a reaction diffusion problem.",err,error,*999)
1445 SELECT CASE(control_loop%PROBLEM%SPECIFICATION(3))
1447 SELECT CASE(solver%GLOBAL_NUMBER)
1458 solvers=>solver%SOLVERS
1461 CALL reaction_diffusion_post_solve_output_data(control_loop,pde_solver,err,error,*999)
1463 local_error=
"The solver global number of "//
trim(
number_to_vstring(solver%GLOBAL_NUMBER,
"*",err,error))// &
1464 &
" is invalid for a Strang split reaction-diffusion problem." 1465 CALL flagerror(local_error,err,error,*999)
1471 CALL reaction_diffusion_post_solve_output_data(control_loop,solver,err,error,*999)
1473 local_error=
"Problem subtype "//
trim(
number_to_vstring(control_loop%PROBLEM%SPECIFICATION(3),
"*",err,error))// &
1474 &
" is not valid for a reaction diffusion type of a classical field problem class." 1475 CALL flagerror(local_error,err,error,*999)
1478 CALL flagerror(
"Problem is not associated.",err,error,*999)
1481 CALL flagerror(
"Solver is not associated.",err,error,*999)
1484 CALL flagerror(
"Control loop is not associated.",err,error,*999)
1487 exits(
"REACTION_DIFFUSION_POST_SOLVE")
1489 999 errorsexits(
"REACTION_DIFFUSION_POST_SOLVE",err,error)
1491 END SUBROUTINE reaction_diffusion_post_solve
1496 SUBROUTINE reaction_diffusion_post_solve_output_data(CONTROL_LOOP,SOLVER,ERR,ERROR,*)
1501 INTEGER(INTG),
INTENT(OUT) :: ERR
1509 REAL(DP) :: CURRENT_TIME,TIME_INCREMENT
1510 INTEGER(INTG) :: EQUATIONS_SET_IDX,CURRENT_LOOP_ITERATION,OUTPUT_FREQUENCY,MAX_DIGITS
1511 INTEGER(INTG) :: myComputationalNodeNumber
1513 CHARACTER(30) :: FILE
1514 CHARACTER(30) :: OUTPUT_FILE
1516 CHARACTER(100) :: FMT, TEMP_FMT
1518 enters(
"REACTION_DIFFUSION_POST_SOLVE_OUTPUT_DATA",err,error,*999)
1520 IF(
ASSOCIATED(control_loop))
THEN 1521 IF(
ASSOCIATED(solver))
THEN 1522 IF(
ASSOCIATED(control_loop%PROBLEM))
THEN 1523 IF(.NOT.
ALLOCATED(control_loop%PROBLEM%SPECIFICATION))
THEN 1524 CALL flagerror(
"Problem specification is not allocated.",err,error,*999)
1525 ELSE IF(
SIZE(control_loop%PROBLEM%SPECIFICATION,1)<3)
THEN 1526 CALL flagerror(
"Problem specification must have three entries for a reaction diffusion problem.",err,error,*999)
1528 SELECT CASE(control_loop%PROBLEM%SPECIFICATION(3))
1532 solver_equations=>solver%SOLVER_EQUATIONS
1533 IF(
ASSOCIATED(solver_equations))
THEN 1534 solver_mapping=>solver_equations%SOLVER_MAPPING
1535 IF(
ASSOCIATED(solver_mapping))
THEN 1537 DO equations_set_idx=1,solver_mapping%NUMBER_OF_EQUATIONS_SETS
1538 equations_set=>solver_mapping%EQUATIONS_SETS(equations_set_idx)%PTR
1539 current_loop_iteration=control_loop%TIME_LOOP%ITERATION_NUMBER
1540 output_frequency=control_loop%TIME_LOOP%OUTPUT_NUMBER
1542 max_digits=floor(log10((control_loop%TIME_LOOP%STOP_TIME-control_loop%TIME_LOOP%START_TIME)/ &
1543 & control_loop%TIME_LOOP%TIME_INCREMENT))+1
1544 IF(output_frequency>0)
THEN 1545 IF(mod(current_loop_iteration,output_frequency)==0)
THEN 1546 IF(control_loop%TIME_LOOP%CURRENT_TIME<=control_loop%TIME_LOOP%STOP_TIME)
THEN 1547 IF(solver_mapping%NUMBER_OF_EQUATIONS_SETS.EQ.1)
THEN 1548 WRITE(temp_fmt,
'("I",I0,".",I0)') max_digits,max_digits
1550 fmt =
trim(temp_fmt)
1551 WRITE(temp_fmt,
'(A2,A38,A20,A2)')
"(",
'"TIME_STEP_SPEC_1.part",I2.2,".",',fmt,
")" 1552 fmt =
trim(temp_fmt)
1553 WRITE(output_file,fmt) &
1554 & mycomputationalnodenumber,current_loop_iteration
1556 WRITE(temp_fmt,
'("I",I0,".",I0)') max_digits,max_digits
1558 fmt =
trim(temp_fmt)
1559 WRITE(temp_fmt,
'(A2,A38,A20,A2)')
"(",
'"TIME_STEP_SPEC_",I0,".part",I2.2,".",',fmt,
")" 1560 fmt =
trim(temp_fmt)
1561 WRITE(output_file,fmt) &
1562 & equations_set_idx, mycomputationalnodenumber,current_loop_iteration
1564 WRITE(*,*) output_file
1565 file=
trim(output_file)
1568 CALL reaction_diffusion_io_write_cmgui(equations_set%REGION,equations_set%GLOBAL_NUMBER,file, &
1578 CALL flagerror(
"Not implemented.",err,error,*999)
1580 local_error=
"Problem subtype "//
trim(
number_to_vstring(control_loop%PROBLEM%SPECIFICATION(3),
"*",err,error))// &
1581 &
" is not valid for an advection-diffusion equation type of a classical field problem class." 1582 CALL flagerror(local_error,err,error,*999)
1585 CALL flagerror(
"Problem is not associated.",err,error,*999)
1588 CALL flagerror(
"Solver is not associated.",err,error,*999)
1591 CALL flagerror(
"Control loop is not associated.",err,error,*999)
1594 exits(
"REACTION_DIFFUSION_POST_SOLVE_OUTPUT_DATA")
1596 999 errorsexits(
"REACTION_DIFFUSION_POST_SOLVE_OUTPUT_DATA",err,error)
1599 END SUBROUTINE reaction_diffusion_post_solve_output_data
1604 SUBROUTINE reaction_diffusion_control_loop_post_loop(CONTROL_LOOP,ERR,ERROR,*)
1608 INTEGER(INTG),
INTENT(OUT) :: ERR
1622 enters(
"REACTION_DIFFUSION_CONTROL_LOOP_POST_LOOP",err,error,*999)
1625 IF(
ASSOCIATED(control_loop))
THEN 1626 problem=>control_loop%PROBLEM
1627 IF(
ASSOCIATED(problem))
THEN 1628 SELECT CASE(problem%SPECIFICATION(3))
1630 solvers=>control_loop%SOLVERS
1631 IF(
ASSOCIATED(solvers))
THEN 1633 solver_equations=>solver%SOLVER_EQUATIONS
1634 IF(
ASSOCIATED(solver_equations))
THEN 1635 solver_mapping=>solver_equations%SOLVER_MAPPING
1636 IF(
ASSOCIATED(solver_mapping))
THEN 1637 equations_set=>solver_mapping%EQUATIONS_SETS(1)%PTR
1638 IF(
ASSOCIATED(equations_set))
THEN 1639 equations=>equations_set%EQUATIONS
1640 IF(
ASSOCIATED(equations))
THEN 1641 equations_matrices=>equations%EQUATIONS_MATRICES
1642 dynamic_matrices=>equations_matrices%DYNAMIC_MATRICES
1643 stiffness_matrix=>dynamic_matrices%MATRICES(1)%PTR
1644 damping_matrix=>dynamic_matrices%MATRICES(2)%PTR
1645 stiffness_matrix%UPDATE_MATRIX = .false.
1646 damping_matrix%UPDATE_MATRIX = .false.
1648 CALL flagerror(
"Equations not associated.",err,error,*999)
1651 CALL flagerror(
"Equations Set not associated.",err,error,*999)
1655 CALL flagerror(
"Solver Mapping not associated.",err,error,*999)
1658 CALL flagerror(
"Solver Equations not associated.", err,error,*999)
1661 CALL flagerror(
"Solvers is not associated.", err,error,*999)
1669 CALL flagerror(
"Problem is not associated.",err,error,*999)
1672 CALL flagerror(
"Control Loop is not associated.",err,error,*999)
1674 exits(
"REACTION_DIFFUSION_CONTROL_LOOP_POST_LOOP")
1676 999 errorsexits(
"REACTION_DIFFUSION_CONTROL_LOOP_POST_LOOP",err,error)
1678 END SUBROUTINE reaction_diffusion_control_loop_post_loop
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.
subroutine, public solvers_create_finish(SOLVERS, ERR, ERROR,)
Finish the creation of solvers.
subroutine, public equations_mapping_dynamic_variable_type_set(EQUATIONS_MAPPING, DYNAMIC_VARIABLE_TYPE, ERR, ERROR,)
Sets the mapping between a dependent field variable and the equations set dynamic matrices...
Contains information on the equations mapping i.e., how field variable DOFS are mapped to the rows an...
Contains information about the CellML equations for a solver.
Contains information about the equations in an equations set.
integer(intg), parameter equations_set_gfem_solution_method
Grid-based Finite Element Method solution method.
integer(intg), parameter problem_control_time_loop_type
Time control loop.
integer(intg), parameter problem_setup_control_type
Solver setup for a problem.
This module handles all problem wide constants.
integer(intg), parameter solver_equations_first_order_dynamic
Solver equations are first order dynamic.
integer(intg), parameter, public control_loop_node
The identifier for a each "leaf" node in a control loop.
subroutine, public solver_dynamic_order_set(SOLVER, ORDER, ERR, ERROR,)
Sets/changes the order for a dynamic solver.
Converts a number to its equivalent varying string representation.
subroutine, public equations_create_start(EQUATIONS_SET, EQUATIONS, ERR, ERROR,)
Start the creation of equations for the equation set.
Contains information on the mesh decomposition.
subroutine, public equations_matrices_create_start(EQUATIONS, EQUATIONS_MATRICES, ERR, ERROR,)
Starts the creation of the equations matrices and rhs for the the equations.
Contains information on the type of solver to be used.
subroutine, public solvers_number_set(SOLVERS, NUMBER_OF_SOLVERS, ERR, ERROR,)
Sets/changes the number of solvers.
integer(intg), parameter no_part_deriv
No partial derivative i.e., u.
integer(intg), parameter, public solver_dynamic_crank_nicolson_scheme
Crank-Nicolson dynamic solver.
subroutine, public solver_dynamic_degree_set(SOLVER, DEGREE, ERR, ERROR,)
Sets/changes the degree of the polynomial used to interpolate time for a dynamic solver.
This module handles all equations matrix and rhs routines.
integer(intg), parameter, public solver_dynamic_first_order
Dynamic solver has first order terms.
subroutine, public solver_type_set(SOLVER, SOLVE_TYPE, ERR, ERROR,)
Sets/changes the type for a solver.
Contains information on an equations set.
This module handles all equations routines.
integer(intg), parameter, public solver_dae_type
A differential-algebraic equation solver.
integer(intg), parameter equations_set_setup_source_type
Source setup.
This module contains all string manipulation and transformation routines.
subroutine, public solvers_create_start(CONTROL_LOOP, SOLVERS, ERR, ERROR,)
Start the creation of a solvers for the control loop.
Contains information on the solvers to be used in a control loop.
integer(intg), parameter first_part_deriv
First partial derivative i.e., du/ds.
This module contains routines for timing the program.
subroutine, public control_loop_current_times_get(CONTROL_LOOP, CURRENT_TIME, TIME_INCREMENT, ERR, ERROR,)
Gets the current time parameters for a time control loop.
Contains information of the source vector for equations matrices.
subroutine, public equations_matrices_dynamic_lumping_type_set(EQUATIONS_MATRICES, LUMPING_TYPE, ERR, ERROR,)
Sets the lumping of the linear equations matrices.
subroutine, public equations_time_dependence_type_set(EQUATIONS, TIME_DEPENDENCE_TYPE, ERR, ERROR,)
Sets/changes the time dependence type for equations.
subroutine, public solver_equations_sparsity_type_set(SOLVER_EQUATIONS, SPARSITY_TYPE, ERR, ERROR,)
Sets/changes the sparsity type for solver equations.
integer(intg), parameter problem_cellml_reac_eval_reac_diff_no_split_subtype
subroutine, public solvers_solver_get(SOLVERS, SOLVER_INDEX, SOLVER, ERR, ERROR,)
Returns a pointer to the specified solver in the list of solvers.
Contains information for a field defined on a region.
integer(intg), parameter, public equations_matrices_full_matrices
Use fully populated equation matrices.
subroutine, public equations_mapping_rhs_variable_type_set(EQUATIONS_MAPPING, RHS_VARIABLE_TYPE, ERR, ERROR,)
Sets the mapping between a dependent field variable and the equations set rhs vector.
integer(intg), parameter solver_equations_linear
Solver equations are linear.
Contains information on a control loop.
This module provides an iso_varying_string module, conformant to the API specified in ISO/IEC 1539-2:...
subroutine, public solver_equations_create_finish(SOLVER_EQUATIONS, ERR, ERROR,)
Finishes the process of creating solver equations.
integer(intg), parameter, public solver_sparse_matrices
Use sparse solver matrices.
subroutine, public solver_equations_create_start(SOLVER, SOLVER_EQUATIONS, ERR, ERROR,)
Starts the process of creating solver equations.
integer(intg), parameter, public solver_dynamic_type
A dynamic solver.
integer(intg), parameter, public basis_default_quadrature_scheme
Identifier for the default quadrature scheme.
integer(intg), parameter problem_setup_solvers_type
Solver setup for a problem.
integer(intg), parameter equations_set_setup_equations_type
Equations setup.
Contains information for mapping field variables to the dynamic matrices in the equations set of the ...
This module contains all program wide constants.
integer(intg), parameter solver_equations_nonlinear
Solver equations are nonlinear.
subroutine, public solver_library_type_set(SOLVER, SOLVER_LIBRARY_TYPE, ERR, ERROR,)
Sets/changes the type of library type to use for the solver.
integer(intg), parameter, public equations_lumped_matrices
The equations matrices are "mass" lumped.
integer(intg), parameter problem_setup_initial_type
Initial setup for a problem.
integer(intg), parameter problem_constant_reac_diff_no_split_subtype
integer(intg), parameter equations_first_order_dynamic
The equations are first order dynamic.
subroutine, public solver_equations_linearity_type_set(SOLVER_EQUATIONS, LINEARITY_TYPE, ERR, ERROR,)
Sets/changes the linearity type for solver equations.
integer(intg), parameter equations_set_cellml_reac_no_split_reac_diff_subtype
integer(intg), parameter equations_set_setup_start_action
Start setup action.
integer(intg), parameter problem_classical_field_class
subroutine, public cellml_equations_create_start(SOLVER, CELLML_EQUATIONS, ERR, ERROR,)
Starts the process of creating CellML equations.
subroutine, public exits(NAME)
Records the exit out of the named procedure.
recursive subroutine, public control_loop_solvers_get(CONTROL_LOOP, SOLVERS, ERR, ERROR,)
Returns a pointer to the solvers for a control loop.
This module contains all type definitions in order to avoid cyclic module references.
subroutine, public solver_cellml_equations_get(SOLVER, CELLML_EQUATIONS, ERR, ERROR,)
Returns a pointer to the CellML equations for a solver.
Contains information on the equations matrices and vectors.
integer(intg), parameter, public equations_matrix_fem_structure
Finite element matrix structure.
integer(intg), parameter equations_set_cellml_reac_split_reac_diff_subtype
Temporary IO routines for fluid mechanics.
This module contains all the low-level base routines e.g., all debug, control, and low-level communic...
integer(intg), parameter problem_cellml_reac_integ_reac_diff_strang_split_subtype
integer(intg), parameter, public general_output_type
General output type.
subroutine, public equationsmatrices_dynamicstructuretypeset(EQUATIONS_MATRICES, STRUCTURE_TYPE, ERR, ERROR,)
Sets the structure (sparsity) of the dynamic equations matrices.
subroutine, public equations_mapping_create_finish(EQUATIONS_MAPPING, ERR, ERROR,)
Finishes the process of creating an equations mapping.
Returns the specified control loop as indexed by the control loop identifier from the control loop ro...
subroutine, public control_loop_type_set(CONTROL_LOOP, LOOP_TYPE, ERR, ERROR,)
Sets/changes the control loop type.
subroutine, public equations_mapping_source_variable_type_set(EQUATIONS_MAPPING, SOURCE_VARIABLE_TYPE, ERR, ERROR,)
Sets the mapping between a source field variable and the equations set source vector.
subroutine, public equations_set_equations_get(EQUATIONS_SET, EQUATIONS, ERR, ERROR,)
Gets the equations for an equations set.
This module contains all computational environment variables.
integer(intg), parameter, public solver_cellml_evaluator_type
A CellML evaluation solver.
integer(intg), dimension(4) partial_derivative_first_derivative_map
PARTIAL_DERIVATIVE_FIRST_DERIVATIVE_MAP(nic) gives the partial derivative index for the first derivat...
subroutine, public equations_create_finish(EQUATIONS, ERR, ERROR,)
Finish the creation of equations.
This module handles all domain mappings routines.
integer(intg), parameter problem_setup_finish_action
Finish setup action.
This module handles all equations mapping routines.
Contains information about the solver equations for a solver.
subroutine, public equations_matrices_dynamic_storage_type_set(EQUATIONS_MATRICES, STORAGE_TYPE, ERR, ERROR,)
Sets the storage type (sparsity) of the dynamic equations matrices.
integer(intg), parameter, public equations_matrix_diagonal_structure
Diagonal matrix structure.
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.
integer(intg), parameter problem_setup_cellml_equations_type
CellML equations setup for a problem.
integer(intg), parameter equations_set_classical_field_class
integer(intg), parameter equations_linear
The equations are linear.
subroutine, public equations_matrices_create_finish(EQUATIONS_MATRICES, ERR, ERROR,)
Finishes the creation of the equations matrices and RHS for the the equations.
This module handles all distributed matrix vector routines.
This module handles all boundary conditions routines.
This module handles all solver routines.
subroutine, public equations_mapping_create_start(EQUATIONS, EQUATIONS_MAPPING, ERR, ERROR,)
Finishes the process of creating an equations mapping for a equations set equations.
integer(intg), parameter, public equations_matrix_unlumped
The matrix is not lumped.
Contains information about an equations matrix.
Contains information for a particular quadrature scheme.
This module contains all routines dealing with (non-distributed) matrix and vectors types...
integer(intg), parameter, public distributed_matrix_block_storage_type
Distributed matrix block storage type.
integer(intg), parameter, public equations_matrix_lumped
The matrix is "mass" lumped.
This module handles all reaction diffusion equation routines.
subroutine, public equations_linearity_type_set(EQUATIONS, LINEARITY_TYPE, ERR, ERROR,)
Sets/changes the linearity type for equations.
subroutine, public control_loop_create_start(PROBLEM, CONTROL_LOOP, ERR, ERROR,)
Start the process of creating a control loop for a problem.
integer(intg), parameter problem_setup_solver_equations_type
Solver equations setup for a problem.
integer(intg), parameter equations_set_reaction_diffusion_equation_type
Contains information on the solver mapping between the global equation sets and the solver matrices...
subroutine, public solver_dynamic_scheme_set(SOLVER, SCHEME, ERR, ERROR,)
Sets/changes the scheme for a dynamic solver.
Contains information for a field variable defined on a field.
subroutine, public cellml_equations_create_finish(CELLML_EQUATIONS, ERR, ERROR,)
Finishes the process of creating CellML equations.
integer(intg), parameter equations_set_fd_solution_method
Finite Difference solution method.
integer(intg), parameter, public equations_matrices_sparse_matrices
Use sparse equations matrices.
Contains information on the setup information for an equations set.
integer(intg), parameter problem_setup_start_action
Start setup action.
subroutine, public solver_equations_time_dependence_type_set(SOLVER_EQUATIONS, TIME_DEPENDENCE_TYPE, ERR, ERROR,)
Sets/changes the time dependence type for solver equations.
This module handles all control loop routines.
integer(intg), parameter, public solver_cmiss_library
CMISS (internal) solver library.
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.
subroutine, public solver_solver_equations_get(SOLVER, SOLVER_EQUATIONS, ERR, ERROR,)
Returns a pointer to the solver equations for a solver.
integer(intg), parameter equations_set_constant_reac_diff_subtype
Contains all information about a basis .
integer(intg), parameter equations_set_fv_solution_method
Finite Volume solution method.
integer(intg), parameter, public solver_dynamic_first_degree
Dynamic solver uses a first degree polynomial for time interpolation.
integer(intg), parameter equations_set_setup_initial_type
Initial setup.
recursive subroutine, public control_loop_create_finish(CONTROL_LOOP, ERR, ERROR,)
Finish the process of creating a control loop.
integer(intg), parameter equations_set_setup_analytic_type
Analytic setup.
subroutine, public solver_dae_times_set(SOLVER, START_TIME, END_TIME, ERR, ERROR,)
Set/change the times for a differential-algebraic equation solver.
Flags an error condition.
Contains information of the RHS vector for equations matrices.
integer(intg) function, public computational_node_number_get(ERR, ERROR)
Returns the number/rank of the computational nodes.
integer(intg), parameter equations_nonlinear
The equations are non-linear.
integer(intg), parameter, public distributed_matrix_diagonal_storage_type
Distributed matrix diagonal storage type.
integer(intg), parameter problem_reaction_diffusion_equation_type
This module contains all kind definitions.
integer(intg), parameter equations_set_setup_finish_action
Finish setup action.
integer(intg), parameter, public distributed_matrix_compressed_row_storage_type
Distributed matrix compressed row storage type.
Contains information of the dynamic matrices for equations matrices.