102 INTEGER(INTG),
INTENT(IN) :: SOLUTION_METHOD
103 INTEGER(INTG),
INTENT(OUT) :: ERR
108 enters(
"BioelectricFiniteElasticity_EquationsSetSolutionMethodSet",err,error,*999)
110 IF(
ASSOCIATED(equations_set))
THEN 111 IF(.NOT.
ALLOCATED(equations_set%SPECIFICATION))
THEN 112 CALL flagerror(
"Equations set specification is not allocated.",err,error,*999)
113 ELSE IF(
SIZE(equations_set%SPECIFICATION,1)/=3)
THEN 114 CALL flagerror(
"Equations set specification must have three entries for a "// &
115 &
"Bioelectric-finite elasticity type equations set.",err,error,*999)
117 SELECT CASE(equations_set%SPECIFICATION(3))
123 SELECT CASE(solution_method)
127 CALL flagerror(
"Not implemented.",err,error,*999)
129 CALL flagerror(
"Not implemented.",err,error,*999)
131 CALL flagerror(
"Not implemented.",err,error,*999)
133 CALL flagerror(
"Not implemented.",err,error,*999)
135 CALL flagerror(
"Not implemented.",err,error,*999)
137 local_error=
"The specified solution method of "//
trim(
number_to_vstring(solution_method,
"*",err,error))//
" is invalid." 138 CALL flagerror(local_error,err,error,*999)
141 local_error=
"Equations set subtype of "//
trim(
number_to_vstring(equations_set%SPECIFICATION(3),
"*",err,error))// &
142 &
" is not valid for a bioelectrics finite elasticity equation type of a multi physics equations set class." 143 CALL flagerror(local_error,err,error,*999)
146 CALL flagerror(
"Equations set is not associated.",err,error,*999)
149 exits(
"BioelectricFiniteElasticity_EquationsSetSolutionMethodSet")
151 999
errors(
"BioelectricFiniteElasticity_EquationsSetSolutionMethodSet",err,error)
152 exits(
"BioelectricFiniteElasticity_EquationsSetSolutionMethodSet")
167 INTEGER(INTG),
INTENT(OUT) :: ERR
170 enters(
"BioelectricFiniteElasticity_EquationsSetSetup",err,error,*999)
172 CALL flagerror(
"BioelectricFiniteElasticity_EquationsSetSetup is not implemented.",err,error,*999)
174 exits(
"BioelectricFiniteElasticity_EquationsSetSetup")
176 999
errors(
"BioelectricFiniteElasticity_EquationsSetSetup",err,error)
177 exits(
"BioelectricFiniteElasticity_EquationsSetSetup")
191 INTEGER(INTG),
INTENT(IN) :: ELEMENT_NUMBER
192 INTEGER(INTG),
INTENT(OUT) :: ERR
195 enters(
"BioelectricFiniteElasticity_FiniteElementCalculate",err,error,*999)
197 CALL flagerror(
"BioelectricFiniteElasticity_FiniteElementCalculate is not implemented.",err,error,*999)
199 exits(
"BioelectricFiniteElasticity_FiniteElementCalculate")
201 999
errors(
"BioelectricFiniteElasticity_FiniteElementCalculate",err,error)
202 exits(
"BioelectricFiniteElasticity_FiniteElementCalculate")
216 INTEGER(INTG),
INTENT(IN) :: problemSpecification(:)
217 INTEGER(INTG),
INTENT(OUT) :: err
221 INTEGER(INTG) :: problemSubtype
223 enters(
"BioelectricFiniteElasticity_ProblemSpecificationSet",err,error,*999)
225 IF(
ASSOCIATED(problem))
THEN 226 IF(
SIZE(problemspecification,1)==3)
THEN 227 problemsubtype=problemspecification(3)
228 SELECT CASE(problemsubtype)
236 localerror=
"The third problem specification of "//
trim(
numbertovstring(problemsubtype,
"*",err,error))// &
237 &
" is not valid for a bioelectric finite elasticity type of a multi physics problem." 238 CALL flagerror(localerror,err,error,*999)
240 IF(
ALLOCATED(problem%specification))
THEN 241 CALL flagerror(
"Problem specification is already allocated.",err,error,*999)
243 ALLOCATE(problem%specification(3),stat=err)
244 IF(err/=0)
CALL flagerror(
"Could not allocate problem specification.",err,error,*999)
249 CALL flagerror(
"Bioelectric finite elasticity problem specification must have three entries.",err,error,*999)
252 CALL flagerror(
"Problem is not associated.",err,error,*999)
255 exits(
"BioelectricFiniteElasticity_ProblemSpecificationSet")
257 999
errors(
"BioelectricFiniteElasticity_ProblemSpecificationSet",err,error)
258 exits(
"BioelectricFiniteElasticity_ProblemSpecificationSet")
273 INTEGER(INTG),
INTENT(OUT) :: ERR
281 TYPE(
solvers_type),
POINTER :: SOLVERS,MONODOMAIN_SOLVERS,ELASTICITY_SOLVERS
284 enters(
"BIOELECTRIC_FINITE_ELASTICITY_PROBLEM_SETUP",err,error,*999)
286 NULLIFY(control_loop)
287 NULLIFY(monodomain_sub_loop)
288 NULLIFY(elasticity_sub_loop)
291 NULLIFY(monodomain_solvers)
292 NULLIFY(elasticity_solvers)
293 NULLIFY(solver_equations)
294 NULLIFY(cellml_equations)
296 IF(
ASSOCIATED(problem))
THEN 297 IF(.NOT.
ALLOCATED(problem%specification))
THEN 298 CALL flagerror(
"Problem specification is not allocated.",err,error,*999)
299 ELSE IF(
SIZE(problem%specification,1)<3)
THEN 300 CALL flagerror(
"Problem specification must have three entries for a bioelectric-finite elasticity problem.",err,error,*999)
302 SELECT CASE(problem%SPECIFICATION(3))
310 SELECT CASE(problem_setup%SETUP_TYPE)
312 SELECT CASE(problem_setup%ACTION_TYPE)
318 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
320 &
" is invalid for a bioelectrics finite elasticity equation." 321 CALL flagerror(local_error,err,error,*999)
324 SELECT CASE(problem_setup%ACTION_TYPE)
353 control_loop_root=>problem%CONTROL_LOOP
358 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
360 &
" is invalid for a bioelectrics finite elasticity equation." 361 CALL flagerror(local_error,err,error,*999)
365 control_loop_root=>problem%CONTROL_LOOP
367 SELECT CASE(problem_setup%ACTION_TYPE)
414 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
416 &
" is invalid for a bioelectrics finite elasticity equation." 417 CALL flagerror(local_error,err,error,*999)
420 SELECT CASE(problem_setup%ACTION_TYPE)
423 control_loop_root=>problem%CONTROL_LOOP
442 NULLIFY(solver_equations)
450 control_loop_root=>problem%CONTROL_LOOP
458 NULLIFY(solver_equations)
469 NULLIFY(solver_equations)
474 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
476 &
" is invalid for a bioelectrics finite elasticity equation." 477 CALL flagerror(local_error,err,error,*999)
480 SELECT CASE(problem_setup%ACTION_TYPE)
483 control_loop_root=>problem%CONTROL_LOOP
493 control_loop_root=>problem%CONTROL_LOOP
504 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
506 &
" is invalid for a bioelectrics finite elasticity equation." 507 CALL flagerror(local_error,err,error,*999)
510 local_error=
"The setup type of "//
trim(
number_to_vstring(problem_setup%SETUP_TYPE,
"*",err,error))// &
511 &
" is invalid for a bioelectrics finite elasticity equation." 512 CALL flagerror(local_error,err,error,*999)
515 local_error=
"The problem subtype of "//
trim(
number_to_vstring(problem%SPECIFICATION(3),
"*",err,error))// &
516 &
" does not equal a transient monodomain quasistatic finite elasticity equation subtype." 517 CALL flagerror(local_error,err,error,*999)
520 CALL flagerror(
"Problem is not associated.",err,error,*999)
523 exits(
"BIOELECTRIC_FINITE_ELASTICITY_PROBLEM_SETUP")
525 999 errorsexits(
"BIOELECTRIC_FINITE_ELASTICITY_PROBLEM_SETUP",err,error)
540 INTEGER(INTG),
INTENT(OUT) :: ERR
546 enters(
"BIOELECTRIC_FINITE_ELASTICITY_PRE_SOLVE",err,error,*999)
548 IF(
ASSOCIATED(control_loop))
THEN 549 IF(
ASSOCIATED(solver))
THEN 550 IF(
ASSOCIATED(control_loop%PROBLEM))
THEN 551 IF(.NOT.
ALLOCATED(control_loop%problem%specification))
THEN 552 CALL flagerror(
"Problem specification is not allocated.",err,error,*999)
553 ELSE IF(
SIZE(control_loop%problem%specification,1)<3)
THEN 554 CALL flagerror(
"Problem specification must have three entries for a bioelectric-finite elasticity problem.", &
557 SELECT CASE(control_loop%PROBLEM%SPECIFICATION(3))
560 SELECT CASE(control_loop%LOOP_TYPE)
566 local_error=
"Control loop loop type "//
trim(
number_to_vstring(control_loop%LOOP_TYPE,
"*",err,error))// &
567 &
" is not valid for a bioelectrics finite elasticity type of a multi physics problem class." 568 CALL flagerror(local_error,err,error,*999)
571 SELECT CASE(control_loop%LOOP_TYPE)
577 local_error=
"Control loop loop type "//
trim(
number_to_vstring(control_loop%LOOP_TYPE,
"*",err,error))// &
578 &
" is not valid for a bioelectrics finite elasticity type of a multi physics problem class." 579 CALL flagerror(local_error,err,error,*999)
582 local_error=
"Problem subtype "//
trim(
number_to_vstring(control_loop%PROBLEM%SPECIFICATION(3),
"*",err,error))// &
583 &
" is not valid for a bioelectrics finite elasticity type of a multi physics problem class." 584 CALL flagerror(local_error,err,error,*999)
587 CALL flagerror(
"Problem is not associated.",err,error,*999)
590 CALL flagerror(
"Solver is not associated.",err,error,*999)
593 CALL flagerror(
"Control loop is not associated.",err,error,*999)
596 exits(
"BIOELECTRIC_FINITE_ELASTICITY_PRE_SOLVE")
598 999 errorsexits(
"BIOELECTRIC_FINITE_ELASTICITY_PRE_SOLVE",err,error)
613 INTEGER(INTG),
INTENT(OUT) :: ERR
619 enters(
"BIOELECTRIC_FINITE_ELASTICITY_POST_SOLVE",err,error,*999)
621 IF(
ASSOCIATED(control_loop))
THEN 622 IF(
ASSOCIATED(solver))
THEN 623 IF(
ASSOCIATED(control_loop%PROBLEM))
THEN 624 IF(.NOT.
ALLOCATED(control_loop%problem%specification))
THEN 625 CALL flagerror(
"Problem specification is not allocated.",err,error,*999)
626 ELSE IF(
SIZE(control_loop%problem%specification,1)<3)
THEN 627 CALL flagerror(
"Problem specification must have three entries for a bioelectric-finite elasticity problem.", &
630 SELECT CASE(control_loop%PROBLEM%SPECIFICATION(3))
634 SELECT CASE(solver%SOLVE_TYPE)
643 &
" is not valid for a bioelectrics finite elasticity type of a multi physics problem class." 644 CALL flagerror(local_error,err,error,*999)
647 local_error=
"Problem subtype "//
trim(
number_to_vstring(control_loop%PROBLEM%SPECIFICATION(3),
"*",err,error))// &
648 &
" is not valid for a bioelectrics finite elasticity type of a multi physics problem class." 649 CALL flagerror(local_error,err,error,*999)
652 CALL flagerror(
"Problem is not associated.",err,error,*999)
655 CALL flagerror(
"Solver is not associated.",err,error,*999)
658 CALL flagerror(
"Control loop is not associated.",err,error,*999)
661 exits(
"BIOELECTRIC_FINITE_ELASTICITY_POST_SOLVE")
663 999 errorsexits(
"BIOELECTRIC_FINITE_ELASTICITY_POST_SOLVE",err,error)
677 INTEGER(INTG),
INTENT(OUT) :: ERR
683 enters(
"BioelectricFiniteElasticity_ControlLoopPreLoop",err,error,*999)
685 IF(
ASSOCIATED(control_loop))
THEN 686 IF(control_loop%NUMBER_OF_SUB_LOOPS==0)
THEN 687 problem=>control_loop%PROBLEM
688 IF(
ASSOCIATED(problem))
THEN 689 IF(.NOT.
ALLOCATED(control_loop%problem%specification))
THEN 690 CALL flagerror(
"Problem specification is not allocated.",err,error,*999)
691 ELSE IF(
SIZE(control_loop%problem%specification,1)<3)
THEN 692 CALL flagerror(
"Problem specification must have three entries for a bioelectric-finite elasticity problem.", &
695 SELECT CASE(problem%SPECIFICATION(2))
697 SELECT CASE(control_loop%LOOP_TYPE)
701 SELECT CASE(problem%SPECIFICATION(3))
708 local_error=
"The third problem specification of "// &
710 &
" is not valid for bioelectric finite elasticity problem." 711 CALL flagerror(local_error,err,error,*999)
715 SELECT CASE(problem%SPECIFICATION(3))
717 IF(control_loop%WHILE_LOOP%ITERATION_NUMBER==1)
THEN 723 local_error=
"The third problem specification of "// &
725 &
" is not valid for bioelectric finite elasticity problem." 726 CALL flagerror(local_error,err,error,*999)
730 local_error=
"Control loop loop type "//
trim(
number_to_vstring(control_loop%LOOP_TYPE,
"*",err,error))// &
731 &
" is not valid for bioelectric finite elasticity problem type." 732 CALL flagerror(local_error,err,error,*999)
735 local_error=
"The second problem specification of "// &
737 &
" is not valid for a multi physics problem." 738 CALL flagerror(local_error,err,error,*999)
741 CALL flagerror(
"Control loop problem is not associated.",err,error,*999)
747 CALL flagerror(
"Control loop is not associated.",err,error,*999)
750 exits(
"BioelectricFiniteElasticity_ControlLoopPreLoop")
752 999
errors(
"BioelectricFiniteElasticity_ControlLoopPreLoop",err,error)
753 exits(
"BioelectricFiniteElasticity_ControlLoopPreLoop")
767 INTEGER(INTG),
INTENT(OUT) :: ERR
771 TYPE(
field_type),
POINTER :: DEPENDENT_FIELD,FIBRE_FIELD,GEOMETRIC_FIELD,INDEPENDENT_FIELD
781 & FIBRE_INTERPOLATION_PARAMETERS,DEPENDENT_INTERPOLATION_PARAMETERS
783 & DEPENDENT_INTERPOLATED_POINT
785 & DEPENDENT_INTERPOLATED_POINT_METRICS
789 INTEGER(INTG) :: DEPENDENT_NUMBER_OF_GAUSS_POINTS
790 INTEGER(INTG) :: MESH_COMPONENT_NUMBER,NUMBER_OF_ELEMENTS,FIELD_VAR_TYPE
791 INTEGER(INTG) :: equations_set_idx,gauss_idx,dof_idx,element_idx,idx
792 REAL(DP) :: DZDNU(3,3),DZDNUT(3,3),AZL(3,3)
794 enters(
"BioelectricFiniteElasticity_ComputeFibreStretch",err,error,*999)
798 NULLIFY(solver_equations)
799 NULLIFY(field_var_u1)
800 NULLIFY(dependent_basis)
802 NULLIFY(dependent_field,fibre_field,geometric_field,independent_field)
803 NULLIFY(dependent_quadrature_scheme)
804 NULLIFY(geometric_interpolation_parameters,fibre_interpolation_parameters,dependent_interpolation_parameters)
805 NULLIFY(geometric_interpolated_point,fibre_interpolated_point,dependent_interpolated_point)
806 NULLIFY(geometric_interpolated_point_metrics,dependent_interpolated_point_metrics)
808 IF(
ASSOCIATED(control_loop))
THEN 809 IF(control_loop%NUMBER_OF_SUB_LOOPS==0)
THEN 810 SELECT CASE(control_loop%LOOP_TYPE)
820 IF(
ASSOCIATED(solver_equations))
THEN 821 solver_mapping=>solver_equations%SOLVER_MAPPING
822 IF(
ASSOCIATED(solver_mapping))
THEN 823 DO equations_set_idx=1,solver_mapping%NUMBER_OF_EQUATIONS_SETS
824 equations_set=>solver_mapping%EQUATIONS_SETS(equations_set_idx)%PTR
825 IF(
ASSOCIATED(equations_set))
THEN 826 geometric_field=>equations_set%GEOMETRY%GEOMETRIC_FIELD
827 IF(.NOT.
ASSOCIATED(geometric_field))
THEN 828 local_error=
"Geometric field is not associated for equations set index "// &
830 CALL flagerror(local_error,err,error,*999)
832 dependent_field=>equations_set%DEPENDENT%DEPENDENT_FIELD
833 IF(.NOT.
ASSOCIATED(dependent_field))
THEN 834 local_error=
"Dependent field is not associated for equations set index "// &
836 CALL flagerror(local_error,err,error,*999)
838 independent_field=>equations_set%INDEPENDENT%INDEPENDENT_FIELD
839 IF(.NOT.
ASSOCIATED(independent_field))
THEN 840 local_error=
"Independent field is not associated for equations set index "// &
842 CALL flagerror(local_error,err,error,*999)
844 equations=>equations_set%EQUATIONS
845 IF(.NOT.
ASSOCIATED(equations))
THEN 846 local_error=
"Equations is not associated for equations set index "// &
848 CALL flagerror(local_error,err,error,*999)
850 fibre_field=>equations%INTERPOLATION%FIBRE_FIELD
851 IF(.NOT.
ASSOCIATED(fibre_field))
THEN 852 local_error=
"Fibre field is not associated for equations set index "// &
854 CALL flagerror(local_error,err,error,*999)
857 local_error=
"Equations set is not associated for equations set index "// &
859 CALL flagerror(local_error,err,error,*999)
863 CALL flagerror(
"Solver equations solver mapping is not associated.",err,error,*999)
866 CALL flagerror(
"Solver solver equations are not associated.",err,error,*999)
869 CALL field_variable_get(independent_field,field_u1_variable_type,field_var_u1,err,error,*999)
871 decomposition=>dependent_field%DECOMPOSITION
872 mesh_component_number=decomposition%MESH_COMPONENT_NUMBER
874 IF(control_loop%WHILE_LOOP%ITERATION_NUMBER==1)
THEN 876 CALL field_parameter_sets_copy(independent_field,field_u1_variable_type, &
877 & field_values_set_type,field_previous_values_set_type,1.0_dp,err,error,*999)
880 number_of_elements=dependent_field%GEOMETRIC_FIELD%DECOMPOSITION%TOPOLOGY%ELEMENTS%NUMBER_OF_ELEMENTS
883 DO element_idx=1,number_of_elements
885 dependent_basis=>decomposition%DOMAIN(mesh_component_number)%PTR%TOPOLOGY%ELEMENTS%ELEMENTS(element_idx)%BASIS
887 dependent_number_of_gauss_points=dependent_quadrature_scheme%NUMBER_OF_GAUSS
888 geometric_basis=>geometric_field%DECOMPOSITION%DOMAIN(geometric_field%DECOMPOSITION%MESH_COMPONENT_NUMBER)%PTR% &
889 & topology%ELEMENTS%ELEMENTS(element_idx)%BASIS
894 dzdnu(idx,idx)=1.0_dp
898 field_var_type=equations_set%EQUATIONS%EQUATIONS_MAPPING%NONLINEAR_MAPPING%RESIDUAL_VARIABLES(1)%PTR%VARIABLE_TYPE
899 dependent_interpolation_parameters=>equations%INTERPOLATION%DEPENDENT_INTERP_PARAMETERS(field_var_type)%PTR
900 geometric_interpolation_parameters=>equations%INTERPOLATION%GEOMETRIC_INTERP_PARAMETERS(field_u_variable_type)%PTR
901 fibre_interpolation_parameters=>equations%INTERPOLATION%FIBRE_INTERP_PARAMETERS(field_u_variable_type)%PTR
903 CALL field_interpolation_parameters_element_get(field_values_set_type,element_idx, &
904 & geometric_interpolation_parameters,err,error,*999)
905 CALL field_interpolation_parameters_element_get(field_values_set_type,element_idx, &
906 & fibre_interpolation_parameters,err,error,*999)
907 CALL field_interpolation_parameters_element_get(field_values_set_type,element_idx, &
908 & dependent_interpolation_parameters,err,error,*999)
911 geometric_interpolated_point=>equations%INTERPOLATION%GEOMETRIC_INTERP_POINT(field_u_variable_type)%PTR
912 geometric_interpolated_point_metrics=>equations%INTERPOLATION% &
913 & geometric_interp_point_metrics(field_u_variable_type)%PTR
914 fibre_interpolated_point=>equations%INTERPOLATION%FIBRE_INTERP_POINT(field_u_variable_type)%PTR
915 dependent_interpolated_point=>equations%INTERPOLATION%DEPENDENT_INTERP_POINT(field_var_type)%PTR
916 dependent_interpolated_point_metrics=>equations%INTERPOLATION%DEPENDENT_INTERP_POINT_METRICS(field_var_type)%PTR
919 DO gauss_idx=1,dependent_number_of_gauss_points
923 & dependent_interpolated_point,err,error,*999)
924 CALL field_interpolated_point_metrics_calculate(dependent_basis%NUMBER_OF_XI, &
925 & dependent_interpolated_point_metrics,err,error,*999)
927 & geometric_interpolated_point,err,error,*999)
928 CALL field_interpolated_point_metrics_calculate(geometric_basis%NUMBER_OF_XI, &
929 & geometric_interpolated_point_metrics,err,error,*999)
931 & fibre_interpolated_point,err,error,*999)
935 & geometric_interpolated_point_metrics,fibre_interpolated_point,dzdnu,err,error,*999)
942 dof_idx=field_var_u1%COMPONENTS(1)%PARAM_TO_DOF_MAP%GAUSS_POINT_PARAM2DOF_MAP%GAUSS_POINTS(gauss_idx,element_idx)
943 CALL field_parameter_set_update_local_dof(independent_field,field_u1_variable_type,field_values_set_type, &
944 & dof_idx,sqrt(azl(1,1)),err,error,*999)
950 CALL field_parameter_set_update_start(independent_field,field_u1_variable_type,field_values_set_type,err,error,*999)
951 CALL field_parameter_set_update_finish(independent_field,field_u1_variable_type,field_values_set_type,err,error,*999)
955 &
" is not valid for a bioelectrics finite elasticity type of a multi physics problem class." 956 CALL flagerror(local_error,err,error,*999)
962 CALL flagerror(
"Control loop is not associated.",err,error,*999)
965 exits(
"BioelectricFiniteElasticity_ComputeFibreStretch")
967 999
errors(
"BioelectricFiniteElasticity_ComputeFibreStretch",err,error)
968 exits(
"BioelectricFiniteElasticity_ComputeFibreStretch")
982 INTEGER(INTG),
INTENT(OUT) :: ERR
987 TYPE(
field_type),
POINTER :: DEPENDENT_FIELD,FIBRE_FIELD,GEOMETRIC_FIELD,INDEPENDENT_FIELD
997 & FIBRE_INTERPOLATION_PARAMETERS,DEPENDENT_INTERPOLATION_PARAMETERS
999 & DEPENDENT_INTERPOLATED_POINT
1001 & DEPENDENT_INTERPOLATED_POINT_METRICS
1005 INTEGER(INTG) :: DEPENDENT_NUMBER_OF_GAUSS_POINTS
1006 INTEGER(INTG) :: MESH_COMPONENT_NUMBER,NUMBER_OF_ELEMENTS
1007 INTEGER(INTG) :: equations_set_idx,gauss_idx,dof_idx,element_idx
1008 INTEGER(INTG) :: ITERATION_NUMBER,MAXIMUM_NUMBER_OF_ITERATIONS
1009 REAL(DP) :: LENGTH_HS,LENGTH_HS_0,ACTIVE_STRESS,FIBRE_STRETCH,FIBRE_STRETCH_OLD
1010 REAL(DP) :: FACTOR_LENGTH,FACTOR_VELO,SARCO_LENGTH,VELOCITY,VELOCITY_MAX,TIME_STEP,kappa,A,S,d,c
1013 REAL(DP) :: VELOCITY_AVERAGE,STRETCH_AVERAGE,OLD_STRETCH_AVERAGE
1014 INTEGER(INTG) :: counter
1016 enters(
"BioelectricFiniteElasticity_ForceLengthVelocityRelation",err,error,*999)
1018 NULLIFY(control_loop_parent)
1019 NULLIFY(equations_set)
1020 NULLIFY(solver_mapping)
1021 NULLIFY(geometric_basis)
1022 NULLIFY(decomposition)
1025 NULLIFY(solver_equations)
1026 NULLIFY(field_var_u,field_var_u1)
1027 NULLIFY(dependent_basis)
1029 NULLIFY(dependent_field,fibre_field,geometric_field,independent_field)
1030 NULLIFY(dependent_quadrature_scheme)
1031 NULLIFY(geometric_interpolation_parameters,fibre_interpolation_parameters,dependent_interpolation_parameters)
1032 NULLIFY(geometric_interpolated_point,fibre_interpolated_point,dependent_interpolated_point)
1033 NULLIFY(geometric_interpolated_point_metrics,dependent_interpolated_point_metrics)
1035 IF(
ASSOCIATED(control_loop))
THEN 1036 IF(control_loop%NUMBER_OF_SUB_LOOPS==0)
THEN 1037 SELECT CASE(control_loop%LOOP_TYPE)
1048 IF(
ASSOCIATED(solver_equations))
THEN 1049 solver_mapping=>solver_equations%SOLVER_MAPPING
1050 IF(
ASSOCIATED(solver_mapping))
THEN 1051 DO equations_set_idx=1,solver_mapping%NUMBER_OF_EQUATIONS_SETS
1052 equations_set=>solver_mapping%EQUATIONS_SETS(equations_set_idx)%PTR
1053 IF(
ASSOCIATED(equations_set))
THEN 1054 dependent_field=>equations_set%DEPENDENT%DEPENDENT_FIELD
1055 IF(.NOT.
ASSOCIATED(dependent_field))
THEN 1056 local_error=
"Dependent field is not associated for equations set index "// &
1058 CALL flagerror(local_error,err,error,*999)
1060 independent_field=>equations_set%INDEPENDENT%INDEPENDENT_FIELD
1061 IF(.NOT.
ASSOCIATED(independent_field))
THEN 1062 local_error=
"Independent field is not associated for equations set index "// &
1064 CALL flagerror(local_error,err,error,*999)
1067 local_error=
"Equations set is not associated for equations set index "// &
1069 CALL flagerror(local_error,err,error,*999)
1073 CALL flagerror(
"Solver equations solver mapping is not associated.",err,error,*999)
1076 CALL flagerror(
"Solver solver equations are not associated.",err,error,*999)
1079 CALL field_variable_get(independent_field,field_u_variable_type,field_var_u,err,error,*999)
1080 CALL field_variable_get(independent_field,field_u1_variable_type,field_var_u1,err,error,*999)
1083 dof_idx=field_var_u1%COMPONENTS(2)%PARAM_TO_DOF_MAP%CONSTANT_PARAM2DOF_MAP
1084 CALL field_parameter_set_get_local_dof(independent_field,field_u1_variable_type, &
1085 & field_values_set_type,dof_idx,length_hs_0,err,error,*999)
1088 dof_idx=field_var_u1%COMPONENTS(3)%PARAM_TO_DOF_MAP%CONSTANT_PARAM2DOF_MAP
1089 CALL field_parameter_set_get_local_dof(independent_field,field_u1_variable_type, &
1090 & field_values_set_type,dof_idx,velocity_max,err,error,*999)
1092 iteration_number=control_loop%WHILE_LOOP%ITERATION_NUMBER
1093 maximum_number_of_iterations=control_loop%WHILE_LOOP%MAXIMUM_NUMBER_OF_ITERATIONS
1095 IF(iteration_number==1)
THEN 1096 CALL field_parameter_sets_copy(independent_field,field_u_variable_type, &
1097 & field_values_set_type,field_previous_values_set_type,1.0_dp,err,error,*999)
1100 CALL field_parameter_sets_copy(dependent_field,field_u_variable_type, &
1101 & field_previous_values_set_type,field_values_set_type,1.0_dp,err,error,*999)
1104 time_step=control_loop_parent%TIME_LOOP%TIME_INCREMENT
1106 decomposition=>dependent_field%DECOMPOSITION
1107 mesh_component_number=decomposition%MESH_COMPONENT_NUMBER
1110 velocity_average=0.0_dp
1111 stretch_average=0.0_dp
1112 old_stretch_average=0.0_dp
1116 number_of_elements=dependent_field%GEOMETRIC_FIELD%DECOMPOSITION%TOPOLOGY%ELEMENTS%NUMBER_OF_ELEMENTS
1119 DO element_idx=1,number_of_elements
1121 dependent_basis=>decomposition%DOMAIN(mesh_component_number)%PTR%TOPOLOGY%ELEMENTS%ELEMENTS(element_idx)%BASIS
1123 dependent_number_of_gauss_points=dependent_quadrature_scheme%NUMBER_OF_GAUSS
1126 DO gauss_idx=1,dependent_number_of_gauss_points
1129 dof_idx=field_var_u%COMPONENTS(1)%PARAM_TO_DOF_MAP%GAUSS_POINT_PARAM2DOF_MAP%GAUSS_POINTS(gauss_idx,element_idx)
1130 CALL field_parameter_set_get_local_dof(independent_field,field_u_variable_type,field_previous_values_set_type, &
1131 & dof_idx,active_stress,err,error,*999)
1136 dof_idx=field_var_u1%COMPONENTS(1)%PARAM_TO_DOF_MAP%GAUSS_POINT_PARAM2DOF_MAP%GAUSS_POINTS(gauss_idx,element_idx)
1137 CALL field_parameter_set_get_local_dof(independent_field,field_u1_variable_type, &
1138 & field_values_set_type,dof_idx,fibre_stretch,err,error,*999)
1141 length_hs=length_hs_0*fibre_stretch
1146 sarco_length=2.0_dp*length_hs
1147 IF(sarco_length.LE.1.27_dp)
THEN 1148 factor_length=0.0_dp
1149 ELSEIF(sarco_length.LE.1.7_dp)
THEN 1150 factor_length=1.6047_dp*sarco_length-2.0379_dp
1151 ELSEIF(sarco_length.LE.2.34_dp)
THEN 1152 factor_length=0.4844_dp*sarco_length-0.1334_dp
1153 ELSEIF(sarco_length.LE.2.51_dp)
THEN 1154 factor_length=1.0_dp
1155 ELSEIF(sarco_length.LE.3.94_dp)
THEN 1156 factor_length=-0.6993_dp*sarco_length+2.7552_dp
1158 factor_length=0.0_dp
1162 active_stress=active_stress*factor_length
1165 dof_idx=field_var_u%COMPONENTS(1)%PARAM_TO_DOF_MAP%GAUSS_POINT_PARAM2DOF_MAP%GAUSS_POINTS(gauss_idx,element_idx)
1166 CALL field_parameter_set_update_local_dof(independent_field,field_u_variable_type,field_values_set_type, &
1167 & dof_idx,active_stress,err,error,*999)
1176 dof_idx=field_var_u1%COMPONENTS(1)%PARAM_TO_DOF_MAP%GAUSS_POINT_PARAM2DOF_MAP%GAUSS_POINTS(gauss_idx,element_idx)
1177 CALL field_parameter_set_get_local_dof(independent_field,field_u1_variable_type, &
1178 & field_previous_values_set_type,dof_idx,fibre_stretch_old,err,error,*999)
1181 velocity=(fibre_stretch-fibre_stretch_old)/time_step
1185 IF(velocity<velocity_max)
THEN 1186 CALL flag_warning(
'Exceeded maximum contraction velocity (shortening).',err,error,*999)
1189 IF(iteration_number<(maximum_number_of_iterations/2))
THEN 1190 velocity=velocity*1.0_dp/dble((maximum_number_of_iterations/2)-iteration_number)
1192 ELSEIF(velocity>(abs(velocity_max)))
THEN 1193 CALL flag_warning(
'Exceeded maximum contraction velocity (lengthening).',err,error,*999)
1205 IF(velocity<0.0_dp)
THEN 1207 factor_velo=(1-velocity/velocity_max)/(1+velocity/velocity_max/kappa)
1211 c=velocity/velocity_max*s*(kappa+1)
1212 factor_velo=1+c*(a-1)/(d+c)
1216 active_stress=active_stress*factor_velo
1219 dof_idx=field_var_u%COMPONENTS(1)%PARAM_TO_DOF_MAP%GAUSS_POINT_PARAM2DOF_MAP%GAUSS_POINTS(gauss_idx,element_idx)
1220 CALL field_parameter_set_update_local_dof(independent_field,field_u_variable_type,field_values_set_type, &
1221 & dof_idx,active_stress,err,error,*999)
1317 CALL field_parameter_set_update_start(independent_field,field_u_variable_type,field_values_set_type,err,error,*999)
1318 CALL field_parameter_set_update_finish(independent_field,field_u_variable_type,field_values_set_type,err,error,*999)
1322 &
" is not valid for a bioelectrics finite elasticity type of a multi physics problem class." 1323 CALL flagerror(local_error,err,error,*999)
1329 CALL flagerror(
"Control loop is not associated.",err,error,*999)
1333 exits(
"BioelectricFiniteElasticity_ForceLengthVelocityRelation")
1335 999
errors(
"BioelectricFiniteElasticity_ForceLengthVelocityRelation",err,error)
1336 exits(
"BioelectricFiniteElasticity_ForceLengthVelocityRelation")
1350 INTEGER(INTG),
INTENT(OUT) :: ERR
1354 INTEGER(INTG) :: equations_set_idx
1366 enters(
"BioelectricFiniteElasticity_ControlLoopPostLoop",err,error,*999)
1368 IF(
ASSOCIATED(control_loop))
THEN 1369 IF(control_loop%NUMBER_OF_SUB_LOOPS==0)
THEN 1370 problem=>control_loop%PROBLEM
1371 IF(
ASSOCIATED(problem))
THEN 1372 IF(.NOT.
ALLOCATED(control_loop%problem%specification))
THEN 1373 CALL flagerror(
"Problem specification is not allocated.",err,error,*999)
1374 ELSE IF(
SIZE(control_loop%problem%specification,1)<3)
THEN 1375 CALL flagerror(
"Problem specification must have three entries for a bioelectric-finite elasticity problem.", &
1378 SELECT CASE(control_loop%LOOP_TYPE)
1380 SELECT CASE(problem%SPECIFICATION(2))
1386 &
" is not valid for a multi physics problem class." 1387 CALL flagerror(local_error,err,error,*999)
1397 CALL flagerror(
"Control loop problem is not associated.",err,error,*999)
1403 time_loop=>control_loop%TIME_LOOP
1404 IF(
ASSOCIATED(time_loop))
THEN 1405 problem=>control_loop%PROBLEM
1406 IF(
ASSOCIATED(problem))
THEN 1409 NULLIFY(solver_equations)
1410 NULLIFY(elasticity_sub_loop)
1417 IF(
ASSOCIATED(solver_equations))
THEN 1418 solver_mapping=>solver_equations%SOLVER_MAPPING
1419 IF(
ASSOCIATED(solver_mapping))
THEN 1420 DO equations_set_idx=1,solver_mapping%NUMBER_OF_EQUATIONS_SETS
1421 equations_set=>solver_mapping%EQUATIONS_SETS(equations_set_idx)%PTR
1422 IF(
ASSOCIATED(equations_set))
THEN 1423 dependent_field=>equations_set%DEPENDENT%DEPENDENT_FIELD
1424 NULLIFY(dependent_region)
1425 CALL field_region_get(dependent_field,dependent_region,err,error,*999)
1431 local_error=
"Equations set is not associated for equations set index "// &
1433 &
" in the solver mapping." 1434 CALL flagerror(local_error,err,error,*999)
1438 CALL flagerror(
"Solver equations solver mapping is not associated.",err,error,*999)
1441 CALL flagerror(
"Solver solver equations are not associated.",err,error,*999)
1449 NULLIFY(solver_equations)
1450 NULLIFY(bioelectric_sub_loop)
1457 IF(
ASSOCIATED(solver_equations))
THEN 1458 solver_mapping=>solver_equations%SOLVER_MAPPING
1459 IF(
ASSOCIATED(solver_mapping))
THEN 1460 DO equations_set_idx=1,solver_mapping%NUMBER_OF_EQUATIONS_SETS
1461 equations_set=>solver_mapping%EQUATIONS_SETS(equations_set_idx)%PTR
1462 IF(
ASSOCIATED(equations_set))
THEN 1463 dependent_field=>equations_set%DEPENDENT%DEPENDENT_FIELD
1464 NULLIFY(dependent_region)
1465 CALL field_region_get(dependent_field,dependent_region,err,error,*999)
1471 WRITE(*,*) time_loop%ITERATION_NUMBER
1474 local_error=
"Equations set is not associated for equations set index "// &
1476 &
" in the solver mapping." 1477 CALL flagerror(local_error,err,error,*999)
1481 CALL flagerror(
"Solver equations solver mapping is not associated.",err,error,*999)
1484 CALL flagerror(
"Solver solver equations are not associated.",err,error,*999)
1488 CALL flagerror(
"Control loop problem is not associated.",err,error,*999)
1491 CALL flagerror(
"Time loop is not associated.",err,error,*999)
1496 CALL flagerror(
"Control loop is not associated.",err,error,*999)
1499 exits(
"BioelectricFiniteElasticity_ControlLoopPostLoop")
1501 999
errors(
"BioelectricFiniteElasticity_ControlLoopPostLoop",err,error)
1502 exits(
"BioelectricFiniteElasticity_ControlLoopPostLoop")
1517 INTEGER(INTG),
INTENT(OUT) :: ERR
1521 INTEGER(INTG) :: equations_set_idx,NUMBER_OF_NODES,dof_idx,node_idx
1530 REAL(DP) :: x1,x2,x3,y1,y2,y3,my_sum
1532 enters(
"BioelectricFiniteElasticity_ConvergenceCheck",err,error,*999)
1536 NULLIFY(solver_equations)
1539 IF(
ASSOCIATED(control_loop))
THEN 1540 IF(control_loop%NUMBER_OF_SUB_LOOPS==0)
THEN 1541 problem=>control_loop%PROBLEM
1542 IF(
ASSOCIATED(problem))
THEN 1543 SELECT CASE(control_loop%LOOP_TYPE)
1554 IF(
ASSOCIATED(solver_equations))
THEN 1555 solver_mapping=>solver_equations%SOLVER_MAPPING
1556 IF(
ASSOCIATED(solver_mapping))
THEN 1557 DO equations_set_idx=1,solver_mapping%NUMBER_OF_EQUATIONS_SETS
1558 equations_set=>solver_mapping%EQUATIONS_SETS(equations_set_idx)%PTR
1559 IF(
ASSOCIATED(equations_set))
THEN 1560 dependent_field=>equations_set%DEPENDENT%DEPENDENT_FIELD
1562 local_error=
"Equations set is not associated for equations set index "// &
1564 &
" in the solver mapping." 1565 CALL flagerror(local_error,err,error,*999)
1569 CALL flagerror(
"Solver equations solver mapping is not associated.",err,error,*999)
1572 CALL flagerror(
"Solver solver equations are not associated.",err,error,*999)
1575 IF(control_loop%WHILE_LOOP%ITERATION_NUMBER==1)
THEN 1578 CALL field_variable_get(dependent_field,field_u_variable_type,field_var,err,error,*999)
1580 number_of_nodes=dependent_field%DECOMPOSITION%DOMAIN(dependent_field%DECOMPOSITION% &
1581 & mesh_component_number)%PTR%MAPPINGS%NODES%NUMBER_OF_LOCAL
1584 DO node_idx=1,number_of_nodes
1587 dof_idx=field_var%COMPONENTS(1)%PARAM_TO_DOF_MAP%NODE_PARAM2DOF_MAP%NODES(node_idx)% &
1588 & derivatives(1)%VERSIONS(1)
1589 CALL field_parameter_set_get_local_dof(dependent_field,field_u_variable_type, &
1590 & field_values_set_type,dof_idx,x1,err,error,*999)
1591 CALL field_parameter_set_get_local_dof(dependent_field,field_u_variable_type, &
1592 & field_previous_iteration_values_set_type,dof_idx,y1,err,error,*999)
1593 dof_idx=field_var%COMPONENTS(2)%PARAM_TO_DOF_MAP%NODE_PARAM2DOF_MAP%NODES(node_idx)% &
1594 & derivatives(1)%VERSIONS(1)
1595 CALL field_parameter_set_get_local_dof(dependent_field,field_u_variable_type, &
1596 & field_values_set_type,dof_idx,x2,err,error,*999)
1597 CALL field_parameter_set_get_local_dof(dependent_field,field_u_variable_type, &
1598 & field_previous_iteration_values_set_type,dof_idx,y2,err,error,*999)
1599 dof_idx=field_var%COMPONENTS(3)%PARAM_TO_DOF_MAP%NODE_PARAM2DOF_MAP%NODES(node_idx)% &
1600 & derivatives(1)%VERSIONS(1)
1601 CALL field_parameter_set_get_local_dof(dependent_field,field_u_variable_type, &
1602 & field_values_set_type,dof_idx,x3,err,error,*999)
1603 CALL field_parameter_set_get_local_dof(dependent_field,field_u_variable_type, &
1604 & field_previous_iteration_values_set_type,dof_idx,y3,err,error,*999)
1607 my_sum=my_sum+sqrt((x1-y1)**2+(x2-y2)**2+(x3-y3)**2)
1610 IF(my_sum<1.0e-06_dp)
THEN 1611 control_loop%WHILE_LOOP%CONTINUE_LOOP=.false.
1614 CALL field_parameter_sets_copy(dependent_field,field_u_variable_type, &
1615 & field_values_set_type,field_previous_values_set_type,1.0_dp,err,error,*999)
1616 ELSEIF(control_loop%WHILE_LOOP%ITERATION_NUMBER==control_loop%WHILE_LOOP%MAXIMUM_NUMBER_OF_ITERATIONS)
THEN 1618 CALL flag_warning(
'----------- Maximum number of iterations in while loop reached. -----------',err,error,*999)
1620 CALL field_parameter_sets_copy(dependent_field,field_u_variable_type, &
1621 & field_values_set_type,field_previous_values_set_type,1.0_dp,err,error,*999)
1627 CALL field_parameter_sets_copy(dependent_field,field_u_variable_type, &
1628 & field_values_set_type,field_previous_iteration_values_set_type,1.0_dp,err,error,*999)
1634 CALL flagerror(
"Control loop problem is not associated.",err,error,*999)
1640 CALL flagerror(
"Control loop is not associated.",err,error,*999)
1643 exits(
"BioelectricFiniteElasticity_ConvergenceCheck")
1645 999
errors(
"BioelectricFiniteElasticity_ConvergenceCheck",err,error)
1646 exits(
"BioelectricFiniteElasticity_ConvergenceCheck")
1661 LOGICAL,
INTENT(IN) :: CALC_CLOSEST_GAUSS_POINT
1662 INTEGER(INTG),
INTENT(OUT) :: ERR
1665 TYPE(
control_loop_type),
POINTER :: CONTROL_LOOP_ROOT,CONTROL_LOOP_PARENT,CONTROL_LOOP_ELASTICITY,CONTROL_LOOP_MONODOMAIN
1669 TYPE(
field_type),
POINTER :: INDEPENDENT_FIELD_ELASTICITY,GEOMETRIC_FIELD_MONODOMAIN,GEOMETRIC_FIELD_ELASTICITY
1670 TYPE(
field_type),
POINTER :: DEPENDENT_FIELD_MONODOMAIN,INDEPENDENT_FIELD_MONODOMAIN,DEPENDENT_FIELD_ELASTICITY
1679 TYPE(
field_variable_type),
POINTER :: FIELD_VAR_DEP_M,FIELD_VAR_GEO_M,FIELD_VAR_IND_FE,FIELD_VAR_IND_M,FIELD_VAR_IND_M_2
1680 INTEGER(INTG) :: component_idx,element_idx,ne,start_elem,START_ELEMENT,start_element_idx
1681 INTEGER(INTG) :: DEPENDENT_FIELD_INTERPOLATION,GEOMETRIC_FIELD_INTERPOLATION
1682 INTEGER(INTG) :: node_idx,node_idx_2,GAUSS_POINT,gauss_idx,fibre_idx
1683 INTEGER(INTG) :: nodes_in_Xi_1,nodes_in_Xi_2,nodes_in_Xi_3,n3,n2,n1,dof_idx,dof_idx2,idx,my_element_idx
1684 INTEGER(INTG) :: offset,n4
1685 REAL(DP) :: XVALUE_M,XVALUE_FE,DIST_LEFT,DIST_RIGHT,
VALUE,VALUE_LEFT,VALUE_RIGHT,DISTANCE,VELOCITY,VELOCITY_MAX,OLD_DIST
1686 REAL(DP) :: OLD_DIST_2,OLD_DIST_3,OLD_DIST_4
1687 REAL(DP) :: XI(3),PREVIOUS_NODE(3),DIST_INIT,SARCO_LENGTH_INIT,TIME_STEP,DIST
1688 LOGICAL :: OUTSIDE_NODE
1689 REAL(DP),
POINTER :: GAUSS_POSITIONS(:,:)
1691 enters(
"BioelectricFiniteElasticity_UpdateGeometricField",err,error,*999)
1693 NULLIFY(control_loop_root)
1694 NULLIFY(control_loop_parent)
1695 NULLIFY(control_loop_elasticity)
1696 NULLIFY(control_loop_monodomain)
1700 NULLIFY(independent_field_elasticity)
1701 NULLIFY(dependent_field_monodomain)
1702 NULLIFY(independent_field_monodomain)
1703 NULLIFY(dependent_field_elasticity)
1704 NULLIFY(solver_equations)
1705 NULLIFY(solver_mapping)
1706 NULLIFY(equations_set)
1707 NULLIFY(geometric_field_monodomain)
1708 NULLIFY(geometric_field_elasticity)
1709 NULLIFY(elements_topology)
1710 NULLIFY(interpolated_point)
1711 NULLIFY(interpolation_parameters)
1712 NULLIFY(field_var_dep_m)
1713 NULLIFY(field_var_geo_m)
1714 NULLIFY(field_var_ind_fe)
1715 NULLIFY(field_var_ind_m)
1716 NULLIFY(field_var_ind_m_2)
1717 NULLIFY(gauss_positions)
1719 IF(
ASSOCIATED(control_loop))
THEN 1720 IF(control_loop%NUMBER_OF_SUB_LOOPS==0)
THEN 1721 problem=>control_loop%PROBLEM
1722 IF(
ASSOCIATED(problem))
THEN 1723 IF(.NOT.
ALLOCATED(problem%specification))
THEN 1724 CALL flagerror(
"Problem specification is not allocated.",err,error,*999)
1725 ELSE IF(
SIZE(problem%specification,1)<3)
THEN 1726 CALL flagerror(
"Problem specification must have three entries for a bioelectric-finite elasticity problem.", &
1729 SELECT CASE(problem%SPECIFICATION(2))
1731 SELECT CASE(problem%SPECIFICATION(3))
1735 control_loop_root=>problem%CONTROL_LOOP
1741 solver_equations=>solver%SOLVER_EQUATIONS
1742 IF(
ASSOCIATED(solver_equations))
THEN 1743 solver_mapping=>solver_equations%SOLVER_MAPPING
1744 IF(
ASSOCIATED(solver_mapping))
THEN 1745 equations_set=>solver_mapping%EQUATIONS_SETS(1)%PTR
1746 IF(
ASSOCIATED(equations_set))
THEN 1747 geometric_field_monodomain=>equations_set%GEOMETRY%GEOMETRIC_FIELD
1748 IF(.NOT.
ASSOCIATED(geometric_field_monodomain))
THEN 1749 CALL flagerror(
"Geometric field is not associated.",err,error,*999)
1752 CALL flagerror(
"Equations set is not associated.",err,error,*999)
1755 CALL flagerror(
"Solver mapping is not associated.",err,error,*999)
1758 CALL flagerror(
"Solver equations is not associated.",err,error,*999)
1762 NULLIFY(solver_mapping)
1763 NULLIFY(equations_set)
1764 NULLIFY(solver_equations)
1769 solver_equations=>solver%SOLVER_EQUATIONS
1770 IF(
ASSOCIATED(solver_equations))
THEN 1771 solver_mapping=>solver_equations%SOLVER_MAPPING
1772 IF(
ASSOCIATED(solver_mapping))
THEN 1773 equations_set=>solver_mapping%EQUATIONS_SETS(1)%PTR
1774 IF(
ASSOCIATED(equations_set))
THEN 1775 dependent_field_elasticity=>equations_set%DEPENDENT%DEPENDENT_FIELD
1776 IF(.NOT.
ASSOCIATED(dependent_field_elasticity))
THEN 1777 CALL flagerror(
"Dependent field is not associated.",err,error,*999)
1780 CALL flagerror(
"Equations set is not associated.",err,error,*999)
1783 CALL flagerror(
"Solver mapping is not associated.",err,error,*999)
1786 CALL flagerror(
"Solver equations is not associated.",err,error,*999)
1788 DO component_idx=1,geometric_field_monodomain%VARIABLES(1)%NUMBER_OF_COMPONENTS
1790 geometric_field_interpolation=geometric_field_monodomain%VARIABLES(1)%COMPONENTS(component_idx)%INTERPOLATION_TYPE
1791 dependent_field_interpolation=dependent_field_elasticity%VARIABLES(1)%COMPONENTS(component_idx)%INTERPOLATION_TYPE
1792 IF(geometric_field_interpolation==dependent_field_interpolation)
THEN 1794 CALL field_parameterstofieldparameterscopy(dependent_field_elasticity,field_u_variable_type, &
1795 & field_values_set_type,component_idx,geometric_field_monodomain,field_u_variable_type,field_values_set_type, &
1796 & component_idx,err,error,*999)
1798 local_error=
"The interpolation type of component number "//
trim(
number_to_vstring(component_idx,
"*",err, &
1799 & error))//
" of field number "//
trim(
number_to_vstring(geometric_field_monodomain%USER_NUMBER,
"*",err, &
1800 & error))//
" does not coincide with the interpolation type of field number " &
1802 CALL flagerror(local_error,err,error,*999)
1809 control_loop_root=>problem%CONTROL_LOOP
1815 solver_equations=>solver%SOLVER_EQUATIONS
1816 IF(
ASSOCIATED(solver_equations))
THEN 1817 solver_mapping=>solver_equations%SOLVER_MAPPING
1818 IF(
ASSOCIATED(solver_mapping))
THEN 1819 equations_set=>solver_mapping%EQUATIONS_SETS(1)%PTR
1820 IF(
ASSOCIATED(equations_set))
THEN 1821 geometric_field_monodomain=>equations_set%GEOMETRY%GEOMETRIC_FIELD
1822 IF(.NOT.
ASSOCIATED(geometric_field_monodomain))
THEN 1823 CALL flagerror(
"Geometric field is not associated.",err,error,*999)
1826 dependent_field_monodomain=>equations_set%DEPENDENT%DEPENDENT_FIELD
1827 IF(.NOT.
ASSOCIATED(dependent_field_monodomain))
THEN 1828 CALL flagerror(
"Dependent field is not associated.",err,error,*999)
1830 independent_field_monodomain=>equations_set%INDEPENDENT%INDEPENDENT_FIELD
1831 IF(.NOT.
ASSOCIATED(independent_field_monodomain))
THEN 1832 CALL flagerror(
"Independent field is not associated.",err,error,*999)
1835 CALL flagerror(
"Equations set is not associated.",err,error,*999)
1838 CALL flagerror(
"Solver mapping is not associated.",err,error,*999)
1841 CALL flagerror(
"Solver equations is not associated.",err,error,*999)
1845 NULLIFY(solver_mapping)
1846 NULLIFY(equations_set)
1847 NULLIFY(solver_equations)
1852 solver_equations=>solver%SOLVER_EQUATIONS
1853 IF(
ASSOCIATED(solver_equations))
THEN 1854 solver_mapping=>solver_equations%SOLVER_MAPPING
1855 IF(
ASSOCIATED(solver_mapping))
THEN 1856 equations_set=>solver_mapping%EQUATIONS_SETS(1)%PTR
1857 IF(
ASSOCIATED(equations_set))
THEN 1858 independent_field_elasticity=>equations_set%INDEPENDENT%INDEPENDENT_FIELD
1859 IF(.NOT.
ASSOCIATED(independent_field_elasticity))
THEN 1860 CALL flagerror(
"Independent field is not associated.",err,error,*999)
1862 geometric_field_elasticity=>equations_set%GEOMETRY%GEOMETRIC_FIELD
1863 IF(.NOT.
ASSOCIATED(geometric_field_elasticity))
THEN 1864 CALL flagerror(
"Dependent field is not associated.",err,error,*999)
1867 CALL flagerror(
"Equations set is not associated.",err,error,*999)
1870 CALL flagerror(
"Solver mapping is not associated.",err,error,*999)
1873 CALL flagerror(
"Solver equations is not associated.",err,error,*999)
1880 CALL field_variable_get(dependent_field_monodomain,field_v_variable_type,field_var_dep_m,err,error,*999)
1881 CALL field_variable_get(geometric_field_monodomain,field_u_variable_type,field_var_geo_m,err,error,*999)
1882 CALL field_variable_get(independent_field_elasticity,field_v_variable_type,field_var_ind_fe,err,error,*999)
1883 CALL field_variable_get(independent_field_monodomain,field_u1_variable_type,field_var_ind_m,err,error,*999)
1884 CALL field_variable_get(independent_field_monodomain,field_u2_variable_type,field_var_ind_m_2,err,error,*999)
1886 nodes_mapping=>geometric_field_monodomain%DECOMPOSITION%DOMAIN(geometric_field_monodomain%DECOMPOSITION% &
1887 & mesh_component_number)%PTR%MAPPINGS%NODES
1889 elements_topology=>geometric_field_elasticity%DECOMPOSITION%TOPOLOGY%ELEMENTS
1893 dof_idx=field_var_ind_m_2%COMPONENTS(2)%PARAM_TO_DOF_MAP%CONSTANT_PARAM2DOF_MAP
1894 CALL field_parameter_set_get_local_dof(independent_field_monodomain,field_u2_variable_type, &
1895 & field_values_set_type,dof_idx,velocity_max,err,error,*999)
1900 time_step=control_loop_parent%TIME_LOOP%TIME_INCREMENT
1905 DO element_idx=1,elements_topology%NUMBER_OF_ELEMENTS
1906 ne=elements_topology%ELEMENTS(element_idx)%LOCAL_NUMBER
1907 my_element_idx=element_idx
1910 dof_idx=field_var_ind_fe%COMPONENTS(1)%PARAM_TO_DOF_MAP%ELEMENT_PARAM2DOF_MAP%ELEMENTS(ne)
1911 CALL field_parameter_set_get_local_dof(independent_field_elasticity,field_v_variable_type,field_values_set_type, &
1912 & dof_idx,nodes_in_xi_1,err,error,*999)
1913 dof_idx=field_var_ind_fe%COMPONENTS(2)%PARAM_TO_DOF_MAP%ELEMENT_PARAM2DOF_MAP%ELEMENTS(ne)
1914 CALL field_parameter_set_get_local_dof(independent_field_elasticity,field_v_variable_type,field_values_set_type, &
1915 & dof_idx,nodes_in_xi_2,err,error,*999)
1916 dof_idx=field_var_ind_fe%COMPONENTS(3)%PARAM_TO_DOF_MAP%ELEMENT_PARAM2DOF_MAP%ELEMENTS(ne)
1917 CALL field_parameter_set_get_local_dof(independent_field_elasticity,field_v_variable_type,field_values_set_type, &
1918 & dof_idx,nodes_in_xi_3,err,error,*999)
1920 dof_idx=field_var_ind_fe%COMPONENTS(4)%PARAM_TO_DOF_MAP%ELEMENT_PARAM2DOF_MAP%ELEMENTS(ne)
1921 CALL field_parameter_set_get_local_dof(independent_field_elasticity,field_v_variable_type,field_values_set_type, &
1922 & dof_idx,start_elem,err,error,*999)
1925 IF((nodes_in_xi_1==0).OR.(nodes_in_xi_2==0).OR.(nodes_in_xi_3==0).OR.(start_elem==0)) cycle
1928 start_element_idx=my_element_idx
1931 xi=[0.0_dp,1.0_dp/(
REAL(2*nodes_in_xi_2)),1.0_dp/(
REAL(2*nodes_in_xi_3))]
1934 DO n3=1,nodes_in_xi_3
1935 DO n2=1,nodes_in_xi_2
1936 fibre_idx=fibre_idx+1
1941 interpolation_parameters=>equations_set%EQUATIONS%INTERPOLATION%DEPENDENT_INTERP_PARAMETERS &
1942 & (field_u_variable_type)%PTR
1943 CALL field_interpolation_parameters_element_get(field_values_set_type,ne,interpolation_parameters, &
1945 interpolated_point=>equations_set%EQUATIONS%INTERPOLATION%DEPENDENT_INTERP_POINT(field_u_variable_type)%PTR
1948 gauss_positions=>geometric_field_elasticity%DECOMPOSITION%DOMAIN(geometric_field_elasticity%DECOMPOSITION% &
1949 & mesh_component_number)%PTR%TOPOLOGY%ELEMENTS%ELEMENTS(ne)%BASIS%QUADRATURE%QUADRATURE_SCHEME_MAP( &
1952 DO n1=1,nodes_in_xi_1
1956 CALL field_parameter_set_update_local_node(independent_field_monodomain,field_v_variable_type, &
1957 & field_values_set_type,1,1,node_idx,3,fibre_idx,err,error,*999)
1960 CALL field_interpolate_xi(
no_part_deriv,xi,interpolated_point,err,error,*999)
1963 CALL field_parameter_set_update_local_node(dependent_field_monodomain,field_v_variable_type, &
1964 & field_values_set_type,1,1,node_idx,1,interpolated_point%VALUES(1,1),err,error,*999)
1965 CALL field_parameter_set_update_local_node(dependent_field_monodomain,field_v_variable_type, &
1966 & field_values_set_type,1,1,node_idx,2,interpolated_point%VALUES(2,1),err,error,*999)
1967 CALL field_parameter_set_update_local_node(dependent_field_monodomain,field_v_variable_type, &
1968 & field_values_set_type,1,1,node_idx,3,interpolated_point%VALUES(3,1),err,error,*999)
1970 IF((n1==1).AND.(ne==start_element))
THEN 1972 CALL field_parameter_set_update_local_node(geometric_field_monodomain,field_u_variable_type, &
1973 & field_values_set_type,1,1,node_idx,1,0.0_dp,err,error,*999)
1976 dof_idx2=field_var_dep_m%COMPONENTS(1)%PARAM_TO_DOF_MAP%NODE_PARAM2DOF_MAP%NODES(node_idx-1)% &
1977 & derivatives(1)%VERSIONS(1)
1978 CALL field_parameter_set_get_local_dof(dependent_field_monodomain,field_v_variable_type, &
1979 & field_values_set_type,dof_idx2,previous_node(1),err,error,*999)
1980 dof_idx2=field_var_dep_m%COMPONENTS(2)%PARAM_TO_DOF_MAP%NODE_PARAM2DOF_MAP%NODES(node_idx-1)% &
1981 & derivatives(1)%VERSIONS(1)
1982 CALL field_parameter_set_get_local_dof(dependent_field_monodomain,field_v_variable_type, &
1983 & field_values_set_type,dof_idx2,previous_node(2),err,error,*999)
1984 dof_idx2=field_var_dep_m%COMPONENTS(3)%PARAM_TO_DOF_MAP%NODE_PARAM2DOF_MAP%NODES(node_idx-1)% &
1985 & derivatives(1)%VERSIONS(1)
1986 CALL field_parameter_set_get_local_dof(dependent_field_monodomain,field_v_variable_type, &
1987 & field_values_set_type,dof_idx2,previous_node(3),err,error,*999)
1991 & (interpolated_point%VALUES(1,1)-previous_node(1))*(interpolated_point%VALUES(1,1)-previous_node(1))+ &
1992 & (interpolated_point%VALUES(2,1)-previous_node(2))*(interpolated_point%VALUES(2,1)-previous_node(2))+ &
1993 & (interpolated_point%VALUES(3,1)-previous_node(3))*(interpolated_point%VALUES(3,1)-previous_node(3)))
1999 dof_idx=field_var_ind_m_2%COMPONENTS(1)%PARAM_TO_DOF_MAP%NODE_PARAM2DOF_MAP%NODES(node_idx)% &
2000 & derivatives(1)%VERSIONS(1)
2001 CALL field_parameter_set_get_local_dof(independent_field_monodomain,field_u2_variable_type, &
2002 & field_values_set_type,dof_idx,old_dist,err,error,*999)
2005 dof_idx=field_var_ind_m_2%COMPONENTS(4)%PARAM_TO_DOF_MAP%NODE_PARAM2DOF_MAP%NODES(node_idx)% &
2006 & derivatives(1)%VERSIONS(1)
2007 CALL field_parameter_set_get_local_dof(independent_field_monodomain,field_u2_variable_type, &
2008 & field_values_set_type,dof_idx,old_dist_2,err,error,*999)
2011 dof_idx=field_var_ind_m_2%COMPONENTS(5)%PARAM_TO_DOF_MAP%NODE_PARAM2DOF_MAP%NODES(node_idx)% &
2012 & derivatives(1)%VERSIONS(1)
2013 CALL field_parameter_set_get_local_dof(independent_field_monodomain,field_u2_variable_type, &
2014 & field_values_set_type,dof_idx,old_dist_3,err,error,*999)
2017 dof_idx=field_var_ind_m_2%COMPONENTS(6)%PARAM_TO_DOF_MAP%NODE_PARAM2DOF_MAP%NODES(node_idx)% &
2018 & derivatives(1)%VERSIONS(1)
2019 CALL field_parameter_set_get_local_dof(independent_field_monodomain,field_u2_variable_type, &
2020 & field_values_set_type,dof_idx,old_dist_4,err,error,*999)
2024 velocity=0.25_dp*((dist-old_dist)/time_step+(dist-old_dist_2)/(2.0_dp*time_step)+ &
2025 & (dist-old_dist_3)/(3.0_dp*time_step)+(dist-old_dist_4)/(4.0_dp*time_step))
2026 IF(.NOT. calc_closest_gauss_point)
THEN 2028 IF(velocity<velocity_max)
THEN 2029 CALL flag_warning(
'Exceeded maximum contraction velocity (shortening).',err,error,*999)
2030 velocity=velocity_max
2032 ELSEIF(velocity>(abs(velocity_max)/2.0_dp))
THEN 2033 CALL flag_warning(
'Exceeded maximum contraction velocity (lengthening).',err,error,*999)
2034 velocity=-velocity_max/2.0_dp
2039 CALL field_parameter_set_update_local_node(independent_field_monodomain,field_u2_variable_type, &
2040 & field_values_set_type,1,1,node_idx,3,velocity/abs(velocity_max),err,error,*999)
2043 CALL field_parameter_set_update_local_node(independent_field_monodomain,field_u2_variable_type, &
2044 & field_values_set_type,1,1,node_idx,1,dist,err,error,*999)
2047 CALL field_parameter_set_update_local_node(independent_field_monodomain,field_u2_variable_type, &
2048 & field_values_set_type,1,1,node_idx,4,old_dist,err,error,*999)
2051 CALL field_parameter_set_update_local_node(independent_field_monodomain,field_u2_variable_type, &
2052 & field_values_set_type,1,1,node_idx,5,old_dist_2,err,error,*999)
2055 CALL field_parameter_set_update_local_node(independent_field_monodomain,field_u2_variable_type, &
2056 & field_values_set_type,1,1,node_idx,6,old_dist_3,err,error,*999)
2061 dof_idx2=field_var_geo_m%COMPONENTS(1)%PARAM_TO_DOF_MAP%NODE_PARAM2DOF_MAP%NODES(node_idx-1)% &
2062 & derivatives(1)%VERSIONS(1)
2063 CALL field_parameter_set_get_local_dof(geometric_field_monodomain,field_u_variable_type, &
2064 & field_values_set_type,dof_idx2,value_left,err,error,*999)
2066 CALL field_parameter_set_update_local_node(geometric_field_monodomain,field_u_variable_type, &
2067 & field_values_set_type,1,1,node_idx,1,value_left+dist,err,error,*999)
2070 dof_idx=field_var_ind_m%COMPONENTS(2)%PARAM_TO_DOF_MAP%CONSTANT_PARAM2DOF_MAP
2071 CALL field_parameter_set_get_local_dof(independent_field_monodomain,field_u1_variable_type, &
2072 & field_values_set_type,dof_idx,sarco_length_init,err,error,*999)
2073 dof_idx=field_var_ind_m%COMPONENTS(3)%PARAM_TO_DOF_MAP%CONSTANT_PARAM2DOF_MAP
2074 CALL field_parameter_set_get_local_dof(independent_field_monodomain,field_u1_variable_type, &
2075 & field_values_set_type,dof_idx,dist_init,err,error,*999)
2077 VALUE=sarco_length_init*dist/dist_init
2078 CALL field_parameter_set_update_local_node(independent_field_monodomain,field_u1_variable_type, &
2079 & field_values_set_type,1,1,node_idx,1,
VALUE,err,error,*999)
2082 IF((n1==2).AND.(ne==start_element))
THEN 2084 CALL field_parameter_set_update_local_node(independent_field_monodomain,field_u1_variable_type, &
2085 & field_values_set_type,1,1,node_idx-1,1,
VALUE,err,error,*999)
2087 CALL field_parameter_set_update_local_node(independent_field_monodomain,field_u2_variable_type, &
2088 & field_values_set_type,1,1,node_idx-1,1,dist,err,error,*999)
2090 CALL field_parameter_set_update_local_node(independent_field_monodomain,field_u2_variable_type, &
2091 & field_values_set_type,1,1,node_idx-1,3,velocity/abs(velocity_max),err,error,*999)
2096 IF(calc_closest_gauss_point)
THEN 2098 distance=1000000.0_dp
2100 DO gauss_idx=1,
SIZE(gauss_positions,2)
2103 & (xi(1)-gauss_positions(1,gauss_idx))*(xi(1)-gauss_positions(1,gauss_idx))+ &
2104 & (xi(2)-gauss_positions(2,gauss_idx))*(xi(2)-gauss_positions(2,gauss_idx))+ &
2105 & (xi(3)-gauss_positions(3,gauss_idx))*(xi(3)-gauss_positions(3,gauss_idx)))
2106 IF(
VALUE<distance)
THEN 2108 gauss_point=gauss_idx
2111 IF(gauss_point==0)
CALL flag_warning(
"Closest Gauss Point not found",err,error,*999)
2113 CALL field_parameter_set_update_local_node(independent_field_monodomain,field_v_variable_type, &
2114 & field_values_set_type,1,1,node_idx,4,gauss_point,err,error,*999)
2115 CALL field_parameter_set_update_local_node(independent_field_monodomain,field_v_variable_type, &
2116 & field_values_set_type,1,1,node_idx,5,ne,err,error,*999)
2119 IF(start_elem==1)
THEN 2121 xi(1)=xi(1)+1.0_dp/(
REAL(nodes_in_xi_1-1))
2122 ELSEIF(start_elem==0)
THEN 2124 xi(1)=xi(1)+1.0_dp/(
REAL(nodes_in_xi_1))
2126 local_error=
"The start element index is incorrect. The index is "// &
2128 &
" and should be zero or one." 2129 CALL flagerror(local_error,err,error,*999)
2250 IF(elements_topology%ELEMENTS(my_element_idx)%ADJACENT_ELEMENTS(1)%NUMBER_OF_ADJACENT_ELEMENTS==0)
EXIT 2253 ne=elements_topology%ELEMENTS(my_element_idx)%ADJACENT_ELEMENTS(1)%ADJACENT_ELEMENTS(1)
2256 dof_idx=field_var_ind_fe%COMPONENTS(4)%PARAM_TO_DOF_MAP%ELEMENT_PARAM2DOF_MAP%ELEMENTS(ne)
2257 CALL field_parameter_set_get_local_dof(independent_field_elasticity,field_v_variable_type, &
2258 & field_values_set_type,dof_idx,start_elem,err,error,*999)
2260 IF (start_elem==1)
THEN 2261 ne=elements_topology%ELEMENTS(element_idx)%LOCAL_NUMBER
2267 DO idx=1,elements_topology%NUMBER_OF_ELEMENTS
2268 IF(ne==elements_topology%ELEMENTS(idx)%ADJACENT_ELEMENTS(0)%ADJACENT_ELEMENTS(1))
THEN 2273 IF(my_element_idx==0)
CALL flagerror(
"my_element_idx not found.",err,error,*999)
2275 dof_idx=field_var_ind_fe%COMPONENTS(1)%PARAM_TO_DOF_MAP%ELEMENT_PARAM2DOF_MAP%ELEMENTS(ne)
2276 CALL field_parameter_set_get_local_dof(independent_field_elasticity,field_v_variable_type, &
2277 & field_values_set_type,dof_idx,nodes_in_xi_1,err,error,*999)
2281 xi(1)=1.0_dp/(
REAL(nodes_in_xi_1))
2287 dof_idx=field_var_ind_fe%COMPONENTS(1)%PARAM_TO_DOF_MAP%ELEMENT_PARAM2DOF_MAP%ELEMENTS(ne)
2288 CALL field_parameter_set_get_local_dof(independent_field_elasticity,field_v_variable_type, &
2289 & field_values_set_type,dof_idx,nodes_in_xi_1,err,error,*999)
2291 my_element_idx=start_element_idx
2294 xi(2)=xi(2)+1.0_dp/(
REAL(nodes_in_xi_2))
2297 xi(2)=1.0_dp/(
REAL(2*nodes_in_xi_2))
2298 xi(3)=xi(3)+1.0_dp/(
REAL(nodes_in_xi_3))
2305 control_loop_root=>problem%CONTROL_LOOP
2311 solver_equations=>solver%SOLVER_EQUATIONS
2312 IF(
ASSOCIATED(solver_equations))
THEN 2313 solver_mapping=>solver_equations%SOLVER_MAPPING
2314 IF(
ASSOCIATED(solver_mapping))
THEN 2315 equations_set=>solver_mapping%EQUATIONS_SETS(1)%PTR
2316 IF(
ASSOCIATED(equations_set))
THEN 2317 geometric_field_monodomain=>equations_set%GEOMETRY%GEOMETRIC_FIELD
2318 IF(.NOT.
ASSOCIATED(geometric_field_monodomain))
THEN 2319 CALL flagerror(
"Geometric field is not associated.",err,error,*999)
2322 dependent_field_monodomain=>equations_set%DEPENDENT%DEPENDENT_FIELD
2323 IF(.NOT.
ASSOCIATED(dependent_field_monodomain))
THEN 2324 CALL flagerror(
"Dependent field is not associated.",err,error,*999)
2326 independent_field_monodomain=>equations_set%INDEPENDENT%INDEPENDENT_FIELD
2327 IF(.NOT.
ASSOCIATED(independent_field_monodomain))
THEN 2328 CALL flagerror(
"Independent field is not associated.",err,error,*999)
2331 CALL flagerror(
"Equations set is not associated.",err,error,*999)
2334 CALL flagerror(
"Solver mapping is not associated.",err,error,*999)
2337 CALL flagerror(
"Solver equations is not associated.",err,error,*999)
2341 NULLIFY(solver_mapping)
2342 NULLIFY(equations_set)
2343 NULLIFY(solver_equations)
2348 solver_equations=>solver%SOLVER_EQUATIONS
2349 IF(
ASSOCIATED(solver_equations))
THEN 2350 solver_mapping=>solver_equations%SOLVER_MAPPING
2351 IF(
ASSOCIATED(solver_mapping))
THEN 2352 equations_set=>solver_mapping%EQUATIONS_SETS(1)%PTR
2353 IF(
ASSOCIATED(equations_set))
THEN 2354 independent_field_elasticity=>equations_set%INDEPENDENT%INDEPENDENT_FIELD
2355 IF(.NOT.
ASSOCIATED(independent_field_elasticity))
THEN 2356 CALL flagerror(
"Independent field is not associated.",err,error,*999)
2358 geometric_field_elasticity=>equations_set%GEOMETRY%GEOMETRIC_FIELD
2359 IF(.NOT.
ASSOCIATED(geometric_field_elasticity))
THEN 2360 CALL flagerror(
"Dependent field is not associated.",err,error,*999)
2363 CALL flagerror(
"Equations set is not associated.",err,error,*999)
2366 CALL flagerror(
"Solver mapping is not associated.",err,error,*999)
2369 CALL flagerror(
"Solver equations is not associated.",err,error,*999)
2376 CALL field_variable_get(dependent_field_monodomain,field_v_variable_type,field_var_dep_m,err,error,*999)
2377 CALL field_variable_get(geometric_field_monodomain,field_u_variable_type,field_var_geo_m,err,error,*999)
2378 CALL field_variable_get(independent_field_elasticity,field_v_variable_type,field_var_ind_fe,err,error,*999)
2380 nodes_mapping=>geometric_field_monodomain%DECOMPOSITION%DOMAIN(geometric_field_monodomain%DECOMPOSITION% &
2381 & mesh_component_number)%PTR%MAPPINGS%NODES
2383 elements_topology=>geometric_field_elasticity%DECOMPOSITION%TOPOLOGY%ELEMENTS
2387 DO element_idx=1,elements_topology%NUMBER_OF_ELEMENTS
2388 ne=elements_topology%ELEMENTS(element_idx)%LOCAL_NUMBER
2389 my_element_idx=element_idx
2392 dof_idx=field_var_ind_fe%COMPONENTS(1)%PARAM_TO_DOF_MAP%ELEMENT_PARAM2DOF_MAP%ELEMENTS(ne)
2393 CALL field_parameter_set_get_local_dof(independent_field_elasticity,field_v_variable_type,field_values_set_type, &
2394 & dof_idx,nodes_in_xi_1,err,error,*999)
2395 dof_idx=field_var_ind_fe%COMPONENTS(2)%PARAM_TO_DOF_MAP%ELEMENT_PARAM2DOF_MAP%ELEMENTS(ne)
2396 CALL field_parameter_set_get_local_dof(independent_field_elasticity,field_v_variable_type,field_values_set_type, &
2397 & dof_idx,nodes_in_xi_2,err,error,*999)
2398 dof_idx=field_var_ind_fe%COMPONENTS(3)%PARAM_TO_DOF_MAP%ELEMENT_PARAM2DOF_MAP%ELEMENTS(ne)
2399 CALL field_parameter_set_get_local_dof(independent_field_elasticity,field_v_variable_type,field_values_set_type, &
2400 & dof_idx,nodes_in_xi_3,err,error,*999)
2402 dof_idx=field_var_ind_fe%COMPONENTS(4)%PARAM_TO_DOF_MAP%ELEMENT_PARAM2DOF_MAP%ELEMENTS(ne)
2403 CALL field_parameter_set_get_local_dof(independent_field_elasticity,field_v_variable_type,field_values_set_type, &
2404 & dof_idx,start_elem,err,error,*999)
2407 IF((nodes_in_xi_1==0).OR.(nodes_in_xi_2==0).OR.(nodes_in_xi_3==0).OR.(start_elem==0)) cycle
2410 start_element_idx=my_element_idx
2413 xi=[0.0_dp,1.0_dp/(
REAL(2*nodes_in_xi_2)),1.0_dp/(
REAL(2*nodes_in_xi_3))]
2416 DO n3=1,nodes_in_xi_3
2417 DO n2=1,nodes_in_xi_2
2418 fibre_idx=fibre_idx+1
2423 interpolation_parameters=>equations_set%EQUATIONS%INTERPOLATION%DEPENDENT_INTERP_PARAMETERS &
2424 & (field_u_variable_type)%PTR
2425 CALL field_interpolation_parameters_element_get(field_values_set_type,ne,interpolation_parameters, &
2427 interpolated_point=>equations_set%EQUATIONS%INTERPOLATION%DEPENDENT_INTERP_POINT(field_u_variable_type)%PTR
2430 gauss_positions=>geometric_field_elasticity%DECOMPOSITION%DOMAIN(geometric_field_elasticity%DECOMPOSITION% &
2431 & mesh_component_number)%PTR%TOPOLOGY%ELEMENTS%ELEMENTS(ne)%BASIS%QUADRATURE%QUADRATURE_SCHEME_MAP( &
2434 DO n1=1,nodes_in_xi_1
2438 CALL field_parameter_set_update_local_node(independent_field_monodomain,field_v_variable_type, &
2439 & field_values_set_type,1,1,node_idx,3,fibre_idx,err,error,*999)
2442 CALL field_interpolate_xi(
no_part_deriv,xi,interpolated_point,err,error,*999)
2445 CALL field_parameter_set_update_local_node(dependent_field_monodomain,field_v_variable_type, &
2446 & field_values_set_type,1,1,node_idx,1,interpolated_point%VALUES(1,1),err,error,*999)
2447 CALL field_parameter_set_update_local_node(dependent_field_monodomain,field_v_variable_type, &
2448 & field_values_set_type,1,1,node_idx,2,interpolated_point%VALUES(2,1),err,error,*999)
2449 CALL field_parameter_set_update_local_node(dependent_field_monodomain,field_v_variable_type, &
2450 & field_values_set_type,1,1,node_idx,3,interpolated_point%VALUES(3,1),err,error,*999)
2452 IF((n1==1).AND.(ne==start_element))
THEN 2454 CALL field_parameter_set_update_local_node(geometric_field_monodomain,field_u_variable_type, &
2455 & field_values_set_type,1,1,node_idx,1,0.0_dp,err,error,*999)
2458 dof_idx2=field_var_dep_m%COMPONENTS(1)%PARAM_TO_DOF_MAP%NODE_PARAM2DOF_MAP%NODES(node_idx-1)% &
2459 & derivatives(1)%VERSIONS(1)
2460 CALL field_parameter_set_get_local_dof(dependent_field_monodomain,field_v_variable_type, &
2461 & field_values_set_type,dof_idx2,previous_node(1),err,error,*999)
2462 dof_idx2=field_var_dep_m%COMPONENTS(2)%PARAM_TO_DOF_MAP%NODE_PARAM2DOF_MAP%NODES(node_idx-1)% &
2463 & derivatives(1)%VERSIONS(1)
2464 CALL field_parameter_set_get_local_dof(dependent_field_monodomain,field_v_variable_type, &
2465 & field_values_set_type,dof_idx2,previous_node(2),err,error,*999)
2466 dof_idx2=field_var_dep_m%COMPONENTS(3)%PARAM_TO_DOF_MAP%NODE_PARAM2DOF_MAP%NODES(node_idx-1)% &
2467 & derivatives(1)%VERSIONS(1)
2468 CALL field_parameter_set_get_local_dof(dependent_field_monodomain,field_v_variable_type, &
2469 & field_values_set_type,dof_idx2,previous_node(3),err,error,*999)
2473 & (interpolated_point%VALUES(1,1)-previous_node(1))*(interpolated_point%VALUES(1,1)-previous_node(1))+ &
2474 & (interpolated_point%VALUES(2,1)-previous_node(2))*(interpolated_point%VALUES(2,1)-previous_node(2))+ &
2475 & (interpolated_point%VALUES(3,1)-previous_node(3))*(interpolated_point%VALUES(3,1)-previous_node(3)))
2478 dof_idx2=field_var_geo_m%COMPONENTS(1)%PARAM_TO_DOF_MAP%NODE_PARAM2DOF_MAP%NODES(node_idx-1)% &
2479 & derivatives(1)%VERSIONS(1)
2480 CALL field_parameter_set_get_local_dof(geometric_field_monodomain,field_u_variable_type, &
2481 & field_values_set_type,dof_idx2,value_left,err,error,*999)
2483 CALL field_parameter_set_update_local_node(geometric_field_monodomain,field_u_variable_type, &
2484 & field_values_set_type,1,1,node_idx,1,value_left+dist,err,error,*999)
2488 IF(calc_closest_gauss_point)
THEN 2490 distance=1000000.0_dp
2492 DO gauss_idx=1,
SIZE(gauss_positions,2)
2495 & (xi(1)-gauss_positions(1,gauss_idx))*(xi(1)-gauss_positions(1,gauss_idx))+ &
2496 & (xi(2)-gauss_positions(2,gauss_idx))*(xi(2)-gauss_positions(2,gauss_idx))+ &
2497 & (xi(3)-gauss_positions(3,gauss_idx))*(xi(3)-gauss_positions(3,gauss_idx)))
2498 IF(
VALUE<distance)
THEN 2500 gauss_point=gauss_idx
2503 IF(gauss_point==0)
CALL flag_warning(
"Closest Gauss Point not found",err,error,*999)
2505 CALL field_parameter_set_update_local_node(independent_field_monodomain,field_v_variable_type, &
2506 & field_values_set_type,1,1,node_idx,4,gauss_point,err,error,*999)
2507 CALL field_parameter_set_update_local_node(independent_field_monodomain,field_v_variable_type, &
2508 & field_values_set_type,1,1,node_idx,5,ne,err,error,*999)
2511 IF(start_elem==1)
THEN 2513 xi(1)=xi(1)+1.0_dp/(
REAL(nodes_in_xi_1-1))
2514 ELSEIF(start_elem==0)
THEN 2516 xi(1)=xi(1)+1.0_dp/(
REAL(nodes_in_xi_1))
2518 local_error=
"The start element index is incorrect. The index is "// &
2520 &
" and should be zero or one." 2521 CALL flagerror(local_error,err,error,*999)
2528 IF(elements_topology%ELEMENTS(my_element_idx)%ADJACENT_ELEMENTS(1)%NUMBER_OF_ADJACENT_ELEMENTS==0)
EXIT 2531 ne=elements_topology%ELEMENTS(my_element_idx)%ADJACENT_ELEMENTS(1)%ADJACENT_ELEMENTS(1)
2534 dof_idx=field_var_ind_fe%COMPONENTS(4)%PARAM_TO_DOF_MAP%ELEMENT_PARAM2DOF_MAP%ELEMENTS(ne)
2535 CALL field_parameter_set_get_local_dof(independent_field_elasticity,field_v_variable_type, &
2536 & field_values_set_type,dof_idx,start_elem,err,error,*999)
2538 IF (start_elem==1)
THEN 2539 ne=elements_topology%ELEMENTS(element_idx)%LOCAL_NUMBER
2545 DO idx=1,elements_topology%NUMBER_OF_ELEMENTS
2546 IF(ne==elements_topology%ELEMENTS(idx)%ADJACENT_ELEMENTS(0)%ADJACENT_ELEMENTS(1))
THEN 2551 IF(my_element_idx==0)
CALL flagerror(
"my_element_idx not found.",err,error,*999)
2553 dof_idx=field_var_ind_fe%COMPONENTS(1)%PARAM_TO_DOF_MAP%ELEMENT_PARAM2DOF_MAP%ELEMENTS(ne)
2554 CALL field_parameter_set_get_local_dof(independent_field_elasticity,field_v_variable_type, &
2555 & field_values_set_type,dof_idx,nodes_in_xi_1,err,error,*999)
2559 xi(1)=1.0_dp/(
REAL(nodes_in_xi_1))
2565 dof_idx=field_var_ind_fe%COMPONENTS(1)%PARAM_TO_DOF_MAP%ELEMENT_PARAM2DOF_MAP%ELEMENTS(ne)
2566 CALL field_parameter_set_get_local_dof(independent_field_elasticity,field_v_variable_type, &
2567 & field_values_set_type,dof_idx,nodes_in_xi_1,err,error,*999)
2569 my_element_idx=start_element_idx
2572 xi(2)=xi(2)+1.0_dp/(
REAL(nodes_in_xi_2))
2575 xi(2)=1.0_dp/(
REAL(2*nodes_in_xi_2))
2576 xi(3)=xi(3)+1.0_dp/(
REAL(nodes_in_xi_3))
2582 local_error=
"The third problem specification of "// &
2584 &
" is not valid for a bioelectrics finite elasticity of a multi physics problem." 2585 CALL flagerror(local_error,err,error,*999)
2588 local_error=
"The second problem specification of "// &
2590 &
" is not valid for a multi physics problem." 2591 CALL flagerror(local_error,err,error,*999)
2594 CALL flagerror(
"Control loop problem is not associated.",err,error,*999)
2600 CALL flagerror(
"Control loop is not associated.",err,error,*999)
2603 exits(
"BioelectricFiniteElasticity_UpdateGeometricField")
2605 999
errors(
"BioelectricFiniteElasticity_UpdateGeometricField",err,error)
2606 exits(
"BioelectricFiniteElasticity_UpdateGeometricField")
2621 INTEGER(INTG),
INTENT(OUT) :: ERR
2624 TYPE(
control_loop_type),
POINTER :: CONTROL_LOOP_ROOT,CONTROL_LOOP_PARENT,CONTROL_LOOP_ELASTICITY,CONTROL_LOOP_MONODOMAIN
2628 TYPE(
field_type),
POINTER :: INDEPENDENT_FIELD_MONODOMAIN,INDEPENDENT_FIELD_ELASTICITY
2635 INTEGER(INTG) :: node_idx,element_idx,gauss_idx,ne
2636 INTEGER(INTG) :: nearestGP,inElement,dof_idx
2637 INTEGER(INTG) :: NUMBER_OF_GAUSS_POINTS
2638 REAL(DP) :: ACTIVE_STRESS
2639 REAL(DP) :: TITIN_STRESS_UNBOUND,TITIN_STRESS_BOUND,TITIN_STRESS_CROSS_FIBRE_UNBOUND,TITIN_STRESS_CROSS_FIBRE_BOUND,ACTIVATION
2640 INTEGER(INTG),
PARAMETER :: MAX_NUMBER_OF_GAUSS_POINTS=64
2641 INTEGER(INTG) :: NUMBER_OF_NODES(max_number_of_gauss_points)
2642 REAL(DP) :: ACTIVE_STRESS_VALUES(max_number_of_gauss_points)
2643 REAL(DP) :: TITIN_STRESS_VALUES_UNBOUND(max_number_of_gauss_points),TITIN_STRESS_VALUES_BOUND(max_number_of_gauss_points)
2644 REAL(DP) :: TITIN_STRESS_VALUES_CROSS_FIBRE_UNBOUND(max_number_of_gauss_points)
2645 REAL(DP) :: TITIN_STRESS_VALUES_CROSS_FIBRE_BOUND(max_number_of_gauss_points)
2646 REAL(DP) :: ACTIVATION_VALUES(max_number_of_gauss_points)
2647 REAL(DP) :: A_1,A_2,x_1,x_2
2648 REAL(DP) :: A_1_VALUES(max_number_of_gauss_points),A_2_VALUES(max_number_of_gauss_points), &
2649 & x_1_VALUES(MAX_NUMBER_OF_GAUSS_POINTS),x_2_VALUES(MAX_NUMBER_OF_GAUSS_POINTS)
2651 NULLIFY(control_loop_parent)
2652 NULLIFY(control_loop_monodomain)
2653 NULLIFY(control_loop_elasticity)
2656 NULLIFY(field_variable_u)
2657 NULLIFY(field_variable_v)
2658 NULLIFY(field_variable_fe)
2660 enters(
"BioelectricFiniteElasticity_IndependentFieldInterpolate",err,error,*999)
2662 IF(
ASSOCIATED(control_loop))
THEN 2663 problem=>control_loop%PROBLEM
2664 IF(
ASSOCIATED(problem))
THEN 2665 IF(.NOT.
ALLOCATED(problem%specification))
THEN 2666 CALL flagerror(
"Problem specification is not allocated.",err,error,*999)
2667 ELSE IF(
SIZE(problem%specification,1)<3)
THEN 2668 CALL flagerror(
"Problem specification must have three entries for a bioelectric-finite elasticity problem.", &
2671 SELECT CASE(problem%SPECIFICATION(3))
2674 IF(control_loop%NUMBER_OF_SUB_LOOPS==0)
THEN 2675 control_loop_root=>problem%CONTROL_LOOP
2681 solver_equations=>solver%SOLVER_EQUATIONS
2682 IF(
ASSOCIATED(solver_equations))
THEN 2683 solver_mapping=>solver_equations%SOLVER_MAPPING
2684 IF(
ASSOCIATED(solver_mapping))
THEN 2685 equations_set=>solver_mapping%EQUATIONS_SETS(1)%PTR
2686 IF(
ASSOCIATED(equations_set))
THEN 2687 independent_field_monodomain=>equations_set%INDEPENDENT%INDEPENDENT_FIELD
2688 IF(.NOT.
ASSOCIATED(independent_field_monodomain))
CALL flagerror(
"Independent field is not associated.", &
2691 CALL flagerror(
"Equations set is not associated.",err,error,*999)
2694 CALL flagerror(
"Solver mapping is not associated.",err,error,*999)
2697 CALL flagerror(
"Solver equations is not associated.",err,error,*999)
2706 solver_equations=>solver%SOLVER_EQUATIONS
2707 IF(
ASSOCIATED(solver_equations))
THEN 2708 solver_mapping=>solver_equations%SOLVER_MAPPING
2709 IF(
ASSOCIATED(solver_mapping))
THEN 2710 equations_set=>solver_mapping%EQUATIONS_SETS(1)%PTR
2711 IF(
ASSOCIATED(equations_set))
THEN 2712 independent_field_elasticity=>equations_set%INDEPENDENT%INDEPENDENT_FIELD
2713 IF(.NOT.
ASSOCIATED(independent_field_elasticity))
CALL flagerror(
"Independent field is not associated.",err, &
2716 CALL flagerror(
"Equations set is not associated.",err,error,*999)
2719 CALL flagerror(
"Solver mapping is not associated.",err,error,*999)
2722 CALL flagerror(
"Solver equations is not associated.",err,error,*999)
2726 elements_mapping=>independent_field_elasticity%DECOMPOSITION%DOMAIN(independent_field_elasticity%DECOMPOSITION% &
2727 & mesh_component_number)%PTR%MAPPINGS%ELEMENTS
2728 nodes_mapping=>independent_field_monodomain%DECOMPOSITION%DOMAIN(independent_field_monodomain%DECOMPOSITION% &
2729 & mesh_component_number)%PTR%MAPPINGS%NODES
2731 CALL field_variable_get(independent_field_monodomain,field_u_variable_type,field_variable_u,err,error,*999)
2732 CALL field_variable_get(independent_field_monodomain,field_v_variable_type,field_variable_v,err,error,*999)
2733 CALL field_variable_get(independent_field_elasticity,field_u_variable_type,field_variable_fe,err,error,*999)
2737 DO element_idx=elements_mapping%INTERNAL_START,elements_mapping%BOUNDARY_FINISH
2738 ne=elements_mapping%DOMAIN_LIST(element_idx)
2740 number_of_gauss_points=independent_field_elasticity%DECOMPOSITION%DOMAIN(independent_field_elasticity% &
2741 & decomposition%MESH_COMPONENT_NUMBER)%PTR%TOPOLOGY%ELEMENTS%ELEMENTS(ne)%BASIS%QUADRATURE%QUADRATURE_SCHEME_MAP &
2744 IF(number_of_gauss_points>max_number_of_gauss_points)
CALL flagerror( &
2745 &
"NUMBER_OF_GAUSS_POINTS is greater than MAX_NUMBER_OF_GAUSS_POINTS.",err,error,*999)
2747 active_stress_values=0.0_dp
2748 titin_stress_values_unbound=0.0_dp
2749 titin_stress_values_bound=0.0_dp
2750 titin_stress_values_cross_fibre_unbound=0.0_dp
2751 titin_stress_values_cross_fibre_bound=0.0_dp
2752 activation_values=0.0_dp
2759 DO node_idx=1,nodes_mapping%NUMBER_OF_LOCAL
2760 dof_idx=field_variable_v%COMPONENTS(5)%PARAM_TO_DOF_MAP%NODE_PARAM2DOF_MAP%NODES(node_idx)%DERIVATIVES(1)% &
2762 CALL field_parameter_set_get_local_dof(independent_field_monodomain,field_v_variable_type,field_values_set_type, &
2763 & dof_idx,inelement,err,error,*999)
2766 IF(inelement==ne)
THEN 2768 dof_idx=field_variable_v%COMPONENTS(4)%PARAM_TO_DOF_MAP%NODE_PARAM2DOF_MAP%NODES(node_idx)%DERIVATIVES(1)% &
2770 CALL field_parameter_set_get_local_dof(independent_field_monodomain,field_v_variable_type,field_values_set_type, &
2771 & dof_idx,nearestgp,err,error,*999)
2772 IF(nearestgp>max_number_of_gauss_points)
CALL flagerror( &
2773 &
"Nearest Gauss Point is greater than MAX_NUMBER_OF_GAUSS_POINTS.",err,error,*999)
2775 SELECT CASE(problem%SPECIFICATION(3))
2779 dof_idx=field_variable_u%COMPONENTS(1)%PARAM_TO_DOF_MAP%NODE_PARAM2DOF_MAP%NODES(node_idx)%DERIVATIVES(1)% &
2781 CALL field_parameter_set_get_local_dof(independent_field_monodomain,field_u_variable_type, &
2782 & field_values_set_type,dof_idx,active_stress,err,error,*999)
2785 number_of_nodes(nearestgp)=number_of_nodes(nearestgp)+1
2787 active_stress_values(nearestgp)=active_stress_values(nearestgp)+active_stress
2792 dof_idx=field_variable_u%COMPONENTS(1)%PARAM_TO_DOF_MAP%NODE_PARAM2DOF_MAP%NODES(node_idx)%DERIVATIVES(1)% &
2794 CALL field_parameter_set_get_local_dof(independent_field_monodomain,field_u_variable_type, &
2795 & field_values_set_type,dof_idx,active_stress,err,error,*999)
2798 number_of_nodes(nearestgp)=number_of_nodes(nearestgp)+1
2800 active_stress_values(nearestgp)=active_stress_values(nearestgp)+active_stress
2803 dof_idx=field_variable_u%COMPONENTS(2)%PARAM_TO_DOF_MAP%NODE_PARAM2DOF_MAP%NODES(node_idx)%DERIVATIVES(1)% &
2805 CALL field_parameter_set_get_local_dof(independent_field_monodomain,field_u_variable_type, &
2806 & field_values_set_type,dof_idx,titin_stress_unbound,err,error,*999)
2808 dof_idx=field_variable_u%COMPONENTS(3)%PARAM_TO_DOF_MAP%NODE_PARAM2DOF_MAP%NODES(node_idx)%DERIVATIVES(1)% &
2810 CALL field_parameter_set_get_local_dof(independent_field_monodomain,field_u_variable_type, &
2811 & field_values_set_type,dof_idx,titin_stress_bound,err,error,*999)
2813 dof_idx=field_variable_u%COMPONENTS(4)%PARAM_TO_DOF_MAP%NODE_PARAM2DOF_MAP%NODES(node_idx)%DERIVATIVES(1)% &
2815 CALL field_parameter_set_get_local_dof(independent_field_monodomain,field_u_variable_type, &
2816 & field_values_set_type,dof_idx,titin_stress_cross_fibre_unbound,err,error,*999)
2818 dof_idx=field_variable_u%COMPONENTS(5)%PARAM_TO_DOF_MAP%NODE_PARAM2DOF_MAP%NODES(node_idx)%DERIVATIVES(1)% &
2820 CALL field_parameter_set_get_local_dof(independent_field_monodomain,field_u_variable_type, &
2821 & field_values_set_type,dof_idx,titin_stress_cross_fibre_bound,err,error,*999)
2823 dof_idx=field_variable_u%COMPONENTS(6)%PARAM_TO_DOF_MAP%NODE_PARAM2DOF_MAP%NODES(node_idx)%DERIVATIVES(1)% &
2825 CALL field_parameter_set_get_local_dof(independent_field_monodomain,field_u_variable_type, &
2826 & field_values_set_type,dof_idx,activation,err,error,*999)
2828 titin_stress_values_unbound(nearestgp)=titin_stress_values_unbound(nearestgp)+titin_stress_unbound
2829 titin_stress_values_bound(nearestgp)=titin_stress_values_bound(nearestgp)+titin_stress_bound
2830 titin_stress_values_cross_fibre_unbound(nearestgp)=titin_stress_values_cross_fibre_unbound(nearestgp) + &
2831 & titin_stress_cross_fibre_unbound
2832 titin_stress_values_cross_fibre_bound(nearestgp)=titin_stress_values_cross_fibre_bound(nearestgp) + &
2833 & titin_stress_cross_fibre_bound
2834 activation_values(nearestgp)=activation_values(nearestgp)+activation
2839 number_of_nodes(nearestgp)=number_of_nodes(nearestgp)+1
2842 dof_idx=field_variable_u%COMPONENTS(1)%PARAM_TO_DOF_MAP%NODE_PARAM2DOF_MAP%NODES(node_idx)%DERIVATIVES(1)% &
2844 CALL field_parameter_set_get_local_dof(independent_field_monodomain,field_u_variable_type, &
2845 & field_values_set_type,dof_idx,a_1,err,error,*999)
2847 dof_idx=field_variable_u%COMPONENTS(2)%PARAM_TO_DOF_MAP%NODE_PARAM2DOF_MAP%NODES(node_idx)%DERIVATIVES(1)% &
2849 CALL field_parameter_set_get_local_dof(independent_field_monodomain,field_u_variable_type, &
2850 & field_values_set_type,dof_idx,a_2,err,error,*999)
2852 dof_idx=field_variable_u%COMPONENTS(3)%PARAM_TO_DOF_MAP%NODE_PARAM2DOF_MAP%NODES(node_idx)%DERIVATIVES(1)% &
2854 CALL field_parameter_set_get_local_dof(independent_field_monodomain,field_u_variable_type, &
2855 & field_values_set_type,dof_idx,x_1,err,error,*999)
2857 dof_idx=field_variable_u%COMPONENTS(4)%PARAM_TO_DOF_MAP%NODE_PARAM2DOF_MAP%NODES(node_idx)%DERIVATIVES(1)% &
2859 CALL field_parameter_set_get_local_dof(independent_field_monodomain,field_u_variable_type, &
2860 & field_values_set_type,dof_idx,x_2,err,error,*999)
2862 a_1_values(nearestgp)=a_1_values(nearestgp)+a_1
2863 a_2_values(nearestgp)=a_2_values(nearestgp)+a_2
2864 x_1_values(nearestgp)=x_1_values(nearestgp)+x_1
2865 x_2_values(nearestgp)=x_2_values(nearestgp)+x_2
2872 DO gauss_idx=1,number_of_gauss_points
2874 IF(number_of_nodes(gauss_idx)<=0)
THEN 2875 active_stress=0.0_dp
2876 titin_stress_unbound=0.0_dp
2877 titin_stress_bound=0.0_dp
2878 titin_stress_cross_fibre_unbound=0.0_dp
2879 titin_stress_cross_fibre_bound=0.0_dp
2886 active_stress=active_stress_values(gauss_idx)/number_of_nodes(gauss_idx)
2887 titin_stress_unbound=titin_stress_values_unbound(gauss_idx)/number_of_nodes(gauss_idx)
2888 titin_stress_bound=titin_stress_values_bound(gauss_idx)/number_of_nodes(gauss_idx)
2889 titin_stress_cross_fibre_unbound=titin_stress_values_cross_fibre_unbound(gauss_idx)/number_of_nodes(gauss_idx)
2890 titin_stress_cross_fibre_bound=titin_stress_values_cross_fibre_bound(gauss_idx)/ &
2891 & number_of_nodes(gauss_idx)
2892 activation=activation_values(gauss_idx)/number_of_nodes(gauss_idx)
2893 a_1=a_1_values(gauss_idx)/number_of_nodes(gauss_idx)
2894 a_2=a_2_values(gauss_idx)/number_of_nodes(gauss_idx)
2895 x_1=x_1_values(gauss_idx)/number_of_nodes(gauss_idx)
2896 x_2=x_2_values(gauss_idx)/number_of_nodes(gauss_idx)
2899 SELECT CASE(problem%SPECIFICATION(3))
2902 dof_idx=field_variable_fe%COMPONENTS(1)%PARAM_TO_DOF_MAP%GAUSS_POINT_PARAM2DOF_MAP%GAUSS_POINTS(gauss_idx,ne)
2903 CALL field_parameter_set_update_local_dof(independent_field_elasticity,field_u_variable_type, &
2904 & field_values_set_type,dof_idx,active_stress,err,error,*999)
2908 dof_idx=field_variable_fe%COMPONENTS(1)%PARAM_TO_DOF_MAP%GAUSS_POINT_PARAM2DOF_MAP%GAUSS_POINTS(gauss_idx,ne)
2909 CALL field_parameter_set_update_local_dof(independent_field_elasticity,field_u_variable_type, &
2910 & field_values_set_type,dof_idx,active_stress,err,error,*999)
2911 dof_idx=field_variable_fe%COMPONENTS(2)%PARAM_TO_DOF_MAP%GAUSS_POINT_PARAM2DOF_MAP%GAUSS_POINTS(gauss_idx,ne)
2912 CALL field_parameter_set_update_local_dof(independent_field_elasticity,field_u_variable_type, &
2913 & field_values_set_type,dof_idx,titin_stress_unbound,err,error,*999)
2914 dof_idx=field_variable_fe%COMPONENTS(3)%PARAM_TO_DOF_MAP%GAUSS_POINT_PARAM2DOF_MAP%GAUSS_POINTS(gauss_idx,ne)
2915 CALL field_parameter_set_update_local_dof(independent_field_elasticity,field_u_variable_type, &
2916 & field_values_set_type,dof_idx,titin_stress_bound,err,error,*999)
2917 dof_idx=field_variable_fe%COMPONENTS(4)%PARAM_TO_DOF_MAP%GAUSS_POINT_PARAM2DOF_MAP%GAUSS_POINTS(gauss_idx,ne)
2918 CALL field_parameter_set_update_local_dof(independent_field_elasticity,field_u_variable_type, &
2919 & field_values_set_type,dof_idx,titin_stress_cross_fibre_unbound,err,error,*999)
2920 dof_idx=field_variable_fe%COMPONENTS(5)%PARAM_TO_DOF_MAP%GAUSS_POINT_PARAM2DOF_MAP%GAUSS_POINTS(gauss_idx,ne)
2921 CALL field_parameter_set_update_local_dof(independent_field_elasticity,field_u_variable_type, &
2922 & field_values_set_type,dof_idx,titin_stress_cross_fibre_bound,err,error,*999)
2923 dof_idx=field_variable_fe%COMPONENTS(6)%PARAM_TO_DOF_MAP%GAUSS_POINT_PARAM2DOF_MAP%GAUSS_POINTS(gauss_idx,ne)
2924 CALL field_parameter_set_update_local_dof(independent_field_elasticity,field_u_variable_type, &
2925 & field_values_set_type,dof_idx,activation,err,error,*999)
2929 dof_idx=field_variable_fe%COMPONENTS(1)%PARAM_TO_DOF_MAP%GAUSS_POINT_PARAM2DOF_MAP%GAUSS_POINTS(gauss_idx,ne)
2930 CALL field_parameter_set_update_local_dof(independent_field_elasticity,field_u_variable_type, &
2931 & field_values_set_type,dof_idx,a_1,err,error,*999)
2932 dof_idx=field_variable_fe%COMPONENTS(2)%PARAM_TO_DOF_MAP%GAUSS_POINT_PARAM2DOF_MAP%GAUSS_POINTS(gauss_idx,ne)
2933 CALL field_parameter_set_update_local_dof(independent_field_elasticity,field_u_variable_type, &
2934 & field_values_set_type,dof_idx,a_2,err,error,*999)
2935 dof_idx=field_variable_fe%COMPONENTS(3)%PARAM_TO_DOF_MAP%GAUSS_POINT_PARAM2DOF_MAP%GAUSS_POINTS(gauss_idx,ne)
2936 CALL field_parameter_set_update_local_dof(independent_field_elasticity,field_u_variable_type, &
2937 & field_values_set_type,dof_idx,x_1,err,error,*999)
2938 dof_idx=field_variable_fe%COMPONENTS(4)%PARAM_TO_DOF_MAP%GAUSS_POINT_PARAM2DOF_MAP%GAUSS_POINTS(gauss_idx,ne)
2939 CALL field_parameter_set_update_local_dof(independent_field_elasticity,field_u_variable_type, &
2940 & field_values_set_type,dof_idx,x_2,err,error,*999)
2948 CALL field_parameter_set_update_start(independent_field_elasticity, &
2949 & field_u_variable_type,field_values_set_type,err,error,*999)
2950 CALL field_parameter_set_update_finish(independent_field_elasticity, &
2951 & field_u_variable_type,field_values_set_type,err,error,*999)
2955 local_error=
"Independent field interpolation is not implemented for problem subtype " &
2957 CALL flagerror(local_error,err,error,*999)
2960 CALL flagerror(
"Problem is not associated.",err,error,*999)
2963 CALL flagerror(
"Control loop is not associated.",err,error,*999)
2966 exits(
"BioelectricFiniteElasticity_IndependentFieldInterpolate")
2968 999
errors(
"BioelectricFiniteElasticity_IndependentFieldInterpolate",err,error)
2969 exits(
"BioelectricFiniteElasticity_IndependentFieldInterpolate")
2984 INTEGER(INTG),
INTENT(OUT) :: ERR
2987 TYPE(
control_loop_type),
POINTER :: CONTROL_LOOP_ROOT,CONTROL_LOOP_PARENT,CONTROL_LOOP_MONODOMAIN
2991 TYPE(
field_type),
POINTER :: INDEPENDENT_FIELD_MONODOMAIN
2997 INTEGER(INTG) :: node_idx,dof_idx
2998 REAL(DP),
PARAMETER :: LENGTH_ACTIN=1.04_dp,length_mband=0.0625_dp,length_myosin=0.7375_dp
2999 REAL(DP),
PARAMETER :: LENGTH_ZERO=0.635_dp,length_zdisc=0.05_dp
3000 REAL(DP) :: F0,FORCE,TITIN_BOUND,TITIN_XF_BOUND,TITIN_UNBOUND,TITIN_XF_UNBOUND
3001 REAL(DP) :: ELONGATION,ELONGATION_NEW
3002 REAL(DP) :: ELONGATION_DIST_IG,ELONGATION_PEVK
3003 REAL(DP) :: LENGTH_TITIN,LENGTH_INIT_TITIN,LENGTH_DIST_IG_F0,LENGTH_DIST_IG
3004 REAL(DP) :: STIFFNESS_PEVK
3005 REAL(DP) :: SARCO_LENGTH_AT_ACTIVATION,SARCO_LENGTH
3006 REAL(DP) :: ACTIN_MYOSIN_DISTANCE,d10
3007 REAL(DP) :: SLOPE,STIFFNESS_DIST,FORCE_DISTAL_IG,DELTA_F,DIFF_QUOT
3008 REAL(DP),
PARAMETER,
DIMENSION(5) :: COEFF_MATRIX=[5.0239_dp,-0.6717_dp,-2.5841_dp,-5.0128_dp,-5.0239_dp]
3009 REAL(DP),
DIMENSION(250) :: LENGTHS_DIST_IG,FORCES_DIST_IG
3010 REAL(DP),
PARAMETER :: DX=0.001_dp
3011 REAL(DP),
PARAMETER :: FORCE_INCREMENT=1.e-5_dp,tol=1.e-5_dp
3012 INTEGER(INTG) :: INDEX_REF,INDEX_PSEUDO,INDEX_I
3013 INTEGER(INTG),
PARAMETER :: DIM_DATA=250
3014 INTEGER(INTG) :: SWITCH_MODEL
3016 NULLIFY(control_loop_root)
3017 NULLIFY(control_loop_parent)
3018 NULLIFY(control_loop_monodomain)
3022 NULLIFY(independent_field_monodomain)
3023 NULLIFY(solver_equations)
3024 NULLIFY(solver_mapping)
3025 NULLIFY(equations_set)
3026 NULLIFY(field_var_ind_m)
3028 enters(
"BIOELECTRIC_FINITE_ELASTICITY_COMPUTE_TITIN",err,error,*999)
3032 & [0.0_dp,0.001_dp,0.002_dp,0.003_dp,0.004_dp,0.005_dp,0.006_dp,0.007_dp,0.008_dp,0.009_dp,0.01_dp,0.011_dp,0.012_dp, &
3033 & 0.013_dp,0.014_dp,0.015_dp,0.016_dp,0.017_dp,0.018_dp,0.019_dp,0.02_dp,0.021_dp,0.022_dp,0.023_dp,0.024_dp, &
3034 & 0.025_dp,0.026_dp,0.027_dp,0.028_dp,0.029_dp,0.03_dp,0.031_dp,0.032_dp,0.033_dp,0.034_dp,0.035_dp,0.036_dp, &
3035 & 0.037_dp,0.038_dp,0.039_dp,0.04_dp,0.041_dp,0.042_dp,0.043_dp,0.044_dp,0.045_dp,0.046_dp,0.047_dp,0.048_dp, &
3036 & 0.049_dp,0.05_dp,0.051_dp,0.052_dp,0.053_dp,0.054_dp,0.055_dp,0.056_dp,0.057_dp,0.058_dp,0.059_dp,0.06_dp, &
3037 & 0.061_dp,0.062_dp,0.063_dp,0.064_dp,0.065_dp,0.066_dp,0.067_dp,0.068_dp,0.069_dp,0.070_dp,0.071_dp,0.072_dp, &
3038 & 0.073_dp,0.074_dp,0.075_dp,0.076_dp,0.077_dp,0.078_dp,0.079_dp,0.080_dp,0.081_dp,0.082_dp,0.083_dp,0.084_dp, &
3039 & 0.085_dp,0.086_dp,0.087_dp,0.088_dp,0.089_dp,0.090_dp,0.091_dp,0.092_dp,0.093_dp,0.094_dp,0.095_dp,0.096_dp, &
3040 & 0.097_dp,0.098_dp,0.099_dp,0.1_dp,0.101_dp,0.102_dp,0.103_dp,0.104_dp,0.105_dp,0.106_dp,0.107_dp,0.108_dp, &
3041 & 0.109_dp,0.11_dp,0.111_dp,0.112_dp,0.113_dp,0.114_dp,0.115_dp,0.116_dp,0.117_dp,0.118_dp,0.119_dp,0.12_dp, &
3042 & 0.121_dp,0.122_dp,0.123_dp,0.124_dp,0.125_dp,0.126_dp,0.127_dp,0.128_dp,0.129_dp,0.13_dp,0.131_dp,0.132_dp, &
3043 & 0.133_dp,0.134_dp,0.135_dp,0.136_dp,0.137_dp,0.138_dp,0.139_dp,0.14_dp,0.141_dp,0.142_dp,0.143_dp,0.144_dp, &
3044 & 0.145_dp,0.146_dp,0.147_dp,0.148_dp,0.149_dp,0.15_dp,0.151_dp,0.152_dp,0.153_dp,0.154_dp,0.155_dp,0.156_dp, &
3045 & 0.157_dp,0.158_dp,0.159_dp,0.16_dp,0.161_dp,0.162_dp,0.163_dp,0.164_dp,0.165_dp,0.166_dp,0.167_dp, 0.168_dp, &
3046 & 0.169_dp,0.17_dp,0.171_dp,0.172_dp,0.173_dp,0.174_dp,0.175_dp,0.176_dp,0.177_dp,0.178_dp,0.179_dp,0.18_dp, &
3047 & 0.181_dp,0.182_dp,0.183_dp,0.184_dp,0.185_dp,0.186_dp,0.187_dp,0.188_dp,0.189_dp,0.19_dp,0.191_dp,0.192_dp, &
3048 & 0.193_dp,0.194_dp,0.195_dp,0.196_dp,0.197_dp,0.198_dp,0.199_dp,0.2_dp,0.201_dp,0.202_dp,0.203_dp,0.204_dp, &
3049 & 0.205_dp,0.206_dp,0.207_dp,0.208_dp,0.209_dp,0.21_dp,0.211_dp,0.212_dp,0.213_dp,0.214_dp,0.215_dp,0.216_dp, &
3050 & 0.217_dp,0.218_dp,0.219_dp,0.22_dp,0.221_dp,0.222_dp,0.223_dp,0.224_dp,0.225_dp,0.226_dp,0.227_dp,0.228_dp, &
3051 & 0.229_dp,0.23_dp,0.231_dp,0.232_dp,0.233_dp,0.234_dp,0.235_dp,0.236_dp,0.237_dp,0.238_dp,0.239_dp,0.24_dp, &
3052 & 0.241_dp,0.242_dp,0.243_dp,0.244_dp,0.245_dp,0.246_dp,0.247_dp,0.248_dp,0.249_dp]
3054 & [0.0_dp,0.03461753545561_dp,0.049729169766010_dp,0.058506390323323_dp,0.064606296848594_dp,0.06922519775133_dp, &
3055 & 0.0729080120998386_dp,0.0759458896446241_dp,0.0785230355395668_dp,0.0807314335143191_dp,0.0826674161660979_dp, &
3056 & 0.0843819721302_dp,0.0859161360822_dp,0.087300738288_dp,0.0885510536196_dp,0.08970061165_dp,0.090751366_dp, &
3057 & 0.0917285714001_dp,0.0926271710799_dp,0.093467026018_dp,0.094254010845_dp,0.094992014919_dp,0.09568255451_dp, &
3058 & 0.0963346932312_dp,0.0969518155718_dp,0.097537000419_dp,0.098093047899_dp,0.098622503780_dp,0.09912768169_dp, &
3059 & 0.0996103583026_dp,0.1000734170008_dp,0.100517614158_dp,0.100942907967_dp,0.101351270601_dp,0.101745244913_dp, &
3060 & 0.1021260518375_dp,0.1024947934706_dp,0.102851281365_dp,0.103194317381_dp,0.103528086731_dp,0.103853341524_dp, &
3061 & 0.1041686065999_dp,0.1044739635997_dp,0.104772842609_dp,0.105064758806_dp,0.105347078318_dp,0.105624524436_dp, &
3062 & 0.1058959740402_dp,0.1061596374590_dp,0.106419674124_dp,0.106673222977_dp,0.106921779223_dp,0.107167251003_dp, &
3063 & 0.1074055929211_dp,0.1076418938850_dp,0.107872798106_dp,0.108100580266_dp,0.108324935479_dp,0.108545154704_dp, &
3064 & 0.1087634145225_dp,0.1089769308376_dp,0.109189523632_dp,0.109397109133_dp,0.109604335645_dp,0.109806785604_dp, &
3065 & 0.1100090293896_dp,0.1102069598668_dp,0.110404790711_dp,0.110598542577_dp,0.110792294444_dp,0.110982362315_dp, &
3066 & 0.1111722575399_dp,0.1113591719379_dp,0.111545514634_dp,0.111729654458_dp,0.111912731875_dp,0.112094428489_dp, &
3067 & 0.1122745119339_dp,0.1124540532647_dp,0.112631398979_dp,0.112808744694_dp,0.112983883284_dp,0.113158733268_dp, &
3068 & 0.1133324054841_dp,0.1135049882670_dp,0.113677360515_dp,0.113847891889_dp,0.114018423263_dp,0.114187784974_dp, &
3069 & 0.1143564686814_dp,0.1145249703398_dp,0.114691998719_dp,0.114859027099_dp,0.115025270473_dp,0.115190825075_dp, &
3070 & 0.1153563796784_dp,0.1155207617063_dp,0.115685013868_dp,0.115849024045_dp,0.116012135436_dp,0.116175246828_dp, &
3071 & 0.1163378963393_dp,0.1165000194746_dp,0.116662142610_dp,0.116823704015_dp,0.116984982740_dp,0.117146261465_dp, &
3072 & 0.1173069696799_dp,0.1174675396300_dp,0.117628109580_dp,0.117788165045_dp,0.117948154078_dp,0.118108143111_dp, &
3073 & 0.1182677147299_dp,0.1184272433357_dp,0.118586771941_dp,0.118745999791_dp,0.118905181478_dp,0.119064363164_dp, &
3074 & 0.1192233610196_dp,0.1193823026790_dp,0.119541244338_dp,0.119700101992_dp,0.119858904246_dp,0.120017706500_dp, &
3075 & 0.1201764919257_dp,0.1203352494533_dp,0.120494006981_dp,0.120652768322_dp,0.120811570168_dp,0.120970372014_dp, &
3076 & 0.1211291738603_dp,0.1212880693042_dp,0.121446999172_dp,0.121605929041_dp,0.121764923098_dp,0.121924059629_dp, &
3077 & 0.1220831961613_dp,0.1222423326927_dp,0.122401700265_dp,0.122561117298_dp,0.122720534331_dp,0.122880045624_dp, &
3078 & 0.1230398124447_dp,0.1231995792652_dp,0.123359346085_dp,0.123519381317_dp,0.123679562894_dp,0.123839744470_dp, &
3079 & 0.1239999260467_dp,0.1241605622478_dp,0.124321219453_dp,0.124481876659_dp,0.124642637543_dp,0.124803827368_dp, &
3080 & 0.1249650171945_dp,0.1251262070202_dp,0.125287609380_dp,0.125449385133_dp,0.125611160886_dp,0.125772936638_dp, &
3081 & 0.1259350043157_dp,0.1260974158090_dp,0.126259827302_dp,0.126422238795_dp,0.126584979901_dp,0.126748073636_dp, &
3082 & 0.1269111673704_dp,0.1270742611047_dp,0.127237669513_dp,0.127401488846_dp,0.127565308178_dp,0.127729127511_dp, &
3083 & 0.1278931842348_dp,0.1280577695422_dp,0.128222354849_dp,0.128386940157_dp,0.128551614623_dp,0.128717003455_dp, &
3084 & 0.1288823922862_dp,0.1290477811173_dp,0.129213169948_dp,0.129379259581_dp,0.129545486803_dp,0.129711714025_dp, &
3085 & 0.1298779412472_dp,0.1300445897140_dp,0.130211687650_dp,0.130378785586_dp,0.130545883522_dp,0.130713029866_dp, &
3086 & 0.1308810284274_dp,0.1310490269884_dp,0.131217025549_dp,0.131385024110_dp,0.131553528414_dp,0.131722455223_dp, &
3087 & 0.1318913820322_dp,0.1320603088411_dp,0.132229235650_dp,0.132399074312_dp,0.132568954822_dp,0.132738835332_dp, &
3088 & 0.1329087158420_dp,0.1330788764544_dp,0.133249734060_dp,0.133420591667_dp,0.133591449273_dp,0.133762306879_dp, &
3089 & 0.1339336992411_dp,0.1341055553883_dp,0.134277411535_dp,0.134449267682_dp,0.134621123829_dp,0.134793694483_dp, &
3090 & 0.1349665687658_dp,0.1351394430487_dp,0.135312317331_dp,0.135485191614_dp,0.135658878561_dp,0.135832788820_dp, &
3091 & 0.1360066990800_dp,0.1361806093395_dp,0.136354519599_dp,0.136529253243_dp,0.136704215658_dp,0.136879178072_dp, &
3092 & 0.1370541404878_dp,0.1372291029027_dp,0.137404806924_dp,0.137580836098_dp,0.137756865271_dp,0.137932894445_dp, &
3093 & 0.1381089236188_dp,0.1382855157880_dp,0.138462624830_dp,0.138639733872_dp,0.138816842915_dp,0.138993951957_dp, &
3094 & 0.1391713448843_dp,0.1393495454909_dp,0.139527746097_dp,0.139705946704_dp,0.139884147310_dp,0.140062347917_dp, &
3095 & 0.1402415516727_dp,0.1404208541990_dp,0.140600156725270_dp,0.140779459251523_dp,0.140958761777775_dp]
3097 IF(
ASSOCIATED(control_loop))
THEN 3098 problem=>control_loop%PROBLEM
3099 IF(
ASSOCIATED(problem))
THEN 3100 SELECT CASE(problem%SPECIFICATION(3))
3102 IF(control_loop%NUMBER_OF_SUB_LOOPS==0)
THEN 3103 control_loop_root=>problem%CONTROL_LOOP
3110 solver_equations=>solver%SOLVER_EQUATIONS
3111 IF(
ASSOCIATED(solver_equations))
THEN 3112 solver_mapping=>solver_equations%SOLVER_MAPPING
3113 IF(
ASSOCIATED(solver_mapping))
THEN 3114 equations_set=>solver_mapping%EQUATIONS_SETS(1)%PTR
3115 IF(
ASSOCIATED(equations_set))
THEN 3116 independent_field_monodomain=>equations_set%INDEPENDENT%INDEPENDENT_FIELD
3117 IF(.NOT.
ASSOCIATED(independent_field_monodomain))
THEN 3118 CALL flagerror(
"Independent field is not associated.",err,error,*999)
3121 CALL field_variable_get(independent_field_monodomain,field_u1_variable_type,field_var_ind_m,err,error,*999)
3123 nodes_mapping=>independent_field_monodomain%DECOMPOSITION%DOMAIN(independent_field_monodomain%DECOMPOSITION% &
3124 & mesh_component_number)%PTR%MAPPINGS%NODES
3129 DO node_idx=1,nodes_mapping%NUMBER_OF_LOCAL
3132 dof_idx=field_var_ind_m%COMPONENTS(4)%PARAM_TO_DOF_MAP%NODE_PARAM2DOF_MAP%NODES(node_idx)%DERIVATIVES(1)% &
3134 CALL field_parameter_set_get_local_dof(independent_field_monodomain,field_u1_variable_type, &
3135 & field_values_set_type,dof_idx,sarco_length_at_activation,err,error,*999)
3138 dof_idx=field_var_ind_m%COMPONENTS(1)%PARAM_TO_DOF_MAP%NODE_PARAM2DOF_MAP%NODES(node_idx)%DERIVATIVES(1)% &
3140 CALL field_parameter_set_get_local_dof(independent_field_monodomain,field_u1_variable_type, &
3141 & field_values_set_type,dof_idx,sarco_length,err,error,*999)
3143 elongation=sarco_length-sarco_length_at_activation
3145 IF(elongation.LT.0)
THEN 3146 length_titin=sarco_length-length_myosin-length_mband-length_zdisc
3148 titin_unbound=coeff_matrix(1)*exp(length_titin)+coeff_matrix(2)*length_titin**3+coeff_matrix(3)* &
3149 & length_titin**2+coeff_matrix(4)*length_titin+coeff_matrix(5)
3150 CALL field_parameter_set_update_local_node(independent_field_monodomain, &
3151 & field_u_variable_type,field_values_set_type,1,1,node_idx,2,titin_unbound,err,error,*999)
3152 CALL field_parameter_set_update_local_node(independent_field_monodomain, &
3153 & field_u_variable_type,field_values_set_type,1,1,node_idx,3,titin_unbound,err,error,*999)
3157 d10=-13.39_dp*sarco_length+58.37_dp
3160 actin_myosin_distance=0.001_dp*(2.0_dp/3.0_dp*d10)
3162 titin_xf_unbound=0.5_dp*titin_unbound*actin_myosin_distance/length_titin
3163 CALL field_parameter_set_update_local_node(independent_field_monodomain, &
3164 & field_u_variable_type,field_values_set_type,1,1,node_idx,4,titin_xf_unbound,err,error,*999)
3165 CALL field_parameter_set_update_local_node(independent_field_monodomain, &
3166 & field_u_variable_type,field_values_set_type,1,1,node_idx,5,titin_xf_unbound,err,error,*999)
3171 length_titin=sarco_length-length_myosin-length_mband-length_zdisc
3173 titin_unbound=coeff_matrix(1)*exp(length_titin)+coeff_matrix(2)*length_titin**3+coeff_matrix(3)* &
3174 & length_titin**2+coeff_matrix(4)*length_titin+coeff_matrix(5)
3182 IF(switch_model.EQ.1)
THEN 3183 length_init_titin=sarco_length_at_activation-length_myosin-length_mband-length_zdisc
3185 f0=coeff_matrix(1)*exp(length_init_titin)+coeff_matrix(2)*length_init_titin**3+coeff_matrix(3)* &
3186 & length_init_titin**2+coeff_matrix(4)*length_init_titin+coeff_matrix(5)
3188 stiffness_pevk=1000.0_dp*(0.1880_dp*sarco_length_at_activation**4-0.8694_dp*sarco_length_at_activation**3+ &
3189 & 1.5084_dp*sarco_length_at_activation**2-1.1577_dp*sarco_length_at_activation+0.3345_dp)
3190 IF(elongation.LT.0.02)
THEN 3193 force=(elongation-0.02_dp)*stiffness_pevk
3195 titin_bound=f0+force
3198 ELSEIF(switch_model.EQ.2)
THEN 3199 length_init_titin=sarco_length_at_activation-length_myosin-length_mband-length_zdisc
3201 f0=coeff_matrix(1)*exp(length_init_titin)+coeff_matrix(2)*length_init_titin**3+coeff_matrix(3)* &
3202 & length_init_titin**2+coeff_matrix(4)*length_init_titin+coeff_matrix(5)
3203 force=2.0_dp*elongation**2
3204 titin_bound=f0+force
3207 ELSEIF(switch_model.EQ.3)
THEN 3208 length_init_titin=sarco_length_at_activation-length_myosin-length_mband-length_zdisc
3210 f0=coeff_matrix(1)*exp(length_init_titin)+coeff_matrix(2)*length_init_titin**3+coeff_matrix(3)* &
3211 & length_init_titin**2+coeff_matrix(4)*length_init_titin+coeff_matrix(5)
3213 stiffness_pevk=1000.0_dp*(0.1880_dp*sarco_length_at_activation**4-0.8694_dp*sarco_length_at_activation**3+ &
3214 & 1.5084_dp*sarco_length_at_activation**2-1.1577_dp*sarco_length_at_activation+0.3345_dp)
3217 length_dist_ig_f0=-35.63_dp+39.58889_dp*(f0+0.9_dp)
3218 ELSEIF(f0.GE.0.24_dp)
THEN 3219 length_dist_ig_f0=0.1411_dp+0.196576763485477_dp*(f0-0.2495_dp)
3221 index_pseudo=ceiling(f0/dx)
3222 index_i=index_ref+index_pseudo-1
3223 length_dist_ig_f0=lengths_dist_ig(index_i)-(lengths_dist_ig(index_i+1)-lengths_dist_ig(index_i))* &
3224 & (forces_dist_ig(index_i)-f0)/(forces_dist_ig(index_i+1)-forces_dist_ig(index_i))
3227 elongation_new=-1.0_dp
3229 DO WHILE (elongation_new.LT.elongation)
3230 force=force+force_increment
3231 titin_bound=force+f0
3232 elongation_pevk=force/stiffness_pevk
3233 IF (titin_bound.LE.0.0_dp)
THEN 3234 length_dist_ig=-35.63_dp+39.58889_dp*(titin_bound+0.9_dp)
3235 ELSE IF (titin_bound.GE.0.24_dp)
THEN 3236 length_dist_ig=0.1411_dp+0.196576763485477_dp*(titin_bound-0.2495_dp)
3238 index_pseudo=ceiling(titin_bound/dx)
3239 index_i=index_ref+index_pseudo-1
3240 length_dist_ig=lengths_dist_ig(index_i)-(lengths_dist_ig(index_i+1)-lengths_dist_ig( &
3241 & index_i))*(forces_dist_ig(index_i)-titin_bound)/(forces_dist_ig(index_i+1)-forces_dist_ig(index_i))
3243 elongation_dist_ig=length_dist_ig-length_dist_ig_f0
3244 elongation_new=elongation_pevk+elongation_dist_ig
3248 ELSEIF(switch_model.EQ.4)
THEN 3249 length_init_titin=sarco_length_at_activation-length_myosin-length_mband-length_zdisc
3251 f0=coeff_matrix(1)*exp(length_init_titin)+coeff_matrix(2)*length_init_titin**3+coeff_matrix(3)* &
3252 & length_init_titin**2+coeff_matrix(4)*length_init_titin+coeff_matrix(5)
3254 stiffness_pevk=1000.0_dp*(0.1880_dp*sarco_length_at_activation**4-0.8694_dp*sarco_length_at_activation**3+ &
3255 & 1.5084_dp*sarco_length_at_activation**2-1.1577_dp*sarco_length_at_activation+0.3345_dp)
3260 length_dist_ig_f0=0.0_dp
3261 IF(f0.GE.forces_dist_ig(dim_data))
THEN 3264 DO WHILE (f0.GT.forces_dist_ig(index_i))
3268 slope=(forces_dist_ig(index_i)-forces_dist_ig(index_i-1))/ &
3269 & (lengths_dist_ig(index_i)-lengths_dist_ig(index_i-1))
3270 length_dist_ig_f0=lengths_dist_ig(index_i-1)+slope*(f0-forces_dist_ig(index_i-1))
3274 stiffness_dist=1.0_dp
3280 elongation_pevk=elongation/2.0_dp
3281 length_dist_ig=length_dist_ig_f0+elongation-elongation_pevk
3283 DO WHILE(abs(delta_f).GT.tol)
3285 IF(length_dist_ig.GE.lengths_dist_ig(dim_data))
THEN 3288 DO WHILE(length_dist_ig.GT.lengths_dist_ig(index_i))
3292 stiffness_dist=(forces_dist_ig(index_i)-forces_dist_ig(index_i-1))/ &
3293 & (lengths_dist_ig(index_i)-lengths_dist_ig(index_i-1))
3294 force_distal_ig=forces_dist_ig(index_i-1)+stiffness_dist* &
3295 & (length_dist_ig-lengths_dist_ig(index_i-1))
3297 force=stiffness_pevk*elongation_pevk
3298 titin_bound=force+f0
3300 delta_f=titin_bound-force_distal_ig
3301 diff_quot=stiffness_pevk+stiffness_dist
3302 elongation_pevk=elongation_pevk-delta_f/diff_quot
3303 length_dist_ig=length_dist_ig_f0+elongation-elongation_pevk
3309 d10=-13.39_dp*sarco_length+58.37_dp
3312 actin_myosin_distance=0.001_dp*(2.0_dp/3.0_dp*d10)
3314 titin_xf_unbound=0.5_dp*titin_unbound*actin_myosin_distance/length_titin
3316 titin_xf_bound=0.5_dp*titin_bound*actin_myosin_distance/length_dist_ig
3318 CALL field_parameter_set_update_local_node(independent_field_monodomain, &
3319 & field_u_variable_type,field_values_set_type,1,1,node_idx,2,titin_unbound,err,error,*999)
3320 CALL field_parameter_set_update_local_node(independent_field_monodomain, &
3321 & field_u_variable_type,field_values_set_type,1,1,node_idx,3,titin_bound,err,error,*999)
3322 CALL field_parameter_set_update_local_node(independent_field_monodomain, &
3323 & field_u_variable_type,field_values_set_type,1,1,node_idx,4,titin_xf_unbound,err,error,*999)
3324 CALL field_parameter_set_update_local_node(independent_field_monodomain, &
3325 & field_u_variable_type,field_values_set_type,1,1,node_idx,5,titin_xf_bound,err,error,*999)
3331 CALL field_parameter_set_update_start(independent_field_monodomain, &
3332 & field_u_variable_type,field_values_set_type,err,error,*999)
3333 CALL field_parameter_set_update_finish(independent_field_monodomain, &
3334 & field_u_variable_type,field_values_set_type,err,error,*999)
3337 CALL flagerror(
"Equations set is not associated.",err,error,*999)
3340 CALL flagerror(
"Solver mapping is not associated.",err,error,*999)
3343 CALL flagerror(
"Solver equations is not associated.",err,error,*999)
3347 CALL flagerror(
"Problem subtype not implemented for titin",err,error,*999)
3350 CALL flagerror(
"Problem not associated",err,error,*999)
3353 CALL flagerror(
"Control loop is not associated.",err,error,*999)
3356 exits(
"BIOELECTRIC_FINITE_ELASTICITY_COMPUTE_TITIN")
3358 999 errorsexits(
"BIOELECTRIC_FINITE_ELASTICITY_COMPUTE_TITIN",err,error)
integer(intg), parameter equations_set_fem_solution_method
Finite Element Method solution method.
subroutine, public bioelectricfiniteelasticity_updategeometricfield(CONTROL_LOOP, CALC_CLOSEST_GAUSS_POINT, ERR, ERROR,)
Update the the bioelectric equation geometric field from the finite elasticity dependent field (defor...
This module contains all basis function routines.
subroutine, public enters(NAME, ERR, ERROR,)
Records the entry into the named procedure and initialises the error code.
subroutine, public bioelectric_finite_elasticity_post_solve(CONTROL_LOOP, SOLVER, ERR, ERROR,)
Sets up the bioelectrics finite elasticity problem post solve.
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 bioelectricfiniteelasticity_equationssetsetup(EQUATIONS_SET, EQUATIONS_SET_SETUP, ERR, ERROR,)
Sets up the bioelectrics finite elasticity equation.
subroutine, public bioelectricfiniteelasticity_equationssetsolutionmethodset(EQUATIONS_SET, SOLUTION_METHOD, ERR, ERROR,)
Sets/changes the solution method for a bioelectrics finite elasticity equation type of a multi physic...
Contains information about the CellML equations for a solver.
Contains information about the equations in an equations set.
subroutine, public finite_elasticity_post_solve(CONTROL_LOOP, SOLVER, ERR, ERROR,)
Sets up the finite elasticity problem post solve.
integer(intg), parameter equations_set_gfem_solution_method
Grid-based Finite Element Method solution method.
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 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.
Returns the transpose of a matrix A in A^T.
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.
Contains information on the mesh decomposition.
integer(intg), parameter equations_set_standard_monodomain_elasticity_subtype
subroutine, public control_loop_sub_loop_get(CONTROL_LOOP, SUB_LOOP_INDEX, SUB_LOOP, ERR, ERROR,)
Gets/returns a pointer to the sub loops as specified by the sub loop index for a control loop...
Contains information on the type of solver to be used.
integer(intg), parameter, public solver_petsc_library
PETSc solver library.
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.
integer(intg), parameter problem_bioelectric_finite_elasticity_type
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.
subroutine, public bioelectricfiniteelasticity_controllooppreloop(CONTROL_LOOP, ERR, ERROR,)
Sets up the bioelectrics finite elasticity problem pre-control loop.
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 problem_monodomain_elasticity_w_titin_subtype
Contains information on an equations set.
This module handles all equations routines.
integer(intg), parameter, public solver_dae_type
A differential-algebraic equation solver.
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.
subroutine bioelectric_finite_elasticity_compute_titin(CONTROL_LOOP, ERR, ERROR,)
Computes force enhancement based on the titin model of C Rode et al. (2009). Force depression is not ...
integer(intg), parameter first_part_deriv
First partial derivative i.e., du/ds.
integer(intg), parameter solver_equations_static
Solver equations are static.
subroutine, public solver_equations_sparsity_type_set(SOLVER_EQUATIONS, SPARSITY_TYPE, ERR, ERROR,)
Sets/changes the sparsity type for solver equations.
This module contains all mathematics support routines.
subroutine, public bioelectricfiniteelasticity_controllooppostloop(CONTROL_LOOP, ERR, ERROR,)
Sets up the bioelectrics finite elasticity problem post-control loop.
subroutine, public solvers_solver_get(SOLVERS, SOLVER_INDEX, SOLVER, ERR, ERROR,)
Returns a pointer to the specified solver in the list of solvers.
subroutine bioelectricfiniteelasticity_computefibrestretch(CONTROL_LOOP, ERR, ERROR,)
Computes the fibre stretch for bioelectrics finite elasticity problems.
Contains information for a field defined on a region.
integer(intg), parameter equations_set_1d3d_monodomain_elasticity_subtype
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.
This module contains all program wide constants.
integer(intg), parameter solver_equations_nonlinear
Solver equations are nonlinear.
subroutine, public bioelectricfiniteelasticity_finiteelementcalculate(EQUATIONS_SET, ELEMENT_NUMBER, ERR, ERROR,)
Calculates the element stiffness matrices and RHS for a bioelectrics finite elasticity equation finit...
subroutine, public solver_library_type_set(SOLVER, SOLVER_LIBRARY_TYPE, ERR, ERROR,)
Sets/changes the type of library type to use for the solver.
subroutine, public bioelectricfiniteelasticity_problemspecificationset(problem, problemSpecification, err, error,)
Sets the problem specification for a bioelectric finite elasticity problem type . ...
Flags a warning to the user.
integer(intg), parameter problem_setup_initial_type
Initial setup for a problem.
Contains the interpolated point coordinate metrics. Old CMISS name GL,GU,RG.
integer(intg), parameter problem_monodomain_elasticity_velocity_subtype
subroutine, public solver_equations_linearity_type_set(SOLVER_EQUATIONS, LINEARITY_TYPE, ERR, ERROR,)
Sets/changes the linearity type for solver equations.
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.
This module contains all the low-level base routines e.g., all debug, control, and low-level communic...
integer(intg), parameter equations_set_1d3d_monodomain_active_strain_subtype
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.
integer(intg), parameter problem_multi_physics_class
integer(intg), parameter, public solver_nonlinear_type
A nonlinear solver.
subroutine, public solver_solution_update(SOLVER, ERR, ERROR,)
Updates the solver solution from the field variables.
subroutine, public bioelectric_post_solve(SOLVER, ERR, ERROR,)
Performs post solve actions for a bioelectrics problem class.
subroutine, public finiteelasticity_gaussdeformationgradienttensor(dependentInterpPointMetrics, geometricInterpPointMetrics, fibreInterpolatedPoint, dZdNu, err, error,)
Evaluates the deformation gradient tensor at a given Gauss point.
subroutine bioelectricfiniteelasticity_independentfieldinterpolate(CONTROL_LOOP, ERR, ERROR,)
Interpolates the finite elasticity independent field from the biolectrics independent field...
subroutine bioelectricfiniteelasticity_convergencecheck(CONTROL_LOOP, ERR, ERROR,)
Check for the convergence of the bioelectric finite elasticity while loop, i.e., if the force-length ...
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.
Contains the topology information for the elements of a decomposition.
integer(intg), parameter equations_set_gfv_solution_method
Grid-based Finite Volume solution method.
Contains information for a problem.
integer(intg), parameter problem_setup_cellml_equations_type
CellML equations setup for a problem.
subroutine, public bioelectric_finite_elasticity_problem_setup(PROBLEM, PROBLEM_SETUP, ERR, ERROR,)
Sets up the bioelectric finite elasticity problem.
subroutine bioelectricfiniteelasticity_forcelengthvelocityrelation(CONTROL_LOOP, ERR, ERROR,)
Computes the bioelectrics finite elasticity force-length and force_velocity relations.
This module handles all routines pertaining to bioelectrics coupled with finite elasticity.
This module handles all solver routines.
Contains the interpolated value (and the derivatives wrt xi) of a field at a point. Old CMISS name XG.
Contains information for a particular quadrature scheme.
subroutine, public solver_dynamic_restart_set(SOLVER, RESTART, ERR, ERROR,)
Sets/changes the restart value for a dynamic solver.
Implements lists of Field IO operation.
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_monodomain_elasticity_velocity_subtype
subroutine, public biodomain_pre_solve(SOLVER, ERR, ERROR,)
Performs pre-solve actions for mono- and bi-domain problems.
Contains information on the solver mapping between the global equation sets and the solver matrices...
subroutine, public control_loop_output_type_set(CONTROL_LOOP, OUTPUT_TYPE, ERR, ERROR,)
Sets/changes the output type for a control loop.
subroutine, public solver_dynamic_scheme_set(SOLVER, SCHEME, ERR, ERROR,)
Sets/changes the scheme for a dynamic solver.
subroutine, public finite_elasticity_pre_solve(CONTROL_LOOP, SOLVER, ERR, ERROR,)
Sets up the finite elasticity problem pre-solve.
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 problem_control_load_increment_loop_type
Load increment control loop.
Contains information on the domain mappings (i.e., local and global numberings).
Contains the parameters required to interpolate a field variable within an element. Old CMISS name XE.
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.
This module handles all bioelectric domain equation routines.
Calculates and returns the matrix-product A*B in the matrix C.
subroutine, public errors(NAME, ERR, ERROR)
Records the exiting error of the subroutine.
This module defines all constants shared across equations set routines.
This module handles all bioelectric class 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_monodomain_elasticity_w_titin_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.
recursive subroutine, public control_loop_create_finish(CONTROL_LOOP, ERR, ERROR,)
Finish the process of creating a control loop.
integer(intg), parameter problem_monodomain_1d3d_active_strain_subtype
subroutine, public control_loop_number_of_sub_loops_set(CONTROL_LOOP, NUMBER_OF_SUB_LOOPS, ERR, ERROR,)
Sets/changes the number of sub loops in a control loop.
subroutine, public bioelectric_finite_elasticity_pre_solve(CONTROL_LOOP, SOLVER, ERR, ERROR,)
Sets up the bioelectrics finite elasticity problem pre-solve.
Flags an error condition.
subroutine, public finiteelasticity_controltimelooppreloop(CONTROL_LOOP, ERR, ERROR,)
Runs before each time loop for a finite elasticity problem.
integer(intg), parameter problem_control_while_loop_type
While control loop.
This module handles all finite elasticity routines.
integer(intg), parameter problem_gudunov_monodomain_1d3d_elasticity_subtype
This module contains all kind definitions.
subroutine, public field_io_nodes_export(FIELDS, FILE_NAME, METHOD, ERR, ERROR,)
Export nodal information.
subroutine, public biodomain_control_loop_post_loop(CONTROL_LOOP, ERR, ERROR,)
Runs after each control loop iteration.
integer(intg), parameter problem_gudunov_monodomain_simple_elasticity_subtype