88 PUBLIC monodomain_control_loop_post_loop
90 PUBLIC monodomain_equation_equations_set_setup
92 PUBLIC monodomain_finiteelementcalculate
94 PUBLIC monodomain_equationssetsolutionmethodset
96 PUBLIC monodomain_equationssetspecificationset
98 PUBLIC monodomain_problemspecificationset
100 PUBLIC monodomain_equation_problem_setup
102 PUBLIC monodomain_pre_solve,monodomain_post_solve
111 SUBROUTINE monodomain_control_loop_post_loop(CONTROL_LOOP,ERR,ERROR,*)
115 INTEGER(INTG),
INTENT(OUT) :: ERR
118 INTEGER(INTG) :: equations_set_idx
130 INTEGER(INTG) :: OUTPUT_ITERATION_NUMBER,CURRENT_LOOP_ITERATION
132 enters(
"MONODOMAIN_CONTROL_LOOP_POST_LOOP",err,error,*999)
134 IF(
ASSOCIATED(control_loop))
THEN 136 SELECT CASE(control_loop%LOOP_TYPE)
143 time_loop=>control_loop%TIME_LOOP
144 IF(
ASSOCIATED(time_loop))
THEN 145 problem=>control_loop%PROBLEM
146 IF(
ASSOCIATED(problem))
THEN 153 solver_equations=>solver%SOLVER_EQUATIONS
154 IF(
ASSOCIATED(solver_equations))
THEN 155 solver_mapping=>solver_equations%SOLVER_MAPPING
156 IF(
ASSOCIATED(solver_mapping))
THEN 157 DO equations_set_idx=1,solver_mapping%NUMBER_OF_EQUATIONS_SETS
158 equations_set=>solver_mapping%EQUATIONS_SETS(equations_set_idx)%PTR
159 IF(
ASSOCIATED(equations_set))
THEN 160 dependent_field=>equations_set%DEPENDENT%DEPENDENT_FIELD
161 NULLIFY(dependent_region)
162 CALL field_region_get(dependent_field,dependent_region,err,error,*999)
164 parent_loop=>control_loop%PARENT_LOOP
165 IF(
ASSOCIATED(parent_loop))
THEN 167 NULLIFY(time_loop_parent)
168 time_loop_parent=>parent_loop%TIME_LOOP
169 IF(
ASSOCIATED(time_loop_parent))
THEN 170 output_iteration_number=time_loop_parent%OUTPUT_NUMBER
171 current_loop_iteration=time_loop_parent%GLOBAL_ITERATION_NUMBER
176 output_iteration_number=time_loop%OUTPUT_NUMBER
177 current_loop_iteration=time_loop%GLOBAL_ITERATION_NUMBER
182 output_iteration_number=time_loop%OUTPUT_NUMBER
183 current_loop_iteration=time_loop%GLOBAL_ITERATION_NUMBER
188 IF(output_iteration_number/=0.AND.mod(current_loop_iteration,output_iteration_number)==0)
THEN 192 local_error=
"Equations set is not associated for equations set index "// &
194 &
" in the solver mapping." 195 CALL flagerror(local_error,err,error,*999)
199 CALL flagerror(
"Solver equations solver mapping is not associated.",err,error,*999)
202 CALL flagerror(
"Solver solver equations are not associated.",err,error,*999)
205 CALL flagerror(
"Control loop problem is not associated.",err,error,*999)
208 CALL flagerror(
"Time loop is not associated.",err,error,*999)
215 local_error=
"The control loop type of "//
trim(
number_to_vstring(control_loop%LOOP_TYPE,
"*",err,error))// &
217 CALL flagerror(local_error,err,error,*999)
221 CALL flagerror(
"Control loop is not associated.",err,error,*999)
224 exits(
"MONODOMAIN_CONTROL_LOOP_POST_LOOP")
226 999 errorsexits(
"MONODOMAIN_CONTROL_LOOP_POST_LOOP",err,error)
229 END SUBROUTINE monodomain_control_loop_post_loop
236 SUBROUTINE monodomain_equationssetspecificationset(equationsSet,specification,err,error,*)
240 INTEGER(INTG),
INTENT(IN) :: specification(:)
241 INTEGER(INTG),
INTENT(OUT) :: err
244 INTEGER(INTG) :: subtype
247 enters(
"Monodomain_EquationsSetSpecificationSet",err,error,*999)
249 IF(
ASSOCIATED(equationsset))
THEN 250 IF(
SIZE(specification,1)<3)
THEN 251 CALL flagerror(
"Equations set specification must have at least three entries for a monodomain class equations set.", &
254 SELECT CASE(specification(2))
256 subtype=specification(3)
263 &
" is not valid for a Monodomain equation type of a Strang splitting equations set class." 264 CALL flagerror(localerror,err,error,*999)
267 IF(
ALLOCATED(equationsset%specification))
THEN 268 CALL flagerror(
"Equations set specification is already allocated.",err,error,*999)
270 ALLOCATE(equationsset%specification(3),stat=err)
271 IF(err/=0)
CALL flagerror(
"Could not allocate equations set specification.",err,error,*999)
276 localerror=
"Equations set equation type "//
trim(
numbertovstring(specification(2),
"*",err,error))// &
277 &
" is not valid for a monodomain equations set class." 280 CALL flagerror(
"Equations set is not associated",err,error,*999)
283 CALL exits(
"Monodomain_EquationsSetSpecificationSet")
285 999
CALL errors(
"Monodomain_EquationsSetSpecificationSet",err,error)
286 CALL exits(
"Monodomain_EquationsSetSpecificationSet")
289 END SUBROUTINE monodomain_equationssetspecificationset
296 SUBROUTINE monodomain_problemspecificationset(problem,problemSpecification,err,error,*)
300 INTEGER(INTG),
INTENT(IN) :: problemSpecification(:)
301 INTEGER(INTG),
INTENT(OUT) :: err
305 INTEGER(INTG) :: problemType,problemSubtype
307 CALL enters(
"Monodomain_ProblemSpecificationSet",err,error,*999)
309 IF(
ASSOCIATED(problem))
THEN 310 IF(
SIZE(problemspecification,1)>=3)
THEN 311 problemtype=problemspecification(2)
312 SELECT CASE(problemtype)
314 problemsubtype=problemspecification(3)
315 SELECT CASE(problemsubtype)
321 &
" is not valid for a Monodomain equation type of a Strang splitting problem class." 322 CALL flagerror(localerror,err,error,*999)
324 IF(
ALLOCATED(problem%specification))
THEN 325 CALL flagerror(
"Problem specification is already allocated.",err,error,*999)
327 ALLOCATE(problem%specification(3),stat=err)
328 IF(err/=0)
CALL flagerror(
"Could not allocate problem specification.",err,error,*999)
333 &
" is not valid for a monodomain problem class." 334 CALL flagerror(localerror,err,error,*999)
337 CALL flagerror(
"Monodomain problem specification must have a type.",err,error,*999)
340 CALL flagerror(
"Problem is not associated",err,error,*999)
343 CALL exits(
"Monodomain_ProblemSpecificationSet")
345 999
CALL errors(
"Monodomain_ProblemSpecificationSet",err,error)
346 CALL exits(
"Monodomain_ProblemSpecificationSet")
349 END SUBROUTINE monodomain_problemspecificationset
356 SUBROUTINE monodomain_finiteelementcalculate(EQUATIONS_SET,ELEMENT_NUMBER,ERR,ERROR,*)
360 INTEGER(INTG),
INTENT(IN) :: ELEMENT_NUMBER
361 INTEGER(INTG),
INTENT(OUT) :: ERR
364 INTEGER(INTG) FIELD_VAR_TYPE,ng,mh,mhs,ms,nh,nhs,ni,ns,nj
365 REAL(DP) :: RWG,SUM,Df, Dt, D(3,3), f(3), fnorm
366 REAL(DP) :: DPHIDX(3,8)
367 TYPE(
basis_type),
POINTER :: DEPENDENT_BASIS,GEOMETRIC_BASIS
375 TYPE(
field_type),
POINTER :: DEPENDENT_FIELD,GEOMETRIC_FIELD,MATERIALS_FIELD
380 enters(
"Monodomain_FiniteElementCalculate",err,error,*999)
382 IF(
ASSOCIATED(equations_set))
THEN 383 equations=>equations_set%EQUATIONS
384 IF(
ASSOCIATED(equations))
THEN 385 IF(.NOT.
ALLOCATED(equations_set%SPECIFICATION))
THEN 386 CALL flagerror(
"Equations set specification is not allocated.",err,error,*999)
387 ELSE IF(
SIZE(equations_set%SPECIFICATION,1)/=3)
THEN 388 CALL flagerror(
"Equations set specification must have three entries for a monodomain type equations set.", &
391 SELECT CASE(equations_set%SPECIFICATION(3))
394 dependent_field=>equations%INTERPOLATION%DEPENDENT_FIELD
395 geometric_field=>equations%INTERPOLATION%GEOMETRIC_FIELD
396 materials_field=>equations%INTERPOLATION%MATERIALS_FIELD
397 equations_matrices=>equations%EQUATIONS_MATRICES
398 dynamic_matrices=>equations_matrices%DYNAMIC_MATRICES
399 stiffness_matrix=>dynamic_matrices%MATRICES(1)%PTR
400 damping_matrix=>dynamic_matrices%MATRICES(2)%PTR
401 rhs_vector=>equations_matrices%RHS_VECTOR
403 IF(.NOT.(stiffness_matrix%UPDATE_MATRIX.OR.damping_matrix%UPDATE_MATRIX.OR.rhs_vector%UPDATE_VECTOR))
RETURN 406 equations_mapping=>equations%EQUATIONS_MAPPING
407 dynamic_mapping=>equations_mapping%DYNAMIC_MAPPING
408 field_variable=>dynamic_mapping%EQUATIONS_MATRIX_TO_VAR_MAPS(1)%VARIABLE
409 field_var_type=field_variable%VARIABLE_TYPE
410 geometric_variable=>geometric_field%VARIABLE_TYPE_MAP(field_u_variable_type)%PTR
411 dependent_basis=>dependent_field%DECOMPOSITION%DOMAIN(dependent_field%DECOMPOSITION%MESH_COMPONENT_NUMBER)%PTR% &
412 & topology%ELEMENTS%ELEMENTS(element_number)%BASIS
413 geometric_basis=>geometric_field%DECOMPOSITION%DOMAIN(geometric_field%DECOMPOSITION%MESH_COMPONENT_NUMBER)%PTR% &
414 & topology%ELEMENTS%ELEMENTS(element_number)%BASIS
417 CALL field_interpolation_parameters_element_get(field_values_set_type,element_number,equations%INTERPOLATION% &
418 & geometric_interp_parameters(field_u_variable_type)%PTR,err,error,*999)
419 CALL field_interpolation_parameters_element_get(field_values_set_type,element_number,equations%INTERPOLATION% &
420 & materials_interp_parameters(field_u_variable_type)%PTR,err,error,*999)
423 DO ng=1,quadrature_scheme%NUMBER_OF_GAUSS
427 & geometric_interp_point(field_u_variable_type)%PTR,err,error,*999)
428 CALL field_interpolated_point_metrics_calculate(geometric_basis%NUMBER_OF_XI,equations%INTERPOLATION% &
429 & geometric_interp_point_metrics(field_u_variable_type)%PTR,err,error,*999)
431 & materials_interp_point(field_u_variable_type)%PTR,err,error,*999)
434 rwg=equations%INTERPOLATION%GEOMETRIC_INTERP_POINT_METRICS(field_u_variable_type)%PTR%JACOBIAN* &
435 & quadrature_scheme%GAUSS_WEIGHTS(ng)
438 DO ms=1,dependent_basis%NUMBER_OF_ELEMENT_PARAMETERS
439 DO nj=1,geometric_variable%NUMBER_OF_COMPONENTS
441 DO ni=1,dependent_basis%NUMBER_OF_XI
442 dphidx(nj,ms)=dphidx(nj,ms) + &
444 & equations%INTERPOLATION%GEOMETRIC_INTERP_POINT_METRICS(field_u_variable_type)%PTR%DXI_DX(ni,nj)
450 df = equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_u_variable_type)%PTR%VALUES(2,
no_part_deriv)
451 dt = equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_u_variable_type)%PTR%VALUES(3,
no_part_deriv)
453 DO nj=1,geometric_variable%NUMBER_OF_COMPONENTS
454 f(nj) = equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_u_variable_type)%PTR%VALUES(3+nj,
no_part_deriv)
455 fnorm = fnorm + f(nj)*f(nj)
459 IF(fnorm < 1e-6)
THEN 460 f = (/ 1.0, 0.0, 0.0 /)
464 DO ni=1,geometric_variable%NUMBER_OF_COMPONENTS
467 DO nj=1,geometric_variable%NUMBER_OF_COMPONENTS
468 d(ni,nj) = d(ni,nj) + (df - dt) * f(ni) * f(nj)
474 DO mh=1,field_variable%NUMBER_OF_COMPONENTS
476 DO ms=1,dependent_basis%NUMBER_OF_ELEMENT_PARAMETERS
479 IF(stiffness_matrix%UPDATE_MATRIX.OR.damping_matrix%UPDATE_MATRIX)
THEN 481 DO nh=1,field_variable%NUMBER_OF_COMPONENTS
482 DO ns=1,dependent_basis%NUMBER_OF_ELEMENT_PARAMETERS
484 IF(stiffness_matrix%UPDATE_MATRIX)
THEN 486 DO ni=1,geometric_variable%NUMBER_OF_COMPONENTS
487 DO nj=1,geometric_variable%NUMBER_OF_COMPONENTS
488 sum=sum + d(ni,nj) * dphidx(ni,ms) * dphidx(nj,ns)
491 stiffness_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)=stiffness_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)+sum*rwg
494 IF(damping_matrix%UPDATE_MATRIX)
THEN 495 damping_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)=damping_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)+ &
503 IF(rhs_vector%UPDATE_VECTOR) rhs_vector%ELEMENT_VECTOR%VECTOR(mhs)=0.0_dp
510 IF(rhs_vector%UPDATE_VECTOR) rhs_vector%ELEMENT_VECTOR%VECTOR(mhs)=0.0_dp
512 IF(dependent_field%SCALINGS%SCALING_TYPE/=field_no_scaling)
THEN 513 CALL field_interpolationparametersscalefactorselementget(element_number,equations%INTERPOLATION% &
514 & dependent_interp_parameters(field_var_type)%PTR,err,error,*999)
516 DO mh=1,field_variable%NUMBER_OF_COMPONENTS
518 DO ms=1,dependent_basis%NUMBER_OF_ELEMENT_PARAMETERS
521 IF(stiffness_matrix%UPDATE_MATRIX.OR.damping_matrix%UPDATE_MATRIX)
THEN 523 DO nh=1,field_variable%NUMBER_OF_COMPONENTS
524 DO ns=1,dependent_basis%NUMBER_OF_ELEMENT_PARAMETERS
526 IF(stiffness_matrix%UPDATE_MATRIX)
THEN 527 stiffness_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)=stiffness_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)* &
528 & equations%INTERPOLATION%DEPENDENT_INTERP_PARAMETERS(field_var_type)%PTR%SCALE_FACTORS(ms,mh)* &
529 & equations%INTERPOLATION%DEPENDENT_INTERP_PARAMETERS(field_var_type)%PTR%SCALE_FACTORS(ns,nh)
531 IF(damping_matrix%UPDATE_MATRIX)
THEN 532 damping_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)=damping_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)* &
533 & equations%INTERPOLATION%DEPENDENT_INTERP_PARAMETERS(field_var_type)%PTR%SCALE_FACTORS(ms,mh)* &
534 & equations%INTERPOLATION%DEPENDENT_INTERP_PARAMETERS(field_var_type)%PTR%SCALE_FACTORS(ns,nh)
540 IF(rhs_vector%UPDATE_VECTOR) rhs_vector%ELEMENT_VECTOR%VECTOR(mhs)=rhs_vector%ELEMENT_VECTOR%VECTOR(mhs)* &
541 & equations%INTERPOLATION%DEPENDENT_INTERP_PARAMETERS(field_var_type)%PTR%SCALE_FACTORS(ms,mh)
550 local_error=
"Equations set subtype "//
trim(
number_to_vstring(equations_set%SPECIFICATION(3),
"*",err,error))// &
551 &
" is not valid for a Monodomain equation type of a Strang splitting equations set class." 552 CALL flagerror(local_error,err,error,*999)
555 CALL flagerror(
"Equations set equations is not associated.",err,error,*999)
558 CALL flagerror(
"Equations set is not associated.",err,error,*999)
561 exits(
"Monodomain_FiniteElementCalculate")
563 999 errorsexits(
"Monodomain_FiniteElementCalculate",err,error)
566 END SUBROUTINE monodomain_finiteelementcalculate
573 SUBROUTINE monodomain_equation_equations_set_setup(EQUATIONS_SET,EQUATIONS_SET_SETUP,ERR,ERROR,*)
578 INTEGER(INTG),
INTENT(OUT) :: ERR
583 enters(
"MONODOMAIN_EQUATION_EQUATIONS_SET_SETUP",err,error,*999)
585 IF(
ASSOCIATED(equations_set))
THEN 586 IF(.NOT.
ALLOCATED(equations_set%SPECIFICATION))
THEN 587 CALL flagerror(
"Equations set specification is not allocated.",err,error,*999)
588 ELSE IF(
SIZE(equations_set%SPECIFICATION,1)/=3)
THEN 589 CALL flagerror(
"Equations set specification must have three entries for a monodomain type equations set.", &
592 SELECT CASE(equations_set%SPECIFICATION(3))
594 CALL monodomain_equationssetsubtypesetup(equations_set,equations_set_setup,err,error,*999)
596 local_error=
"Equations set subtype "//
trim(
number_to_vstring(equations_set%SPECIFICATION(3),
"*",err,error))// &
597 &
" is not valid for a Monodomain equation type of a Strang splitting equation set class." 598 CALL flagerror(local_error,err,error,*999)
601 CALL flagerror(
"Equations set is not associated.",err,error,*999)
604 exits(
"MONODOMAIN_EQUATION_EQUATIONS_SET_SETUP")
606 999 errorsexits(
"MONODOMAIN_EQUATION_EQUATIONS_SET_SETUP",err,error)
608 END SUBROUTINE monodomain_equation_equations_set_setup
615 SUBROUTINE monodomain_equationssetsolutionmethodset(EQUATIONS_SET,SOLUTION_METHOD,ERR,ERROR,*)
619 INTEGER(INTG),
INTENT(IN) :: SOLUTION_METHOD
620 INTEGER(INTG),
INTENT(OUT) :: ERR
625 enters(
"MONODOMAIN_EQUATIONS_SET_SOLUTION_METHOD_SET",err,error,*999)
627 IF(
ASSOCIATED(equations_set))
THEN 628 IF(.NOT.
ALLOCATED(equations_set%SPECIFICATION))
THEN 629 CALL flagerror(
"Equations set specification is not allocated.",err,error,*999)
630 ELSE IF(
SIZE(equations_set%SPECIFICATION,1)/=3)
THEN 631 CALL flagerror(
"Equations set specification must have three entries for a monodomain type equations set.", &
634 SELECT CASE(equations_set%SPECIFICATION(3))
636 SELECT CASE(solution_method)
640 CALL flagerror(
"Not implemented.",err,error,*999)
642 CALL flagerror(
"Not implemented.",err,error,*999)
644 CALL flagerror(
"Not implemented.",err,error,*999)
646 CALL flagerror(
"Not implemented.",err,error,*999)
648 CALL flagerror(
"Not implemented.",err,error,*999)
650 local_error=
"The specified solution method of "//
trim(
number_to_vstring(solution_method,
"*",err,error))//
" is invalid." 651 CALL flagerror(local_error,err,error,*999)
654 local_error=
"Equations set subtype of "//
trim(
number_to_vstring(equations_set%SPECIFICATION(3),
"*",err,error))// &
655 &
" is not valid for a Monodomain equation type of monodomain Strang splitting equations set class." 656 CALL flagerror(local_error,err,error,*999)
659 CALL flagerror(
"Equations set is not associated.",err,error,*999)
662 exits(
"Monodomain_EquationsSetSolutionMethodSet")
664 999
errors(
"Monodomain_EquationsSetSolutionMethodSet",err,error)
665 exits(
"Monodomain_EquationsSetSolutionMethodSet")
668 END SUBROUTINE monodomain_equationssetsolutionmethodset
675 SUBROUTINE monodomain_equationssetsubtypesetup(EQUATIONS_SET,EQUATIONS_SET_SETUP,ERR,ERROR,*)
680 INTEGER(INTG),
INTENT(OUT) :: ERR
683 INTEGER(INTG) :: component_idx,GEOMETRIC_MESH_COMPONENT,GEOMETRIC_SCALING_TYPE,NUMBER_OF_DIMENSIONS, &
684 & NUMBER_OF_MATERIALS_COMPONENTS, NUM_COMP
692 enters(
"MONODOMAIN_EQUATION_EQUATION_SET_SUBTYPE_SETUP",err,error,*999)
695 NULLIFY(equations_mapping)
696 NULLIFY(equations_matrices)
697 NULLIFY(geometric_decomposition)
700 IF(
ASSOCIATED(equations_set))
THEN 701 IF(.NOT.
ALLOCATED(equations_set%SPECIFICATION))
THEN 702 CALL flagerror(
"Equations set specification is not allocated.",err,error,*999)
703 ELSE IF(
SIZE(equations_set%SPECIFICATION,1)/=3)
THEN 704 CALL flagerror(
"Equations set specification must have three entries for a monodomain type equations set.", &
709 SELECT CASE(equations_set_setup%SETUP_TYPE)
711 SELECT CASE(equations_set_setup%ACTION_TYPE)
718 local_error=
"The action type of "//
trim(
number_to_vstring(equations_set_setup%ACTION_TYPE,
"*",err,error))// &
720 &
" is invalid for a Monodomain equation." 721 CALL flagerror(local_error,err,error,*999)
726 SELECT CASE(equations_set_setup%ACTION_TYPE)
728 IF(equations_set%DEPENDENT%DEPENDENT_FIELD_AUTO_CREATED)
THEN 730 CALL field_create_start(equations_set_setup%FIELD_USER_NUMBER,equations_set%REGION,equations_set%DEPENDENT% &
731 & dependent_field,err,error,*999)
732 CALL field_type_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_general_type,err,error,*999)
733 CALL field_dependent_type_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_dependent_type,err,error,*999)
734 CALL field_mesh_decomposition_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_decomposition,err,error,*999)
735 CALL field_mesh_decomposition_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,geometric_decomposition, &
737 CALL field_geometric_field_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,equations_set%GEOMETRY% &
738 & geometric_field,err,error,*999)
739 CALL field_number_of_variables_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,2,err,error,*999)
740 CALL field_variable_types_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,(/field_u_variable_type, &
741 & field_deludeln_variable_type/),err,error,*999)
742 CALL field_dimension_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type, &
743 & field_scalar_dimension_type,err,error,*999)
744 CALL field_dimension_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_deludeln_variable_type, &
745 & field_scalar_dimension_type,err,error,*999)
746 CALL field_data_type_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type, &
747 & field_dp_type,err,error,*999)
748 CALL field_data_type_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_deludeln_variable_type, &
749 & field_dp_type,err,error,*999)
753 CALL field_number_of_components_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type,1,&
755 CALL field_number_of_components_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_deludeln_variable_type,&
759 CALL field_component_mesh_component_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type,1, &
760 & geometric_mesh_component,err,error,*999)
761 CALL field_component_mesh_component_set(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type,1, &
762 & geometric_mesh_component,err,error,*999)
763 CALL field_component_mesh_component_set(equations_set%DEPENDENT%DEPENDENT_FIELD,field_deludeln_variable_type,1, &
764 & geometric_mesh_component,err,error,*999)
765 SELECT CASE(equations_set%SOLUTION_METHOD)
767 CALL field_component_interpolation_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD, &
768 & field_u_variable_type,1,field_node_based_interpolation,err,error,*999)
769 CALL field_component_interpolation_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD, &
770 & field_deludeln_variable_type,1,field_node_based_interpolation,err,error,*999)
772 CALL field_scaling_type_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_scaling_type,err,error,*999)
773 CALL field_scaling_type_set(equations_set%DEPENDENT%DEPENDENT_FIELD,geometric_scaling_type,err,error,*999)
775 local_error=
"The solution method of "//
trim(
number_to_vstring(equations_set%SOLUTION_METHOD,
"*",err,error))// &
776 &
" is invalid or not implemented" 777 CALL flagerror(local_error,err,error,*999)
781 CALL flagerror(
"No user specified field supported!",err,error,*999)
784 IF(equations_set%DEPENDENT%DEPENDENT_FIELD_AUTO_CREATED)
THEN 785 CALL field_create_finish(equations_set%DEPENDENT%DEPENDENT_FIELD,err,error,*999)
788 local_error=
"The action type of "//
trim(
number_to_vstring(equations_set_setup%ACTION_TYPE,
"*",err,error))// &
790 &
" is invalid for a Monodomain equation" 791 CALL flagerror(local_error,err,error,*999)
795 SELECT CASE(equations_set_setup%ACTION_TYPE)
797 IF(equations_set%INDEPENDENT%INDEPENDENT_FIELD_AUTO_CREATED)
THEN 798 SELECT CASE(equations_set%SPECIFICATION(3))
804 CALL flagerror(
"Invalid cell model equations set subtype",err,error,*999)
807 CALL field_create_start(equations_set_setup%FIELD_USER_NUMBER,equations_set%REGION,equations_set%INDEPENDENT% &
808 & independent_field,err,error,*999)
809 CALL field_type_set_and_lock(equations_set%INDEPENDENT%INDEPENDENT_FIELD,field_general_type,err,error,*999)
810 CALL field_dependent_type_set_and_lock(equations_set%INDEPENDENT%INDEPENDENT_FIELD,&
811 & field_independent_type,err,error,*999)
812 CALL field_mesh_decomposition_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_decomposition,err,error,*999)
813 CALL field_mesh_decomposition_set_and_lock(equations_set%INDEPENDENT%INDEPENDENT_FIELD,geometric_decomposition, &
815 CALL field_geometric_field_set_and_lock(equations_set%INDEPENDENT%INDEPENDENT_FIELD,equations_set%GEOMETRY% &
816 & geometric_field,err,error,*999)
817 CALL field_number_of_variables_set_and_lock(equations_set%INDEPENDENT%INDEPENDENT_FIELD,1,err,error,*999)
818 CALL field_variable_types_set_and_lock(equations_set%INDEPENDENT%INDEPENDENT_FIELD,&
819 &(/field_u_variable_type/),err,error,*999)
820 CALL field_dimension_set_and_lock(equations_set%INDEPENDENT%INDEPENDENT_FIELD,field_u_variable_type, &
821 & field_vector_dimension_type,err,error,*999)
822 CALL field_data_type_set_and_lock(equations_set%INDEPENDENT%INDEPENDENT_FIELD,field_u_variable_type, &
823 & field_dp_type,err,error,*999)
825 CALL field_number_of_components_set_and_lock(equations_set%INDEPENDENT%INDEPENDENT_FIELD,field_u_variable_type,&
826 &num_comp,err,error,*999)
827 CALL field_dof_order_type_set(equations_set%INDEPENDENT%INDEPENDENT_FIELD,field_u_variable_type,&
828 & field_contiguous_component_dof_order,err,error,*999)
831 CALL field_component_mesh_component_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type,1, &
832 & geometric_mesh_component,err,error,*999)
833 CALL field_component_mesh_component_set(equations_set%INDEPENDENT%INDEPENDENT_FIELD,field_u_variable_type,1, &
834 & geometric_mesh_component,err,error,*999)
836 SELECT CASE(equations_set%SOLUTION_METHOD)
838 CALL field_component_interpolation_set_and_lock(equations_set%INDEPENDENT%INDEPENDENT_FIELD, &
839 & field_u_variable_type,1,field_node_based_interpolation,err,error,*999)
841 CALL field_scaling_type_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_scaling_type,err,error,*999)
842 CALL field_scaling_type_set(equations_set%INDEPENDENT%INDEPENDENT_FIELD,geometric_scaling_type,err,error,*999)
846 CALL flagerror(
"No user specified field supported!",err,error,*999)
850 IF(equations_set%INDEPENDENT%INDEPENDENT_FIELD_AUTO_CREATED)
THEN 851 CALL field_create_finish(equations_set%INDEPENDENT%INDEPENDENT_FIELD,err,error,*999)
852 SELECT CASE(equations_set%SPECIFICATION(3))
858 CALL flagerror(
"Invalid cell model equations set subtype",err,error,*999)
862 local_error=
"The action type of "//
trim(
number_to_vstring(equations_set_setup%ACTION_TYPE,
"*",err,error))// &
864 &
" is invalid for a Monodomain equation" 865 CALL flagerror(local_error,err,error,*999)
869 SELECT CASE(equations_set_setup%ACTION_TYPE)
871 equations_materials=>equations_set%MATERIALS
872 IF(
ASSOCIATED(equations_materials))
THEN 873 IF(equations_materials%MATERIALS_FIELD_AUTO_CREATED)
THEN 875 CALL field_create_start(equations_set_setup%FIELD_USER_NUMBER,equations_set%REGION,equations_materials% &
876 & materials_field,err,error,*999)
877 CALL field_type_set_and_lock(equations_materials%MATERIALS_FIELD,field_material_type,err,error,*999)
878 CALL field_dependent_type_set_and_lock(equations_materials%MATERIALS_FIELD,field_independent_type,err,error,*999)
879 CALL field_mesh_decomposition_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_decomposition,err,error,*999)
880 CALL field_mesh_decomposition_set_and_lock(equations_materials%MATERIALS_FIELD,geometric_decomposition, &
882 CALL field_geometric_field_set_and_lock(equations_materials%MATERIALS_FIELD,equations_set%GEOMETRY% &
883 & geometric_field,err,error,*999)
884 CALL field_number_of_variables_set_and_lock(equations_materials%MATERIALS_FIELD,1,err,error,*999)
885 CALL field_variable_types_set_and_lock(equations_materials%MATERIALS_FIELD,(/field_u_variable_type/), &
887 CALL field_dimension_set_and_lock(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
888 & field_vector_dimension_type,err,error,*999)
889 CALL field_data_type_set_and_lock(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
890 & field_dp_type,err,error,*999)
891 CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
892 & number_of_dimensions,err,error,*999)
898 number_of_materials_components= 7
900 CALL field_number_of_components_set_and_lock(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
901 & number_of_materials_components,err,error,*999)
904 CALL field_component_interpolation_set(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
905 & 1,field_node_based_interpolation,err,error,*999)
906 CALL field_component_interpolation_set(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
907 & 2,field_constant_interpolation,err,error,*999)
908 CALL field_component_interpolation_set(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
909 & 3,field_constant_interpolation,err,error,*999)
912 CALL field_component_mesh_component_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
913 & component_idx,geometric_mesh_component,err,error,*999)
914 CALL field_component_mesh_component_set(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
915 & component_idx+3,geometric_mesh_component,err,error,*999)
916 CALL field_component_interpolation_set(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
917 & component_idx+3,field_node_based_interpolation,err,error,*999)
920 CALL field_component_interpolation_set(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
921 & number_of_materials_components,field_node_based_interpolation,err,error,*999)
924 CALL field_scaling_type_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_scaling_type,err,error,*999)
925 CALL field_scaling_type_set(equations_materials%MATERIALS_FIELD,geometric_scaling_type,err,error,*999)
928 CALL flagerror(
"No user specified field supported!",err,error,*999)
932 CALL flagerror(
"Equations set materials is not associated.",err,error,*999)
935 equations_materials=>equations_set%MATERIALS
936 IF(
ASSOCIATED(equations_materials))
THEN 937 IF(equations_materials%MATERIALS_FIELD_AUTO_CREATED)
THEN 939 CALL field_create_finish(equations_materials%MATERIALS_FIELD,err,error,*999)
941 CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
942 & number_of_dimensions,err,error,*999)
945 number_of_materials_components=number_of_dimensions
947 DO component_idx=1,number_of_dimensions
948 CALL field_component_values_initialise(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
949 & field_values_set_type,component_idx,1.0_dp,err,error,*999)
953 CALL flagerror(
"Equations set materials is not associated.",err,error,*999)
957 local_error=
"The action type of "//
trim(
number_to_vstring(equations_set_setup%ACTION_TYPE,
"*",err,error))// &
959 &
" is invalid for a Monodomain equation." 960 CALL flagerror(local_error,err,error,*999)
963 SELECT CASE(equations_set_setup%ACTION_TYPE)
969 local_error=
"The action type of "//
trim(
number_to_vstring(equations_set_setup%ACTION_TYPE,
"*",err,error))// &
971 &
" is invalid for a monodomain equation." 972 CALL flagerror(local_error,err,error,*999)
975 SELECT CASE(equations_set_setup%ACTION_TYPE)
977 IF(equations_set%DEPENDENT%DEPENDENT_FINISHED)
THEN 982 CALL flagerror(
"Equations set dependent field has not been finished.",err,error,*999)
985 SELECT CASE(equations_set%SOLUTION_METHOD)
1003 SELECT CASE(equations%SPARSITY_TYPE)
1018 local_error=
"The equations matrices sparsity type of "// &
1020 CALL flagerror(local_error,err,error,*999)
1024 local_error=
"The solution method of "//
trim(
number_to_vstring(equations_set%SOLUTION_METHOD,
"*",err,error))// &
1025 &
" is invalid or not implemented." 1026 CALL flagerror(local_error,err,error,*999)
1029 local_error=
"The action type of "//
trim(
number_to_vstring(equations_set_setup%ACTION_TYPE,
"*",err,error))// &
1030 &
" for a setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
1031 &
" is invalid for a Monodomain equation." 1032 CALL flagerror(local_error,err,error,*999)
1035 local_error=
"The setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
1036 &
" is invalid for a Monodomain equation." 1037 CALL flagerror(local_error,err,error,*999)
1040 local_error=
"The equations set subtype of "//
trim(
number_to_vstring(equations_set%SPECIFICATION(3),
"*",err,error))// &
1041 &
" does not equal a Monodomain equation subtype." 1042 CALL flagerror(local_error,err,error,*999)
1045 CALL flagerror(
"Equations set is not associated.",err,error,*999)
1048 exits(
"Monodomain_EquationsSetSubtypeSetup")
1050 999 errorsexits(
"Monodomain_EquationsSetSubtypeSetup",err,error)
1053 END SUBROUTINE monodomain_equationssetsubtypesetup
1060 SUBROUTINE monodomain_equation_problem_setup(PROBLEM,PROBLEM_SETUP,ERR,ERROR,*)
1065 INTEGER(INTG),
INTENT(OUT) :: ERR
1070 enters(
"MONODOMAIN_EQUATION_PROBLEM_SETUP",err,error,*999)
1072 IF(
ASSOCIATED(problem))
THEN 1073 IF(.NOT.
ALLOCATED(problem%SPECIFICATION))
THEN 1074 CALL flagerror(
"Problem specification is not allocated.",err,error,*999)
1075 ELSE IF(
SIZE(problem%SPECIFICATION,1)<2)
THEN 1076 CALL flagerror(
"Problem specification must have at least two entries for a monodomain equation problem.",err,error,*999)
1078 SELECT CASE(problem%SPECIFICATION(2))
1080 CALL monodomain_problemstrangsplittingsetup(problem,problem_setup,err,error,*999)
1083 &
" is not valid for a Monodomain equation Strang splitting problem class." 1084 CALL flagerror(local_error,err,error,*999)
1087 CALL flagerror(
"Problem is not associated.",err,error,*999)
1090 exits(
"MONODOMAIN_EQUATION_PROBLEM_SETUP")
1092 999 errorsexits(
"MONODOMAIN_EQUATION_PROBLEM_SETUP",err,error)
1094 END SUBROUTINE monodomain_equation_problem_setup
1101 SUBROUTINE monodomain_problemstrangsplittingsetup(PROBLEM,PROBLEM_SETUP,ERR,ERROR,*)
1106 INTEGER(INTG),
INTENT(OUT) :: ERR
1111 enters(
"Monodomain_ProblemStrangSplittingSetup",err,error,*999)
1113 IF(
ASSOCIATED(problem))
THEN 1114 IF(.NOT.
ALLOCATED(problem%SPECIFICATION))
THEN 1115 CALL flagerror(
"Problem specification is not allocated.",err,error,*999)
1116 ELSE IF(
SIZE(problem%SPECIFICATION,1)<3)
THEN 1117 CALL flagerror(
"Problem specification must have three entries for a monodomain Strang splitting problem.",err,error,*999)
1119 SELECT CASE(problem%SPECIFICATION(3))
1121 CALL monodomain_equation_problem_subtype_setup(problem,problem_setup,err,error,*999)
1124 &
" is not valid for a Monodomain equation type of a Strang splitting problem class." 1125 CALL flagerror(local_error,err,error,*999)
1128 CALL flagerror(
"Problem is not associated.",err,error,*999)
1131 exits(
"Monodomain_ProblemStrangSplittingSetup")
1133 999
errors(
"Monodomain_ProblemStrangSplittingSetup",err,error)
1134 exits(
"Monodomain_ProblemStrangSplittingSetup")
1137 END SUBROUTINE monodomain_problemstrangsplittingsetup
1144 SUBROUTINE monodomain_equation_problem_subtype_setup(PROBLEM,PROBLEM_SETUP,ERR,ERROR,*)
1149 INTEGER(INTG),
INTENT(OUT) :: ERR
1158 enters(
"MONODOMAIN_EQUATION_PROBLEM_SUBTYPE_SETUP",err,error,*999)
1160 NULLIFY(control_loop)
1162 NULLIFY(solver_equations)
1165 IF(
ASSOCIATED(problem))
THEN 1166 IF(.NOT.
ALLOCATED(control_loop%PROBLEM%SPECIFICATION))
THEN 1167 CALL flagerror(
"Problem specification is not allocated.",err,error,*999)
1168 ELSE IF(
SIZE(control_loop%PROBLEM%SPECIFICATION,1)<3)
THEN 1169 CALL flagerror(
"Problem specification must have three entries for a monodomain equation problem.",err,error,*999)
1173 SELECT CASE(problem_setup%SETUP_TYPE)
1175 SELECT CASE(problem_setup%ACTION_TYPE)
1181 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
1183 &
" is invalid for a monodomain equation." 1184 CALL flagerror(local_error,err,error,*999)
1187 SELECT CASE(problem_setup%ACTION_TYPE)
1194 control_loop_root=>problem%CONTROL_LOOP
1198 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
1200 &
" is invalid for a monodomain equation." 1201 CALL flagerror(local_error,err,error,*999)
1205 control_loop_root=>problem%CONTROL_LOOP
1207 SELECT CASE(problem_setup%ACTION_TYPE)
1226 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
1228 &
" is invalid for a monodomain equation." 1229 CALL flagerror(local_error,err,error,*999)
1232 SELECT CASE(problem_setup%ACTION_TYPE)
1235 control_loop_root=>problem%CONTROL_LOOP
1247 control_loop_root=>problem%CONTROL_LOOP
1256 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
1258 &
" is invalid for a monodomain equation." 1259 CALL flagerror(local_error,err,error,*999)
1262 local_error=
"The setup type of "//
trim(
number_to_vstring(problem_setup%SETUP_TYPE,
"*",err,error))// &
1263 &
" is invalid for a Monodomain equation." 1264 CALL flagerror(local_error,err,error,*999)
1267 local_error=
"The problem subtype of "//
trim(
number_to_vstring(problem%SPECIFICATION(3),
"*",err,error))// &
1268 &
" does not equal a Monodomain equation subtype." 1269 CALL flagerror(local_error,err,error,*999)
1272 CALL flagerror(
"Problem is not associated.",err,error,*999)
1275 exits(
"MONODOMAIN_EQUATION_PROBLEM_SUBTYPE_SETUP")
1277 999 errorsexits(
"MONODOMAIN_EQUATION_PROBLEM_SUBTYPE_SETUP",err,error)
1279 END SUBROUTINE monodomain_equation_problem_subtype_setup
1286 SUBROUTINE monodomain_pre_solve(CONTROL_LOOP,SOLVER,ERR,ERROR,*)
1291 INTEGER(INTG),
INTENT(OUT) :: ERR
1295 TYPE(
field_type),
POINTER :: DEPENDENT_FIELD, INDEPENDENT_FIELD
1297 enters(
"MONODOMAIN_PRE_SOLVE",err,error,*999)
1299 IF(
ASSOCIATED(control_loop%PROBLEM))
THEN 1300 IF(.NOT.
ALLOCATED(control_loop%PROBLEM%SPECIFICATION))
THEN 1301 CALL flagerror(
"Problem specification is not allocated.",err,error,*999)
1302 ELSE IF(
SIZE(control_loop%PROBLEM%SPECIFICATION,1)<2)
THEN 1303 CALL flagerror(
"Problem specification must at least two entries for a monodomain equation problem.",err,error,*999)
1305 SELECT CASE(control_loop%PROBLEM%SPECIFICATION(2))
1307 dependent_field=>solver%SOLVERS%SOLVERS(1)%PTR%SOLVER_EQUATIONS%SOLVER_MAPPING% &
1308 & equations_sets(1)%PTR%DEPENDENT%DEPENDENT_FIELD
1309 independent_field=>solver%SOLVERS%SOLVERS(1)%PTR%SOLVER_EQUATIONS%SOLVER_MAPPING% &
1310 & equations_sets(1)%PTR%INDEPENDENT%INDEPENDENT_FIELD
1312 CALL field_parameterstofieldparameterscopy(independent_field,field_u_variable_type,field_values_set_type, &
1313 & 1,dependent_field,field_u_variable_type,field_values_set_type,1,err,error,*999)
1314 CALL field_parameterstofieldparameterscopy(independent_field,field_u_variable_type,field_values_set_type, &
1315 & 1,dependent_field,field_u_variable_type,field_previous_values_set_type,1,err,error,*999)
1318 local_error=
"Problem type "//
trim(
number_to_vstring(control_loop%PROBLEM%SPECIFICATION(2),
"*",err,error))// &
1319 &
" is not valid for a monodomain problem class." 1320 CALL flagerror(local_error,err,error,*999)
1323 CALL flagerror(
"Problem is not associated.",err,error,*999)
1326 exits(
"MONODOMAIN_PRE_SOLVE")
1328 999 errorsexits(
"MONODOMAIN_PRE_SOLVE",err,error)
1330 END SUBROUTINE monodomain_pre_solve
1337 SUBROUTINE monodomain_post_solve(CONTROL_LOOP,SOLVER,ERR,ERROR,*)
1342 INTEGER(INTG),
INTENT(OUT) :: ERR
1346 REAL(DP) :: TMPV, TMPA
1348 TYPE(
field_type),
POINTER :: DEPENDENT_FIELD, MATERIAL_FIELD, INDEPENDENT_FIELD, GEOMETRIC_FIELD
1356 enters(
"MONODOMAIN_POST_SOLVE",err,error,*999)
1358 IF(
ASSOCIATED(control_loop%PROBLEM))
THEN 1359 IF(.NOT.
ALLOCATED(control_loop%PROBLEM%SPECIFICATION))
THEN 1360 CALL flagerror(
"Problem specification is not allocated.",err,error,*999)
1361 ELSE IF(
SIZE(control_loop%PROBLEM%SPECIFICATION,1)<3)
THEN 1362 CALL flagerror(
"Problem specification must have three entries for a monodomain equation problem.",err,error,*999)
1364 SELECT CASE(control_loop%PROBLEM%SPECIFICATION(2))
1369 equations=>solver%SOLVERS%SOLVERS(1)%PTR%SOLVER_EQUATIONS%SOLVER_MAPPING%EQUATIONS_SETS(1)%PTR%EQUATIONS
1370 equations_matrices=>equations%EQUATIONS_MATRICES
1371 dynamic_matrices=>equations_matrices%DYNAMIC_MATRICES
1372 stiffness_matrix=>dynamic_matrices%MATRICES(1)%PTR
1373 damping_matrix=>dynamic_matrices%MATRICES(2)%PTR
1374 rhs_vector=>equations_matrices%RHS_VECTOR
1375 stiffness_matrix%UPDATE_MATRIX = .false.
1376 damping_matrix%UPDATE_MATRIX = .false.
1377 rhs_vector%UPDATE_VECTOR = .false.
1380 geometric_field => solver%SOLVERS%SOLVERS(1)%PTR%SOLVER_EQUATIONS%SOLVER_MAPPING% &
1381 & equations_sets(1)%PTR%GEOMETRY%GEOMETRIC_FIELD
1382 dependent_field => solver%SOLVERS%SOLVERS(1)%PTR%SOLVER_EQUATIONS%SOLVER_MAPPING% &
1383 & equations_sets(1)%PTR%DEPENDENT%DEPENDENT_FIELD
1384 material_field => solver%SOLVERS%SOLVERS(1)%PTR%SOLVER_EQUATIONS%SOLVER_MAPPING% &
1385 & equations_sets(1)%PTR%MATERIALS%MATERIALS_FIELD
1386 independent_field => solver%SOLVERS%SOLVERS(1)%PTR%SOLVER_EQUATIONS%SOLVER_MAPPING% &
1387 & equations_sets(1)%PTR%INDEPENDENT%INDEPENDENT_FIELD
1389 CALL field_parameterstofieldparameterscopy(dependent_field,field_u_variable_type,field_values_set_type, &
1390 & 1, independent_field,field_u_variable_type,field_values_set_type, 1,err,error,*999)
1392 SELECT CASE(control_loop%PROBLEM%SPECIFICATION(3))
1395 & control_loop%TIME_LOOP%CURRENT_TIME-control_loop%TIME_LOOP%TIME_INCREMENT, control_loop%TIME_LOOP%CURRENT_TIME&
1399 & control_loop%TIME_LOOP%CURRENT_TIME-control_loop%TIME_LOOP%TIME_INCREMENT, control_loop%TIME_LOOP%CURRENT_TIME&
1402 CALL flagerror(
"Invalid cell model subtype",err,error,*999)
1405 DO i=1,independent_field%DECOMPOSITION%DOMAIN(1)%PTR%TOPOLOGY%NODES%NUMBER_OF_NODES
1407 CALL field_parameter_set_get_node(independent_field,field_u_variable_type,field_values_set_type,1,1,i,1,tmpv,&
1411 CALL field_parameter_set_get_node(material_field,field_u_variable_type,field_values_set_type,1,1,i,7,tmpa,&
1415 CALL field_parameter_set_update_node(material_field,field_u_variable_type,field_values_set_type,1,1,i,7,&
1416 &control_loop%TIME_LOOP%CURRENT_TIME, err,error,*999)
1421 IF(mod(control_loop%TIME_LOOP%CURRENT_TIME+1e-6,5.0)<1e-3)
THEN 1422 WRITE(*,*)
'T=',control_loop%TIME_LOOP%CURRENT_TIME
1426 local_error=
"Problem type "//
trim(
number_to_vstring(control_loop%PROBLEM%SPECIFICATION(2),
"*",err,error))// &
1427 &
" is not valid for a monodomain problem class." 1428 CALL flagerror(local_error,err,error,*999)
1431 CALL flagerror(
"Problem is not associated.",err,error,*999)
1434 exits(
"MONODOMAIN_POST_SOLVE")
1436 999 errorsexits(
"MONODOMAIN_POST_SOLVE",err,error)
1438 END SUBROUTINE monodomain_post_solve
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.
integer(intg), parameter, public control_loop_progress_output
Progress output from control loop.
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 equations in an equations set.
integer(intg), parameter equations_set_gfem_solution_method
Grid-based Finite Element Method solution method.
subroutine, public bueno_orovio_integrate(cells, materials, t0, t1, err, error,)
Contains information for a region.
integer(intg), parameter problem_control_time_loop_type
Time control loop.
Contains information on a time iteration control loop.
integer(intg), parameter equations_set_monodomain_tentusscher06_subtype
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.
integer(intg), parameter problem_monodomain_buenoorovio_subtype
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.
integer(intg), parameter equations_set_bioelectrics_class
Contains information on an equations set.
This module handles all equations routines.
integer(intg), parameter equations_set_setup_source_type
Source setup.
integer(intg), parameter problem_control_fixed_loop_type
Fixed iteration control loop.
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 problem_control_simple_type
Simple, one iteration 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 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.
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.
integer(intg), parameter problem_bioelectrics_class
integer(intg), parameter equations_set_monodomain_buenoorovio_subtype
subroutine, public tentusscher06_integrate(cells, materials, t0, t1, err, error,)
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 ...
integer(intg), parameter equations_set_setup_independent_type
Independent variables.
This module contains all program wide constants.
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 problem_setup_initial_type
Initial setup for a problem.
integer(intg), parameter equations_set_monodomain_strang_splitting_equation_type
integer(intg), parameter equations_first_order_dynamic
The equations are first order dynamic.
integer(intg), parameter problem_monodomain_strang_splitting_equation_type
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_setup_start_action
Start setup action.
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.
Contains information on the equations matrices and vectors.
integer(intg), parameter, public equations_matrix_fem_structure
Finite element matrix structure.
This module contains all the low-level base routines e.g., all debug, control, and low-level communic...
subroutine, public equationsmatrices_dynamicstructuretypeset(EQUATIONS_MATRICES, STRUCTURE_TYPE, ERR, ERROR,)
Sets the structure (sparsity) of the dynamic equations matrices.
subroutine, public equations_matrices_linear_storage_type_set(EQUATIONS_MATRICES, STORAGE_TYPE, ERR, ERROR,)
Sets the storage type (sparsity) of the linear 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_set_equations_get(EQUATIONS_SET, EQUATIONS, ERR, ERROR,)
Gets the equations for an equations set.
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 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 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.
Contains information about an equations matrix.
Contains information for a particular quadrature scheme.
Implements lists of Field IO operation.
This module contains all routines dealing with (non-distributed) matrix and vectors types...
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.
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.
integer(intg), parameter equations_set_fd_solution_method
Finite Difference solution method.
integer(intg), parameter, public equations_matrices_sparse_matrices
Use sparse equations matrices.
integer(intg), parameter problem_control_load_increment_loop_type
Load increment control loop.
Contains information on the setup information for an equations set.
This module handles all Galerkin projection routines.
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.
Contains all information about a basis .
integer(intg), parameter equations_set_fv_solution_method
Finite Volume solution method.
integer(intg), parameter, public matrix_block_storage_type
Matrix block storage type.
subroutine, public bueno_orovio_initialize(field, err, error,)
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.
Flags an error condition.
integer(intg), parameter problem_monodomain_tentusscher06_subtype
This module handles all Monodomain equations routines.
integer(intg), parameter problem_control_while_loop_type
While control loop.
Contains information of the RHS vector for equations matrices.
real(dp), parameter zero_tolerance
This module contains all kind definitions.
subroutine, public field_io_nodes_export(FIELDS, FILE_NAME, METHOD, ERR, ERROR,)
Export nodal information.
subroutine, public tentusscher06_initialize(field, err, error,)
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.