85 PUBLIC multicompartmenttransport_equationssetsetup
86 PUBLIC multicompartmenttransport_equationssetsolutionmethodset
88 PUBLIC multi_compartment_transport_problem_setup
89 PUBLIC multicompartmenttransport_problemspecificationset
91 PUBLIC multicompartmenttransport_finiteelementcalculate
93 PUBLIC multi_compartment_transport_pre_solve
94 PUBLIC multi_compartment_transport_post_solve
104 SUBROUTINE multicompartmenttransport_equationssetsolutionmethodset(EQUATIONS_SET,SOLUTION_METHOD,ERR,ERROR,*)
108 INTEGER(INTG),
INTENT(IN) :: SOLUTION_METHOD
109 INTEGER(INTG),
INTENT(OUT) :: ERR
113 enters(
"MultiCompartmentTransport_EquationsSetSolutionMethodSet",err,error,*999)
115 CALL flagerror(
"Not implemented.",err,error,*999)
117 exits(
"MultiCompartmentTransport_EquationsSetSolutionMethodSet")
119 999
errors(
"MultiCompartmentTransport_EquationsSetSolutionMethodSet",err,error)
120 exits(
"MultiCompartmentTransport_EquationsSetSolutionMethodSet")
123 END SUBROUTINE multicompartmenttransport_equationssetsolutionmethodset
130 SUBROUTINE multicompartmenttransport_equationssetsetup(EQUATIONS_SET,EQUATIONS_SET_SETUP,ERR,ERROR,*)
135 INTEGER(INTG),
INTENT(OUT) :: ERR
140 enters(
"MultiCompartmentTransport_EquationsSetSetup",err,error,*999)
142 CALL flagerror(
"Not implemented.",err,error,*999)
144 exits(
"MultiCompartmentTransport_EquationsSetSetup")
146 999 errorsexits(
"MultiCompartmentTransport_EquationsSetSetup",err,error)
149 END SUBROUTINE multicompartmenttransport_equationssetsetup
156 SUBROUTINE multicompartmenttransport_finiteelementcalculate(EQUATIONS_SET,ELEMENT_NUMBER,ERR,ERROR,*)
160 INTEGER(INTG),
INTENT(IN) :: ELEMENT_NUMBER
161 INTEGER(INTG),
INTENT(OUT) :: ERR
165 enters(
"MultiCompartmentTransport_FiniteElementCalculate",err,error,*999)
167 CALL flagerror(
"Not implemented.",err,error,*999)
169 exits(
"MultiCompartmentTransport_FiniteElementCalculate")
171 999
errors(
"MultiCompartmentTransport_FiniteElementCalculate",err,error)
172 exits(
"MultiCompartmentTransport_FiniteElementCalculate")
175 END SUBROUTINE multicompartmenttransport_finiteelementcalculate
182 SUBROUTINE multicompartmenttransport_problemspecificationset(problem,problemSpecification,err,error,*)
186 INTEGER(INTG),
INTENT(IN) :: problemSpecification(:)
187 INTEGER(INTG),
INTENT(OUT) :: err
191 INTEGER(INTG) :: problemSubtype
193 enters(
"MultiCompartmentTransport_ProblemSpecificationSet",err,error,*999)
195 IF(
ASSOCIATED(problem))
THEN 196 IF(
SIZE(problemspecification,1)==3)
THEN 197 problemsubtype=problemspecification(3)
198 SELECT CASE(problemsubtype)
203 &
" is not valid for a multi-compartment coupled transport equation type of a multi physics problem class." 204 CALL flagerror(localerror,err,error,*999)
206 IF(
ALLOCATED(problem%specification))
THEN 207 CALL flagerror(
"Problem specification is already allocated.",err,error,*999)
209 ALLOCATE(problem%specification(3),stat=err)
210 IF(err/=0)
CALL flagerror(
"Could not allocate problem specification.",err,error,*999)
215 CALL flagerror(
"Multi-compartment transport problem specification must have 3 entries.",err,error,*999)
218 CALL flagerror(
"Problem is not associated.",err,error,*999)
221 exits(
"MultiCompartmentTransport_ProblemSpecificationSet")
223 999
errors(
"MultiCompartmentTransport_ProblemSpecificationSet",err,error)
224 exits(
"MultiCompartmentTransport_ProblemSpecificationSet")
227 END SUBROUTINE multicompartmenttransport_problemspecificationset
234 SUBROUTINE multi_compartment_transport_problem_setup(PROBLEM,PROBLEM_SETUP,ERR,ERROR,*)
239 INTEGER(INTG),
INTENT(OUT) :: ERR
243 TYPE(
solver_type),
POINTER :: SOLVER_DIFFUSION, SOLVER_ADVECTION_DIFFUSION
244 TYPE(
solver_equations_type),
POINTER :: SOLVER_EQUATIONS_DIFFUSION, SOLVER_EQUATIONS_ADVECTION_DIFFUSION
248 enters(
"MULTI_COMPARTMENT_TRANSPORT_PROBLEM_SETUP",err,error,*999)
250 NULLIFY(control_loop)
252 NULLIFY(solver_diffusion)
253 NULLIFY(solver_advection_diffusion)
254 NULLIFY(solver_equations_diffusion)
255 NULLIFY(solver_equations_advection_diffusion)
256 IF(
ASSOCIATED(problem))
THEN 257 IF(.NOT.
ALLOCATED(problem%SPECIFICATION))
THEN 258 CALL flagerror(
"Problem specification is not allocated.",err,error,*999)
259 ELSE IF(
SIZE(problem%SPECIFICATION,1)<3)
THEN 260 CALL flagerror(
"Problem specification must have three entries for a multi compartment transport problem.",err,error,*999)
262 SELECT CASE(problem%SPECIFICATION(3))
268 SELECT CASE(problem_setup%SETUP_TYPE)
270 SELECT CASE(problem_setup%ACTION_TYPE)
276 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
278 &
" is invalid for a multi-compartment transport equation." 279 CALL flagerror(local_error,err,error,*999)
282 SELECT CASE(problem_setup%ACTION_TYPE)
289 control_loop_root=>problem%CONTROL_LOOP
293 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
295 &
" is invalid for a multi-compartment transport equation." 296 CALL flagerror(local_error,err,error,*999)
300 control_loop_root=>problem%CONTROL_LOOP
302 SELECT CASE(problem_setup%ACTION_TYPE)
322 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
324 &
" is invalid for a multi-compartment transport equation." 325 CALL flagerror(local_error,err,error,*999)
328 SELECT CASE(problem_setup%ACTION_TYPE)
331 control_loop_root=>problem%CONTROL_LOOP
344 control_loop_root=>problem%CONTROL_LOOP
353 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
355 &
" is invalid for a multi-compartment transport equation." 356 CALL flagerror(local_error,err,error,*999)
359 local_error=
"The setup type of "//
trim(
number_to_vstring(problem_setup%SETUP_TYPE,
"*",err,error))// &
360 &
" is invalid for a multi-compartment transport equation." 361 CALL flagerror(local_error,err,error,*999)
368 local_error=
"The problem subtype of "//
trim(
number_to_vstring(problem%SPECIFICATION(3),
"*",err,error))// &
369 &
" does not equal a standard multi-component transport equation subtype." 370 CALL flagerror(local_error,err,error,*999)
374 CALL flagerror(
"Problem is not associated.",err,error,*999)
377 exits(
"MULTI_COMPARTMENT_TRANSPORT_PROBLEM_SETUP")
379 999 errorsexits(
"MULTI_COMPARTMENT_TRANSPORT_PROBLEM_SETUP",err,error)
381 END SUBROUTINE multi_compartment_transport_problem_setup
388 SUBROUTINE multi_compartment_transport_pre_solve(CONTROL_LOOP,SOLVER,ERR,ERROR,*)
393 INTEGER(INTG),
INTENT(OUT) :: ERR
404 enters(
"MULTI_COMPARTMENT_TRANSPORT_PRE_SOLVE",err,error,*999)
406 IF(
ASSOCIATED(control_loop))
THEN 407 IF(
ASSOCIATED(solver))
THEN 408 IF(
ASSOCIATED(control_loop%PROBLEM))
THEN 409 IF(.NOT.
ALLOCATED(control_loop%PROBLEM%SPECIFICATION))
THEN 410 CALL flagerror(
"Problem specification is not allocated.",err,error,*999)
411 ELSE IF(
SIZE(control_loop%PROBLEM%SPECIFICATION,1)<3)
THEN 412 CALL flagerror(
"Problem specification must have three entries for a multi compartment transport problem.", &
415 SELECT CASE(control_loop%PROBLEM%SPECIFICATION(3))
417 solver_equations=>solver%SOLVER_EQUATIONS
418 IF(
ASSOCIATED(solver_equations))
THEN 419 solver_mapping=>solver_equations%SOLVER_MAPPING
420 equations=>solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(1)%EQUATIONS
421 IF(
ASSOCIATED(equations))
THEN 422 equations_set=>equations%EQUATIONS_SET
423 IF(
ASSOCIATED(equations_set))
THEN 424 IF(
ASSOCIATED(equations_set%ANALYTIC))
THEN 426 CALL multicompartmenttransport_presolveupdateanalyticvalues(control_loop,solver,err,error,*999)
441 local_error=
"Problem subtype "//
trim(
number_to_vstring(control_loop%PROBLEM%SPECIFICATION(3),
"*",err,error))// &
442 &
" is not valid for a multi-compartment transport type of a multi physics problem class." 443 CALL flagerror(local_error,err,error,*999)
446 CALL flagerror(
"Problem is not associated.",err,error,*999)
449 CALL flagerror(
"Solver is not associated.",err,error,*999)
452 CALL flagerror(
"Control loop is not associated.",err,error,*999)
455 exits(
"MULTI_COMPARTMENT_TRANSPORT_PRE_SOLVE")
457 999 errorsexits(
"MULTI_COMPARTMENT_TRANSPORT_PRE_SOLVE",err,error)
459 END SUBROUTINE multi_compartment_transport_pre_solve
465 SUBROUTINE multicompartmenttransport_presolveupdateanalyticvalues(CONTROL_LOOP,SOLVER,ERR,ERROR,*)
470 INTEGER(INTG),
INTENT(OUT) :: ERR
473 TYPE(
field_type),
POINTER :: ANALYTIC_FIELD,DEPENDENT_FIELD,GEOMETRIC_FIELD,MATERIALS_FIELD,SOURCE_FIELD
475 TYPE(
field_variable_type),
POINTER :: ANALYTIC_VARIABLE,FIELD_VARIABLE,GEOMETRIC_VARIABLE,MATERIALS_VARIABLE
487 REAL(DP),
POINTER :: ANALYTIC_PARAMETERS(:),GEOMETRIC_PARAMETERS(:),MATERIALS_PARAMETERS(:)
488 INTEGER(INTG) :: NUMBER_OF_DIMENSIONS,BOUNDARY_CONDITION_CHECK_VARIABLE
490 REAL(DP) :: CURRENT_TIME,TIME_INCREMENT
491 REAL(DP) :: NORMAL(3),TANGENTS(3,3),
VALUE,X(3),VALUE_SOURCE
493 INTEGER(INTG) :: component_idx,deriv_idx,dim_idx,local_ny,node_idx,eqnset_idx
494 INTEGER(INTG) :: VARIABLE_TYPE
495 INTEGER(INTG) :: ANALYTIC_FUNCTION_TYPE
496 INTEGER(INTG) :: GLOBAL_DERIV_INDEX
497 REAL(DP) :: A1,A2,A3,A4,D1,D2,D3,D4,LAMBDA_12,LAMBDA_13,LAMBDA_23
506 enters(
"MultiCompartmentTransport_PreSolveUpdateAnalyticValues",err,error,*999)
521 IF(
ASSOCIATED(control_loop))
THEN 525 IF(
ASSOCIATED(solver))
THEN 526 IF(
ASSOCIATED(control_loop%PROBLEM))
THEN 527 IF(.NOT.
ALLOCATED(control_loop%PROBLEM%SPECIFICATION))
THEN 528 CALL flagerror(
"Problem specification is not allocated.",err,error,*999)
529 ELSE IF(
SIZE(control_loop%PROBLEM%SPECIFICATION,1)<3)
THEN 530 CALL flagerror(
"Problem specification must have three entries for a multi compartment transport problem.", &
533 SELECT CASE(control_loop%PROBLEM%SPECIFICATION(3))
536 solver_equations=>solver%SOLVER_EQUATIONS
537 IF(
ASSOCIATED(solver_equations))
THEN 540 DO eqnset_idx=1,solver_equations%SOLVER_MAPPING%NUMBER_OF_EQUATIONS_SETS
541 solver_mapping=>solver_equations%SOLVER_MAPPING
542 equations=>solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(eqnset_idx)%EQUATIONS
543 IF(
ASSOCIATED(equations))
THEN 544 equations_set=>equations%EQUATIONS_SET
545 IF(
ASSOCIATED(equations_set))
THEN 546 IF(
ASSOCIATED(equations_set%ANALYTIC))
THEN 547 dependent_field=>equations_set%DEPENDENT%DEPENDENT_FIELD
548 IF(
ASSOCIATED(dependent_field))
THEN 549 geometric_field=>equations_set%GEOMETRY%GEOMETRIC_FIELD
550 IF(
ASSOCIATED(geometric_field))
THEN 551 analytic_field=>equations_set%ANALYTIC%ANALYTIC_FIELD
552 CALL field_number_of_components_get(geometric_field,field_u_variable_type,&
553 & number_of_dimensions,err,error,*999)
554 NULLIFY(geometric_variable)
555 NULLIFY(geometric_parameters)
556 CALL field_variable_get(geometric_field,field_u_variable_type,geometric_variable,err,error,*999)
557 CALL field_parameter_set_data_get(geometric_field,field_u_variable_type,field_values_set_type,&
558 & geometric_parameters,err,error,*999)
559 NULLIFY(analytic_variable)
560 NULLIFY(analytic_parameters)
561 IF(
ASSOCIATED(analytic_field))
THEN 562 CALL field_variable_get(analytic_field,field_u_variable_type,analytic_variable,err,error,*999)
563 CALL field_parameter_set_data_get(analytic_field,field_u_variable_type,field_values_set_type, &
564 & analytic_parameters,err,error,*999)
566 NULLIFY(materials_field)
567 NULLIFY(materials_variable)
568 NULLIFY(materials_parameters)
569 IF(
ASSOCIATED(equations_set%MATERIALS))
THEN 570 materials_field=>equations_set%MATERIALS%MATERIALS_FIELD
571 CALL field_variable_get(materials_field,field_u_variable_type,materials_variable,err,error,*999)
572 CALL field_parameter_set_data_get(materials_field,field_u_variable_type,field_values_set_type, &
573 & materials_parameters,err,error,*999)
575 equations_set%ANALYTIC%ANALYTIC_USER_PARAMS(1)=current_time
577 variable_type=dependent_field%VARIABLES(2*eqnset_idx-1)%VARIABLE_TYPE
578 field_variable=>dependent_field%VARIABLE_TYPE_MAP(variable_type)%PTR
579 IF(
ASSOCIATED(field_variable))
THEN 580 DO component_idx=1,field_variable%NUMBER_OF_COMPONENTS
581 IF(field_variable%COMPONENTS(component_idx)%INTERPOLATION_TYPE== &
582 & field_node_based_interpolation)
THEN 583 domain=>field_variable%COMPONENTS(component_idx)%DOMAIN
584 IF(
ASSOCIATED(domain))
THEN 585 IF(
ASSOCIATED(domain%TOPOLOGY))
THEN 586 domain_nodes=>domain%TOPOLOGY%NODES
587 IF(
ASSOCIATED(domain_nodes))
THEN 589 & field_variable,boundary_conditions_variable,err,error,*999)
590 IF(
ASSOCIATED(boundary_conditions_variable))
THEN 592 DO node_idx=1,domain_nodes%NUMBER_OF_NODES
594 DO dim_idx=1,number_of_dimensions
596 local_ny=geometric_variable%COMPONENTS(dim_idx)%PARAM_TO_DOF_MAP% &
597 & node_param2dof_map%NODES(node_idx)%DERIVATIVES(1)%VERSIONS(1)
598 x(dim_idx)=geometric_parameters(local_ny)
601 DO deriv_idx=1,domain_nodes%NODES(node_idx)%NUMBER_OF_DERIVATIVES
602 analytic_function_type=equations_set%ANALYTIC%ANALYTIC_FUNCTION_TYPE
603 global_deriv_index=domain_nodes%NODES(node_idx)%DERIVATIVES(deriv_idx)% &
604 & global_derivative_index
606 & analytic_function_type,x,tangents,normal,current_time,variable_type, &
607 & global_deriv_index,component_idx,analytic_parameters,materials_parameters, &
608 &
VALUE,err,error,*999)
610 local_ny=field_variable%COMPONENTS(component_idx)%PARAM_TO_DOF_MAP% &
611 & node_param2dof_map%NODES(node_idx)%DERIVATIVES(deriv_idx)%VERSIONS(1)
612 CALL field_parameter_set_update_local_dof(dependent_field,variable_type, &
613 & field_analytic_values_set_type,local_ny,
VALUE,err,error,*999)
614 boundary_condition_check_variable=boundary_conditions_variable% &
615 & condition_types(local_ny)
617 CALL field_parameter_set_update_local_dof(dependent_field, &
618 & variable_type,field_values_set_type,local_ny, &
619 &
VALUE,err,error,*999)
632 CALL flagerror(
"Boundary conditions variable is not associated.",err,error,*999)
635 CALL flagerror(
"Domain topology nodes is not associated.",err,error,*999)
638 CALL flagerror(
"Domain topology is not associated.",err,error,*999)
641 CALL flagerror(
"Domain is not associated.",err,error,*999)
644 CALL flagerror(
"Only node based interpolation is implemented.",err,error,*999)
647 CALL field_parameter_set_update_start(dependent_field,variable_type, &
648 & field_analytic_values_set_type,err,error,*999)
649 CALL field_parameter_set_update_finish(dependent_field,variable_type, &
650 & field_analytic_values_set_type,err,error,*999)
651 CALL field_parameter_set_update_start(dependent_field,variable_type, &
652 & field_values_set_type,err,error,*999)
653 CALL field_parameter_set_update_finish(dependent_field,variable_type, &
654 & field_values_set_type,err,error,*999)
656 CALL flagerror(
"Field variable is not associated.",err,error,*999)
660 CALL field_parameter_set_data_restore(geometric_field,field_u_variable_type,&
661 & field_values_set_type,geometric_parameters,err,error,*999)
663 CALL flagerror(
"Equations set geometric field is not associated.",err,error,*999)
666 CALL flagerror(
"Equations set dependent field is not associated.",err,error,*999)
672 CALL flagerror(
"Equations set is not associated.",err,error,*999)
675 CALL flagerror(
"Equations are not associated.",err,error,*999)
680 CALL field_parameter_set_update_start(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type, &
681 & field_values_set_type,err,error,*999)
682 CALL field_parameter_set_update_finish(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type, &
683 & field_values_set_type,err,error,*999)
684 CALL field_parameter_set_update_start(equations_set%DEPENDENT%DEPENDENT_FIELD,field_v_variable_type, &
685 & field_values_set_type,err,error,*999)
686 CALL field_parameter_set_update_finish(equations_set%DEPENDENT%DEPENDENT_FIELD,field_v_variable_type, &
687 & field_values_set_type,err,error,*999)
690 IF(
ASSOCIATED(equations_set))
THEN 691 IF(
ASSOCIATED(equations_set%ANALYTIC))
THEN 692 source_field=>equations_set%SOURCE%SOURCE_FIELD
693 IF(
ASSOCIATED(source_field))
THEN 694 geometric_field=>equations_set%GEOMETRY%GEOMETRIC_FIELD
695 IF(
ASSOCIATED(geometric_field))
THEN 696 CALL field_number_of_components_get(geometric_field,field_u_variable_type,number_of_dimensions,err,error,*999)
697 NULLIFY(geometric_variable)
698 CALL field_variable_get(geometric_field,field_u_variable_type,geometric_variable,err,error,*999)
699 CALL field_parameter_set_data_get(geometric_field,field_u_variable_type,field_values_set_type, &
700 & geometric_parameters,err,error,*999)
701 variable_type=field_u_variable_type
702 field_variable=>source_field%VARIABLE_TYPE_MAP(variable_type)%PTR
703 IF(
ASSOCIATED(field_variable))
THEN 704 DO component_idx=1,field_variable%NUMBER_OF_COMPONENTS
705 IF(field_variable%COMPONENTS(component_idx)%INTERPOLATION_TYPE==field_node_based_interpolation)
THEN 706 domain=>field_variable%COMPONENTS(component_idx)%DOMAIN
707 IF(
ASSOCIATED(domain))
THEN 708 IF(
ASSOCIATED(domain%TOPOLOGY))
THEN 709 domain_nodes=>domain%TOPOLOGY%NODES
710 IF(
ASSOCIATED(domain_nodes))
THEN 712 DO node_idx=1,domain_nodes%NUMBER_OF_NODES
714 DO dim_idx=1,number_of_dimensions
716 local_ny=geometric_variable%COMPONENTS(dim_idx)%PARAM_TO_DOF_MAP% &
717 & node_param2dof_map%NODES(node_idx)%DERIVATIVES(1)%VERSIONS(1)
718 x(dim_idx)=geometric_parameters(local_ny)
721 DO deriv_idx=1,domain_nodes%NODES(node_idx)%NUMBER_OF_DERIVATIVES
722 SELECT CASE(equations_set%ANALYTIC%ANALYTIC_FUNCTION_TYPE)
724 SELECT CASE(eqnset_idx)
726 value_source=exp(-1*current_time)*(-1*a1*(x(1)*x(1)+x(2)*x(2))-4*d1*a1+lambda_12*(a1-a2)*&
727 & (x(1)*x(1)+x(2)*x(2)))
729 value_source=exp(-1*current_time)*(-1*a2*(x(1)*x(1)+x(2)*x(2))-4*d2*a2+lambda_12*(a2-a1)*&
730 & (x(1)*x(1)+x(2)*x(2)))
733 SELECT CASE(eqnset_idx)
735 value_source=exp(-1*current_time)*(-1*a1*(x(1)*x(1)+x(2)*x(2)+x(3)*x(3))-&
736 & 6*d1*a1+lambda_13*(a1-a3)*&
737 & (x(1)*x(1)+x(2)*x(2)+x(3)*x(3))+lambda_12*(a1-a2)*(x(1)*x(1)+x(2)*x(2)+x(3)*x(3)))
739 value_source=exp(-1*current_time)*(-1*a2*(x(1)*x(1)+x(2)*x(2)+x(3)*x(3))-&
740 & 6*d2*a2+lambda_12*(a2-a1)*&
741 & (x(1)*x(1)+x(2)*x(2)+x(3)*x(3))+lambda_23*(a2-a3)*(x(1)*x(1)+x(2)*x(2)+x(3)*x(3)))
743 value_source=exp(-1*current_time)*(-1*a3*(x(1)*x(1)+x(2)*x(2)+x(3)*x(3))-&
744 & 6*d3*a3+lambda_13*(a3-a1)*&
745 & (x(1)*x(1)+x(2)*x(2)+x(3)*x(3))+lambda_23*(a3-a2)*(x(1)*x(1)+x(2)*x(2)+x(3)*x(3)))
748 local_error=
"The analytic function type of "// &
751 CALL flagerror(local_error,err,error,*999)
754 local_ny=field_variable%COMPONENTS(component_idx)%PARAM_TO_DOF_MAP% &
755 & node_param2dof_map%NODES(node_idx)%DERIVATIVES(deriv_idx)%VERSIONS(1)
756 CALL field_parameter_set_update_local_dof(source_field,field_u_variable_type, &
757 & field_values_set_type,local_ny,value_source,err,error,*999)
761 CALL flagerror(
"Domain topology nodes is not associated.",err,error,*999)
764 CALL flagerror(
"Domain topology is not associated.",err,error,*999)
767 CALL flagerror(
"Domain is not associated.",err,error,*999)
770 CALL flagerror(
"Only node based interpolation is implemented.",err,error,*999)
773 CALL field_parameter_set_update_start(source_field,field_u_variable_type,field_values_set_type, &
775 CALL field_parameter_set_update_finish(source_field,field_u_variable_type,field_values_set_type, &
778 CALL flagerror(
"Field variable is not associated.",err,error,*999)
780 CALL field_parameter_set_data_restore(geometric_field,field_u_variable_type,field_values_set_type, &
781 & geometric_parameters,err,error,*999)
783 CALL flagerror(
"Equations set geometric field is not associated.",err,error,*999)
786 CALL flagerror(
"Equations set source field is not associated.",err,error,*999)
789 CALL flagerror(
"Equations set analytic is not associated.",err,error,*999)
792 CALL flagerror(
"Equations set is not associated.",err,error,*999)
796 CALL flagerror(
"Solver equations are not associated.",err,error,*999)
799 local_error=
"Problem subtype "//
trim(
number_to_vstring(control_loop%PROBLEM%SPECIFICATION(3),
"*",err,error))// &
800 &
" is not valid for a multi-physics coupled diffusion equation type of a multi-physics problem class." 801 CALL flagerror(local_error,err,error,*999)
804 CALL flagerror(
"Problem is not associated.",err,error,*999)
807 CALL flagerror(
"Solver is not associated.",err,error,*999)
810 CALL flagerror(
"Control loop is not associated.",err,error,*999)
813 exits(
"MultiCompartmentTransport_PreSolveUpdateAnalyticValues")
815 999
errors(
"MultiCompartmentTransport_PreSolveUpdateAnalyticValues",err,error)
816 exits(
"MultiCompartmentTransport_PreSolveUpdateAnalyticValues")
819 END SUBROUTINE multicompartmenttransport_presolveupdateanalyticvalues
824 SUBROUTINE multi_compartment_transport_post_solve(CONTROL_LOOP,SOLVER,ERR,ERROR,*)
829 INTEGER(INTG),
INTENT(OUT) :: ERR
838 REAL(DP),
POINTER :: OUTPUT_DATA1(:),OUTPUT_DATA2(:),OUTPUT_DATA3(:),OUTPUT_DATA4(:),OUTPUT_DATA5(:)
839 enters(
"MULTI_COMPARTMENT_TRANSPORT_POST_SOLVE",err,error,*999)
840 NULLIFY(output_data1)
841 NULLIFY(output_data2)
842 NULLIFY(output_data3)
843 NULLIFY(output_data4)
844 NULLIFY(output_data5)
845 IF(
ASSOCIATED(control_loop))
THEN 846 IF(
ASSOCIATED(solver))
THEN 847 IF(
ASSOCIATED(control_loop%PROBLEM))
THEN 848 IF(.NOT.
ALLOCATED(control_loop%PROBLEM%SPECIFICATION))
THEN 849 CALL flagerror(
"Problem specification is not allocated.",err,error,*999)
850 ELSE IF(
SIZE(control_loop%PROBLEM%SPECIFICATION,1)<3)
THEN 851 CALL flagerror(
"Problem specification must have three entries for a multi compartment transport problem.", &
854 SELECT CASE(control_loop%PROBLEM%SPECIFICATION(3))
856 IF(solver%GLOBAL_NUMBER==1)
THEN 859 solver_equations=>solver%SOLVER_EQUATIONS
860 IF(
ASSOCIATED(solver_equations))
THEN 861 solver_mapping=>solver_equations%SOLVER_MAPPING
862 equations=>solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(1)%EQUATIONS
863 IF(
ASSOCIATED(equations))
THEN 864 equations_set=>equations%EQUATIONS_SET
865 IF(
ASSOCIATED(equations_set))
THEN 892 ELSE IF(solver%GLOBAL_NUMBER==2)
THEN 896 local_error=
"Problem subtype "//
trim(
number_to_vstring(control_loop%PROBLEM%SPECIFICATION(3),
"*",err,error))// &
897 &
" is not valid for a multi-compartment type of a multi physics problem class." 898 CALL flagerror(local_error,err,error,*999)
901 CALL flagerror(
"Problem is not associated.",err,error,*999)
904 CALL flagerror(
"Solver is not associated.",err,error,*999)
907 CALL flagerror(
"Control loop is not associated.",err,error,*999)
910 exits(
"MULTI_COMPARTMENT_TRANSPORT_POST_SOLVE")
912 999 errorsexits(
"MULTI_COMPARTMENT_TRANSPORT_POST_SOLVE",err,error)
914 END SUBROUTINE multi_compartment_transport_post_solve
921 SUBROUTINE multicompartmenttransport_postsolveoutputdata(CONTROL_LOOP,SOLVER,ERR,ERROR,*)
926 INTEGER(INTG),
INTENT(OUT) :: ERR
932 enters(
"MultiCompartmentTransport_PostSolveOutputData",err,error,*999)
934 IF(
ASSOCIATED(control_loop))
THEN 935 IF(
ASSOCIATED(solver))
THEN 936 IF(
ASSOCIATED(control_loop%PROBLEM))
THEN 937 IF(.NOT.
ALLOCATED(control_loop%PROBLEM%SPECIFICATION))
THEN 938 CALL flagerror(
"Problem specification is not allocated.",err,error,*999)
939 ELSE IF(
SIZE(control_loop%PROBLEM%SPECIFICATION,1)<3)
THEN 940 CALL flagerror(
"Problem specification must have three entries for a multi compartment transport problem.", &
943 SELECT CASE(control_loop%PROBLEM%SPECIFICATION(3))
948 local_error=
"Problem subtype "//
trim(
number_to_vstring(control_loop%PROBLEM%SPECIFICATION(3),
"*",err,error))// &
949 &
" is not valid for a multi-compartment transport type of a multi physics problem class." 950 CALL flagerror(local_error,err,error,*999)
953 CALL flagerror(
"Problem is not associated.",err,error,*999)
956 CALL flagerror(
"Solver is not associated.",err,error,*999)
959 CALL flagerror(
"Control loop is not associated.",err,error,*999)
962 exits(
"MultiCompartmentTransport_PostSolveOutputData")
964 999
errors(
"MultiCompartmentTransport_PostSolveOutputData",err,error)
965 exits(
"MultiCompartmentTransport_PostSolveOutputData")
968 END SUBROUTINE multicompartmenttransport_postsolveoutputdata
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 solvers_create_finish(SOLVERS, ERR, ERROR,)
Finish the creation of solvers.
This module contains all coordinate transformation and support routines.
Contains information about the equations in an equations set.
integer(intg), parameter problem_control_time_loop_type
Time control loop.
integer(intg), parameter problem_setup_control_type
Solver setup for a problem.
This module handles all problem wide constants.
integer(intg), parameter solver_equations_first_order_dynamic
Solver equations are first order dynamic.
integer(intg), parameter, public control_loop_node
The identifier for a each "leaf" node in a control loop.
subroutine, public solver_dynamic_order_set(SOLVER, ORDER, ERR, ERROR,)
Sets/changes the order for a dynamic solver.
Converts a number to its equivalent varying string representation.
Contains information on the type of solver to be used.
subroutine, public solvers_number_set(SOLVERS, NUMBER_OF_SOLVERS, ERR, ERROR,)
Sets/changes the number of solvers.
integer(intg), parameter, public solver_dynamic_crank_nicolson_scheme
Crank-Nicolson dynamic solver.
subroutine, public solver_dynamic_degree_set(SOLVER, DEGREE, ERR, ERROR,)
Sets/changes the degree of the polynomial used to interpolate time for a dynamic solver.
This module handles all equations matrix and rhs routines.
integer(intg), parameter, public solver_dynamic_first_order
Dynamic solver has first order terms.
subroutine, public solver_type_set(SOLVER, SOLVE_TYPE, ERR, ERROR,)
Sets/changes the type for a solver.
Contains information on an equations set.
This module handles all equations routines.
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.
This module contains routines for timing the program.
subroutine, public control_loop_current_times_get(CONTROL_LOOP, CURRENT_TIME, TIME_INCREMENT, ERR, ERROR,)
Gets the current time parameters for a time control loop.
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 solvers_solver_get(SOLVERS, SOLVER_INDEX, SOLVER, ERR, ERROR,)
Returns a pointer to the specified solver in the list of solvers.
Contains information for a field defined on a region.
integer(intg), parameter 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 equations_set_multi_comp_diffusion_two_comp_two_dim
Prescribed solution, using a source term to correct for error - 2D with 2 compartments.
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 problem_setup_solvers_type
Solver setup for a problem.
This module contains all program wide constants.
subroutine, public solver_library_type_set(SOLVER, SOLVER_LIBRARY_TYPE, ERR, ERROR,)
Sets/changes the type of library type to use for the solver.
integer(intg), parameter problem_setup_initial_type
Initial setup for a problem.
Contains information on the boundary conditions for a dependent field variable.
This module handles all advection-diffusion equation routines.
subroutine, public solver_equations_linearity_type_set(SOLVER_EQUATIONS, LINEARITY_TYPE, ERR, ERROR,)
Sets/changes the linearity type for solver 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.
integer(intg), parameter problem_multi_compartment_transport_type
Problem type for the multi-compartment coupled transport, comprising either/or/both advection-diffusi...
subroutine, public diffusion_analyticfunctionsevaluate(EQUATIONS_SET, ANALYTIC_FUNCTION_TYPE, X, TANGENTS, NORMAL, TIME, VARIABLE_TYPE, GLOBAL_DERIVATIVE, COMPONENT_NUMBER, ANALYTIC_PARAMETERS, MATERIALS_PARAMETERS, VALUE, ERR, ERROR,)
Evaluate the analytic solutions for a diffusion equation.
This module contains all the low-level base routines e.g., all debug, control, and low-level communic...
Returns the specified control loop as indexed by the control loop identifier from the control loop ro...
TThis module handles all routines pertaining to (advection-)diffusion coupled to (advection-)diffusio...
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
This module handles all domain mappings routines.
integer(intg), parameter problem_setup_finish_action
Finish setup action.
This module handles all equations mapping routines.
Contains information about the solver equations for a solver.
Contains information for a problem.
Contains the topology information for the nodes of a domain.
This module handles all distributed matrix vector routines.
This module handles all boundary conditions routines.
This module handles all solver routines.
This module contains all routines dealing with (non-distributed) matrix and vectors types...
subroutine, public control_loop_create_start(PROBLEM, CONTROL_LOOP, ERR, ERROR,)
Start the process of creating a control loop for a problem.
integer(intg), parameter problem_setup_solver_equations_type
Solver equations setup for a problem.
Contains information on the solver mapping between the global equation sets and the solver matrices...
subroutine, public solver_dynamic_scheme_set(SOLVER, SCHEME, ERR, ERROR,)
Sets/changes the scheme for a dynamic solver.
Contains information for a field variable defined on a field.
integer(intg), parameter problem_standard_multi_compartment_transport_subtype
Contains information on the setup information for an equations set.
A pointer to the domain decomposition for this domain.
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.
integer(intg), parameter, public boundary_condition_fixed
The dof is fixed as a boundary condition.
subroutine, public errors(NAME, ERR, ERROR)
Records the exiting error of the subroutine.
This module defines all constants shared across equations set routines.
subroutine, public solver_solver_equations_get(SOLVER, SOLVER_EQUATIONS, ERR, ERROR,)
Returns a pointer to the solver equations for a solver.
subroutine, public boundary_conditions_variable_get(BOUNDARY_CONDITIONS, FIELD_VARIABLE, BOUNDARY_CONDITIONS_VARIABLE, ERR, ERROR,)
Find the boundary conditions variable for a given field variable.
integer(intg), parameter equations_set_multi_comp_diffusion_three_comp_three_dim
Prescribed solution, using a source term to correct for error - 3D with 3 compartments.
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.
Flags an error condition.
This module handles all diffusion equation routines.
This module contains all kind definitions.
Temporary IO routines for fluid mechanics.