118 INTEGER(INTG),
INTENT(OUT) :: ERR
121 INTEGER(INTG) :: component_idx,deriv_idx,dim_idx,local_ny,node_idx,NUMBER_OF_DIMENSIONS,variable_idx,variable_type,global_ny
122 REAL(DP) ::
VALUE,X(3)
123 REAL(DP),
POINTER :: GEOMETRIC_PARAMETERS(:)
126 TYPE(
field_type),
POINTER :: DEPENDENT_FIELD,GEOMETRIC_FIELD
130 enters(
"Poisson_BoundaryConditionsAnalyticCalculate",err,error,*999)
132 IF(
ASSOCIATED(equations_set))
THEN 133 IF(
ASSOCIATED(equations_set%ANALYTIC))
THEN 134 dependent_field=>equations_set%DEPENDENT%DEPENDENT_FIELD
135 IF(
ASSOCIATED(dependent_field))
THEN 136 geometric_field=>equations_set%GEOMETRY%GEOMETRIC_FIELD
137 IF(
ASSOCIATED(geometric_field))
THEN 138 CALL field_number_of_components_get(geometric_field,field_u_variable_type,number_of_dimensions,err,error,*999)
139 NULLIFY(geometric_variable)
140 CALL field_variable_get(geometric_field,field_u_variable_type,geometric_variable,err,error,*999)
141 NULLIFY(geometric_parameters)
142 CALL field_parameter_set_data_get(geometric_field,field_u_variable_type,field_values_set_type,geometric_parameters, &
145 IF(
ASSOCIATED(boundary_conditions))
THEN 147 DO variable_idx=1,dependent_field%NUMBER_OF_VARIABLES
148 variable_type=dependent_field%VARIABLES(variable_idx)%VARIABLE_TYPE
149 field_variable=>dependent_field%VARIABLE_TYPE_MAP(variable_type)%PTR
150 IF(
ASSOCIATED(field_variable))
THEN 151 CALL field_parameter_set_create(dependent_field,variable_type,field_analytic_values_set_type,err,error,*999)
152 DO component_idx=1,field_variable%NUMBER_OF_COMPONENTS
153 IF(field_variable%COMPONENTS(component_idx)%INTERPOLATION_TYPE==field_node_based_interpolation)
THEN 154 domain=>field_variable%COMPONENTS(component_idx)%DOMAIN
155 IF(
ASSOCIATED(domain))
THEN 156 IF(
ASSOCIATED(domain%TOPOLOGY))
THEN 157 domain_nodes=>domain%TOPOLOGY%NODES
158 IF(
ASSOCIATED(domain_nodes))
THEN 161 DO node_idx=1,domain_nodes%NUMBER_OF_NODES
163 DO dim_idx=1,number_of_dimensions
164 local_ny=geometric_variable%COMPONENTS(dim_idx)%PARAM_TO_DOF_MAP%NODE_PARAM2DOF_MAP% &
165 & nodes(node_idx)%DERIVATIVES(1)%VERSIONS(1)
166 x(dim_idx)=geometric_parameters(local_ny)
169 DO deriv_idx=1,domain_nodes%NODES(node_idx)%NUMBER_OF_DERIVATIVES
170 SELECT CASE(equations_set%ANALYTIC%ANALYTIC_FUNCTION_TYPE)
173 SELECT CASE(variable_type)
174 CASE(field_u_variable_type)
175 SELECT CASE(domain_nodes%NODES(node_idx)%DERIVATIVES(deriv_idx)%GLOBAL_DERIVATIVE_INDEX)
177 VALUE=log(4.0_dp/((x(1)+x(2)+1.0_dp)**2))
179 CALL flagerror(
"Not implemented.",err,error,*999)
181 CALL flagerror(
"Not implemented.",err,error,*999)
183 CALL flagerror(
"Not implemented.",err,error,*999)
186 domain_nodes%NODES(node_idx)%DERIVATIVES(deriv_idx)%GLOBAL_DERIVATIVE_INDEX,
"*", &
187 & err,error))//
" is invalid." 188 CALL flagerror(local_error,err,error,*999)
190 CASE(field_deludeln_variable_type)
191 SELECT CASE(domain_nodes%NODES(node_idx)%DERIVATIVES(deriv_idx)%GLOBAL_DERIVATIVE_INDEX)
194 VALUE=-2.0_dp*(x(1)+x(2))/(x(1)+x(2)+1.0_dp)
196 CALL flagerror(
"Not implemented.",err,error,*999)
198 CALL flagerror(
"Not implemented.",err,error,*999)
200 CALL flagerror(
"Not implemented.",err,error,*999)
203 domain_nodes%NODES(node_idx)%DERIVATIVES(deriv_idx)%GLOBAL_DERIVATIVE_INDEX,
"*", &
204 & err,error))//
" is invalid." 205 CALL flagerror(local_error,err,error,*999)
209 CALL flagerror(
"The analytic function type is not implemented yet.",err,error,*999)
211 CALL flagerror(
"The analytic function type is not implemented yet.",err,error,*999)
214 SELECT CASE(variable_type)
215 CASE(field_u_variable_type)
216 SELECT CASE(domain_nodes%NODES(node_idx)%DERIVATIVES(deriv_idx)%GLOBAL_DERIVATIVE_INDEX)
218 VALUE=log(6.0_dp/((x(1)+x(2)+x(3)+1.0_dp)**2))
220 CALL flagerror(
"Not implemented.",err,error,*999)
222 CALL flagerror(
"Not implemented.",err,error,*999)
224 CALL flagerror(
"Not implemented.",err,error,*999)
227 domain_nodes%NODES(node_idx)%DERIVATIVES(deriv_idx)%GLOBAL_DERIVATIVE_INDEX,
"*", &
228 & err,error))//
" is invalid." 229 CALL flagerror(local_error,err,error,*999)
231 CASE(field_deludeln_variable_type)
232 SELECT CASE(domain_nodes%NODES(node_idx)%DERIVATIVES(deriv_idx)%GLOBAL_DERIVATIVE_INDEX)
234 VALUE=-3.0_dp/(x(1)+x(2)+x(3)+1.0_dp)
236 CALL flagerror(
"Not implemented.",err,error,*999)
238 CALL flagerror(
"Not implemented.",err,error,*999)
240 CALL flagerror(
"Not implemented.",err,error,*999)
243 domain_nodes%NODES(node_idx)%DERIVATIVES(deriv_idx)%GLOBAL_DERIVATIVE_INDEX,
"*", &
244 & err,error))//
" is invalid." 245 CALL flagerror(local_error,err,error,*999)
250 CALL flagerror(local_error,err,error,*999)
253 CALL flagerror(
"The analytic function type is not implemented yet.",err,error,*999)
255 CALL flagerror(
"The analytic function type is not implemented yet.",err,error,*999)
259 SELECT CASE(variable_type)
260 CASE(field_u_variable_type)
261 SELECT CASE(domain_nodes%NODES(node_idx)%DERIVATIVES(deriv_idx)%GLOBAL_DERIVATIVE_INDEX)
263 VALUE=sin(2.0_dp*
pi*x(1)/10.0_dp)*sin(2.0_dp*
pi*x(2)/10.0_dp)*sin(2.0_dp*
pi*x(3)/10.0_dp)
266 CALL flagerror(
"Not implemented.",err,error,*999)
268 CALL flagerror(
"Not implemented.",err,error,*999)
270 CALL flagerror(
"Not implemented.",err,error,*999)
273 domain_nodes%NODES(node_idx)%DERIVATIVES(deriv_idx)%GLOBAL_DERIVATIVE_INDEX,
"*", &
274 & err,error))//
" is invalid." 275 CALL flagerror(local_error,err,error,*999)
277 CASE(field_deludeln_variable_type)
278 SELECT CASE(domain_nodes%NODES(node_idx)%DERIVATIVES(deriv_idx)%GLOBAL_DERIVATIVE_INDEX)
282 CALL flagerror(
"Not implemented.",err,error,*999)
284 CALL flagerror(
"Not implemented.",err,error,*999)
286 CALL flagerror(
"Not implemented.",err,error,*999)
289 domain_nodes%NODES(node_idx)%DERIVATIVES(deriv_idx)%GLOBAL_DERIVATIVE_INDEX,
"*", &
290 & err,error))//
" is invalid." 291 CALL flagerror(local_error,err,error,*999)
296 CALL flagerror(local_error,err,error,*999)
299 local_error=
"The analytic function type of "// &
302 CALL flagerror(local_error,err,error,*999)
305 local_ny=field_variable%COMPONENTS(component_idx)%PARAM_TO_DOF_MAP% &
306 & node_param2dof_map%NODES(node_idx)%DERIVATIVES(deriv_idx)%VERSIONS(1)
307 CALL field_parameter_set_update_local_dof(dependent_field,variable_type, &
308 & field_analytic_values_set_type,local_ny,
VALUE,err,error,*999)
310 global_ny=field_variable%DOMAIN_MAPPING%LOCAL_TO_GLOBAL_MAP(local_ny)
312 IF(variable_type==field_u_variable_type.AND.domain_nodes%NODES(node_idx)%BOUNDARY_NODE)
THEN 317 IF(variable_type==field_deludeln_variable_type.and.node_idx/=1)
THEN 318 IF(domain_nodes%NODES(node_idx)%BOUNDARY_NODE)
THEN 329 CALL flagerror(
"Domain topology nodes is not associated.",err,error,*999)
332 CALL flagerror(
"Domain topology is not associated.",err,error,*999)
335 CALL flagerror(
"Domain is not associated.",err,error,*999)
338 CALL flagerror(
"Only node based interpolation is implemented.",err,error,*999)
341 CALL field_parameter_set_update_start(dependent_field,variable_type,field_analytic_values_set_type, &
343 CALL field_parameter_set_update_finish(dependent_field,variable_type,field_analytic_values_set_type, &
346 CALL flagerror(
"Field variable is not associated.",err,error,*999)
351 CALL field_parameter_set_data_restore(geometric_field,field_u_variable_type,field_values_set_type, &
352 & geometric_parameters,err,error,*999)
355 CALL flagerror(
"Boundary conditions is not associated.",err,error,*999)
358 CALL flagerror(
"Equations set geometric field is not associated.",err,error,*999)
361 CALL flagerror(
"Equations set dependent field is not associated.",err,error,*999)
364 CALL flagerror(
"Equations set analytic is not associated.",err,error,*999)
367 CALL flagerror(
"Equations set is not associated.",err,error,*999)
370 exits(
"Poisson_BoundaryConditionsAnalyticCalculate")
372 999 errorsexits(
"Poisson_BoundaryConditionsAnalyticCalculate",err,error)
387 INTEGER(INTG),
INTENT(OUT) :: ERR
392 enters(
"POISSON_EQUATION_EQUATIONS_SET_SETUP",err,error,*999)
394 IF(
ASSOCIATED(equations_set))
THEN 395 IF(.NOT.
ALLOCATED(equations_set%SPECIFICATION))
THEN 396 CALL flagerror(
"Equations set specification is not allocated.",err,error,*999)
397 ELSE IF(
SIZE(equations_set%SPECIFICATION,1)/=3)
THEN 398 CALL flagerror(
"Equations set specification must have three entries for a Poisson type equations set.", &
401 SELECT CASE(equations_set%SPECIFICATION(3))
416 local_error=
"Equations set subtype "//
trim(
number_to_vstring(equations_set%SPECIFICATION(3),
"*",err,error))// &
417 &
" is not valid for a Poisson equation type of a classical field equation set class." 418 CALL flagerror(local_error,err,error,*999)
421 CALL flagerror(
"Equations set is not associated.",err,error,*999)
424 exits(
"POISSON_EQUATION_EQUATIONS_SET_SETUP")
426 999 errorsexits(
"POISSON_EQUATION_EQUATIONS_SET_SETUP",err,error)
439 INTEGER(INTG),
INTENT(IN) :: SOLUTION_METHOD
440 INTEGER(INTG),
INTENT(OUT) :: ERR
445 enters(
"Poisson_EquationsSetSolutionMethodSet",err,error,*999)
447 IF(
ASSOCIATED(equations_set))
THEN 448 IF(.NOT.
ALLOCATED(equations_set%SPECIFICATION))
THEN 449 CALL flagerror(
"Equations set specification is not allocated.",err,error,*999)
450 ELSE IF(
SIZE(equations_set%SPECIFICATION,1)/=3)
THEN 451 CALL flagerror(
"Equations set specification must have three entries for a Poisson type equations set.", &
454 SELECT CASE(equations_set%SPECIFICATION(3))
456 SELECT CASE(solution_method)
460 CALL flagerror(
"Not implemented.",err,error,*999)
462 CALL flagerror(
"Not implemented.",err,error,*999)
464 CALL flagerror(
"Not implemented.",err,error,*999)
466 CALL flagerror(
"Not implemented.",err,error,*999)
468 CALL flagerror(
"Not implemented.",err,error,*999)
470 local_error=
"The specified solution method of "//
trim(
number_to_vstring(solution_method,
"*",err,error))//
" is invalid." 471 CALL flagerror(local_error,err,error,*999)
474 SELECT CASE(solution_method)
478 CALL flagerror(
"Not implemented.",err,error,*999)
480 CALL flagerror(
"Not implemented.",err,error,*999)
482 CALL flagerror(
"Not implemented.",err,error,*999)
484 CALL flagerror(
"Not implemented.",err,error,*999)
486 CALL flagerror(
"Not implemented.",err,error,*999)
488 local_error=
"The specified solution method of "//
trim(
number_to_vstring(solution_method,
"*",err,error))//
" is invalid." 489 CALL flagerror(local_error,err,error,*999)
494 SELECT CASE(solution_method)
498 CALL flagerror(
"Not implemented.",err,error,*999)
500 CALL flagerror(
"Not implemented.",err,error,*999)
502 CALL flagerror(
"Not implemented.",err,error,*999)
504 CALL flagerror(
"Not implemented.",err,error,*999)
506 CALL flagerror(
"Not implemented.",err,error,*999)
508 local_error=
"The specified solution method of "//
trim(
number_to_vstring(solution_method,
"*",err,error))//
" is invalid." 509 CALL flagerror(local_error,err,error,*999)
512 SELECT CASE(solution_method)
516 CALL flagerror(
"Not implemented.",err,error,*999)
518 CALL flagerror(
"Not implemented.",err,error,*999)
520 CALL flagerror(
"Not implemented.",err,error,*999)
522 CALL flagerror(
"Not implemented.",err,error,*999)
524 CALL flagerror(
"Not implemented.",err,error,*999)
526 local_error=
"The specified solution method of "//
trim(
number_to_vstring(solution_method,
"*",err,error))//
" is invalid." 527 CALL flagerror(local_error,err,error,*999)
530 SELECT CASE(solution_method)
534 CALL flagerror(
"Not implemented.",err,error,*999)
536 CALL flagerror(
"Not implemented.",err,error,*999)
538 CALL flagerror(
"Not implemented.",err,error,*999)
540 CALL flagerror(
"Not implemented.",err,error,*999)
542 CALL flagerror(
"Not implemented.",err,error,*999)
544 local_error=
"The specified solution method of "//
trim(
number_to_vstring(solution_method,
"*",err,error))//
" is invalid." 545 CALL flagerror(local_error,err,error,*999)
548 local_error=
"Equations set subtype of "//
trim(
number_to_vstring(equations_set%SPECIFICATION(3),
"*",err,error))// &
549 &
" is not valid for a Poisson equation type of an classical field equations set class." 550 CALL flagerror(local_error,err,error,*999)
553 CALL flagerror(
"Equations set is not associated.",err,error,*999)
556 exits(
"Poisson_EquationsSetSolutionMethodSet")
558 999
errors(
"Poisson_EquationsSetSolutionMethodSet",err,error)
559 exits(
"Poisson_EquationsSetSolutionMethodSet")
572 INTEGER(INTG),
INTENT(IN) :: specification(:)
573 INTEGER(INTG),
INTENT(OUT) :: err
577 INTEGER(INTG) :: subtype
579 enters(
"Poisson_EquationsSetSpecificationSet",err,error,*999)
581 IF(
ASSOCIATED(equationsset))
THEN 582 IF(
SIZE(specification,1)<3)
THEN 583 CALL flagerror(
"Equations set specification must have at least 3 entries for a Poisson equations set.", &
586 subtype=specification(3)
599 localerror=
"The third equations set specification of "//
trim(
numbertovstring(subtype,
"*",err,error))// &
600 &
" is not valid for a Poisson equations set." 601 CALL flagerror(localerror,err,error,*999)
604 IF(
ALLOCATED(equationsset%specification))
THEN 605 CALL flagerror(
"Equations set specification is already allocated.",err,error,*999)
607 ALLOCATE(equationsset%specification(3),stat=err)
608 IF(err/=0)
CALL flagerror(
"Could not allocate equations set specification.",err,error,*999)
612 CALL flagerror(
"Equations set is not associated.",err,error,*999)
615 exits(
"Poisson_EquationsSetSpecificationSet")
617 999
errors(
"Poisson_EquationsSetSpecificationSet",err,error)
618 exits(
"Poisson_EquationsSetSpecificationSet")
633 INTEGER(INTG),
INTENT(OUT) :: ERR
636 INTEGER(INTG) :: component_idx,GEOMETRIC_COMPONENT_NUMBER,GEOMETRIC_SCALING_TYPE,NUMBER_OF_DIMENSIONS, &
637 & NUMBER_OF_MATERIALS_COMPONENTS,GEOMETRIC_MESH_COMPONENT,SOURCE_FIELD_NUMBER_OF_COMPONENTS,I, &
638 & SOURCE_FIELD_NUMBER_OF_VARIABLES
644 TYPE(
field_type),
POINTER :: analytic_field,DEPENDENT_FIELD,geometric_field
647 enters(
"Poisson_EquationsSetPressurePoissonSetup",err,error,*999)
649 NULLIFY(equations_mapping)
650 NULLIFY(equations_matrices)
651 NULLIFY(geometric_decomposition)
652 IF(
ASSOCIATED(equations_set))
THEN 653 IF(.NOT.
ALLOCATED(equations_set%SPECIFICATION))
THEN 654 CALL flagerror(
"Equations set specification is not allocated.",err,error,*999)
655 ELSE IF(
SIZE(equations_set%SPECIFICATION,1)/=3)
THEN 656 CALL flagerror(
"Equations set specification must have three entries for a Poisson type equations set.", &
663 SELECT CASE(equations_set_setup%SETUP_TYPE)
665 SELECT CASE(equations_set_setup%ACTION_TYPE)
671 local_error=
"The action type of "//
trim(
number_to_vstring(equations_set_setup%ACTION_TYPE,
"*",err,error))// &
673 &
" is invalid for a velocity source Poisson equation." 674 CALL flagerror(local_error,err,error,*999)
679 SELECT CASE(equations_set_setup%ACTION_TYPE)
681 IF(equations_set%DEPENDENT%DEPENDENT_FIELD_AUTO_CREATED)
THEN 683 CALL field_create_start(equations_set_setup%FIELD_USER_NUMBER,equations_set%REGION,equations_set%DEPENDENT% &
684 & dependent_field,err,error,*999)
685 CALL field_type_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_general_type,err,error,*999)
686 CALL field_dependent_type_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_dependent_type,err,error,*999)
687 CALL field_mesh_decomposition_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_decomposition,err,error,*999)
688 CALL field_mesh_decomposition_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,geometric_decomposition, &
690 CALL field_geometric_field_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,equations_set%GEOMETRY% &
691 & geometric_field,err,error,*999)
692 CALL field_number_of_variables_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,2,err,error,*999)
693 CALL field_variable_types_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,(/field_u_variable_type, &
694 & field_deludeln_variable_type/),err,error,*999)
695 CALL field_dimension_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type, &
696 & field_scalar_dimension_type,err,error,*999)
697 CALL field_dimension_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_deludeln_variable_type, &
698 & field_scalar_dimension_type,err,error,*999)
699 CALL field_data_type_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type, &
700 & field_dp_type,err,error,*999)
701 CALL field_data_type_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_deludeln_variable_type, &
702 & field_dp_type,err,error,*999)
703 CALL field_number_of_components_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type,1, &
705 CALL field_number_of_components_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_deludeln_variable_type,1, &
708 CALL field_component_mesh_component_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type,1, &
709 & geometric_component_number,err,error,*999)
710 CALL field_component_mesh_component_set(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type,1, &
711 & geometric_component_number,err,error,*999)
712 CALL field_component_mesh_component_set(equations_set%DEPENDENT%DEPENDENT_FIELD,field_deludeln_variable_type,1, &
713 & geometric_component_number,err,error,*999)
714 SELECT CASE(equations_set%SOLUTION_METHOD)
716 CALL field_component_interpolation_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type,1, &
717 & field_node_based_interpolation,err,error,*999)
718 CALL field_component_interpolation_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD, &
719 & field_deludeln_variable_type,1,field_node_based_interpolation,err,error,*999)
721 CALL field_scaling_type_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_scaling_type,err,error,*999)
722 CALL field_scaling_type_set(equations_set%DEPENDENT%DEPENDENT_FIELD,geometric_scaling_type,err,error,*999)
724 CALL flagerror(
"Not implemented.",err,error,*999)
726 CALL flagerror(
"Not implemented.",err,error,*999)
728 CALL flagerror(
"Not implemented.",err,error,*999)
730 CALL flagerror(
"Not implemented.",err,error,*999)
732 CALL flagerror(
"Not implemented.",err,error,*999)
734 local_error=
"The solution method of "//
trim(
number_to_vstring(equations_set%SOLUTION_METHOD,
"*",err,error))// &
736 CALL flagerror(local_error,err,error,*999)
740 CALL field_type_check(equations_set_setup%FIELD,field_general_type,err,error,*999)
741 CALL field_dependent_type_check(equations_set_setup%FIELD,field_dependent_type,err,error,*999)
742 CALL field_number_of_variables_check(equations_set_setup%FIELD,2,err,error,*999)
743 CALL field_variable_types_check(equations_set_setup%FIELD,(/field_u_variable_type,field_deludeln_variable_type/), &
745 CALL field_dimension_check(equations_set_setup%FIELD,field_u_variable_type,field_scalar_dimension_type,err,error,*999)
746 CALL field_dimension_check(equations_set_setup%FIELD,field_deludeln_variable_type,field_scalar_dimension_type, &
748 CALL field_data_type_check(equations_set_setup%FIELD,field_u_variable_type,field_dp_type,err,error,*999)
749 CALL field_data_type_check(equations_set_setup%FIELD,field_deludeln_variable_type,field_dp_type,err,error,*999)
750 CALL field_number_of_components_check(equations_set_setup%FIELD,field_u_variable_type,1,err,error,*999)
751 CALL field_number_of_components_check(equations_set_setup%FIELD,field_deludeln_variable_type,1,err,error,*999)
752 SELECT CASE(equations_set%SOLUTION_METHOD)
754 CALL field_component_interpolation_check(equations_set_setup%FIELD,field_u_variable_type,1, &
755 & field_node_based_interpolation,err,error,*999)
756 CALL field_component_interpolation_check(equations_set_setup%FIELD,field_deludeln_variable_type,1, &
757 & field_node_based_interpolation,err,error,*999)
759 CALL flagerror(
"Not implemented.",err,error,*999)
761 CALL flagerror(
"Not implemented.",err,error,*999)
763 CALL flagerror(
"Not implemented.",err,error,*999)
765 CALL flagerror(
"Not implemented.",err,error,*999)
767 CALL flagerror(
"Not implemented.",err,error,*999)
769 local_error=
"The solution method of "//
trim(
number_to_vstring(equations_set%SOLUTION_METHOD,
"*",err,error))// &
771 CALL flagerror(local_error,err,error,*999)
775 IF(equations_set%DEPENDENT%DEPENDENT_FIELD_AUTO_CREATED)
THEN 776 CALL field_create_finish(equations_set%DEPENDENT%DEPENDENT_FIELD,err,error,*999)
778 CALL field_parameter_set_create(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type, &
779 & field_input_vel1_set_type,err,error,*999)
780 CALL field_parameter_set_create(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type, &
781 & field_input_vel2_set_type,err,error,*999)
782 CALL field_parameter_set_create(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type, &
783 & field_input_vel3_set_type,err,error,*999)
785 CALL field_parameter_set_create(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type, &
786 & field_input_label_set_type,err,error,*999)
789 local_error=
"The action type of "//
trim(
number_to_vstring(equations_set_setup%ACTION_TYPE,
"*",err,error))// &
791 &
" is invalid for a velocity source Poisson equation" 792 CALL flagerror(local_error,err,error,*999)
795 SELECT CASE(equations_set_setup%ACTION_TYPE)
797 equations_materials=>equations_set%MATERIALS
798 IF(
ASSOCIATED(equations_materials))
THEN 799 IF(equations_materials%MATERIALS_FIELD_AUTO_CREATED)
THEN 801 CALL field_create_start(equations_set_setup%FIELD_USER_NUMBER,equations_set%REGION,equations_materials% &
802 & materials_field,err,error,*999)
803 CALL field_type_set_and_lock(equations_materials%MATERIALS_FIELD,field_material_type,err,error,*999)
804 CALL field_dependent_type_set_and_lock(equations_materials%MATERIALS_FIELD,field_independent_type,err,error,*999)
805 CALL field_mesh_decomposition_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_decomposition,err,error,*999)
806 CALL field_mesh_decomposition_set_and_lock(equations_materials%MATERIALS_FIELD,geometric_decomposition, &
808 CALL field_geometric_field_set_and_lock(equations_materials%MATERIALS_FIELD,equations_set%GEOMETRY% &
809 & geometric_field,err,error,*999)
810 CALL field_number_of_variables_set_and_lock(equations_materials%MATERIALS_FIELD,1,err,error,*999)
811 CALL field_variable_types_set_and_lock(equations_materials%MATERIALS_FIELD,(/field_u_variable_type/), &
813 CALL field_dimension_set_and_lock(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
814 & field_vector_dimension_type,err,error,*999)
815 CALL field_data_type_set_and_lock(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
816 & field_dp_type,err,error,*999)
817 CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
818 & number_of_dimensions,err,error,*999)
822 number_of_materials_components=number_of_dimensions+1
826 number_of_materials_components=number_of_dimensions+2
829 CALL field_number_of_components_set_and_lock(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
830 & number_of_materials_components,err,error,*999)
832 DO component_idx=1,number_of_dimensions
833 CALL field_component_mesh_component_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
834 & component_idx,geometric_component_number,err,error,*999)
835 CALL field_component_mesh_component_set(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
836 & component_idx,geometric_component_number,err,error,*999)
837 CALL field_component_interpolation_set(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
838 & component_idx,field_constant_interpolation,err,error,*999)
841 CALL field_component_mesh_component_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
842 & 1,geometric_component_number,err,error,*999)
843 DO component_idx=number_of_dimensions+1,number_of_materials_components
844 CALL field_component_mesh_component_set(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
845 & component_idx,geometric_component_number,err,error,*999)
846 CALL field_component_interpolation_set(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
847 & component_idx,field_constant_interpolation,err,error,*999)
850 CALL field_scaling_type_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_scaling_type,err,error,*999)
851 CALL field_scaling_type_set(equations_materials%MATERIALS_FIELD,geometric_scaling_type,err,error,*999)
854 CALL field_type_check(equations_set_setup%FIELD,field_material_type,err,error,*999)
855 CALL field_dependent_type_check(equations_set_setup%FIELD,field_independent_type,err,error,*999)
856 CALL field_number_of_variables_check(equations_set_setup%FIELD,1,err,error,*999)
857 CALL field_variable_types_check(equations_set_setup%FIELD,(/field_u_variable_type/),err,error,*999)
858 CALL field_dimension_check(equations_set_setup%FIELD,field_u_variable_type,field_vector_dimension_type, &
860 CALL field_data_type_check(equations_set_setup%FIELD,field_u_variable_type,field_dp_type,err,error,*999)
861 CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
862 & number_of_dimensions,err,error,*999)
864 CALL field_number_of_components_check(equations_set_setup%FIELD,field_u_variable_type,number_of_dimensions+1, &
867 CALL field_number_of_components_check(equations_set_setup%FIELD,field_u_variable_type,number_of_dimensions+2, &
872 CALL flagerror(
"Equations set materials is not associated.",err,error,*999)
876 equations_materials=>equations_set%MATERIALS
877 IF(
ASSOCIATED(equations_materials))
THEN 878 IF(equations_materials%MATERIALS_FIELD_AUTO_CREATED)
THEN 880 CALL field_create_finish(equations_materials%MATERIALS_FIELD,err,error,*999)
882 CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
883 & number_of_dimensions,err,error,*999)
887 number_of_materials_components=number_of_dimensions+1
891 number_of_materials_components=number_of_dimensions+2
894 DO component_idx=1,number_of_dimensions
895 CALL field_component_values_initialise(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
896 & field_values_set_type,component_idx,1.0_dp,err,error,*999)
899 DO component_idx=number_of_dimensions+1,number_of_materials_components
900 CALL field_component_values_initialise(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
901 & field_values_set_type,component_idx,1.0_dp,err,error,*999)
905 CALL flagerror(
"Equations set materials is not associated.",err,error,*999)
908 local_error=
"The action type of "//
trim(
number_to_vstring(equations_set_setup%ACTION_TYPE,
"*",err,error))// &
910 &
" is invalid for a velocity source Poisson equation." 911 CALL flagerror(local_error,err,error,*999)
914 SELECT CASE(equations_set%SPECIFICATION(3))
917 SELECT CASE(equations_set_setup%ACTION_TYPE)
920 IF(equations_set%SOURCE%SOURCE_FIELD_AUTO_CREATED)
THEN 923 CALL field_create_start(equations_set_setup%FIELD_USER_NUMBER,equations_set%REGION, &
924 & equations_set%SOURCE%SOURCE_FIELD,err,error,*999)
926 CALL field_type_set_and_lock(equations_set%SOURCE%SOURCE_FIELD,field_general_type,err,error,*999)
928 CALL field_label_set_and_lock(equations_set%SOURCE%SOURCE_FIELD,
"Source Field",err,error, &
931 CALL field_dependent_type_set_and_lock(equations_set%SOURCE%SOURCE_FIELD, &
932 & field_independent_type,err,error,*999)
934 CALL field_mesh_decomposition_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_decomposition, &
937 CALL field_mesh_decomposition_set_and_lock(equations_set%SOURCE%SOURCE_FIELD, &
938 & geometric_decomposition,err,error,*999)
940 CALL field_geometric_field_set_and_lock(equations_set%SOURCE%SOURCE_FIELD,equations_set% &
941 & geometry%GEOMETRIC_FIELD,err,error,*999)
943 source_field_number_of_variables=1
944 CALL field_number_of_variables_set_and_lock(equations_set%SOURCE%SOURCE_FIELD, &
945 & source_field_number_of_variables,err,error,*999)
946 CALL field_variable_types_set_and_lock(equations_set%SOURCE%SOURCE_FIELD, &
947 & (/field_u_variable_type/),err,error,*999)
948 CALL field_dimension_set_and_lock(equations_set%SOURCE%SOURCE_FIELD,field_u_variable_type, &
949 & field_vector_dimension_type,err,error,*999)
950 CALL field_data_type_set_and_lock(equations_set%SOURCE%SOURCE_FIELD,field_u_variable_type, &
951 & field_dp_type,err,error,*999)
952 CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
953 & number_of_dimensions,err,error,*999)
955 source_field_number_of_components=number_of_dimensions
956 CALL field_number_of_components_set_and_lock(equations_set%SOURCE%SOURCE_FIELD, &
957 & field_u_variable_type,source_field_number_of_components,err,error,*999)
958 CALL field_component_mesh_component_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
959 & 1,geometric_mesh_component,err,error,*999)
961 DO i=1,source_field_number_of_components
962 CALL field_component_mesh_component_set(equations_set%SOURCE%SOURCE_FIELD, &
963 & field_u_variable_type,i,geometric_mesh_component,err,error,*999)
966 SELECT CASE(equations_set%SOLUTION_METHOD)
969 DO i=1,source_field_number_of_components
970 CALL field_component_interpolation_set_and_lock(equations_set%SOURCE%SOURCE_FIELD, &
971 & field_u_variable_type,i,field_node_based_interpolation,err,error,*999)
973 CALL field_scaling_type_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_scaling_type, &
975 CALL field_scaling_type_set(equations_set%SOURCE%SOURCE_FIELD,geometric_scaling_type, &
979 local_error=
"The solution method of " &
981 CALL flagerror(local_error,err,error,*999)
985 CALL field_type_check(equations_set_setup%FIELD,field_general_type,err,error,*999)
986 CALL field_dependent_type_check(equations_set_setup%FIELD,field_independent_type,err,error,*999)
987 CALL field_number_of_variables_check(equations_set_setup%FIELD,1,err,error,*999)
988 CALL field_variable_types_check(equations_set_setup%FIELD,(/field_u_variable_type/),err,error,*999)
989 CALL field_dimension_check(equations_set_setup%FIELD,field_u_variable_type,field_vector_dimension_type, &
991 CALL field_data_type_check(equations_set_setup%FIELD,field_u_variable_type,field_dp_type,err,error,*999)
992 CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
993 & number_of_dimensions,err,error,*999)
995 source_field_number_of_components=number_of_dimensions
996 CALL field_number_of_components_check(equations_set_setup%FIELD,field_u_variable_type, &
997 & source_field_number_of_components,err,error,*999)
998 SELECT CASE(equations_set%SOLUTION_METHOD)
1000 CALL field_component_interpolation_check(equations_set_setup%FIELD,field_u_variable_type,1, &
1001 & field_node_based_interpolation,err,error,*999)
1002 CALL field_component_interpolation_check(equations_set_setup%FIELD,field_deludeln_variable_type,1, &
1003 & field_node_based_interpolation,err,error,*999)
1006 &
"*",err,error))//
" is invalid." 1007 CALL flagerror(local_error,err,error,*999)
1012 IF(equations_set%SOURCE%SOURCE_FIELD_AUTO_CREATED)
THEN 1013 CALL field_create_finish(equations_set%SOURCE%SOURCE_FIELD,err,error,*999)
1015 CALL field_parameter_set_create(equations_set%SOURCE%SOURCE_FIELD,field_u_variable_type, &
1016 & field_input_data1_set_type,err,error,*999)
1017 CALL field_parameter_set_create(equations_set%SOURCE%SOURCE_FIELD,field_u_variable_type, &
1018 & field_input_data2_set_type,err,error,*999)
1025 local_error=
"The action type of "//
trim(
number_to_vstring(equations_set_setup%ACTION_TYPE,
"*",err,error))// &
1026 &
" for a setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
1027 &
" is invalid for a standard Navier-Poisson fluid" 1028 CALL flagerror(local_error,err,error,*999)
1031 local_error=
"The equation set subtype of "//
trim(
number_to_vstring(equations_set%SPECIFICATION(3),
"*",err,error))// &
1032 &
" for a setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
1033 &
" is invalid for a Navier-Poisson equation." 1034 CALL flagerror(local_error,err,error,*999)
1038 SELECT CASE(equations_set%SPECIFICATION(3))
1044 SELECT CASE(equations_set_setup%ACTION_TYPE)
1047 IF(equations_set%INDEPENDENT%INDEPENDENT_FIELD_AUTO_CREATED)
THEN 1050 CALL field_create_start(equations_set_setup%FIELD_USER_NUMBER,equations_set%REGION, &
1051 & equations_set%INDEPENDENT%INDEPENDENT_FIELD,err,error,*999)
1053 CALL field_type_set_and_lock(equations_set%INDEPENDENT%INDEPENDENT_FIELD,field_general_type,err,error,*999)
1055 CALL field_label_set_and_lock(equations_set%INDEPENDENT%INDEPENDENT_FIELD,
"Independent Field",err,error,*999)
1057 CALL field_dependent_type_set_and_lock(equations_set%INDEPENDENT%INDEPENDENT_FIELD, &
1058 & field_independent_type,err,error,*999)
1060 CALL field_mesh_decomposition_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_decomposition, &
1063 CALL field_mesh_decomposition_set_and_lock(equations_set%INDEPENDENT%INDEPENDENT_FIELD, &
1064 & geometric_decomposition,err,error,*999)
1066 CALL field_geometric_field_set_and_lock(equations_set%INDEPENDENT%INDEPENDENT_FIELD,equations_set% &
1067 & geometry%GEOMETRIC_FIELD,err,error,*999)
1069 CALL field_number_of_variables_set_and_lock(equations_set%INDEPENDENT%INDEPENDENT_FIELD, &
1071 CALL field_variable_types_set_and_lock(equations_set%INDEPENDENT%INDEPENDENT_FIELD, &
1072 & (/field_u_variable_type/),err,error,*999)
1073 CALL field_dimension_set_and_lock(equations_set%INDEPENDENT%INDEPENDENT_FIELD,field_u_variable_type, &
1074 & field_vector_dimension_type,err,error,*999)
1075 CALL field_data_type_set_and_lock(equations_set%INDEPENDENT%INDEPENDENT_FIELD,field_u_variable_type, &
1076 & field_dp_type,err,error,*999)
1077 CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
1078 & number_of_dimensions,err,error,*999)
1080 CALL field_number_of_components_set_and_lock(equations_set%INDEPENDENT%INDEPENDENT_FIELD, &
1081 & field_u_variable_type,number_of_dimensions,err,error,*999)
1082 CALL field_component_mesh_component_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
1083 & 1,geometric_mesh_component,err,error,*999)
1085 DO i=1,number_of_dimensions
1086 CALL field_component_mesh_component_set(equations_set%INDEPENDENT%INDEPENDENT_FIELD, &
1087 & field_u_variable_type,i,geometric_mesh_component,err,error,*999)
1089 SELECT CASE(equations_set%SOLUTION_METHOD)
1092 DO i=1,number_of_dimensions
1093 CALL field_component_interpolation_set_and_lock(equations_set%INDEPENDENT%INDEPENDENT_FIELD, &
1094 & field_u_variable_type,i,field_node_based_interpolation,err,error,*999)
1096 CALL field_scaling_type_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_scaling_type, &
1098 CALL field_scaling_type_set(equations_set%INDEPENDENT%INDEPENDENT_FIELD,geometric_scaling_type, &
1102 local_error=
"The solution method of " &
1104 CALL flagerror(local_error,err,error,*999)
1108 CALL field_type_check(equations_set_setup%FIELD,field_general_type,err,error,*999)
1109 CALL field_dependent_type_check(equations_set_setup%FIELD,field_independent_type,err,error,*999)
1110 CALL field_number_of_variables_check(equations_set_setup%FIELD,1,err,error,*999)
1111 CALL field_variable_types_check(equations_set_setup%FIELD,(/field_u_variable_type/),err,error,*999)
1112 CALL field_dimension_check(equations_set_setup%FIELD,field_u_variable_type,field_vector_dimension_type, &
1114 CALL field_data_type_check(equations_set_setup%FIELD,field_u_variable_type,field_dp_type,err,error,*999)
1115 CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
1116 & number_of_dimensions,err,error,*999)
1118 CALL field_number_of_components_check(equations_set_setup%FIELD,field_u_variable_type, &
1119 & number_of_dimensions,err,error,*999)
1120 SELECT CASE(equations_set%SOLUTION_METHOD)
1122 CALL field_component_interpolation_check(equations_set_setup%FIELD,field_u_variable_type,1, &
1123 & field_node_based_interpolation,err,error,*999)
1124 CALL field_component_interpolation_check(equations_set_setup%FIELD,field_deludeln_variable_type,1, &
1125 & field_node_based_interpolation,err,error,*999)
1128 &
"*",err,error))//
" is invalid." 1129 CALL flagerror(local_error,err,error,*999)
1134 IF(equations_set%INDEPENDENT%INDEPENDENT_FIELD_AUTO_CREATED)
THEN 1135 CALL field_create_finish(equations_set%INDEPENDENT%INDEPENDENT_FIELD,err,error,*999)
1136 CALL field_parameter_set_create(equations_set%INDEPENDENT%INDEPENDENT_FIELD,field_u_variable_type, &
1137 & field_mesh_displacement_set_type,err,error,*999)
1138 CALL field_parameter_set_create(equations_set%INDEPENDENT%INDEPENDENT_FIELD,field_u_variable_type, &
1139 & field_mesh_velocity_set_type,err,error,*999)
1140 CALL field_parameter_set_create(equations_set%INDEPENDENT%INDEPENDENT_FIELD,field_u_variable_type, &
1141 & field_boundary_set_type,err,error,*999)
1144 local_error=
"The action type of "//
trim(
number_to_vstring(equations_set_setup%ACTION_TYPE,
"*",err,error))// &
1145 &
" for a setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
1146 &
" is invalid for a standard PPE fluid" 1147 CALL flagerror(local_error,err,error,*999)
1150 local_error=
"The equation set subtype of "//
trim(
number_to_vstring(equations_set%SPECIFICATION(3),
"*",err,error))// &
1151 &
" for a setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
1152 &
" is invalid for a PPE equation." 1153 CALL flagerror(local_error,err,error,*999)
1156 SELECT CASE(equations_set_setup%ACTION_TYPE)
1158 IF(equations_set%DEPENDENT%DEPENDENT_FINISHED)
THEN 1159 dependent_field=>equations_set%DEPENDENT%DEPENDENT_FIELD
1160 IF(
ASSOCIATED(dependent_field))
THEN 1161 geometric_field=>equations_set%GEOMETRY%GEOMETRIC_FIELD
1162 IF(
ASSOCIATED(geometric_field))
THEN 1163 CALL field_number_of_components_get(geometric_field,field_u_variable_type,number_of_dimensions,err,error,*999)
1164 SELECT CASE(equations_set_setup%ANALYTIC_FUNCTION_TYPE)
1190 local_error=
"The specified analytic function type of "// &
1192 &
" is invalid for a velocity source Poisson equation." 1193 CALL flagerror(local_error,err,error,*999)
1196 CALL flagerror(
"Equations set geometric field is not associated.",err,error,*999)
1199 CALL flagerror(
"Equations set dependent field is not associated.",err,error,*999)
1202 CALL flagerror(
"Equations set dependent field has not been finished.",err,error,*999)
1205 IF(
ASSOCIATED(equations_set%ANALYTIC))
THEN 1206 analytic_field=>equations_set%ANALYTIC%ANALYTIC_FIELD
1207 IF(
ASSOCIATED(analytic_field))
THEN 1208 IF(equations_set%ANALYTIC%ANALYTIC_FIELD_AUTO_CREATED)
THEN 1209 CALL field_create_finish(equations_set%DEPENDENT%DEPENDENT_FIELD,err,error,*999)
1213 CALL flagerror(
"Equations set analytic is not associated.",err,error,*999)
1216 local_error=
"The action type of "//
trim(
number_to_vstring(equations_set_setup%ACTION_TYPE,
"*",err,error))// &
1217 &
" for a setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
1218 &
" is invalid for a velocity source Poisson equation." 1219 CALL flagerror(local_error,err,error,*999)
1222 SELECT CASE(equations_set_setup%ACTION_TYPE)
1224 IF(equations_set%DEPENDENT%DEPENDENT_FINISHED)
THEN 1230 CALL flagerror(
"Equations set dependent field has not been finished.",err,error,*999)
1233 SELECT CASE(equations_set%SOLUTION_METHOD)
1248 SELECT CASE(equations%SPARSITY_TYPE)
1258 local_error=
"The equations matrices sparsity type of "// &
1260 CALL flagerror(local_error,err,error,*999)
1264 CALL flagerror(
"Not implemented.",err,error,*999)
1266 CALL flagerror(
"Not implemented.",err,error,*999)
1268 CALL flagerror(
"Not implemented.",err,error,*999)
1270 CALL flagerror(
"Not implemented.",err,error,*999)
1272 CALL flagerror(
"Not implemented.",err,error,*999)
1274 local_error=
"The solution method of "//
trim(
number_to_vstring(equations_set%SOLUTION_METHOD,
"*",err,error))// &
1276 CALL flagerror(local_error,err,error,*999)
1279 local_error=
"The action type of "//
trim(
number_to_vstring(equations_set_setup%ACTION_TYPE,
"*",err,error))// &
1280 &
" for a setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
1281 &
" is invalid for a velocity source Poisson equation." 1282 CALL flagerror(local_error,err,error,*999)
1285 local_error=
"The setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
1286 &
" is invalid for a velocity source Poisson equation." 1287 CALL flagerror(local_error,err,error,*999)
1290 local_error=
"The equations set subtype of "//
trim(
number_to_vstring(equations_set%SPECIFICATION(3),
"*",err,error))// &
1291 &
" is not a velocity source Poisson equation subtype." 1292 CALL flagerror(local_error,err,error,*999)
1295 CALL flagerror(
"Equations set is not associated.",err,error,*999)
1298 exits(
"Poisson_EquationsSetPressurePoissonSetup")
1300 999
errors(
"Poisson_EquationsSetPressurePoissonSetup",err,error)
1301 exits(
"Poisson_EquationsSetPressurePoissonSetup")
1316 INTEGER(INTG),
INTENT(OUT) :: ERR
1319 TYPE(
solver_type),
POINTER :: SOLVER_ALE_PPE, SOLVER_LAPLACE
1320 TYPE(
field_type),
POINTER :: INDEPENDENT_FIELD_ALE_PPE
1331 REAL(DP) :: CURRENT_TIME,TIME_INCREMENT,ALPHA
1332 REAL(DP),
POINTER :: MESH_DISPLACEMENT_VALUES(:)
1333 INTEGER(INTG) :: NUMBER_OF_DIMENSIONS_ALE_PPE,GEOMETRIC_MESH_COMPONENT
1334 INTEGER(INTG) :: INPUT_TYPE,INPUT_OPTION,component_idx,deriv_idx,local_ny,node_idx,variable_idx,variable_type
1336 enters(
"POISSON_PRE_SOLVE_UPDATE_PPE_MESH",err,error,*999)
1338 IF(
ASSOCIATED(control_loop))
THEN 1340 NULLIFY(solver_laplace)
1341 NULLIFY(solver_ale_ppe)
1342 IF(
ASSOCIATED(solver))
THEN 1343 IF(
ASSOCIATED(control_loop%PARENT_LOOP%PROBLEM))
THEN 1344 IF(.NOT.
ALLOCATED(control_loop%PROBLEM%SPECIFICATION))
THEN 1345 CALL flagerror(
"Problem specification is not allocated.",err,error,*999)
1346 ELSE IF(
SIZE(control_loop%PROBLEM%SPECIFICATION,1)<3)
THEN 1347 CALL flagerror(
"Problem specification must have three entries for a Poisson problem.",err,error,*999)
1349 SELECT CASE(control_loop%PARENT_LOOP%PROBLEM%SPECIFICATION(3))
1359 solver_equations_ale_ppe=>solver_ale_ppe%SOLVER_EQUATIONS
1360 IF(
ASSOCIATED(solver_equations_ale_ppe))
THEN 1361 solver_mapping_ale_ppe=>solver_equations_ale_ppe%SOLVER_MAPPING
1362 IF(
ASSOCIATED(solver_mapping_ale_ppe))
THEN 1363 equations_set_ale_ppe=>solver_mapping_ale_ppe%EQUATIONS_SETS(1)%PTR
1364 IF(
ASSOCIATED(equations_set_ale_ppe))
THEN 1365 independent_field_ale_ppe=>equations_set_ale_ppe%INDEPENDENT%INDEPENDENT_FIELD
1367 CALL flagerror(
"ALE PPE equations set is not associated.",err,error,*999)
1370 CALL field_number_of_components_get(equations_set_ale_ppe%GEOMETRY%GEOMETRIC_FIELD, &
1371 & field_u_variable_type,number_of_dimensions_ale_ppe,err,error,*999)
1376 NULLIFY(mesh_displacement_values)
1377 CALL field_parameter_set_data_get(equations_set_ale_ppe%INDEPENDENT%INDEPENDENT_FIELD, &
1378 & field_u_variable_type,field_mesh_displacement_set_type,mesh_displacement_values,err,error,*999)
1380 & number_of_dimensions_ale_ppe,input_type,input_option,control_loop%PARENT_LOOP%TIME_LOOP% &
1381 & iteration_number,1.0_dp)
1382 CALL field_parameter_set_update_start(equations_set_ale_ppe%INDEPENDENT%INDEPENDENT_FIELD, &
1383 & field_u_variable_type,field_mesh_displacement_set_type,err,error,*999)
1384 CALL field_parameter_set_update_finish(equations_set_ale_ppe%INDEPENDENT%INDEPENDENT_FIELD, &
1385 & field_u_variable_type,field_mesh_displacement_set_type,err,error,*999)
1387 CALL flagerror(
"ALE PPE solver mapping is not associated.",err,error,*999)
1390 CALL flagerror(
"ALE PPE solver equations are not associated.",err,error,*999)
1393 CALL field_component_mesh_component_get(equations_set_ale_ppe%GEOMETRY%GEOMETRIC_FIELD, &
1394 & field_u_variable_type,1,geometric_mesh_component,err,error,*999)
1397 equations=>solver_mapping_ale_ppe%EQUATIONS_SET_TO_SOLVER_MAP(1)%EQUATIONS
1398 IF(
ASSOCIATED(equations))
THEN 1399 equations_mapping=>equations%EQUATIONS_MAPPING
1400 IF(
ASSOCIATED(equations_mapping))
THEN 1401 DO variable_idx=1,equations_set_ale_ppe%DEPENDENT%DEPENDENT_FIELD%NUMBER_OF_VARIABLES
1402 variable_type=equations_set_ale_ppe%DEPENDENT%DEPENDENT_FIELD%VARIABLES(variable_idx)%VARIABLE_TYPE
1403 field_variable=>equations_set_ale_ppe%GEOMETRY%GEOMETRIC_FIELD%VARIABLE_TYPE_MAP(variable_type)%PTR
1404 IF(
ASSOCIATED(field_variable))
THEN 1405 DO component_idx=1,field_variable%NUMBER_OF_COMPONENTS
1406 domain=>field_variable%COMPONENTS(component_idx)%DOMAIN
1407 IF(
ASSOCIATED(domain))
THEN 1408 IF(
ASSOCIATED(domain%TOPOLOGY))
THEN 1409 domain_nodes=>domain%TOPOLOGY%NODES
1410 IF(
ASSOCIATED(domain_nodes))
THEN 1412 DO node_idx=1,domain_nodes%NUMBER_OF_NODES
1413 DO deriv_idx=1,domain_nodes%NODES(node_idx)%NUMBER_OF_DERIVATIVES
1415 local_ny=field_variable%COMPONENTS(component_idx)%PARAM_TO_DOF_MAP% &
1416 & node_param2dof_map%NODES(node_idx)%DERIVATIVES(deriv_idx)%VERSIONS(1)
1417 CALL field_parameter_set_add_local_dof(equations_set_ale_ppe%GEOMETRY%GEOMETRIC_FIELD, &
1418 & field_u_variable_type,field_values_set_type,local_ny, &
1419 & mesh_displacement_values(local_ny),err,error,*999)
1429 CALL flagerror(
"Equations mapping is not associated.",err,error,*999)
1432 CALL flagerror(
"Equations are not associated.",err,error,*999)
1434 CALL field_parameter_set_update_start(equations_set_ale_ppe%GEOMETRY%GEOMETRIC_FIELD, &
1435 & field_u_variable_type,field_values_set_type,err,error,*999)
1436 CALL field_parameter_set_update_finish(equations_set_ale_ppe%GEOMETRY%GEOMETRIC_FIELD, &
1437 & field_u_variable_type,field_values_set_type,err,error,*999)
1439 time_increment=control_loop%PARENT_LOOP%TIME_LOOP%TIME_INCREMENT
1440 alpha=1.0_dp/time_increment
1441 CALL field_parameter_sets_copy(independent_field_ale_ppe,field_u_variable_type, &
1442 & field_mesh_displacement_set_type,field_mesh_velocity_set_type,alpha,err,error,*999)
1444 CALL flagerror(
"Mesh motion calculation not successful for ALE problem.",err,error,*999)
1447 local_error=
"Problem subtype "//
trim(
number_to_vstring(control_loop%PROBLEM%SPECIFICATION(3),
"*",err,error))// &
1448 &
" is not valid for a PPE equation fluid type of a fluid mechanics problem class." 1449 CALL flagerror(local_error,err,error,*999)
1452 CALL flagerror(
"Problem is not associated.",err,error,*999)
1455 CALL flagerror(
"Solver is not associated.",err,error,*999)
1458 CALL flagerror(
"Control loop is not associated.",err,error,*999)
1460 exits(
"POISSON_PRE_SOLVE_UPDATE_PPE_MESH")
1462 999 errorsexits(
"POISSON_PRE_SOLVE_UPDATE_PPE_MESH",err,error)
1476 INTEGER(INTG),
INTENT(OUT) :: ERR
1479 TYPE(
solver_type),
POINTER :: SOLVER_FITTED, SOLVER_PPE
1480 TYPE(
field_type),
POINTER :: DEPENDENT_FIELD_FITTED,SOURCE_FIELD_PPE
1491 REAL(DP) :: CURRENT_TIME,TIME_INCREMENT
1492 INTEGER(INTG) :: I,NUMBER_OF_DIMENSIONS_PPE,NUMBER_OF_DIMENSIONS_FITTED,GEOMETRIC_MESH_COMPONENT
1494 enters(
"POISSON_PRE_SOLVE_UPDATE_PPE_SOURCE",err,error,*999)
1496 IF(
ASSOCIATED(control_loop))
THEN 1499 NULLIFY(solver_fitted)
1500 IF(
ASSOCIATED(solver))
THEN 1501 IF(
ASSOCIATED(control_loop%PROBLEM))
THEN 1502 IF(.NOT.
ALLOCATED(control_loop%PROBLEM%SPECIFICATION))
THEN 1503 CALL flagerror(
"Problem specification is not allocated.",err,error,*999)
1504 ELSE IF(
SIZE(control_loop%PROBLEM%SPECIFICATION,1)<3)
THEN 1505 CALL flagerror(
"Problem specification must have three entries for a Poisson problem.",err,error,*999)
1507 SELECT CASE(control_loop%PROBLEM%SPECIFICATION(3))
1515 IF(solver%GLOBAL_NUMBER==1)
THEN 1517 ELSE IF(solver%GLOBAL_NUMBER==2)
THEN 1520 solver_equations_fitted=>solver_fitted%SOLVER_EQUATIONS
1521 IF(
ASSOCIATED(solver_equations_fitted))
THEN 1522 solver_mapping_fitted=>solver_equations_fitted%SOLVER_MAPPING
1523 IF(
ASSOCIATED(solver_mapping_fitted))
THEN 1524 equations_set_fitted=>solver_mapping_fitted%EQUATIONS_SETS(1)%PTR
1525 IF(
ASSOCIATED(equations_set_fitted))
THEN 1526 dependent_field_fitted=>equations_set_fitted%DEPENDENT%DEPENDENT_FIELD
1528 CALL flagerror(
"Fitted equations set is not associated.",err,error,*999)
1530 CALL field_number_of_components_get(equations_set_fitted%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
1531 & number_of_dimensions_fitted,err,error,*999)
1533 CALL flagerror(
"Fitted solver mapping is not associated.",err,error,*999)
1536 CALL flagerror(
"Fitted solver equations are not associated.",err,error,*999)
1540 solver_equations_ppe=>solver_ppe%SOLVER_EQUATIONS
1541 IF(
ASSOCIATED(solver_equations_ppe))
THEN 1542 solver_mapping_ppe=>solver_equations_ppe%SOLVER_MAPPING
1543 IF(
ASSOCIATED(solver_mapping_ppe))
THEN 1544 equations_set_ppe=>solver_mapping_ppe%EQUATIONS_SETS(1)%PTR
1545 IF(
ASSOCIATED(equations_set_ppe))
THEN 1546 source_field_ppe=>equations_set_ppe%SOURCE%SOURCE_FIELD
1548 CALL flagerror(
"PPE equations set is not associated.",err,error,*999)
1550 CALL field_number_of_components_get(equations_set_ppe%GEOMETRY%GEOMETRIC_FIELD, &
1551 & field_u_variable_type,number_of_dimensions_ppe,err,error,*999)
1553 CALL flagerror(
"PPE solver mapping is not associated.",err,error,*999)
1556 CALL flagerror(
"PPE solver equations are not associated.",err,error,*999)
1559 IF(number_of_dimensions_ppe==number_of_dimensions_fitted)
THEN 1560 IF(control_loop%TIME_LOOP%ITERATION_NUMBER/=1)
THEN 1561 DO i=1,number_of_dimensions_ppe
1563 CALL field_parameterstofieldparameterscopy(source_field_ppe, &
1564 & field_u_variable_type,field_input_data1_set_type,i,source_field_ppe, &
1565 & field_u_variable_type,field_input_data2_set_type,i,err,error,*999)
1569 DO i=1,number_of_dimensions_ppe
1570 CALL field_parameterstofieldparameterscopy(dependent_field_fitted, &
1571 & field_u_variable_type,field_values_set_type,i,source_field_ppe, &
1572 & field_u_variable_type,field_input_data1_set_type,i,err,error,*999)
1574 IF(control_loop%TIME_LOOP%ITERATION_NUMBER==1)
THEN 1576 DO i=1,number_of_dimensions_ppe
1577 CALL field_parameterstofieldparameterscopy(source_field_ppe, &
1578 & field_u_variable_type,field_input_data1_set_type,i,source_field_ppe, &
1579 & field_u_variable_type,field_input_data2_set_type,i,err,error,*999)
1583 CALL flagerror(
"Dimension of FITTED and PPE equations set is not consistent.",err,error,*999)
1586 CALL field_component_mesh_component_get(equations_set_ppe%GEOMETRY%GEOMETRIC_FIELD, &
1587 & field_u_variable_type,1,geometric_mesh_component,err,error,*999)
1588 CALL field_parameter_set_update_start(equations_set_ppe%SOURCE%SOURCE_FIELD,field_u_variable_type, &
1589 & field_input_data1_set_type,err,error,*999)
1590 CALL field_parameter_set_update_finish(equations_set_ppe%SOURCE%SOURCE_FIELD,field_u_variable_type, &
1591 & field_input_data1_set_type,err,error,*999)
1592 CALL field_parameter_set_update_start(equations_set_ppe%SOURCE%SOURCE_FIELD,field_u_variable_type, &
1593 & field_input_data2_set_type,err,error,*999)
1594 CALL field_parameter_set_update_finish(equations_set_ppe%SOURCE%SOURCE_FIELD,field_u_variable_type, &
1595 & field_input_data2_set_type,err,error,*999)
1597 CALL flagerror(
"Mesh update is not defined for non-dynamic problems.",err,error,*999)
1600 local_error=
"Problem subtype "//
trim(
number_to_vstring(control_loop%PROBLEM%SPECIFICATION(3),
"*",err,error))// &
1601 &
" is not valid for a PPE equation fluid type of a fluid mechanics problem class." 1602 CALL flagerror(local_error,err,error,*999)
1605 CALL flagerror(
"Problem is not associated.",err,error,*999)
1608 CALL flagerror(
"Solver is not associated.",err,error,*999)
1611 CALL flagerror(
"Control loop is not associated.",err,error,*999)
1613 exits(
"POISSON_PRE_SOLVE_UPDATE_PPE_SOURCE")
1615 999 errorsexits(
"POISSON_PRE_SOLVE_UPDATE_PPE_SOURCE",err,error)
1630 INTEGER(INTG),
INTENT(OUT) :: ERR
1633 INTEGER(INTG) :: component_idx,GEOMETRIC_COMPONENT_NUMBER,GEOMETRIC_SCALING_TYPE,NUMBER_OF_DIMENSIONS, &
1634 & NUMBER_OF_MATERIALS_COMPONENTS, GEOMETRIC_MESH_COMPONENT,SOURCE_FIELD_NUMBER_OF_COMPONENTS,I, &
1635 & SOURCE_FIELD_NUMBER_OF_VARIABLES
1641 TYPE(
field_type),
POINTER :: analytic_field,DEPENDENT_FIELD,geometric_field
1644 enters(
"POISSON_EQUATION_EQUATION_SET_LINEAR_SOURCE_SETUP",err,error,*999)
1647 NULLIFY(equations_mapping)
1648 NULLIFY(equations_matrices)
1649 NULLIFY(geometric_decomposition)
1651 IF(
ASSOCIATED(equations_set))
THEN 1652 IF(.NOT.
ALLOCATED(equations_set%SPECIFICATION))
THEN 1653 CALL flagerror(
"Equations set specification is not allocated.",err,error,*999)
1654 ELSE IF(
SIZE(equations_set%SPECIFICATION,1)/=3)
THEN 1655 CALL flagerror(
"Equations set specification must have three entries for a Poisson type equations set.", &
1660 SELECT CASE(equations_set_setup%SETUP_TYPE)
1662 SELECT CASE(equations_set_setup%ACTION_TYPE)
1668 local_error=
"The action type of "//
trim(
number_to_vstring(equations_set_setup%ACTION_TYPE,
"*",err,error))// &
1669 &
" for a setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
1670 &
" is invalid for a linear source Poisson equation." 1671 CALL flagerror(local_error,err,error,*999)
1676 SELECT CASE(equations_set_setup%ACTION_TYPE)
1678 IF(equations_set%DEPENDENT%DEPENDENT_FIELD_AUTO_CREATED)
THEN 1680 CALL field_create_start(equations_set_setup%FIELD_USER_NUMBER,equations_set%REGION,equations_set%DEPENDENT% &
1681 & dependent_field,err,error,*999)
1682 CALL field_type_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_general_type,err,error,*999)
1683 CALL field_dependent_type_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_dependent_type,err,error,*999)
1684 CALL field_mesh_decomposition_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_decomposition,err,error,*999)
1685 CALL field_mesh_decomposition_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,geometric_decomposition, &
1687 CALL field_geometric_field_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,equations_set%GEOMETRY% &
1688 & geometric_field,err,error,*999)
1689 CALL field_number_of_variables_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,2,err,error,*999)
1690 CALL field_variable_types_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,(/field_u_variable_type, &
1691 & field_deludeln_variable_type/),err,error,*999)
1692 CALL field_dimension_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type, &
1693 & field_scalar_dimension_type,err,error,*999)
1694 CALL field_dimension_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_deludeln_variable_type, &
1695 & field_scalar_dimension_type,err,error,*999)
1696 CALL field_data_type_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type, &
1697 & field_dp_type,err,error,*999)
1698 CALL field_data_type_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_deludeln_variable_type, &
1699 & field_dp_type,err,error,*999)
1700 CALL field_number_of_components_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type,1, &
1702 CALL field_number_of_components_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_deludeln_variable_type,1, &
1705 CALL field_component_mesh_component_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type,1, &
1706 & geometric_component_number,err,error,*999)
1707 CALL field_component_mesh_component_set(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type,1, &
1708 & geometric_component_number,err,error,*999)
1709 CALL field_component_mesh_component_set(equations_set%DEPENDENT%DEPENDENT_FIELD,field_deludeln_variable_type,1, &
1710 & geometric_component_number,err,error,*999)
1711 SELECT CASE(equations_set%SOLUTION_METHOD)
1713 CALL field_component_interpolation_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type,1, &
1714 & field_node_based_interpolation,err,error,*999)
1715 CALL field_component_interpolation_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD, &
1716 & field_deludeln_variable_type,1,field_node_based_interpolation,err,error,*999)
1718 CALL field_scaling_type_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_scaling_type,err,error,*999)
1719 CALL field_scaling_type_set(equations_set%DEPENDENT%DEPENDENT_FIELD,geometric_scaling_type,err,error,*999)
1721 CALL flagerror(
"Not implemented.",err,error,*999)
1723 CALL flagerror(
"Not implemented.",err,error,*999)
1725 CALL flagerror(
"Not implemented.",err,error,*999)
1727 CALL flagerror(
"Not implemented.",err,error,*999)
1729 CALL flagerror(
"Not implemented.",err,error,*999)
1731 local_error=
"The solution method of "//
trim(
number_to_vstring(equations_set%SOLUTION_METHOD,
"*",err,error))// &
1733 CALL flagerror(local_error,err,error,*999)
1737 CALL field_type_check(equations_set_setup%FIELD,field_general_type,err,error,*999)
1738 CALL field_dependent_type_check(equations_set_setup%FIELD,field_dependent_type,err,error,*999)
1739 CALL field_number_of_variables_check(equations_set_setup%FIELD,2,err,error,*999)
1740 CALL field_variable_types_check(equations_set_setup%FIELD,(/field_u_variable_type,field_deludeln_variable_type/), &
1742 CALL field_dimension_check(equations_set_setup%FIELD,field_u_variable_type,field_scalar_dimension_type,err,error,*999)
1743 CALL field_dimension_check(equations_set_setup%FIELD,field_deludeln_variable_type,field_scalar_dimension_type, &
1745 CALL field_data_type_check(equations_set_setup%FIELD,field_u_variable_type,field_dp_type,err,error,*999)
1746 CALL field_data_type_check(equations_set_setup%FIELD,field_deludeln_variable_type,field_dp_type,err,error,*999)
1747 CALL field_number_of_components_check(equations_set_setup%FIELD,field_u_variable_type,1,err,error,*999)
1748 CALL field_number_of_components_check(equations_set_setup%FIELD,field_deludeln_variable_type,1,err,error,*999)
1749 SELECT CASE(equations_set%SOLUTION_METHOD)
1751 CALL field_component_interpolation_check(equations_set_setup%FIELD,field_u_variable_type,1, &
1752 & field_node_based_interpolation,err,error,*999)
1753 CALL field_component_interpolation_check(equations_set_setup%FIELD,field_deludeln_variable_type,1, &
1754 & field_node_based_interpolation,err,error,*999)
1756 CALL flagerror(
"Not implemented.",err,error,*999)
1758 CALL flagerror(
"Not implemented.",err,error,*999)
1760 CALL flagerror(
"Not implemented.",err,error,*999)
1762 CALL flagerror(
"Not implemented.",err,error,*999)
1764 CALL flagerror(
"Not implemented.",err,error,*999)
1766 local_error=
"The solution method of "//
trim(
number_to_vstring(equations_set%SOLUTION_METHOD,
"*",err,error))// &
1768 CALL flagerror(local_error,err,error,*999)
1772 IF(equations_set%DEPENDENT%DEPENDENT_FIELD_AUTO_CREATED)
THEN 1773 CALL field_create_finish(equations_set%DEPENDENT%DEPENDENT_FIELD,err,error,*999)
1776 local_error=
"The action type of "//
trim(
number_to_vstring(equations_set_setup%ACTION_TYPE,
"*",err,error))// &
1777 &
" for a setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
1778 &
" is invalid for a linear source Poisson equation" 1779 CALL flagerror(local_error,err,error,*999)
1782 SELECT CASE(equations_set_setup%ACTION_TYPE)
1784 equations_materials=>equations_set%MATERIALS
1785 IF(
ASSOCIATED(equations_materials))
THEN 1786 IF(equations_materials%MATERIALS_FIELD_AUTO_CREATED)
THEN 1788 CALL field_create_start(equations_set_setup%FIELD_USER_NUMBER,equations_set%REGION,equations_materials% &
1789 & materials_field,err,error,*999)
1790 CALL field_type_set_and_lock(equations_materials%MATERIALS_FIELD,field_material_type,err,error,*999)
1791 CALL field_dependent_type_set_and_lock(equations_materials%MATERIALS_FIELD,field_independent_type,err,error,*999)
1792 CALL field_mesh_decomposition_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_decomposition,err,error,*999)
1793 CALL field_mesh_decomposition_set_and_lock(equations_materials%MATERIALS_FIELD,geometric_decomposition, &
1795 CALL field_geometric_field_set_and_lock(equations_materials%MATERIALS_FIELD,equations_set%GEOMETRY% &
1796 & geometric_field,err,error,*999)
1797 CALL field_number_of_variables_set_and_lock(equations_materials%MATERIALS_FIELD,1,err,error,*999)
1798 CALL field_variable_types_set_and_lock(equations_materials%MATERIALS_FIELD,(/field_u_variable_type/), &
1800 CALL field_dimension_set_and_lock(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
1801 & field_vector_dimension_type,err,error,*999)
1802 CALL field_data_type_set_and_lock(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
1803 & field_dp_type,err,error,*999)
1804 CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
1805 & number_of_dimensions,err,error,*999)
1809 number_of_materials_components=number_of_dimensions+1
1813 number_of_materials_components=number_of_dimensions+2
1816 CALL field_number_of_components_set_and_lock(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
1817 & number_of_materials_components,err,error,*999)
1819 DO component_idx=1,number_of_dimensions
1820 CALL field_component_mesh_component_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
1821 & component_idx,geometric_component_number,err,error,*999)
1822 CALL field_component_mesh_component_set(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
1823 & component_idx,geometric_component_number,err,error,*999)
1824 CALL field_component_interpolation_set(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
1825 & component_idx,field_constant_interpolation,err,error,*999)
1828 CALL field_component_mesh_component_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
1829 & 1,geometric_component_number,err,error,*999)
1830 DO component_idx=number_of_dimensions+1,number_of_materials_components
1831 CALL field_component_mesh_component_set(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
1832 & component_idx,geometric_component_number,err,error,*999)
1833 CALL field_component_interpolation_set(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
1834 & component_idx,field_constant_interpolation,err,error,*999)
1837 CALL field_scaling_type_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_scaling_type,err,error,*999)
1838 CALL field_scaling_type_set(equations_materials%MATERIALS_FIELD,geometric_scaling_type,err,error,*999)
1841 CALL field_type_check(equations_set_setup%FIELD,field_material_type,err,error,*999)
1842 CALL field_dependent_type_check(equations_set_setup%FIELD,field_independent_type,err,error,*999)
1843 CALL field_number_of_variables_check(equations_set_setup%FIELD,1,err,error,*999)
1844 CALL field_variable_types_check(equations_set_setup%FIELD,(/field_u_variable_type/),err,error,*999)
1845 CALL field_dimension_check(equations_set_setup%FIELD,field_u_variable_type,field_vector_dimension_type, &
1847 CALL field_data_type_check(equations_set_setup%FIELD,field_u_variable_type,field_dp_type,err,error,*999)
1848 CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
1849 & number_of_dimensions,err,error,*999)
1851 CALL field_number_of_components_check(equations_set_setup%FIELD,field_u_variable_type,number_of_dimensions+1, &
1854 CALL field_number_of_components_check(equations_set_setup%FIELD,field_u_variable_type,number_of_dimensions+2, &
1859 CALL flagerror(
"Equations set materials is not associated.",err,error,*999)
1863 equations_materials=>equations_set%MATERIALS
1864 IF(
ASSOCIATED(equations_materials))
THEN 1865 IF(equations_materials%MATERIALS_FIELD_AUTO_CREATED)
THEN 1867 CALL field_create_finish(equations_materials%MATERIALS_FIELD,err,error,*999)
1869 CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
1870 & number_of_dimensions,err,error,*999)
1874 number_of_materials_components=number_of_dimensions+1
1878 number_of_materials_components=number_of_dimensions+2
1881 DO component_idx=1,number_of_dimensions
1882 CALL field_component_values_initialise(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
1883 & field_values_set_type,component_idx,1.0_dp,err,error,*999)
1886 DO component_idx=number_of_dimensions+1,number_of_materials_components
1887 CALL field_component_values_initialise(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
1888 & field_values_set_type,component_idx,1.0_dp,err,error,*999)
1892 CALL flagerror(
"Equations set materials is not associated.",err,error,*999)
1895 local_error=
"The action type of "//
trim(
number_to_vstring(equations_set_setup%ACTION_TYPE,
"*",err,error))// &
1896 &
" for a setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
1897 &
" is invalid for a linear source Poisson equation." 1898 CALL flagerror(local_error,err,error,*999)
1901 SELECT CASE(equations_set%SPECIFICATION(3))
1903 SELECT CASE(equations_set_setup%ACTION_TYPE)
1906 IF(equations_set%SOURCE%SOURCE_FIELD_AUTO_CREATED)
THEN 1909 CALL field_create_start(equations_set_setup%FIELD_USER_NUMBER,equations_set%REGION, &
1910 & equations_set%SOURCE%SOURCE_FIELD,err,error,*999)
1912 CALL field_type_set_and_lock(equations_set%SOURCE%SOURCE_FIELD,field_general_type,err,error,*999)
1914 CALL field_label_set_and_lock(equations_set%SOURCE%SOURCE_FIELD,
"Source Field",err,error, &
1917 CALL field_dependent_type_set_and_lock(equations_set%SOURCE%SOURCE_FIELD, &
1918 & field_independent_type,err,error,*999)
1920 CALL field_mesh_decomposition_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_decomposition, &
1923 CALL field_mesh_decomposition_set_and_lock(equations_set%SOURCE%SOURCE_FIELD, &
1924 & geometric_decomposition,err,error,*999)
1926 CALL field_geometric_field_set_and_lock(equations_set%SOURCE%SOURCE_FIELD,equations_set% &
1927 & geometry%GEOMETRIC_FIELD,err,error,*999)
1929 source_field_number_of_variables=1
1930 CALL field_number_of_variables_set_and_lock(equations_set%SOURCE%SOURCE_FIELD, &
1931 & source_field_number_of_variables,err,error,*999)
1932 CALL field_variable_types_set_and_lock(equations_set%SOURCE%SOURCE_FIELD, &
1933 & (/field_u_variable_type/),err,error,*999)
1934 CALL field_dimension_set_and_lock(equations_set%SOURCE%SOURCE_FIELD,field_u_variable_type, &
1935 & field_vector_dimension_type,err,error,*999)
1936 CALL field_data_type_set_and_lock(equations_set%SOURCE%SOURCE_FIELD,field_u_variable_type, &
1937 & field_dp_type,err,error,*999)
1938 CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
1939 & number_of_dimensions,err,error,*999)
1941 source_field_number_of_components=number_of_dimensions
1942 CALL field_number_of_components_set_and_lock(equations_set%SOURCE%SOURCE_FIELD, &
1943 & field_u_variable_type,source_field_number_of_components,err,error,*999)
1944 CALL field_component_mesh_component_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
1945 & 1,geometric_mesh_component,err,error,*999)
1947 DO i=1,source_field_number_of_components
1948 CALL field_component_mesh_component_set(equations_set%SOURCE%SOURCE_FIELD, &
1949 & field_u_variable_type,i,geometric_mesh_component,err,error,*999)
1951 SELECT CASE(equations_set%SOLUTION_METHOD)
1954 DO i=1,source_field_number_of_components
1955 CALL field_component_interpolation_set_and_lock(equations_set%SOURCE%SOURCE_FIELD, &
1956 & field_u_variable_type,i,field_node_based_interpolation,err,error,*999)
1958 CALL field_scaling_type_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_scaling_type, &
1960 CALL field_scaling_type_set(equations_set%SOURCE%SOURCE_FIELD,geometric_scaling_type, &
1964 local_error=
"The solution method of " &
1966 CALL flagerror(local_error,err,error,*999)
1970 CALL field_type_check(equations_set_setup%FIELD,field_general_type,err,error,*999)
1971 CALL field_dependent_type_check(equations_set_setup%FIELD,field_independent_type,err,error,*999)
1972 CALL field_number_of_variables_check(equations_set_setup%FIELD,1,err,error,*999)
1973 CALL field_variable_types_check(equations_set_setup%FIELD,(/field_u_variable_type/),err,error,*999)
1974 CALL field_dimension_check(equations_set_setup%FIELD,field_u_variable_type,field_vector_dimension_type, &
1976 CALL field_data_type_check(equations_set_setup%FIELD,field_u_variable_type,field_dp_type,err,error,*999)
1977 CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
1978 & number_of_dimensions,err,error,*999)
1980 source_field_number_of_components=number_of_dimensions
1981 CALL field_number_of_components_check(equations_set_setup%FIELD,field_u_variable_type, &
1982 & source_field_number_of_components,err,error,*999)
1983 SELECT CASE(equations_set%SOLUTION_METHOD)
1985 CALL field_component_interpolation_check(equations_set_setup%FIELD,field_u_variable_type,1, &
1986 & field_node_based_interpolation,err,error,*999)
1987 CALL field_component_interpolation_check(equations_set_setup%FIELD,field_deludeln_variable_type,1, &
1988 & field_node_based_interpolation,err,error,*999)
1991 &
"*",err,error))//
" is invalid." 1992 CALL flagerror(local_error,err,error,*999)
1997 IF(equations_set%SOURCE%SOURCE_FIELD_AUTO_CREATED)
THEN 1998 CALL field_create_finish(equations_set%SOURCE%SOURCE_FIELD,err,error,*999)
2001 local_error=
"The action type of "//
trim(
number_to_vstring(equations_set_setup%ACTION_TYPE,
"*",err,error))// &
2002 &
" for a setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
2003 &
" is invalid for a linear Poisson subtype" 2004 CALL flagerror(local_error,err,error,*999)
2007 local_error=
"The equation set subtype of "//
trim(
number_to_vstring(equations_set%SPECIFICATION(3),
"*",err,error))// &
2008 &
" for a setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
2009 &
" is invalid for a linear Poisson equation." 2010 CALL flagerror(local_error,err,error,*999)
2013 SELECT CASE(equations_set_setup%ACTION_TYPE)
2015 IF(equations_set%DEPENDENT%DEPENDENT_FINISHED)
THEN 2016 dependent_field=>equations_set%DEPENDENT%DEPENDENT_FIELD
2017 IF(
ASSOCIATED(dependent_field))
THEN 2018 geometric_field=>equations_set%GEOMETRY%GEOMETRIC_FIELD
2019 IF(
ASSOCIATED(geometric_field))
THEN 2020 CALL field_number_of_components_get(geometric_field,field_u_variable_type,number_of_dimensions,err,error,*999)
2021 SELECT CASE(equations_set_setup%ANALYTIC_FUNCTION_TYPE)
2026 IF(number_of_dimensions/=2)
THEN 2027 local_error=
"The number of geometric dimensions of "// &
2029 &
" is invalid. The analytic function type of "// &
2031 &
" requires that there be 2 geometric dimensions." 2032 CALL flagerror(local_error,err,error,*999)
2038 local_error=
"The equations set subtype of "// &
2040 &
" is invalid. The analytic function type of "// &
2042 &
" requires that the equations set subtype be an exponential source Poisson equation." 2043 CALL flagerror(local_error,err,error,*999)
2049 IF(number_of_dimensions/=3)
THEN 2050 local_error=
"The number of geometric dimensions of "// &
2052 &
" is invalid. The analytic function type of "// &
2054 &
" requires that there be 3 geometric dimensions." 2055 CALL flagerror(local_error,err,error,*999)
2061 local_error=
"The equations set subtype of "// &
2063 &
" is invalid. The analytic function type of "// &
2065 &
" requires that the equations set subtype be an exponential source Poisson equation." 2066 CALL flagerror(local_error,err,error,*999)
2069 local_error=
"The specified analytic function type of "// &
2071 &
" is invalid for a linear source Poisson equation." 2072 CALL flagerror(local_error,err,error,*999)
2075 CALL flagerror(
"Equations set geometric field is not associated.",err,error,*999)
2078 CALL flagerror(
"Equations set dependent field is not associated.",err,error,*999)
2081 CALL flagerror(
"Equations set dependent field has not been finished.",err,error,*999)
2084 IF(
ASSOCIATED(equations_set%ANALYTIC))
THEN 2085 analytic_field=>equations_set%ANALYTIC%ANALYTIC_FIELD
2086 IF(
ASSOCIATED(analytic_field))
THEN 2087 IF(equations_set%ANALYTIC%ANALYTIC_FIELD_AUTO_CREATED)
THEN 2088 CALL field_create_finish(equations_set%DEPENDENT%DEPENDENT_FIELD,err,error,*999)
2092 CALL flagerror(
"Equations set analytic is not associated.",err,error,*999)
2095 local_error=
"The action type of "//
trim(
number_to_vstring(equations_set_setup%ACTION_TYPE,
"*",err,error))// &
2096 &
" for a setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
2097 &
" is invalid for a linear source Poisson equation." 2098 CALL flagerror(local_error,err,error,*999)
2101 SELECT CASE(equations_set_setup%ACTION_TYPE)
2103 IF(equations_set%DEPENDENT%DEPENDENT_FINISHED)
THEN 2109 CALL flagerror(
"Equations set dependent field has not been finished.",err,error,*999)
2112 SELECT CASE(equations_set%SOLUTION_METHOD)
2127 SELECT CASE(equations%SPARSITY_TYPE)
2137 local_error=
"The equations matrices sparsity type of "// &
2139 CALL flagerror(local_error,err,error,*999)
2143 CALL flagerror(
"Not implemented.",err,error,*999)
2145 CALL flagerror(
"Not implemented.",err,error,*999)
2147 CALL flagerror(
"Not implemented.",err,error,*999)
2149 CALL flagerror(
"Not implemented.",err,error,*999)
2151 CALL flagerror(
"Not implemented.",err,error,*999)
2153 local_error=
"The solution method of "//
trim(
number_to_vstring(equations_set%SOLUTION_METHOD,
"*",err,error))// &
2155 CALL flagerror(local_error,err,error,*999)
2158 local_error=
"The action type of "//
trim(
number_to_vstring(equations_set_setup%ACTION_TYPE,
"*",err,error))// &
2159 &
" for a setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
2160 &
" is invalid for a linear source Poisson equation." 2161 CALL flagerror(local_error,err,error,*999)
2164 local_error=
"The setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
2165 &
" is invalid for a linear source Poisson equation." 2166 CALL flagerror(local_error,err,error,*999)
2169 local_error=
"The equations set subtype of "//
trim(
number_to_vstring(equations_set%SPECIFICATION(3),
"*",err,error))// &
2170 &
" is not a linear source Poisson equation subtype." 2171 CALL flagerror(local_error,err,error,*999)
2174 CALL flagerror(
"Equations set is not associated.",err,error,*999)
2177 exits(
"Poisson_EquationsSetLinearSourceSetup")
2179 999
errors(
"Poisson_EquationsSetLinearSourceSetup",err,error)
2180 exits(
"Poisson_EquationsSetLinearSourceSetup")
2195 INTEGER(INTG),
INTENT(OUT) :: ERR
2198 INTEGER(INTG) :: component_idx,GEOMETRIC_COMPONENT_NUMBER,GEOMETRIC_SCALING_TYPE,NUMBER_OF_DIMENSIONS, &
2199 & NUMBER_OF_MATERIALS_COMPONENTS, GEOMETRIC_MESH_COMPONENT,SOURCE_FIELD_NUMBER_OF_COMPONENTS, &
2200 & SOURCE_FIELD_NUMBER_OF_VARIABLES
2201 TYPE(
field_type),
POINTER :: ANALYTIC_FIELD,DEPENDENT_FIELD,GEOMETRIC_FIELD
2209 enters(
"Poisson_EquationsSetExtracellularBidomainSetup",err,error,*999)
2212 NULLIFY(equations_mapping)
2213 NULLIFY(equations_matrices)
2214 NULLIFY(geometric_decomposition)
2216 IF(
ASSOCIATED(equations_set))
THEN 2218 SELECT CASE(equations_set_setup%SETUP_TYPE)
2220 SELECT CASE(equations_set_setup%ACTION_TYPE)
2226 local_error=
"The action type of "//
trim(
number_to_vstring(equations_set_setup%ACTION_TYPE,
"*",err,error))// &
2227 &
" for a setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
2228 &
" is invalid for an extracellular bidomain Poisson equation." 2229 CALL flagerror(local_error,err,error,*999)
2236 SELECT CASE(equations_set_setup%ACTION_TYPE)
2238 IF(equations_set%DEPENDENT%DEPENDENT_FIELD_AUTO_CREATED)
THEN 2240 CALL field_create_start(equations_set_setup%FIELD_USER_NUMBER,equations_set%REGION,equations_set%DEPENDENT% &
2241 & dependent_field,err,error,*999)
2242 CALL field_label_set(equations_set%DEPENDENT%DEPENDENT_FIELD,
"Dependent Field",err,error,*999)
2243 CALL field_type_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_general_type,err,error,*999)
2244 CALL field_dependent_type_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_dependent_type,err,error,*999)
2245 CALL field_mesh_decomposition_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_decomposition,err,error,*999)
2246 CALL field_mesh_decomposition_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,geometric_decomposition, &
2248 CALL field_geometric_field_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,equations_set%GEOMETRY% &
2249 & geometric_field,err,error,*999)
2250 CALL field_number_of_variables_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,2,err,error,*999)
2251 CALL field_variable_types_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,(/field_u_variable_type, &
2252 & field_deludeln_variable_type/),err,error,*999)
2254 CALL field_variable_label_set(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type,
"Phi",err,error,*999)
2255 CALL field_variable_label_set(equations_set%DEPENDENT%DEPENDENT_FIELD,field_deludeln_variable_type,
"del Phi/del n", &
2258 CALL field_dimension_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type, &
2259 & field_scalar_dimension_type,err,error,*999)
2260 CALL field_dimension_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_deludeln_variable_type, &
2261 & field_scalar_dimension_type,err,error,*999)
2263 CALL field_data_type_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type, &
2264 & field_dp_type,err,error,*999)
2265 CALL field_data_type_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_deludeln_variable_type, &
2266 & field_dp_type,err,error,*999)
2268 CALL field_number_of_components_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type,1, &
2270 CALL field_number_of_components_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_deludeln_variable_type,1, &
2273 CALL field_component_label_set(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type,1,
"Phi",err,error,*999)
2274 CALL field_component_label_set(equations_set%DEPENDENT%DEPENDENT_FIELD,field_deludeln_variable_type,1, &
2275 &
"del Phi/del n",err,error,*999)
2278 CALL field_component_mesh_component_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type,1, &
2279 & geometric_component_number,err,error,*999)
2281 CALL field_component_mesh_component_set(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type,1, &
2282 & geometric_component_number,err,error,*999)
2283 CALL field_component_mesh_component_set(equations_set%DEPENDENT%DEPENDENT_FIELD,field_deludeln_variable_type,1, &
2284 & geometric_component_number,err,error,*999)
2286 SELECT CASE(equations_set%SOLUTION_METHOD)
2288 CALL field_component_interpolation_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type,1, &
2289 & field_node_based_interpolation,err,error,*999)
2290 CALL field_component_interpolation_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD, &
2291 & field_deludeln_variable_type,1,field_node_based_interpolation,err,error,*999)
2293 CALL field_scaling_type_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_scaling_type,err,error,*999)
2294 CALL field_scaling_type_set(equations_set%DEPENDENT%DEPENDENT_FIELD,geometric_scaling_type,err,error,*999)
2296 CALL flagerror(
"Not implemented.",err,error,*999)
2298 CALL flagerror(
"Not implemented.",err,error,*999)
2300 CALL flagerror(
"Not implemented.",err,error,*999)
2302 CALL flagerror(
"Not implemented.",err,error,*999)
2304 CALL flagerror(
"Not implemented.",err,error,*999)
2306 local_error=
"The solution method of "//
trim(
number_to_vstring(equations_set%SOLUTION_METHOD,
"*",err,error))// &
2308 CALL flagerror(local_error,err,error,*999)
2312 CALL field_type_check(equations_set_setup%FIELD,field_general_type,err,error,*999)
2313 CALL field_dependent_type_check(equations_set_setup%FIELD,field_dependent_type,err,error,*999)
2314 CALL field_number_of_variables_check(equations_set_setup%FIELD,2,err,error,*999)
2315 CALL field_variable_types_check(equations_set_setup%FIELD, &
2316 & (/field_u_variable_type,field_deludeln_variable_type/),err,error,*999)
2318 CALL field_dimension_check(equations_set_setup%FIELD,field_u_variable_type,field_scalar_dimension_type,err,error,*999)
2319 CALL field_dimension_check(equations_set_setup%FIELD,field_deludeln_variable_type,field_scalar_dimension_type, &
2322 CALL field_data_type_check(equations_set_setup%FIELD,field_u_variable_type,field_dp_type,err,error,*999)
2323 CALL field_data_type_check(equations_set_setup%FIELD,field_deludeln_variable_type,field_dp_type,err,error,*999)
2325 CALL field_number_of_components_check(equations_set_setup%FIELD,field_u_variable_type,1,err,error,*999)
2326 CALL field_number_of_components_check(equations_set_setup%FIELD,field_deludeln_variable_type,1,err,error,*999)
2328 SELECT CASE(equations_set%SOLUTION_METHOD)
2330 CALL field_component_interpolation_check(equations_set_setup%FIELD,field_u_variable_type,1, &
2331 & field_node_based_interpolation,err,error,*999)
2332 CALL field_component_interpolation_check(equations_set_setup%FIELD,field_deludeln_variable_type,1, &
2333 & field_node_based_interpolation,err,error,*999)
2335 CALL flagerror(
"Not implemented.",err,error,*999)
2337 CALL flagerror(
"Not implemented.",err,error,*999)
2339 CALL flagerror(
"Not implemented.",err,error,*999)
2341 CALL flagerror(
"Not implemented.",err,error,*999)
2343 CALL flagerror(
"Not implemented.",err,error,*999)
2345 local_error=
"The solution method of "//
trim(
number_to_vstring(equations_set%SOLUTION_METHOD,
"*",err,error))// &
2347 CALL flagerror(local_error,err,error,*999)
2351 IF(equations_set%DEPENDENT%DEPENDENT_FIELD_AUTO_CREATED)
THEN 2352 CALL field_create_finish(equations_set%DEPENDENT%DEPENDENT_FIELD,err,error,*999)
2355 local_error=
"The action type of "//
trim(
number_to_vstring(equations_set_setup%ACTION_TYPE,
"*",err,error))// &
2356 &
" for a setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
2357 &
" is invalid for an extracellular bidomain Poisson equation" 2358 CALL flagerror(local_error,err,error,*999)
2362 SELECT CASE(equations_set_setup%ACTION_TYPE)
2365 equations_materials=>equations_set%MATERIALS
2366 IF(
ASSOCIATED(equations_materials))
THEN 2367 IF(equations_materials%MATERIALS_FIELD_AUTO_CREATED)
THEN 2369 CALL field_create_start(equations_set_setup%FIELD_USER_NUMBER,equations_set%REGION,equations_materials% &
2370 & materials_field,err,error,*999)
2371 CALL field_label_set(equations_set%MATERIALS%MATERIALS_FIELD,
"Material Field",err,error,*999)
2372 CALL field_type_set_and_lock(equations_materials%MATERIALS_FIELD,field_material_type,err,error,*999)
2373 CALL field_dependent_type_set_and_lock(equations_materials%MATERIALS_FIELD,field_independent_type,err,error,*999)
2374 CALL field_mesh_decomposition_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_decomposition,err,error,*999)
2375 CALL field_mesh_decomposition_set_and_lock(equations_materials%MATERIALS_FIELD,geometric_decomposition, &
2377 CALL field_geometric_field_set_and_lock(equations_materials%MATERIALS_FIELD,equations_set%GEOMETRY% &
2378 & geometric_field,err,error,*999)
2379 CALL field_number_of_variables_set_and_lock(equations_materials%MATERIALS_FIELD,1,err,error,*999)
2380 CALL field_variable_types_set_and_lock(equations_materials%MATERIALS_FIELD,(/field_u_variable_type/), &
2382 CALL field_variable_label_set(equations_set%MATERIALS%MATERIALS_FIELD,field_u_variable_type,
"conductivity",err, &
2384 CALL field_dimension_set_and_lock(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
2385 & field_vector_dimension_type,err,error,*999)
2386 CALL field_data_type_set_and_lock(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
2387 & field_dp_type,err,error,*999)
2388 CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
2389 & number_of_dimensions,err,error,*999)
2390 IF(number_of_dimensions==1)
THEN 2391 number_of_materials_components=2
2392 ELSEIF(number_of_dimensions==2)
THEN 2393 number_of_materials_components=6
2394 ELSEIF(number_of_dimensions==3)
THEN 2395 number_of_materials_components=12
2398 CALL field_number_of_components_set_and_lock(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
2399 & number_of_materials_components,err,error,*999)
2401 CALL field_component_mesh_component_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
2402 & 1,geometric_component_number,err,error,*999)
2403 DO component_idx=1,number_of_materials_components
2404 CALL field_component_mesh_component_set(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
2405 & component_idx,geometric_component_number,err,error,*999)
2406 CALL field_component_interpolation_set(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
2407 & component_idx,field_constant_interpolation,err,error,*999)
2410 CALL field_scaling_type_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_scaling_type,err,error,*999)
2411 CALL field_scaling_type_set(equations_materials%MATERIALS_FIELD,geometric_scaling_type,err,error,*999)
2414 CALL field_type_check(equations_set_setup%FIELD,field_material_type,err,error,*999)
2415 CALL field_dependent_type_check(equations_set_setup%FIELD,field_independent_type,err,error,*999)
2416 CALL field_number_of_variables_check(equations_set_setup%FIELD,1,err,error,*999)
2417 CALL field_variable_types_check(equations_set_setup%FIELD,(/field_u_variable_type/),err,error,*999)
2418 CALL field_dimension_check(equations_set_setup%FIELD,field_u_variable_type,field_vector_dimension_type, &
2420 CALL field_data_type_check(equations_set_setup%FIELD,field_u_variable_type,field_dp_type,err,error,*999)
2421 CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
2422 & number_of_dimensions,err,error,*999)
2423 IF(number_of_dimensions==1)
THEN 2424 CALL field_number_of_components_check(equations_set_setup%FIELD,field_u_variable_type,2,err, &
2426 ELSEIF(number_of_dimensions==2)
THEN 2427 CALL field_number_of_components_check(equations_set_setup%FIELD,field_u_variable_type,6,err, &
2429 ELSEIF(number_of_dimensions==3)
THEN 2430 CALL field_number_of_components_check(equations_set_setup%FIELD,field_u_variable_type,12,err, &
2435 CALL flagerror(
"Equations set materials is not associated.",err,error,*999)
2439 equations_materials=>equations_set%MATERIALS
2440 IF(
ASSOCIATED(equations_materials))
THEN 2441 IF(equations_materials%MATERIALS_FIELD_AUTO_CREATED)
THEN 2443 CALL field_create_finish(equations_materials%MATERIALS_FIELD,err,error,*999)
2445 CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
2446 & number_of_dimensions,err,error,*999)
2447 IF(number_of_dimensions==1)
THEN 2448 number_of_materials_components=2
2449 ELSEIF(number_of_dimensions==2)
THEN 2450 number_of_materials_components=6
2451 ELSEIF(number_of_dimensions==3)
THEN 2452 number_of_materials_components=12
2455 DO component_idx=1,number_of_materials_components
2456 CALL field_component_values_initialise(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
2457 & field_values_set_type,component_idx,1.0_dp,err,error,*999)
2461 CALL flagerror(
"Equations set materials is not associated.",err,error,*999)
2464 local_error=
"The action type of "//
trim(
number_to_vstring(equations_set_setup%ACTION_TYPE,
"*",err,error))// &
2465 &
" for a setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
2466 &
" is invalid for an extrcellular bidomain Poisson equation." 2467 CALL flagerror(local_error,err,error,*999)
2471 SELECT CASE(equations_set%SPECIFICATION(3))
2473 SELECT CASE(equations_set_setup%ACTION_TYPE)
2478 IF(equations_set%SOURCE%SOURCE_FIELD_AUTO_CREATED)
THEN 2481 CALL field_create_start(equations_set_setup%FIELD_USER_NUMBER,equations_set%REGION, &
2482 & equations_set%SOURCE%SOURCE_FIELD,err,error,*999)
2484 CALL field_type_set_and_lock(equations_set%SOURCE%SOURCE_FIELD,field_general_type,err,error,*999)
2486 CALL field_label_set_and_lock(equations_set%SOURCE%SOURCE_FIELD,
"Vm",err,error,*999)
2488 CALL field_dependent_type_set_and_lock(equations_set%SOURCE%SOURCE_FIELD, &
2489 & field_independent_type,err,error,*999)
2491 CALL field_mesh_decomposition_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_decomposition, &
2494 CALL field_mesh_decomposition_set_and_lock(equations_set%SOURCE%SOURCE_FIELD, &
2495 & geometric_decomposition,err,error,*999)
2497 CALL field_geometric_field_set_and_lock(equations_set%SOURCE%SOURCE_FIELD,equations_set% &
2498 & geometry%GEOMETRIC_FIELD,err,error,*999)
2500 source_field_number_of_variables=1
2501 CALL field_number_of_variables_set_and_lock(equations_set%SOURCE%SOURCE_FIELD, &
2502 & source_field_number_of_variables,err,error,*999)
2503 CALL field_variable_types_set_and_lock(equations_set%SOURCE%SOURCE_FIELD, &
2504 & (/field_u_variable_type/),err,error,*999)
2505 CALL field_dimension_set_and_lock(equations_set%SOURCE%SOURCE_FIELD,field_u_variable_type, &
2506 & field_vector_dimension_type,err,error,*999)
2507 CALL field_data_type_set_and_lock(equations_set%SOURCE%SOURCE_FIELD,field_u_variable_type, &
2508 & field_dp_type,err,error,*999)
2510 source_field_number_of_components=1
2511 CALL field_number_of_components_set_and_lock(equations_set%SOURCE%SOURCE_FIELD, &
2512 & field_u_variable_type,source_field_number_of_components,err,error,*999)
2513 CALL field_component_mesh_component_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
2514 & 1,geometric_mesh_component,err,error,*999)
2516 CALL field_component_mesh_component_set(equations_set%SOURCE%SOURCE_FIELD, &
2517 & field_u_variable_type,1,geometric_mesh_component,err,error,*999)
2518 SELECT CASE(equations_set%SOLUTION_METHOD)
2521 CALL field_component_interpolation_set_and_lock(equations_set%SOURCE%SOURCE_FIELD, &
2522 & field_u_variable_type,1,field_node_based_interpolation,err,error,*999)
2523 CALL field_scaling_type_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_scaling_type, &
2525 CALL field_scaling_type_set(equations_set%SOURCE%SOURCE_FIELD,geometric_scaling_type, &
2529 local_error=
"The solution method of " &
2531 CALL flagerror(local_error,err,error,*999)
2535 CALL field_type_check(equations_set_setup%FIELD,field_general_type,err,error,*999)
2536 CALL field_dependent_type_check(equations_set_setup%FIELD,field_independent_type,err,error,*999)
2537 CALL field_number_of_variables_check(equations_set_setup%FIELD,1,err,error,*999)
2538 CALL field_variable_types_check(equations_set_setup%FIELD,(/field_u_variable_type/),err,error,*999)
2539 CALL field_dimension_check(equations_set_setup%FIELD,field_u_variable_type,field_vector_dimension_type, &
2541 CALL field_data_type_check(equations_set_setup%FIELD,field_u_variable_type,field_dp_type,err,error,*999)
2543 source_field_number_of_components=1
2544 CALL field_number_of_components_check(equations_set_setup%FIELD,field_u_variable_type, &
2545 & source_field_number_of_components,err,error,*999)
2546 SELECT CASE(equations_set%SOLUTION_METHOD)
2548 CALL field_component_interpolation_check(equations_set_setup%FIELD,field_u_variable_type,1, &
2549 & field_node_based_interpolation,err,error,*999)
2552 &
"*",err,error))//
" is invalid." 2553 CALL flagerror(local_error,err,error,*999)
2559 IF(equations_set%SOURCE%SOURCE_FIELD_AUTO_CREATED)
THEN 2560 CALL field_create_finish(equations_set%SOURCE%SOURCE_FIELD,err,error,*999)
2563 local_error=
"The action type of "//
trim(
number_to_vstring(equations_set_setup%ACTION_TYPE,
"*",err,error))// &
2564 &
" for a setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
2565 &
" is invalid for an extracellular bidomain Poisson subtype" 2566 CALL flagerror(local_error,err,error,*999)
2569 local_error=
"The equation set subtype of "//
trim(
number_to_vstring(equations_set%SPECIFICATION(3),
"*",err,error))// &
2570 &
" for a setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
2571 &
" is invalid for an extracellular bidomain Poisson equation." 2572 CALL flagerror(local_error,err,error,*999)
2576 SELECT CASE(equations_set_setup%ACTION_TYPE)
2578 IF(equations_set%DEPENDENT%DEPENDENT_FINISHED)
THEN 2579 dependent_field=>equations_set%DEPENDENT%DEPENDENT_FIELD
2580 IF(
ASSOCIATED(dependent_field))
THEN 2581 geometric_field=>equations_set%GEOMETRY%GEOMETRIC_FIELD
2582 IF(
ASSOCIATED(geometric_field))
THEN 2583 CALL field_number_of_components_get(geometric_field,field_u_variable_type,number_of_dimensions,err,error,*999)
2584 SELECT CASE(equations_set_setup%ANALYTIC_FUNCTION_TYPE)
2589 IF(number_of_dimensions/=2)
THEN 2590 local_error=
"The number of geometric dimensions of "// &
2592 &
" is invalid. The analytic function type of "// &
2594 &
" requires that there be 2 geometric dimensions." 2595 CALL flagerror(local_error,err,error,*999)
2601 local_error=
"The equations set subtype of "// &
2603 &
" is invalid. The analytic function type of "// &
2605 &
" requires that the equations set subtype be an exponential source Poisson equation." 2606 CALL flagerror(local_error,err,error,*999)
2612 IF(number_of_dimensions/=3)
THEN 2613 local_error=
"The number of geometric dimensions of "// &
2615 &
" is invalid. The analytic function type of "// &
2617 &
" requires that there be 3 geometric dimensions." 2618 CALL flagerror(local_error,err,error,*999)
2624 local_error=
"The equations set subtype of "// &
2626 &
" is invalid. The analytic function type of "// &
2628 &
" requires that the equations set subtype be an exponential source Poisson equation." 2629 CALL flagerror(local_error,err,error,*999)
2632 local_error=
"The specified analytic function type of "// &
2634 &
" is invalid for a linear source Poisson equation." 2635 CALL flagerror(local_error,err,error,*999)
2638 CALL flagerror(
"Equations set geometric field is not associated.",err,error,*999)
2641 CALL flagerror(
"Equations set dependent field is not associated.",err,error,*999)
2644 CALL flagerror(
"Equations set dependent field has not been finished.",err,error,*999)
2647 IF(
ASSOCIATED(equations_set%ANALYTIC))
THEN 2648 analytic_field=>equations_set%ANALYTIC%ANALYTIC_FIELD
2649 IF(
ASSOCIATED(analytic_field))
THEN 2650 IF(equations_set%ANALYTIC%ANALYTIC_FIELD_AUTO_CREATED)
THEN 2651 CALL field_create_finish(equations_set%DEPENDENT%DEPENDENT_FIELD,err,error,*999)
2655 CALL flagerror(
"Equations set analytic is not associated.",err,error,*999)
2658 local_error=
"The action type of "//
trim(
number_to_vstring(equations_set_setup%ACTION_TYPE,
"*",err,error))// &
2659 &
" for a setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
2660 &
" is invalid for a extracellular bidomain source Poisson equation." 2661 CALL flagerror(local_error,err,error,*999)
2665 SELECT CASE(equations_set_setup%ACTION_TYPE)
2668 IF(equations_set%DEPENDENT%DEPENDENT_FINISHED)
THEN 2674 CALL flagerror(
"Equations set dependent field has not been finished.",err,error,*999)
2678 SELECT CASE(equations_set%SOLUTION_METHOD)
2691 local_error=
"The third equations set specification of "// &
2693 CALL flagerror(local_error,err,error,*999)
2698 SELECT CASE(equations%SPARSITY_TYPE)
2708 local_error=
"The equations matrices sparsity type of "// &
2710 CALL flagerror(local_error,err,error,*999)
2714 CALL flagerror(
"Not implemented.",err,error,*999)
2716 CALL flagerror(
"Not implemented.",err,error,*999)
2718 CALL flagerror(
"Not implemented.",err,error,*999)
2720 CALL flagerror(
"Not implemented.",err,error,*999)
2722 CALL flagerror(
"Not implemented.",err,error,*999)
2724 local_error=
"The solution method of "//
trim(
number_to_vstring(equations_set%SOLUTION_METHOD,
"*",err,error))// &
2726 CALL flagerror(local_error,err,error,*999)
2729 local_error=
"The action type of "//
trim(
number_to_vstring(equations_set_setup%ACTION_TYPE,
"*",err,error))// &
2730 &
" for a setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
2731 &
" is invalid for a linear source Poisson equation." 2732 CALL flagerror(local_error,err,error,*999)
2735 local_error=
"The setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
2736 &
" is invalid for a extracellular bidomain source Poisson equation." 2737 CALL flagerror(local_error,err,error,*999)
2740 local_error=
"The equations set subtype of "//
trim(
number_to_vstring(equations_set%SPECIFICATION(3),
"*",err,error))// &
2741 &
" is not a extracellular bidomain source Poisson equation subtype." 2742 CALL flagerror(local_error,err,error,*999)
2745 CALL flagerror(
"Equations set is not associated.",err,error,*999)
2748 exits(
"Poisson_EquationsSetExtracellularBidomainSetup")
2750 999
errors(
"Poisson_EquationsSetExtracellularBidomainSetup",err,error)
2751 exits(
"Poisson_EquationsSetExtracellularBidomainSetup")
2766 INTEGER(INTG),
INTENT(OUT) :: ERR
2769 INTEGER(INTG) :: component_idx,GEOMETRIC_COMPONENT_NUMBER,GEOMETRIC_SCALING_TYPE,NUMBER_OF_DIMENSIONS, &
2770 & NUMBER_OF_MATERIALS_COMPONENTS
2776 TYPE(
field_type),
POINTER :: analytic_field,DEPENDENT_FIELD,geometric_field
2779 enters(
"POISSON_EQUATION_EQUATION_SET_NONLINEAR_SOURCE_SETUP",err,error,*999)
2782 NULLIFY(equations_mapping)
2783 NULLIFY(equations_matrices)
2784 NULLIFY(geometric_decomposition)
2786 IF(
ASSOCIATED(equations_set))
THEN 2787 IF(.NOT.
ALLOCATED(equations_set%SPECIFICATION))
THEN 2788 CALL flagerror(
"Equations set specification is not allocated.",err,error,*999)
2789 ELSE IF(
SIZE(equations_set%SPECIFICATION,1)/=3)
THEN 2790 CALL flagerror(
"Equations set specification must have three entries for a Poisson type equations set.", &
2795 SELECT CASE(equations_set_setup%SETUP_TYPE)
2797 SELECT CASE(equations_set_setup%ACTION_TYPE)
2803 local_error=
"The action type of "//
trim(
number_to_vstring(equations_set_setup%ACTION_TYPE,
"*",err,error))// &
2804 &
" for a setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
2805 &
" is invalid for a nonlinear source Poisson equation." 2806 CALL flagerror(local_error,err,error,*999)
2811 SELECT CASE(equations_set_setup%ACTION_TYPE)
2813 IF(equations_set%DEPENDENT%DEPENDENT_FIELD_AUTO_CREATED)
THEN 2815 CALL field_create_start(equations_set_setup%FIELD_USER_NUMBER,equations_set%REGION,equations_set%DEPENDENT% &
2816 & dependent_field,err,error,*999)
2817 CALL field_type_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_general_type,err,error,*999)
2818 CALL field_dependent_type_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_dependent_type,err,error,*999)
2819 CALL field_mesh_decomposition_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_decomposition,err,error,*999)
2820 CALL field_mesh_decomposition_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,geometric_decomposition, &
2822 CALL field_geometric_field_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,equations_set%GEOMETRY% &
2823 & geometric_field,err,error,*999)
2824 CALL field_number_of_variables_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,2,err,error,*999)
2825 CALL field_variable_types_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,(/field_u_variable_type, &
2826 & field_deludeln_variable_type/),err,error,*999)
2827 CALL field_dimension_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type, &
2828 & field_scalar_dimension_type,err,error,*999)
2829 CALL field_dimension_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_deludeln_variable_type, &
2830 & field_scalar_dimension_type,err,error,*999)
2831 CALL field_data_type_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type, &
2832 & field_dp_type,err,error,*999)
2833 CALL field_data_type_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_deludeln_variable_type, &
2834 & field_dp_type,err,error,*999)
2835 CALL field_number_of_components_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type,1, &
2837 CALL field_number_of_components_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_deludeln_variable_type,1, &
2840 CALL field_component_mesh_component_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type,1, &
2841 & geometric_component_number,err,error,*999)
2842 CALL field_component_mesh_component_set(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type,1, &
2843 & geometric_component_number,err,error,*999)
2844 CALL field_component_mesh_component_set(equations_set%DEPENDENT%DEPENDENT_FIELD,field_deludeln_variable_type,1, &
2845 & geometric_component_number,err,error,*999)
2846 SELECT CASE(equations_set%SOLUTION_METHOD)
2848 CALL field_component_interpolation_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type,1, &
2849 & field_node_based_interpolation,err,error,*999)
2850 CALL field_component_interpolation_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD, &
2851 & field_deludeln_variable_type,1,field_node_based_interpolation,err,error,*999)
2853 CALL field_scaling_type_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_scaling_type,err,error,*999)
2854 CALL field_scaling_type_set(equations_set%DEPENDENT%DEPENDENT_FIELD,geometric_scaling_type,err,error,*999)
2856 CALL flagerror(
"Not implemented.",err,error,*999)
2858 CALL flagerror(
"Not implemented.",err,error,*999)
2860 CALL flagerror(
"Not implemented.",err,error,*999)
2862 CALL flagerror(
"Not implemented.",err,error,*999)
2864 CALL flagerror(
"Not implemented.",err,error,*999)
2866 local_error=
"The solution method of "//
trim(
number_to_vstring(equations_set%SOLUTION_METHOD,
"*",err,error))// &
2868 CALL flagerror(local_error,err,error,*999)
2872 CALL field_type_check(equations_set_setup%FIELD,field_general_type,err,error,*999)
2873 CALL field_dependent_type_check(equations_set_setup%FIELD,field_dependent_type,err,error,*999)
2874 CALL field_number_of_variables_check(equations_set_setup%FIELD,2,err,error,*999)
2875 CALL field_variable_types_check(equations_set_setup%FIELD,(/field_u_variable_type,field_deludeln_variable_type/), &
2877 CALL field_dimension_check(equations_set_setup%FIELD,field_u_variable_type,field_scalar_dimension_type,err,error,*999)
2878 CALL field_dimension_check(equations_set_setup%FIELD,field_deludeln_variable_type,field_scalar_dimension_type, &
2880 CALL field_data_type_check(equations_set_setup%FIELD,field_u_variable_type,field_dp_type,err,error,*999)
2881 CALL field_data_type_check(equations_set_setup%FIELD,field_deludeln_variable_type,field_dp_type,err,error,*999)
2882 CALL field_number_of_components_check(equations_set_setup%FIELD,field_u_variable_type,1,err,error,*999)
2883 CALL field_number_of_components_check(equations_set_setup%FIELD,field_deludeln_variable_type,1,err,error,*999)
2884 SELECT CASE(equations_set%SOLUTION_METHOD)
2886 CALL field_component_interpolation_check(equations_set_setup%FIELD,field_u_variable_type,1, &
2887 & field_node_based_interpolation,err,error,*999)
2888 CALL field_component_interpolation_check(equations_set_setup%FIELD,field_deludeln_variable_type,1, &
2889 & field_node_based_interpolation,err,error,*999)
2891 CALL flagerror(
"Not implemented.",err,error,*999)
2893 CALL flagerror(
"Not implemented.",err,error,*999)
2895 CALL flagerror(
"Not implemented.",err,error,*999)
2897 CALL flagerror(
"Not implemented.",err,error,*999)
2899 CALL flagerror(
"Not implemented.",err,error,*999)
2901 local_error=
"The solution method of "//
trim(
number_to_vstring(equations_set%SOLUTION_METHOD,
"*",err,error))// &
2903 CALL flagerror(local_error,err,error,*999)
2907 IF(equations_set%DEPENDENT%DEPENDENT_FIELD_AUTO_CREATED)
THEN 2908 CALL field_create_finish(equations_set%DEPENDENT%DEPENDENT_FIELD,err,error,*999)
2911 local_error=
"The action type of "//
trim(
number_to_vstring(equations_set_setup%ACTION_TYPE,
"*",err,error))// &
2912 &
" for a setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
2913 &
" is invalid for a nonlinear source Poisson equation" 2914 CALL flagerror(local_error,err,error,*999)
2917 SELECT CASE(equations_set_setup%ACTION_TYPE)
2919 equations_materials=>equations_set%MATERIALS
2920 IF(
ASSOCIATED(equations_materials))
THEN 2921 IF(equations_materials%MATERIALS_FIELD_AUTO_CREATED)
THEN 2923 CALL field_create_start(equations_set_setup%FIELD_USER_NUMBER,equations_set%REGION,equations_materials% &
2924 & materials_field,err,error,*999)
2925 CALL field_type_set_and_lock(equations_materials%MATERIALS_FIELD,field_material_type,err,error,*999)
2926 CALL field_dependent_type_set_and_lock(equations_materials%MATERIALS_FIELD,field_independent_type,err,error,*999)
2927 CALL field_mesh_decomposition_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_decomposition,err,error,*999)
2928 CALL field_mesh_decomposition_set_and_lock(equations_materials%MATERIALS_FIELD,geometric_decomposition, &
2930 CALL field_geometric_field_set_and_lock(equations_materials%MATERIALS_FIELD,equations_set%GEOMETRY% &
2931 & geometric_field,err,error,*999)
2932 CALL field_number_of_variables_set_and_lock(equations_materials%MATERIALS_FIELD,1,err,error,*999)
2933 CALL field_dimension_set_and_lock(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
2934 & field_vector_dimension_type,err,error,*999)
2935 CALL field_data_type_set_and_lock(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
2936 & field_dp_type,err,error,*999)
2937 CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
2938 & number_of_dimensions,err,error,*999)
2942 number_of_materials_components=number_of_dimensions+3
2946 number_of_materials_components=number_of_dimensions+3
2949 CALL field_number_of_components_set_and_lock(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
2950 & number_of_materials_components,err,error,*999)
2952 DO component_idx=1,number_of_dimensions
2953 CALL field_component_mesh_component_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
2954 & component_idx,geometric_component_number,err,error,*999)
2955 CALL field_component_mesh_component_set(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
2956 & component_idx,geometric_component_number,err,error,*999)
2957 CALL field_component_interpolation_set(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
2958 & component_idx,field_constant_interpolation,err,error,*999)
2961 CALL field_component_mesh_component_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
2962 & 1,geometric_component_number,err,error,*999)
2963 DO component_idx=number_of_dimensions+1,number_of_materials_components
2964 CALL field_component_mesh_component_set(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
2965 & component_idx,geometric_component_number,err,error,*999)
2966 CALL field_component_interpolation_set(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
2967 & component_idx,field_constant_interpolation,err,error,*999)
2970 CALL field_scaling_type_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_scaling_type,err,error,*999)
2971 CALL field_scaling_type_set(equations_materials%MATERIALS_FIELD,geometric_scaling_type,err,error,*999)
2974 CALL field_type_check(equations_set_setup%FIELD,field_material_type,err,error,*999)
2975 CALL field_dependent_type_check(equations_set_setup%FIELD,field_independent_type,err,error,*999)
2976 CALL field_number_of_variables_check(equations_set_setup%FIELD,1,err,error,*999)
2977 CALL field_variable_types_check(equations_set_setup%FIELD,(/field_u_variable_type/),err,error,*999)
2978 CALL field_dimension_check(equations_set_setup%FIELD,field_u_variable_type,field_vector_dimension_type, &
2980 CALL field_data_type_check(equations_set_setup%FIELD,field_u_variable_type,field_dp_type,err,error,*999)
2981 CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
2982 & number_of_dimensions,err,error,*999)
2984 CALL field_number_of_components_check(equations_set_setup%FIELD,field_u_variable_type,number_of_dimensions+3, &
2987 CALL field_number_of_components_check(equations_set_setup%FIELD,field_u_variable_type,number_of_dimensions+3, &
2992 CALL flagerror(
"Equations set materials is not associated.",err,error,*999)
2995 equations_materials=>equations_set%MATERIALS
2996 IF(
ASSOCIATED(equations_materials))
THEN 2997 IF(equations_materials%MATERIALS_FIELD_AUTO_CREATED)
THEN 2999 CALL field_create_finish(equations_materials%MATERIALS_FIELD,err,error,*999)
3001 CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
3002 & number_of_dimensions,err,error,*999)
3006 number_of_materials_components=number_of_dimensions+3
3010 number_of_materials_components=number_of_dimensions+3
3013 DO component_idx=1,number_of_dimensions
3014 CALL field_component_values_initialise(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
3015 & field_values_set_type,component_idx,1.0_dp,err,error,*999)
3018 DO component_idx=number_of_dimensions+1,number_of_materials_components
3019 CALL field_component_values_initialise(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
3020 & field_values_set_type,component_idx,1.0_dp,err,error,*999)
3024 CALL flagerror(
"Equations set materials is not associated.",err,error,*999)
3027 local_error=
"The action type of "//
trim(
number_to_vstring(equations_set_setup%ACTION_TYPE,
"*",err,error))// &
3028 &
" for a setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
3029 &
" is invalid for a linear source Poisson equation." 3030 CALL flagerror(local_error,err,error,*999)
3033 SELECT CASE(equations_set_setup%ACTION_TYPE)
3040 local_error=
"The action type of "//
trim(
number_to_vstring(equations_set_setup%ACTION_TYPE,
"*",err,error))// &
3041 &
" for a setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
3042 &
" is invalid for a nonlinear source Poisson equation." 3043 CALL flagerror(local_error,err,error,*999)
3046 SELECT CASE(equations_set_setup%ACTION_TYPE)
3048 IF(equations_set%DEPENDENT%DEPENDENT_FINISHED)
THEN 3049 dependent_field=>equations_set%DEPENDENT%DEPENDENT_FIELD
3050 IF(
ASSOCIATED(dependent_field))
THEN 3051 geometric_field=>equations_set%GEOMETRY%GEOMETRIC_FIELD
3052 IF(
ASSOCIATED(geometric_field))
THEN 3053 CALL field_number_of_components_get(geometric_field,field_u_variable_type,number_of_dimensions,err,error,*999)
3054 SELECT CASE(equations_set_setup%ANALYTIC_FUNCTION_TYPE)
3059 IF(number_of_dimensions/=2)
THEN 3060 local_error=
"The number of geometric dimensions of "// &
3062 &
" is invalid. The analytic function type of "// &
3064 &
" requires that there be 2 geometric dimensions." 3065 CALL flagerror(local_error,err,error,*999)
3071 local_error=
"The equations set subtype of "// &
3073 &
" is invalid. The analytic function type of "// &
3075 &
" requires that the equations set subtype be an exponential source Poisson equation." 3076 CALL flagerror(local_error,err,error,*999)
3082 IF(number_of_dimensions/=3)
THEN 3083 local_error=
"The number of geometric dimensions of "// &
3085 &
" is invalid. The analytic function type of "// &
3087 &
" requires that there be 3 geometric dimensions." 3088 CALL flagerror(local_error,err,error,*999)
3094 local_error=
"The equations set subtype of "// &
3096 &
" is invalid. The analytic function type of "// &
3098 &
" requires that the equations set subtype be an exponential source Poisson equation." 3099 CALL flagerror(local_error,err,error,*999)
3102 local_error=
"The specified analytic function type of "// &
3104 &
" is invalid for a nonlinear source Poisson equation." 3105 CALL flagerror(local_error,err,error,*999)
3108 CALL flagerror(
"Equations set geometric field is not associated.",err,error,*999)
3111 CALL flagerror(
"Equations set dependent field is not associated.",err,error,*999)
3114 CALL flagerror(
"Equations set dependent field has not been finished.",err,error,*999)
3117 IF(
ASSOCIATED(equations_set%ANALYTIC))
THEN 3118 analytic_field=>equations_set%ANALYTIC%ANALYTIC_FIELD
3119 IF(
ASSOCIATED(analytic_field))
THEN 3120 IF(equations_set%ANALYTIC%ANALYTIC_FIELD_AUTO_CREATED)
THEN 3121 CALL field_create_finish(equations_set%DEPENDENT%DEPENDENT_FIELD,err,error,*999)
3125 CALL flagerror(
"Equations set analytic is not associated.",err,error,*999)
3128 local_error=
"The action type of "//
trim(
number_to_vstring(equations_set_setup%ACTION_TYPE,
"*",err,error))// &
3129 &
" for a setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
3130 &
" is invalid for a nonlinear source Poisson equation." 3131 CALL flagerror(local_error,err,error,*999)
3134 SELECT CASE(equations_set_setup%ACTION_TYPE)
3136 IF(equations_set%DEPENDENT%DEPENDENT_FINISHED)
THEN 3142 CALL flagerror(
"Equations set dependent field has not been finished.",err,error,*999)
3145 SELECT CASE(equations_set%SOLUTION_METHOD)
3162 SELECT CASE(equations%SPARSITY_TYPE)
3178 local_error=
"The equations matrices sparsity type of "// &
3180 CALL flagerror(local_error,err,error,*999)
3184 CALL flagerror(
"Not implemented.",err,error,*999)
3186 CALL flagerror(
"Not implemented.",err,error,*999)
3188 CALL flagerror(
"Not implemented.",err,error,*999)
3190 CALL flagerror(
"Not implemented.",err,error,*999)
3192 CALL flagerror(
"Not implemented.",err,error,*999)
3194 local_error=
"The solution method of "//
trim(
number_to_vstring(equations_set%SOLUTION_METHOD,
"*",err,error))// &
3196 CALL flagerror(local_error,err,error,*999)
3199 local_error=
"The action type of "//
trim(
number_to_vstring(equations_set_setup%ACTION_TYPE,
"*",err,error))// &
3200 &
" for a setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
3201 &
" is invalid for a nonlinear source Poisson equation." 3202 CALL flagerror(local_error,err,error,*999)
3205 local_error=
"The setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
3206 &
" is invalid for a nonlinear source Poisson equation." 3207 CALL flagerror(local_error,err,error,*999)
3210 local_error=
"The equations set subtype of "//
trim(
number_to_vstring(equations_set%SPECIFICATION(3),
"*",err,error))// &
3211 &
" is not a nonlinear source Poisson equation subtype." 3212 CALL flagerror(local_error,err,error,*999)
3215 CALL flagerror(
"Equations set is not associated.",err,error,*999)
3218 exits(
"Poisson_EquationsSetNonlinearSourceSetup")
3220 999
errors(
"Poisson_EquationsSetNonlinearSourceSetup",err,error)
3221 exits(
"Poisson_EquationsSetNonlinearSourceSetup")
3236 INTEGER(INTG),
INTENT(OUT) :: ERR
3241 enters(
"POISSON_EQUATION_PROBLEM_SETUP",err,error,*999)
3243 IF(
ASSOCIATED(problem))
THEN 3244 IF(.NOT.
ALLOCATED(problem%SPECIFICATION))
THEN 3245 CALL flagerror(
"Problem specification is not allocated.",err,error,*999)
3246 ELSE IF(
SIZE(problem%SPECIFICATION,1)<3)
THEN 3247 CALL flagerror(
"Problem specification must have three entries for a Poisson problem.",err,error,*999)
3249 SELECT CASE(problem%SPECIFICATION(3))
3261 &
" is not valid for a Poisson equation type of a classical field problem class." 3262 CALL flagerror(local_error,err,error,*999)
3265 CALL flagerror(
"Problem is not associated.",err,error,*999)
3268 exits(
"POISSON_EQUATION_PROBLEM_SETUP")
3270 999 errorsexits(
"POISSON_EQUATION_PROBLEM_SETUP",err,error)
3283 INTEGER(INTG),
INTENT(IN) :: ELEMENT_NUMBER
3284 INTEGER(INTG),
INTENT(OUT) :: ERR
3287 INTEGER(INTG) FIELD_VAR_TYPE,ng,mh,mhs,mi,ms,nh,nhs,ni,ns,I,J,K,L,H,element_node_identity
3288 REAL(DP) :: RWG,SUM,PGMSI(3),PGNSI(3),SUM2,DXI_DX(3,3),DELTA_T,DXI_DX_DX(3,3),PHINS
3289 REAL(DP) :: CONDUCTIVITY_SUM_MATERIAL(3,3),CONDUCTIVITY_SUM(3,3),CONDUCTIVITY_SUM_TEMP(3,3),dNudX(3,3),dXdNu(3,3), &
3290 & DNUDXI(3,3),DXIDNU(3,3)
3291 REAL(DP) :: CONDUCTIVITY_I_MATERIAL(3,3),CONDUCTIVITY_I(3,3),CONDUCTIVITY_I_TEMP(3,3)
3292 REAL(DP),
ALLOCATABLE :: MATRIX_K_I(:,:)
3293 REAL(DP),
ALLOCATABLE :: Vm(:)
3294 REAL(DP) :: U_VALUE(3),U_DERIV(3,3),RHO_PARAM,MU_PARAM,U_OLD(3),U_SECOND(3,3,3),X(3),B(3),P_DERIV(3),W_VALUE(3)
3295 TYPE(
basis_type),
POINTER :: DEPENDENT_BASIS,GEOMETRIC_BASIS,SOURCE_BASIS,INDEPENDENT_BASIS
3304 TYPE(
field_type),
POINTER :: DEPENDENT_FIELD,GEOMETRIC_FIELD,SOURCE_FIELD,MATERIALS_FIELD,INDEPENDENT_FIELD,FIBRE_FIELD
3311 INTEGER(INTG) :: NUMBER_OF_DIMENSIONS,NUMBER_OF_XI,NUMBER_OF_ELEMENT_PARAMETERS,node_idx,dof_idx
3313 LOGICAL :: INSIDE,BETWEEN
3314 REAL(DP),
POINTER :: INPUT_LABEL(:)
3315 REAL(DP) :: DIFF_COEFF1,DIFF_COEFF2
3318 CHARACTER(26) :: CVAR
3319 INTEGER :: GAUSS_POINT_LOOP_PHASE(2) = [ 0, 0 ]
3320 SAVE gauss_point_loop_phase
3323 NULLIFY(source_field_variable)
3325 enters(
"POISSON_EQUATION_FINITE_ELEMENT_CALCULATE",err,error,*999)
3327 IF(
ASSOCIATED(equations_set))
THEN 3328 IF(.NOT.
ALLOCATED(equations_set%SPECIFICATION))
THEN 3329 CALL flagerror(
"Equations set specification is not allocated.",err,error,*999)
3330 ELSE IF(
SIZE(equations_set%SPECIFICATION,1)/=3)
THEN 3331 CALL flagerror(
"Equations set specification must have three entries for a Poisson type equations set.", &
3334 equations=>equations_set%EQUATIONS
3335 IF(
ASSOCIATED(equations))
THEN 3336 SELECT CASE(equations_set%SPECIFICATION(3))
3339 dependent_field=>equations%INTERPOLATION%DEPENDENT_FIELD
3340 geometric_field=>equations%INTERPOLATION%GEOMETRIC_FIELD
3341 materials_field=>equations%INTERPOLATION%MATERIALS_FIELD
3342 equations_matrices=>equations%EQUATIONS_MATRICES
3343 linear_matrices=>equations_matrices%LINEAR_MATRICES
3344 equations_matrix=>linear_matrices%MATRICES(1)%PTR
3345 rhs_vector=>equations_matrices%RHS_VECTOR
3346 source_vector=>equations_matrices%SOURCE_VECTOR
3347 equations_mapping=>equations%EQUATIONS_MAPPING
3348 linear_mapping=>equations_mapping%LINEAR_MAPPING
3349 field_variable=>linear_mapping%EQUATIONS_MATRIX_TO_VAR_MAPS(1)%VARIABLE
3350 field_var_type=field_variable%VARIABLE_TYPE
3351 dependent_basis=>dependent_field%DECOMPOSITION%DOMAIN(dependent_field%DECOMPOSITION%MESH_COMPONENT_NUMBER)%PTR% &
3352 & topology%ELEMENTS%ELEMENTS(element_number)%BASIS
3353 geometric_basis=>geometric_field%DECOMPOSITION%DOMAIN(geometric_field%DECOMPOSITION%MESH_COMPONENT_NUMBER)%PTR% &
3354 & topology%ELEMENTS%ELEMENTS(element_number)%BASIS
3356 CALL field_interpolation_parameters_element_get(field_values_set_type,element_number,equations%INTERPOLATION% &
3357 & geometric_interp_parameters(field_u_variable_type)%PTR,err,error,*999)
3358 CALL field_interpolation_parameters_element_get(field_values_set_type,element_number,equations%INTERPOLATION% &
3359 & materials_interp_parameters(field_u_variable_type)%PTR,err,error,*999)
3361 DO ng=1,quadrature_scheme%NUMBER_OF_GAUSS
3363 & geometric_interp_point(field_u_variable_type)%PTR,err,error,*999)
3365 & materials_interp_point(field_u_variable_type)%PTR,err,error,*999)
3366 CALL field_interpolated_point_metrics_calculate(geometric_basis%NUMBER_OF_XI,equations%INTERPOLATION% &
3367 & geometric_interp_point_metrics(field_u_variable_type)%PTR,err,error,*999)
3370 rwg=equations%INTERPOLATION%GEOMETRIC_INTERP_POINT_METRICS(field_u_variable_type)%PTR%JACOBIAN* &
3371 & quadrature_scheme%GAUSS_WEIGHTS(ng)
3374 DO mh=1,field_variable%NUMBER_OF_COMPONENTS
3377 DO ms=1,dependent_basis%NUMBER_OF_ELEMENT_PARAMETERS
3380 IF(equations_matrix%UPDATE_MATRIX)
THEN 3382 DO nh=1,field_variable%NUMBER_OF_COMPONENTS
3383 DO ns=1,dependent_basis%NUMBER_OF_ELEMENT_PARAMETERS
3385 DO ni=1,dependent_basis%NUMBER_OF_XI
3390 DO mi=1,dependent_basis%NUMBER_OF_XI
3391 DO ni=1,dependent_basis%NUMBER_OF_XI
3392 sum=sum+pgmsi(mi)*pgnsi(ni)*equations%INTERPOLATION% &
3393 & geometric_interp_point_metrics(field_u_variable_type)%PTR%GU(mi,ni)
3396 equations_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)=equations_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)+sum*rwg
3400 IF(source_vector%UPDATE_VECTOR)
THEN 3402 sum=equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_u_variable_type)%PTR%VALUES(1,
no_part_deriv)
3403 source_vector%ELEMENT_VECTOR%VECTOR(mhs)=source_vector%ELEMENT_VECTOR%VECTOR(mhs)+ &
3404 & sum*quadrature_scheme%GAUSS_BASIS_FNS(ms,
no_part_deriv,ng)*rwg
3412 dependent_field=>equations%INTERPOLATION%DEPENDENT_FIELD
3413 geometric_field=>equations%INTERPOLATION%GEOMETRIC_FIELD
3414 materials_field=>equations%INTERPOLATION%MATERIALS_FIELD
3415 fibre_field=>equations%INTERPOLATION%FIBRE_FIELD
3416 source_field=>equations%INTERPOLATION%SOURCE_FIELD
3418 equations_matrices=>equations%EQUATIONS_MATRICES
3419 linear_matrices=>equations_matrices%LINEAR_MATRICES
3420 equations_matrix=>linear_matrices%MATRICES(1)%PTR
3422 rhs_vector=>equations_matrices%RHS_VECTOR
3423 source_vector=>equations_matrices%SOURCE_VECTOR
3424 source_vector%UPDATE_VECTOR=.true.
3426 equations_mapping=>equations%EQUATIONS_MAPPING
3427 linear_mapping=>equations_mapping%LINEAR_MAPPING
3428 field_variable=>linear_mapping%EQUATIONS_MATRIX_TO_VAR_MAPS(1)%VARIABLE
3429 field_var_type=field_variable%VARIABLE_TYPE
3431 CALL field_variable_get(source_field,field_u_variable_type,source_field_variable,err,error,*999)
3433 dependent_basis=>dependent_field%DECOMPOSITION%DOMAIN(dependent_field%DECOMPOSITION%MESH_COMPONENT_NUMBER)%PTR% &
3434 & topology%ELEMENTS%ELEMENTS(element_number)%BASIS
3435 source_basis=>source_field%DECOMPOSITION%DOMAIN(source_field%DECOMPOSITION%MESH_COMPONENT_NUMBER)%PTR% &
3436 & topology%ELEMENTS%ELEMENTS(element_number)%BASIS
3437 geometric_basis=>geometric_field%DECOMPOSITION%DOMAIN(geometric_field%DECOMPOSITION%MESH_COMPONENT_NUMBER)%PTR% &
3438 & topology%ELEMENTS%ELEMENTS(element_number)%BASIS
3441 number_of_element_parameters=dependent_basis%NUMBER_OF_ELEMENT_PARAMETERS
3443 number_of_dimensions=equations_set%REGION%COORDINATE_SYSTEM%NUMBER_OF_DIMENSIONS
3444 number_of_xi=dependent_field%DECOMPOSITION%DOMAIN(dependent_field%DECOMPOSITION%MESH_COMPONENT_NUMBER)%PTR%TOPOLOGY% &
3445 & elements%ELEMENTS(element_number)%BASIS%NUMBER_OF_XI
3447 CALL field_interpolation_parameters_element_get(field_values_set_type,element_number,equations%INTERPOLATION% &
3448 & geometric_interp_parameters(field_u_variable_type)%PTR,err,error,*999)
3449 CALL field_interpolation_parameters_element_get(field_values_set_type,element_number,equations%INTERPOLATION% &
3450 & materials_interp_parameters(field_u_variable_type)%PTR,err,error,*999)
3451 CALL field_interpolation_parameters_element_get(field_values_set_type,element_number,equations%INTERPOLATION% &
3452 & fibre_interp_parameters(field_u_variable_type)%PTR,err,error,*999)
3453 CALL field_interpolation_parameters_element_get(field_values_set_type,element_number,equations%INTERPOLATION% &
3454 & dependent_interp_parameters(field_var_type)%PTR,err,error,*999)
3455 CALL field_interpolation_parameters_element_get(field_values_set_type,element_number,equations%INTERPOLATION% &
3456 & source_interp_parameters(field_u_variable_type)%PTR,err,error,*999)
3458 geometric_interpolated_point=>equations%INTERPOLATION%GEOMETRIC_INTERP_POINT(field_u_variable_type)%PTR
3459 fibre_interpolated_point=>equations%INTERPOLATION%FIBRE_INTERP_POINT(field_u_variable_type)%PTR
3460 geometric_interp_point_metrics=>equations%INTERPOLATION%GEOMETRIC_INTERP_POINT_METRICS(field_u_variable_type)%PTR
3462 ALLOCATE(matrix_k_i(number_of_element_parameters,number_of_element_parameters),stat=err)
3463 IF(err/=0)
CALL flagerror(
"Could not allocate matrix K_i.",err,error,*999)
3465 ALLOCATE(vm(number_of_element_parameters),stat=err)
3466 IF(err/=0)
CALL flagerror(
"Could not allocate vector V_m.",err,error,*999)
3470 DO ng=1,quadrature_scheme%NUMBER_OF_GAUSS
3472 WRITE (cvar,
'(a17,i2)')
'Gauss Point Loop ',ng
3473 CALL tau_phase_create_dynamic(gauss_point_loop_phase,cvar)
3474 CALL tau_phase_start(gauss_point_loop_phase)
3477 & geometric_interp_point(field_u_variable_type)%PTR,err,error,*999)
3479 & materials_interp_point(field_u_variable_type)%PTR,err,error,*999)
3481 & fibre_interp_point(field_u_variable_type)%PTR,err,error,*999)
3483 & source_interp_point(field_u_variable_type)%PTR,err,error,*999)
3485 CALL field_interpolated_point_metrics_calculate(geometric_basis%NUMBER_OF_XI,geometric_interp_point_metrics, &
3489 rwg=geometric_interp_point_metrics%JACOBIAN*quadrature_scheme%GAUSS_WEIGHTS(ng)
3491 conductivity_sum_material=0.0_dp
3492 conductivity_i_material=0.0_dp
3493 IF(number_of_dimensions==2)
THEN 3495 conductivity_i_material(1,1)=equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_u_variable_type)%PTR%VALUES(1,1)
3496 conductivity_i_material(2,2)=equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_u_variable_type)%PTR%VALUES(2,1)
3497 conductivity_i_material(1,2)=equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_u_variable_type)%PTR%VALUES(3,1)
3498 conductivity_i_material(2,1)=conductivity_i_material(1,2)
3500 conductivity_sum_material(1,1)=conductivity_i_material(1,1)+ &
3501 & equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_u_variable_type)%PTR%VALUES(4,1)
3502 conductivity_sum_material(2,2)=conductivity_i_material(2,2)+ &
3503 & equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_u_variable_type)%PTR%VALUES(5,1)
3504 conductivity_sum_material(1,2)=conductivity_i_material(1,2)+ &
3505 & equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_u_variable_type)%PTR%VALUES(6,1)
3506 conductivity_sum_material(2,1)=conductivity_sum_material(1,2)
3509 conductivity_i_material(1,1)=equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_u_variable_type)%PTR%VALUES(1,1)
3510 conductivity_i_material(2,2)=equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_u_variable_type)%PTR%VALUES(2,1)
3511 conductivity_i_material(3,3)=equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_u_variable_type)%PTR%VALUES(3,1)
3512 conductivity_i_material(1,2)=equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_u_variable_type)%PTR%VALUES(4,1)
3513 conductivity_i_material(2,1)=conductivity_i_material(1,2)
3514 conductivity_i_material(2,3)=equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_u_variable_type)%PTR%VALUES(5,1)
3515 conductivity_i_material(3,2)=conductivity_i_material(2,3)
3516 conductivity_i_material(1,3)=equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_u_variable_type)%PTR%VALUES(6,1)
3517 conductivity_i_material(3,1)=conductivity_i_material(1,3)
3519 conductivity_sum_material(1,1)=conductivity_i_material(1,1)+ &
3520 & equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_u_variable_type)%PTR%VALUES(7,1)
3521 conductivity_sum_material(2,2)=conductivity_i_material(2,2)+ &
3522 & equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_u_variable_type)%PTR%VALUES(8,1)
3523 conductivity_sum_material(3,3)=conductivity_i_material(3,3)+ &
3524 & equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_u_variable_type)%PTR%VALUES(9,1)
3525 conductivity_sum_material(1,2)=conductivity_i_material(1,2)+ &
3526 & equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_u_variable_type)%PTR%VALUES(10,1)
3527 conductivity_sum_material(2,1)=conductivity_sum_material(1,2)
3528 conductivity_sum_material(2,3)=conductivity_i_material(2,3)+ &
3529 & equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_u_variable_type)%PTR%VALUES(11,1)
3530 conductivity_sum_material(3,2)=conductivity_sum_material(2,3)
3531 conductivity_sum_material(1,3)=conductivity_i_material(1,3)+ &
3532 & equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_u_variable_type)%PTR%VALUES(12,1)
3533 conductivity_sum_material(3,1)=conductivity_sum_material(1,3)
3538 & dnudx,dxdnu,dnudxi,dxidnu,err,error,*999)
3540 CALL matrix_product(dnudxi,conductivity_sum_material,conductivity_sum_temp,err,error,*999)
3541 CALL matrix_product(conductivity_sum_temp,dxidnu,conductivity_sum,err,error,*999)
3543 CALL matrix_product(dnudxi,conductivity_i_material,conductivity_i_temp,err,error,*999)
3544 CALL matrix_product(conductivity_i_temp,dxidnu,conductivity_i,err,error,*999)
3547 IF(equations_matrix%UPDATE_MATRIX)
THEN 3550 DO mh=1,field_variable%NUMBER_OF_COMPONENTS
3552 DO ms=1,number_of_element_parameters
3557 DO nh=1,field_variable%NUMBER_OF_COMPONENTS
3558 DO ns=1,number_of_element_parameters
3561 DO ni=1,dependent_basis%NUMBER_OF_XI
3567 DO i=1,dependent_basis%NUMBER_OF_XI
3568 DO k=1,dependent_basis%NUMBER_OF_XI
3569 DO h=1,dependent_basis%NUMBER_OF_XI
3570 sum=sum+conductivity_sum(i,k)*pgnsi(k)*pgmsi(h)*geometric_interp_point_metrics%GU(i,h)
3575 equations_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)=equations_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)+sum*rwg
3584 IF(source_vector%UPDATE_VECTOR)
THEN 3587 DO mh=1,field_variable%NUMBER_OF_COMPONENTS
3589 DO ms=1,number_of_element_parameters
3594 DO nh=1,field_variable%NUMBER_OF_COMPONENTS
3595 DO ns=1,number_of_element_parameters
3598 DO ni=1,dependent_basis%NUMBER_OF_XI
3604 DO i=1,dependent_basis%NUMBER_OF_XI
3605 DO k=1,dependent_basis%NUMBER_OF_XI
3606 DO h=1,dependent_basis%NUMBER_OF_XI
3607 sum=sum+conductivity_i(i,k)*pgnsi(k)*pgmsi(h)*geometric_interp_point_metrics%GU(i,h)
3612 matrix_k_i(mhs,nhs)=matrix_k_i(mhs,nhs)+sum*rwg
3621 IF(rhs_vector%UPDATE_VECTOR)
THEN 3624 DO mh=1,field_variable%NUMBER_OF_COMPONENTS
3626 DO ms=1,number_of_element_parameters
3628 rhs_vector%ELEMENT_VECTOR%VECTOR(mhs)=0.0_dp
3635 CALL tau_phase_stop(gauss_point_loop_phase)
3640 IF(source_vector%UPDATE_VECTOR)
THEN 3643 DO nhs=1,number_of_element_parameters
3645 node_idx=source_vector%ELEMENT_VECTOR%ROW_DOFS(nhs)
3647 dof_idx=source_field_variable%COMPONENTS(1)%PARAM_TO_DOF_MAP%NODE_PARAM2DOF_MAP%NODES(node_idx)% &
3648 & derivatives(1)%VERSIONS(1)
3650 CALL field_parameter_set_get_local_dof(source_field,field_u_variable_type,field_values_set_type, &
3651 & dof_idx,vm(nhs),err,error,*999)
3656 DO mh=1,field_variable%NUMBER_OF_COMPONENTS
3658 DO ms=1,number_of_element_parameters
3662 DO nh=1,field_variable%NUMBER_OF_COMPONENTS
3663 DO ns=1,number_of_element_parameters
3665 source_vector%ELEMENT_VECTOR%VECTOR(mhs)=source_vector%ELEMENT_VECTOR%VECTOR(mhs)+matrix_k_i(mhs,nhs)*vm(nhs)
3673 DEALLOCATE(matrix_k_i)
3683 source_field=>equations%INTERPOLATION%SOURCE_FIELD
3684 materials_field=>equations%INTERPOLATION%MATERIALS_FIELD
3685 dependent_field=>equations%INTERPOLATION%DEPENDENT_FIELD
3686 geometric_field=>equations%INTERPOLATION%GEOMETRIC_FIELD
3687 equations_matrices=>equations%EQUATIONS_MATRICES
3688 linear_matrices=>equations_matrices%LINEAR_MATRICES
3689 equations_matrix=>linear_matrices%MATRICES(1)%PTR
3690 rhs_vector=>equations_matrices%RHS_VECTOR
3691 source_vector=>equations_matrices%SOURCE_VECTOR
3692 equations_mapping=>equations%EQUATIONS_MAPPING
3693 linear_mapping=>equations_mapping%LINEAR_MAPPING
3694 field_variable=>linear_mapping%EQUATIONS_MATRIX_TO_VAR_MAPS(1)%VARIABLE
3695 field_var_type=field_variable%VARIABLE_TYPE
3696 dependent_basis=>dependent_field%DECOMPOSITION%DOMAIN(dependent_field%DECOMPOSITION%MESH_COMPONENT_NUMBER)%PTR% &
3697 & topology%ELEMENTS%ELEMENTS(element_number)%BASIS
3698 source_basis=>source_field%DECOMPOSITION%DOMAIN(source_field%DECOMPOSITION%MESH_COMPONENT_NUMBER)%PTR% &
3699 & topology%ELEMENTS%ELEMENTS(element_number)%BASIS
3700 geometric_basis=>geometric_field%DECOMPOSITION%DOMAIN(geometric_field%DECOMPOSITION%MESH_COMPONENT_NUMBER)%PTR% &
3701 & topology%ELEMENTS%ELEMENTS(element_number)%BASIS
3703 CALL field_interpolation_parameters_element_get(field_values_set_type,element_number,equations%INTERPOLATION% &
3704 & geometric_interp_parameters(field_u_variable_type)%PTR,err,error,*999)
3705 CALL field_interpolation_parameters_element_get(field_values_set_type,element_number,equations%INTERPOLATION% &
3706 & materials_interp_parameters(field_u_variable_type)%PTR,err,error,*999)
3707 CALL field_interpolation_parameters_element_get(field_values_set_type,element_number,equations%INTERPOLATION% &
3708 & materials_interp_parameters(field_u_variable_type)%PTR,err,error,*999)
3709 CALL field_interpolation_parameters_element_get(field_values_set_type,element_number,equations%INTERPOLATION% &
3710 & dependent_interp_parameters(field_var_type)%PTR,err,error,*999)
3712 independent_field=>equations%INTERPOLATION%INDEPENDENT_FIELD
3713 independent_basis=>independent_field%DECOMPOSITION%DOMAIN(independent_field% &
3714 & decomposition%MESH_COMPONENT_NUMBER)%PTR% &
3715 & topology%ELEMENTS%ELEMENTS(element_number)%BASIS
3716 CALL field_interpolation_parameters_element_get(field_mesh_velocity_set_type,element_number,equations%INTERPOLATION% &
3717 & independent_interp_parameters(field_var_type)%PTR,err,error,*999)
3724 CALL field_parameter_set_data_get(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type, &
3725 & field_input_label_set_type,input_label,err,error,*999)
3726 DO i=1,geometric_field%decomposition%domain(1)%ptr%topology%elements%maximum_number_of_element_parameters
3727 element_node_identity=geometric_field%decomposition%domain(1)%ptr%topology% &
3728 & elements%elements(element_number)%element_nodes(i)
3730 IF(input_label(element_node_identity)<0.5_dp)
THEN 3736 DO i=1,geometric_field%decomposition%domain(1)%ptr%topology%elements%maximum_number_of_element_parameters
3737 element_node_identity=geometric_field%decomposition%domain(1)%ptr%topology% &
3738 & elements%elements(element_number)%element_nodes(i)
3740 IF(.NOT.inside)
THEN 3741 IF(input_label(element_node_identity)>0.5_dp)
THEN 3752 ELSE IF(between)
THEN 3755 diff_coeff1=1.0_dp/1000.0_dp
3762 DO ng=1,quadrature_scheme%NUMBER_OF_GAUSS
3764 & geometric_interp_point(field_u_variable_type)%PTR,err,error,*999)
3766 & materials_interp_point(field_u_variable_type)%PTR,err,error,*999)
3768 & dependent_interp_point(field_var_type)%PTR,err,error,*999)
3769 CALL field_interpolated_point_metrics_calculate(geometric_basis%NUMBER_OF_XI,equations%INTERPOLATION% &
3770 & geometric_interp_point_metrics(field_u_variable_type)%PTR,err,error,*999)
3773 & independent_interp_point(field_u_variable_type)%PTR,err,error,*999)
3774 w_value(1)=equations%INTERPOLATION%INDEPENDENT_INTERP_POINT(field_u_variable_type)%PTR%VALUES(1,
no_part_deriv)
3775 w_value(2)=equations%INTERPOLATION%INDEPENDENT_INTERP_POINT(field_u_variable_type)%PTR%VALUES(2,
no_part_deriv)
3776 IF(independent_basis%NUMBER_OF_XI==3)
THEN 3777 w_value(3)=equations%INTERPOLATION%INDEPENDENT_INTERP_POINT(field_u_variable_type)%PTR%VALUES(3,
no_part_deriv)
3792 IF(source_vector%UPDATE_VECTOR)
THEN 3793 CALL field_interpolation_parameters_element_get(field_input_data1_set_type,element_number, &
3794 & equations%INTERPOLATION%SOURCE_INTERP_PARAMETERS(field_u_variable_type)%PTR,err,error,*999)
3796 & source_interp_point(field_u_variable_type)%PTR,err,error,*999)
3797 u_value(1)=equations%INTERPOLATION%SOURCE_INTERP_POINT(field_u_variable_type)%PTR%VALUES(1,
no_part_deriv)
3798 u_value(2)=equations%INTERPOLATION%SOURCE_INTERP_POINT(field_u_variable_type)%PTR%VALUES(2,
no_part_deriv)
3799 u_deriv(1,1)=equations%INTERPOLATION%SOURCE_INTERP_POINT(field_u_variable_type)%PTR%VALUES(1,
part_deriv_s1)
3800 u_deriv(1,2)=equations%INTERPOLATION%SOURCE_INTERP_POINT(field_u_variable_type)%PTR%VALUES(1,
part_deriv_s2)
3801 u_deriv(2,1)=equations%INTERPOLATION%SOURCE_INTERP_POINT(field_u_variable_type)%PTR%VALUES(2,
part_deriv_s1)
3802 u_deriv(2,2)=equations%INTERPOLATION%SOURCE_INTERP_POINT(field_u_variable_type)%PTR%VALUES(2,
part_deriv_s2)
3803 u_second(1,1,1)=equations%INTERPOLATION%SOURCE_INTERP_POINT(field_u_variable_type)%PTR%VALUES(1,
part_deriv_s1_s1)
3804 u_second(1,1,2)=equations%INTERPOLATION%SOURCE_INTERP_POINT(field_u_variable_type)%PTR%VALUES(1,
part_deriv_s1_s2)
3805 u_second(1,2,1)=equations%INTERPOLATION%SOURCE_INTERP_POINT(field_u_variable_type)%PTR%VALUES(1,
part_deriv_s1_s2)
3806 u_second(1,2,2)=equations%INTERPOLATION%SOURCE_INTERP_POINT(field_u_variable_type)%PTR%VALUES(1,
part_deriv_s2_s2)
3807 u_second(2,1,1)=equations%INTERPOLATION%SOURCE_INTERP_POINT(field_u_variable_type)%PTR%VALUES(2,
part_deriv_s1_s1)
3808 u_second(2,1,2)=equations%INTERPOLATION%SOURCE_INTERP_POINT(field_u_variable_type)%PTR%VALUES(2,
part_deriv_s1_s2)
3809 u_second(2,2,1)=equations%INTERPOLATION%SOURCE_INTERP_POINT(field_u_variable_type)%PTR%VALUES(2,
part_deriv_s1_s2)
3810 u_second(2,2,2)=equations%INTERPOLATION%SOURCE_INTERP_POINT(field_u_variable_type)%PTR%VALUES(2,
part_deriv_s2_s2)
3811 IF(dependent_basis%NUMBER_OF_XI==3)
THEN 3812 u_value(3)=equations%INTERPOLATION%SOURCE_INTERP_POINT(field_u_variable_type)%PTR%VALUES(3,
no_part_deriv)
3813 u_deriv(1,3)=equations%INTERPOLATION%SOURCE_INTERP_POINT(field_u_variable_type)%PTR%VALUES(1,
part_deriv_s3)
3814 u_deriv(2,3)=equations%INTERPOLATION%SOURCE_INTERP_POINT(field_u_variable_type)%PTR%VALUES(2,
part_deriv_s3)
3815 u_deriv(3,1)=equations%INTERPOLATION%SOURCE_INTERP_POINT(field_u_variable_type)%PTR%VALUES(3,
part_deriv_s1)
3816 u_deriv(3,2)=equations%INTERPOLATION%SOURCE_INTERP_POINT(field_u_variable_type)%PTR%VALUES(3,
part_deriv_s2)
3817 u_deriv(3,3)=equations%INTERPOLATION%SOURCE_INTERP_POINT(field_u_variable_type)%PTR%VALUES(3,
part_deriv_s3)
3818 u_second(1,1,3)=equations%INTERPOLATION%SOURCE_INTERP_POINT(field_u_variable_type)%PTR%VALUES(1,
part_deriv_s1_s3)
3819 u_second(1,2,3)=equations%INTERPOLATION%SOURCE_INTERP_POINT(field_u_variable_type)%PTR%VALUES(1,
part_deriv_s2_s3)
3820 u_second(1,3,1)=equations%INTERPOLATION%SOURCE_INTERP_POINT(field_u_variable_type)%PTR%VALUES(1,
part_deriv_s1_s3)
3821 u_second(1,3,2)=equations%INTERPOLATION%SOURCE_INTERP_POINT(field_u_variable_type)%PTR%VALUES(1,
part_deriv_s2_s3)
3822 u_second(1,3,3)=equations%INTERPOLATION%SOURCE_INTERP_POINT(field_u_variable_type)%PTR%VALUES(1,
part_deriv_s3_s3)
3823 u_second(2,1,3)=equations%INTERPOLATION%SOURCE_INTERP_POINT(field_u_variable_type)%PTR%VALUES(2,
part_deriv_s1_s3)
3824 u_second(2,2,3)=equations%INTERPOLATION%SOURCE_INTERP_POINT(field_u_variable_type)%PTR%VALUES(2,
part_deriv_s2_s3)
3825 u_second(2,3,1)=equations%INTERPOLATION%SOURCE_INTERP_POINT(field_u_variable_type)%PTR%VALUES(2,
part_deriv_s1_s3)
3826 u_second(2,3,2)=equations%INTERPOLATION%SOURCE_INTERP_POINT(field_u_variable_type)%PTR%VALUES(2,
part_deriv_s2_s3)
3827 u_second(2,3,3)=equations%INTERPOLATION%SOURCE_INTERP_POINT(field_u_variable_type)%PTR%VALUES(2,
part_deriv_s3_s3)
3828 u_second(3,1,1)=equations%INTERPOLATION%SOURCE_INTERP_POINT(field_u_variable_type)%PTR%VALUES(3,
part_deriv_s1_s1)
3829 u_second(3,1,2)=equations%INTERPOLATION%SOURCE_INTERP_POINT(field_u_variable_type)%PTR%VALUES(3,
part_deriv_s1_s2)
3830 u_second(3,1,3)=equations%INTERPOLATION%SOURCE_INTERP_POINT(field_u_variable_type)%PTR%VALUES(3,
part_deriv_s1_s3)
3831 u_second(3,2,1)=equations%INTERPOLATION%SOURCE_INTERP_POINT(field_u_variable_type)%PTR%VALUES(3,
part_deriv_s1_s2)
3832 u_second(3,2,2)=equations%INTERPOLATION%SOURCE_INTERP_POINT(field_u_variable_type)%PTR%VALUES(3,
part_deriv_s2_s2)
3833 u_second(3,2,3)=equations%INTERPOLATION%SOURCE_INTERP_POINT(field_u_variable_type)%PTR%VALUES(3,
part_deriv_s2_s3)
3834 u_second(3,3,1)=equations%INTERPOLATION%SOURCE_INTERP_POINT(field_u_variable_type)%PTR%VALUES(3,
part_deriv_s1_s3)
3835 u_second(3,3,2)=equations%INTERPOLATION%SOURCE_INTERP_POINT(field_u_variable_type)%PTR%VALUES(3,
part_deriv_s2_s3)
3836 u_second(3,3,3)=equations%INTERPOLATION%SOURCE_INTERP_POINT(field_u_variable_type)%PTR%VALUES(3,
part_deriv_s3_s3)
3838 CALL field_interpolation_parameters_element_get(field_input_data2_set_type,element_number, &
3839 & equations%INTERPOLATION%SOURCE_INTERP_PARAMETERS(field_u_variable_type)%PTR,err,error,*999)
3841 & source_interp_point(field_u_variable_type)%PTR,err,error,*999)
3842 u_old(1)=equations%INTERPOLATION%SOURCE_INTERP_POINT(field_u_variable_type)%PTR%VALUES(1,
no_part_deriv)
3843 u_old(2)=equations%INTERPOLATION%SOURCE_INTERP_POINT(field_u_variable_type)%PTR%VALUES(2,
no_part_deriv)
3844 p_deriv(1)=equations%INTERPOLATION%DEPENDENT_INTERP_POINT(field_var_type)%PTR%VALUES(1,
part_deriv_s1)
3845 p_deriv(2)=equations%INTERPOLATION%DEPENDENT_INTERP_POINT(field_var_type)%PTR%VALUES(1,
part_deriv_s2)
3846 IF(dependent_basis%NUMBER_OF_XI==3)
THEN 3847 u_old(3)=equations%INTERPOLATION%SOURCE_INTERP_POINT(field_u_variable_type)%PTR%VALUES(3,
no_part_deriv)
3848 p_deriv(3)=equations%INTERPOLATION%DEPENDENT_INTERP_POINT(field_var_type)%PTR%VALUES(1,
part_deriv_s3)
3852 mu_param=equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_u_variable_type)%PTR%VALUES(1,
no_part_deriv)
3853 rho_param=equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_u_variable_type)%PTR%VALUES(2,
no_part_deriv)
3856 rwg=equations%INTERPOLATION%GEOMETRIC_INTERP_POINT_METRICS(field_u_variable_type)%PTR%JACOBIAN* &
3857 & quadrature_scheme%GAUSS_WEIGHTS(ng)
3860 DO mh=1,field_variable%NUMBER_OF_COMPONENTS
3863 DO ms=1,dependent_basis%NUMBER_OF_ELEMENT_PARAMETERS
3866 IF(equations_matrix%UPDATE_MATRIX)
THEN 3868 DO nh=1,field_variable%NUMBER_OF_COMPONENTS
3869 DO ns=1,dependent_basis%NUMBER_OF_ELEMENT_PARAMETERS
3871 phins=quadrature_scheme%GAUSS_BASIS_FNS(ns,
no_part_deriv,ng)
3872 DO ni=1,dependent_basis%NUMBER_OF_XI
3875 DO mi=1,dependent_basis%NUMBER_OF_XI
3876 dxi_dx(mi,ni)=equations%INTERPOLATION%GEOMETRIC_INTERP_POINT_METRICS(field_u_variable_type)%PTR% &
3882 DO mi=1,dependent_basis%NUMBER_OF_XI
3883 DO ni=1,dependent_basis%NUMBER_OF_XI
3884 sum=sum+pgmsi(mi)*pgnsi(ni)*equations%INTERPOLATION% &
3885 & geometric_interp_point_metrics(field_u_variable_type)%PTR%GU(mi,ni)*diff_coeff1
3888 equations_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)=equations_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)+sum*rwg
3896 IF(source_vector%UPDATE_VECTOR)
THEN 3900 b(k)=-rho_param*((u_value(k)-u_old(k))/delta_t)
3911 b(k)=b(k)+rho_param*w_value(i)*u_deriv(k,l)*dxi_dx(l,i)
3913 b(k)=b(k)+mu_param*u_second(k,l,h)*dxi_dx(l,i)*dxi_dx(h,i)
3922 sum=sum+b(k)*pgmsi(j)*dxi_dx(j,k)
3925 source_vector%ELEMENT_VECTOR%VECTOR(mhs)=source_vector%ELEMENT_VECTOR%VECTOR(mhs)+sum*rwg
3933 IF(source_vector%UPDATE_VECTOR)
THEN 3937 b(k)=-rho_param*((u_value(k)-u_old(k))/delta_t)
3942 b(k)=b(k)-rho_param*(u_value(i)-w_value(i))*u_deriv(k,l)*dxi_dx(l,i)
3945 b(k)=b(k)+mu_param*u_second(k,l,h)*dxi_dx(l,i)*dxi_dx(h,i)
3954 sum=sum+b(k)*pgmsi(j)*dxi_dx(j,k)*diff_coeff2
3957 IF(
ASSOCIATED(equations_set%ANALYTIC))
THEN 3959 x(1) = equations%INTERPOLATION%GEOMETRIC_INTERP_POINT(field_u_variable_type)%PTR%VALUES(1,1)
3960 x(2) = equations%INTERPOLATION%GEOMETRIC_INTERP_POINT(field_u_variable_type)%PTR%VALUES(2,1)
3961 x(3) = equations%INTERPOLATION%GEOMETRIC_INTERP_POINT(field_u_variable_type)%PTR%VALUES(3,1)
3962 sum2=-4.0_dp*
pi*
pi/100.0*(3.0_dp*sin(2.0_dp*
pi*x(1)/10.0_dp)*sin(2.0_dp*
pi*x(2)/10.0)* &
3963 & sin(2.0_dp*
pi*x(3)/10.0_dp)-6.0_dp*rho_param*cos(2.0_dp*
pi*x(1)/10.0_dp)**2+ &
3964 & 8.0_dp*rho_param*cos(2.0_dp*
pi*x(1)/10.0_dp)**2*cos(2.0_dp*
pi*x(3)/10.0_dp)**2- &
3965 & 2.0_dp*rho_param*cos(2.0_dp*
pi*x(3)/10.0_dp)**2+2.0_dp*rho_param*cos(2.0_dp*
pi*x(1)/10.0_dp)**2* &
3966 & cos(2.0_dp*
pi*x(2)/10.0_dp)**2+4.0_dp*rho_param*cos(2.0_dp*
pi*x(2)/10.0_dp)**2- &
3967 & 2.0_dp*rho_param*cos(2.0_dp*
pi*x(2)/10.0_dp)**2*cos(2.0_dp*
pi*x(3)/10.0_dp)**2)
3969 x(1) = equations%INTERPOLATION%GEOMETRIC_INTERP_POINT(field_u_variable_type)%PTR%VALUES(1,1)
3970 x(2) = equations%INTERPOLATION%GEOMETRIC_INTERP_POINT(field_u_variable_type)%PTR%VALUES(2,1)
3971 x(3) = equations%INTERPOLATION%GEOMETRIC_INTERP_POINT(field_u_variable_type)%PTR%VALUES(3,1)
3972 sum2=-12.0_dp* sin(2.0_dp*
pi*x(1)/10.0_dp)*
pi*
pi/100.0_dp*sin(2.0_dp*
pi*x(2)/10.0_dp)* &
3973 & sin(2.0_dp*
pi*x(3)/10.0_dp)
3976 CALL flagerror(
"Not implemented.",err,error,*999)
3979 source_vector%ELEMENT_VECTOR%VECTOR(mhs)=source_vector%ELEMENT_VECTOR%VECTOR(mhs)+sum*rwg &
3980 & -sum2*quadrature_scheme%GAUSS_BASIS_FNS(ms,
no_part_deriv,ng)*rwg
3983 source_vector%ELEMENT_VECTOR%VECTOR(mhs)=0.0_dp
3989 IF(dependent_field%SCALINGS%SCALING_TYPE/=field_no_scaling)
THEN 3990 CALL field_interpolationparametersscalefactorselementget(element_number,equations%INTERPOLATION% &
3991 & dependent_interp_parameters(field_var_type)%PTR,err,error,*999)
3993 DO mh=1,field_variable%NUMBER_OF_COMPONENTS
3995 DO ms=1,dependent_basis%NUMBER_OF_ELEMENT_PARAMETERS
3998 IF(equations_matrix%UPDATE_MATRIX)
THEN 4000 DO nh=1,field_variable%NUMBER_OF_COMPONENTS
4001 DO ns=1,dependent_basis%NUMBER_OF_ELEMENT_PARAMETERS
4003 equations_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)=equations_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)* &
4004 & equations%INTERPOLATION%DEPENDENT_INTERP_PARAMETERS(field_var_type)%PTR%SCALE_FACTORS(ms,mh)* &
4005 & equations%INTERPOLATION%DEPENDENT_INTERP_PARAMETERS(field_var_type)%PTR%SCALE_FACTORS(ns,nh)
4009 IF(rhs_vector%UPDATE_VECTOR) rhs_vector%ELEMENT_VECTOR%VECTOR(mhs)=rhs_vector%ELEMENT_VECTOR%VECTOR(mhs)* &
4010 & equations%INTERPOLATION%DEPENDENT_INTERP_PARAMETERS(field_var_type)%PTR%SCALE_FACTORS(ms,mh)
4011 IF(source_vector%UPDATE_VECTOR) source_vector%ELEMENT_VECTOR%VECTOR(mhs)=source_vector% &
4012 & element_vector%VECTOR(mhs)*equations%INTERPOLATION%DEPENDENT_INTERP_PARAMETERS(field_var_type)% &
4013 &
ptr%SCALE_FACTORS(ms,mh)
4018 CALL flagerror(
"Not implemented.",err,error,*999)
4020 CALL flagerror(
"Can not calculate finite element stiffness matrices for a nonlinear source.",err,error,*999)
4022 CALL flagerror(
"Can not calculate finite element stiffness matrices for a nonlinear source.",err,error,*999)
4024 local_error=
"Equations set subtype "//
trim(
number_to_vstring(equations_set%SPECIFICATION(3),
"*",err,error))// &
4025 &
" is not valid for a Poisson equation type of a classical field equations set class." 4026 CALL flagerror(local_error,err,error,*999)
4029 CALL flagerror(
"Equations set equations is not associated.",err,error,*999)
4032 CALL flagerror(
"Equations set is not associated.",err,error,*999)
4035 exits(
"POISSON_EQUATION_FINITE_ELEMENT_CALCULATE")
4037 999 errorsexits(
"POISSON_EQUATION_FINITE_ELEMENT_CALCULATE",err,error)
4050 INTEGER(INTG),
INTENT(IN) :: ELEMENT_NUMBER
4051 INTEGER(INTG),
INTENT(OUT) :: ERR
4054 INTEGER(INTG) FIELD_VAR_TYPE,ng,mh,mhs,ms,nh,nhs,ns
4055 REAL(DP) :: B_PARAM,C_PARAM,RWG,U_VALUE,VALUE
4056 TYPE(
basis_type),
POINTER :: DEPENDENT_BASIS,GEOMETRIC_BASIS
4063 TYPE(
field_type),
POINTER :: DEPENDENT_FIELD,GEOMETRIC_FIELD,MATERIALS_FIELD
4068 enters(
"Poisson_FiniteElementJacobianEvaluate",err,error,*999)
4070 IF(
ASSOCIATED(equations_set))
THEN 4071 IF(.NOT.
ALLOCATED(equations_set%SPECIFICATION))
THEN 4072 CALL flagerror(
"Equations set specification is not allocated.",err,error,*999)
4073 ELSE IF(
SIZE(equations_set%SPECIFICATION,1)/=3)
THEN 4074 CALL flagerror(
"Equations set specification must have three entries for a Poisson type equations set.", &
4077 equations=>equations_set%EQUATIONS
4078 IF(
ASSOCIATED(equations))
THEN 4079 SELECT CASE(equations_set%SPECIFICATION(3))
4081 CALL flagerror(
"Can not evaluate a Jacobian for a Poisson equation with a linear source.",err,error,*999)
4083 CALL flagerror(
"Can not evaluate a Jacobian for a Poisson equation with a linear source.",err,error,*999)
4085 CALL flagerror(
"Can not evaluate a Jacobian for a Poisson equation with a linear source.",err,error,*999)
4087 equations_matrices=>equations%EQUATIONS_MATRICES
4088 nonlinear_matrices=>equations_matrices%NONLINEAR_MATRICES
4089 jacobian_matrix=>nonlinear_matrices%JACOBIANS(1)%PTR
4090 IF(jacobian_matrix%UPDATE_JACOBIAN)
THEN 4092 dependent_field=>equations%INTERPOLATION%DEPENDENT_FIELD
4093 geometric_field=>equations%INTERPOLATION%GEOMETRIC_FIELD
4094 materials_field=>equations%INTERPOLATION%MATERIALS_FIELD
4095 equations_mapping=>equations%EQUATIONS_MAPPING
4096 nonlinear_mapping=>equations_mapping%NONLINEAR_MAPPING
4097 dependent_variable=>nonlinear_mapping%RESIDUAL_VARIABLES(1)%PTR
4098 field_var_type=dependent_variable%VARIABLE_TYPE
4099 geometric_variable=>geometric_field%VARIABLE_TYPE_MAP(field_u_variable_type)%PTR
4100 dependent_basis=>dependent_field%DECOMPOSITION%DOMAIN(dependent_field%DECOMPOSITION%MESH_COMPONENT_NUMBER)%PTR% &
4101 & topology%ELEMENTS%ELEMENTS(element_number)%BASIS
4102 geometric_basis=>geometric_field%DECOMPOSITION%DOMAIN(geometric_field%DECOMPOSITION%MESH_COMPONENT_NUMBER)%PTR% &
4103 & topology%ELEMENTS%ELEMENTS(element_number)%BASIS
4105 CALL field_interpolation_parameters_element_get(field_values_set_type,element_number,equations%INTERPOLATION% &
4106 & dependent_interp_parameters(field_var_type)%PTR,err,error,*999)
4107 CALL field_interpolation_parameters_element_get(field_values_set_type,element_number,equations%INTERPOLATION% &
4108 & geometric_interp_parameters(field_u_variable_type)%PTR,err,error,*999)
4109 CALL field_interpolation_parameters_element_get(field_values_set_type,element_number,equations%INTERPOLATION% &
4110 & materials_interp_parameters(field_u_variable_type)%PTR,err,error,*999)
4112 DO ng=1,quadrature_scheme%NUMBER_OF_GAUSS
4114 & dependent_interp_point(field_var_type)%PTR,err,error,*999)
4116 & geometric_interp_point(field_u_variable_type)%PTR,err,error,*999)
4117 CALL field_interpolated_point_metrics_calculate(geometric_basis%NUMBER_OF_XI,equations%INTERPOLATION% &
4118 & geometric_interp_point_metrics(field_u_variable_type)%PTR,err,error,*999)
4120 & materials_interp_point(field_u_variable_type)%PTR,err,error,*999)
4122 rwg=equations%INTERPOLATION%GEOMETRIC_INTERP_POINT_METRICS(field_u_variable_type)%PTR%JACOBIAN* &
4123 & quadrature_scheme%GAUSS_WEIGHTS(ng)
4125 c_param=equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_u_variable_type)%PTR% &
4126 & values(geometric_variable%NUMBER_OF_COMPONENTS+3,
no_part_deriv)
4127 u_value=equations%INTERPOLATION%DEPENDENT_INTERP_POINT(field_var_type)%PTR%VALUES(1,
no_part_deriv)
4130 DO mh=1,dependent_variable%NUMBER_OF_COMPONENTS
4132 DO ms=1,dependent_basis%NUMBER_OF_ELEMENT_PARAMETERS
4136 DO nh=1,dependent_variable%NUMBER_OF_COMPONENTS
4137 DO ns=1,dependent_basis%NUMBER_OF_ELEMENT_PARAMETERS
4139 VALUE=-2.0_dp*c_param*quadrature_scheme%GAUSS_BASIS_FNS(ms,
no_part_deriv,ng)* &
4140 & quadrature_scheme%GAUSS_BASIS_FNS(ns,
no_part_deriv,ng)*u_value
4141 jacobian_matrix%ELEMENT_JACOBIAN%MATRIX(mhs,nhs)=jacobian_matrix%ELEMENT_JACOBIAN%MATRIX(mhs,nhs)+
VALUE*rwg
4149 equations_matrices=>equations%EQUATIONS_MATRICES
4150 nonlinear_matrices=>equations_matrices%NONLINEAR_MATRICES
4151 jacobian_matrix=>nonlinear_matrices%JACOBIANS(1)%PTR
4152 IF(jacobian_matrix%UPDATE_JACOBIAN)
THEN 4154 dependent_field=>equations%INTERPOLATION%DEPENDENT_FIELD
4155 geometric_field=>equations%INTERPOLATION%GEOMETRIC_FIELD
4156 materials_field=>equations%INTERPOLATION%MATERIALS_FIELD
4157 equations_mapping=>equations%EQUATIONS_MAPPING
4158 nonlinear_mapping=>equations_mapping%NONLINEAR_MAPPING
4159 dependent_variable=>nonlinear_mapping%RESIDUAL_VARIABLES(1)%PTR
4160 field_var_type=dependent_variable%VARIABLE_TYPE
4161 geometric_variable=>geometric_field%VARIABLE_TYPE_MAP(field_u_variable_type)%PTR
4162 dependent_basis=>dependent_field%DECOMPOSITION%DOMAIN(dependent_field%DECOMPOSITION%MESH_COMPONENT_NUMBER)%PTR% &
4163 & topology%ELEMENTS%ELEMENTS(element_number)%BASIS
4164 geometric_basis=>geometric_field%DECOMPOSITION%DOMAIN(geometric_field%DECOMPOSITION%MESH_COMPONENT_NUMBER)%PTR% &
4165 & topology%ELEMENTS%ELEMENTS(element_number)%BASIS
4167 CALL field_interpolation_parameters_element_get(field_values_set_type,element_number,equations%INTERPOLATION% &
4168 & dependent_interp_parameters(field_var_type)%PTR,err,error,*999)
4169 CALL field_interpolation_parameters_element_get(field_values_set_type,element_number,equations%INTERPOLATION% &
4170 & geometric_interp_parameters(field_u_variable_type)%PTR,err,error,*999)
4171 CALL field_interpolation_parameters_element_get(field_values_set_type,element_number,equations%INTERPOLATION% &
4172 & materials_interp_parameters(field_u_variable_type)%PTR,err,error,*999)
4174 DO ng=1,quadrature_scheme%NUMBER_OF_GAUSS
4176 & dependent_interp_point(field_var_type)%PTR,err,error,*999)
4178 & geometric_interp_point(field_u_variable_type)%PTR,err,error,*999)
4179 CALL field_interpolated_point_metrics_calculate(geometric_basis%NUMBER_OF_XI,equations%INTERPOLATION% &
4180 & geometric_interp_point_metrics(field_u_variable_type)%PTR,err,error,*999)
4182 & materials_interp_point(field_u_variable_type)%PTR,err,error,*999)
4184 rwg=equations%INTERPOLATION%GEOMETRIC_INTERP_POINT_METRICS(field_u_variable_type)%PTR%JACOBIAN* &
4185 & quadrature_scheme%GAUSS_WEIGHTS(ng)
4187 b_param=equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_u_variable_type)%PTR% &
4188 & values(geometric_variable%NUMBER_OF_COMPONENTS+2,
no_part_deriv)
4189 c_param=equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_u_variable_type)%PTR% &
4190 & values(geometric_variable%NUMBER_OF_COMPONENTS+3,
no_part_deriv)
4191 u_value=equations%INTERPOLATION%DEPENDENT_INTERP_POINT(field_var_type)%PTR%VALUES(1,
no_part_deriv)
4194 DO mh=1,dependent_variable%NUMBER_OF_COMPONENTS
4196 DO ms=1,dependent_basis%NUMBER_OF_ELEMENT_PARAMETERS
4200 DO nh=1,dependent_variable%NUMBER_OF_COMPONENTS
4201 DO ns=1,dependent_basis%NUMBER_OF_ELEMENT_PARAMETERS
4203 VALUE=-b_param*c_param*quadrature_scheme%GAUSS_BASIS_FNS(ms,
no_part_deriv,ng)* &
4204 & quadrature_scheme%GAUSS_BASIS_FNS(ns,
no_part_deriv,ng)*exp(c_param*u_value)
4205 jacobian_matrix%ELEMENT_JACOBIAN%MATRIX(mhs,nhs)=jacobian_matrix%ELEMENT_JACOBIAN%MATRIX(mhs,nhs)+
VALUE*rwg
4213 local_error=
"Equations set subtype "//
trim(
number_to_vstring(equations_set%SPECIFICATION(3),
"*",err,error))// &
4214 &
" is not valid for a Poisson equation type of a classical field equations set class." 4215 CALL flagerror(local_error,err,error,*999)
4218 CALL flagerror(
"Equations set equations is not associated.",err,error,*999)
4221 CALL flagerror(
"Equations set is not associated.",err,error,*999)
4224 exits(
"Poisson_FiniteElementJacobianEvaluate")
4226 999
errors(
"Poisson_FiniteElementJacobianEvaluate",err,error)
4227 exits(
"Poisson_FiniteElementJacobianEvaluate")
4241 INTEGER(INTG),
INTENT(IN) :: ELEMENT_NUMBER
4242 INTEGER(INTG),
INTENT(OUT) :: ERR
4245 INTEGER(INTG) FIELD_VAR_TYPE,ng,mh,mhs,ms,nj,nh,nhs,ni,ns
4246 REAL(DP) :: A_PARAM,B_PARAM,C_PARAM,K_PARAM,RWG,SUM1,SUM2,PGMJ(3),PGNJ(3),U_VALUE,WG
4247 TYPE(
basis_type),
POINTER :: DEPENDENT_BASIS,GEOMETRIC_BASIS
4258 TYPE(
field_type),
POINTER :: DEPENDENT_FIELD,GEOMETRIC_FIELD,MATERIALS_FIELD
4263 enters(
"Poisson_FiniteElementResidualEvaluate",err,error,*999)
4265 IF(
ASSOCIATED(equations_set))
THEN 4266 IF(.NOT.
ALLOCATED(equations_set%SPECIFICATION))
THEN 4267 CALL flagerror(
"Equations set specification is not allocated.",err,error,*999)
4268 ELSE IF(
SIZE(equations_set%SPECIFICATION,1)/=3)
THEN 4269 CALL flagerror(
"Equations set specification must have three entries for a Poisson type equations set.", &
4272 equations=>equations_set%EQUATIONS
4273 IF(
ASSOCIATED(equations))
THEN 4274 SELECT CASE(equations_set%SPECIFICATION(3))
4276 CALL flagerror(
"Can not evaluate a residual for a Poisson equation with a linear source.",err,error,*999)
4278 CALL flagerror(
"Can not evaluate a residual for a Poisson equation with a linear source.",err,error,*999)
4280 CALL flagerror(
"Can not evaluate a residual for a Poisson equation with a linear source.",err,error,*999)
4283 dependent_field=>equations%INTERPOLATION%DEPENDENT_FIELD
4284 geometric_field=>equations%INTERPOLATION%GEOMETRIC_FIELD
4285 materials_field=>equations%INTERPOLATION%MATERIALS_FIELD
4286 equations_matrices=>equations%EQUATIONS_MATRICES
4287 linear_matrices=>equations_matrices%LINEAR_MATRICES
4288 nonlinear_matrices=>equations_matrices%NONLINEAR_MATRICES
4289 equations_matrix=>linear_matrices%MATRICES(1)%PTR
4290 rhs_vector=>equations_matrices%RHS_VECTOR
4291 source_vector=>equations_matrices%SOURCE_VECTOR
4292 equations_mapping=>equations%EQUATIONS_MAPPING
4293 linear_mapping=>equations_mapping%LINEAR_MAPPING
4294 nonlinear_mapping=>equations_mapping%NONLINEAR_MAPPING
4295 dependent_variable=>nonlinear_mapping%RESIDUAL_VARIABLES(1)%PTR
4296 field_var_type=dependent_variable%VARIABLE_TYPE
4297 geometric_variable=>geometric_field%VARIABLE_TYPE_MAP(field_u_variable_type)%PTR
4298 dependent_basis=>dependent_field%DECOMPOSITION%DOMAIN(dependent_field%DECOMPOSITION%MESH_COMPONENT_NUMBER)%PTR% &
4299 & topology%ELEMENTS%ELEMENTS(element_number)%BASIS
4300 geometric_basis=>geometric_field%DECOMPOSITION%DOMAIN(geometric_field%DECOMPOSITION%MESH_COMPONENT_NUMBER)%PTR% &
4301 & topology%ELEMENTS%ELEMENTS(element_number)%BASIS
4303 CALL field_interpolation_parameters_element_get(field_values_set_type,element_number,equations%INTERPOLATION% &
4304 & dependent_interp_parameters(field_var_type)%PTR,err,error,*999)
4305 CALL field_interpolation_parameters_element_get(field_values_set_type,element_number,equations%INTERPOLATION% &
4306 & geometric_interp_parameters(field_u_variable_type)%PTR,err,error,*999)
4307 CALL field_interpolation_parameters_element_get(field_values_set_type,element_number,equations%INTERPOLATION% &
4308 & materials_interp_parameters(field_u_variable_type)%PTR,err,error,*999)
4310 DO ng=1,quadrature_scheme%NUMBER_OF_GAUSS
4312 & dependent_interp_point(field_var_type)%PTR,err,error,*999)
4314 & geometric_interp_point(field_u_variable_type)%PTR,err,error,*999)
4315 CALL field_interpolated_point_metrics_calculate(geometric_basis%NUMBER_OF_XI,equations%INTERPOLATION% &
4316 & geometric_interp_point_metrics(field_u_variable_type)%PTR,err,error,*999)
4318 & materials_interp_point(field_u_variable_type)%PTR,err,error,*999)
4321 wg=quadrature_scheme%GAUSS_WEIGHTS(ng)
4322 rwg=equations%INTERPOLATION%GEOMETRIC_INTERP_POINT_METRICS(field_u_variable_type)%PTR%JACOBIAN*wg
4324 IF(equations_matrix%FIRST_ASSEMBLY)
THEN 4325 IF(equations_matrix%UPDATE_MATRIX)
THEN 4326 b_param=equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_u_variable_type)%PTR% &
4327 & values(geometric_variable%NUMBER_OF_COMPONENTS+2,
no_part_deriv)
4329 DO mh=1,dependent_variable%NUMBER_OF_COMPONENTS
4331 DO ms=1,dependent_basis%NUMBER_OF_ELEMENT_PARAMETERS
4335 DO nh=1,dependent_variable%NUMBER_OF_COMPONENTS
4336 DO ns=1,dependent_basis%NUMBER_OF_ELEMENT_PARAMETERS
4339 DO nj=1,geometric_variable%NUMBER_OF_COMPONENTS
4342 DO ni=1,geometric_basis%NUMBER_OF_XI
4343 pgmj(nj)=pgmj(nj)+ &
4345 & equations%INTERPOLATION%GEOMETRIC_INTERP_POINT_METRICS(field_u_variable_type)%PTR%DXI_DX(ni,nj)
4346 pgnj(nj)=pgnj(nj)+ &
4348 & equations%INTERPOLATION%GEOMETRIC_INTERP_POINT_METRICS(field_u_variable_type)%PTR%DXI_DX(ni,nj)
4350 k_param=equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_u_variable_type)%PTR%VALUES(nj,
no_part_deriv)
4351 sum1=sum1+k_param*pgmj(nj)*pgnj(nj)
4353 sum2=b_param*quadrature_scheme%GAUSS_BASIS_FNS(ms,
no_part_deriv,ng)* &
4355 equations_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)=equations_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)+ &
4363 IF(rhs_vector%FIRST_ASSEMBLY)
THEN 4364 IF(rhs_vector%UPDATE_VECTOR)
THEN 4365 a_param=equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_u_variable_type)%PTR% &
4366 & values(geometric_variable%NUMBER_OF_COMPONENTS+1,
no_part_deriv)
4368 DO mh=1,dependent_variable%NUMBER_OF_COMPONENTS
4370 DO ms=1,dependent_basis%NUMBER_OF_ELEMENT_PARAMETERS
4372 rhs_vector%ELEMENT_VECTOR%VECTOR(mhs)=rhs_vector%ELEMENT_VECTOR%VECTOR(mhs)+ &
4373 & quadrature_scheme%GAUSS_BASIS_FNS(ms,
no_part_deriv,ng)*a_param*rwg
4378 IF(nonlinear_matrices%UPDATE_RESIDUAL)
THEN 4379 c_param=equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_u_variable_type)%PTR% &
4380 & values(geometric_variable%NUMBER_OF_COMPONENTS+3,
no_part_deriv)
4381 u_value=equations%INTERPOLATION%DEPENDENT_INTERP_POINT(field_u_variable_type)%PTR% &
4384 DO mh=1,dependent_variable%NUMBER_OF_COMPONENTS
4386 DO ms=1,dependent_basis%NUMBER_OF_ELEMENT_PARAMETERS
4388 nonlinear_matrices%ELEMENT_RESIDUAL%VECTOR(mhs)=nonlinear_matrices%ELEMENT_RESIDUAL%VECTOR(mhs)- &
4389 & quadrature_scheme%GAUSS_BASIS_FNS(ms,
no_part_deriv,ng)*c_param*u_value**2*rwg
4396 dependent_field=>equations%INTERPOLATION%DEPENDENT_FIELD
4397 geometric_field=>equations%INTERPOLATION%GEOMETRIC_FIELD
4398 materials_field=>equations%INTERPOLATION%MATERIALS_FIELD
4399 equations_matrices=>equations%EQUATIONS_MATRICES
4400 linear_matrices=>equations_matrices%LINEAR_MATRICES
4401 nonlinear_matrices=>equations_matrices%NONLINEAR_MATRICES
4402 equations_matrix=>linear_matrices%MATRICES(1)%PTR
4403 rhs_vector=>equations_matrices%RHS_VECTOR
4404 source_vector=>equations_matrices%SOURCE_VECTOR
4405 equations_mapping=>equations%EQUATIONS_MAPPING
4406 linear_mapping=>equations_mapping%LINEAR_MAPPING
4407 nonlinear_mapping=>equations_mapping%NONLINEAR_MAPPING
4408 dependent_variable=>nonlinear_mapping%RESIDUAL_VARIABLES(1)%PTR
4409 field_var_type=dependent_variable%VARIABLE_TYPE
4410 geometric_variable=>geometric_field%VARIABLE_TYPE_MAP(field_u_variable_type)%PTR
4411 dependent_basis=>dependent_field%DECOMPOSITION%DOMAIN(dependent_field%DECOMPOSITION%MESH_COMPONENT_NUMBER)%PTR% &
4412 & topology%ELEMENTS%ELEMENTS(element_number)%BASIS
4413 geometric_basis=>geometric_field%DECOMPOSITION%DOMAIN(geometric_field%DECOMPOSITION%MESH_COMPONENT_NUMBER)%PTR% &
4414 & topology%ELEMENTS%ELEMENTS(element_number)%BASIS
4416 CALL field_interpolation_parameters_element_get(field_values_set_type,element_number,equations%INTERPOLATION% &
4417 & dependent_interp_parameters(field_var_type)%PTR,err,error,*999)
4418 CALL field_interpolation_parameters_element_get(field_values_set_type,element_number,equations%INTERPOLATION% &
4419 & geometric_interp_parameters(field_u_variable_type)%PTR,err,error,*999)
4420 CALL field_interpolation_parameters_element_get(field_values_set_type,element_number,equations%INTERPOLATION% &
4421 & materials_interp_parameters(field_u_variable_type)%PTR,err,error,*999)
4423 DO ng=1,quadrature_scheme%NUMBER_OF_GAUSS
4425 & dependent_interp_point(field_var_type)%PTR,err,error,*999)
4427 & geometric_interp_point(field_u_variable_type)%PTR,err,error,*999)
4428 CALL field_interpolated_point_metrics_calculate(geometric_basis%NUMBER_OF_XI,equations%INTERPOLATION% &
4429 & geometric_interp_point_metrics(field_u_variable_type)%PTR,err,error,*999)
4431 & materials_interp_point(field_u_variable_type)%PTR,err,error,*999)
4434 rwg=equations%INTERPOLATION%GEOMETRIC_INTERP_POINT_METRICS(field_u_variable_type)%PTR%JACOBIAN* &
4435 & quadrature_scheme%GAUSS_WEIGHTS(ng)
4437 IF(equations_matrix%FIRST_ASSEMBLY)
THEN 4438 IF(equations_matrix%UPDATE_MATRIX)
THEN 4440 DO mh=1,dependent_variable%NUMBER_OF_COMPONENTS
4442 DO ms=1,dependent_basis%NUMBER_OF_ELEMENT_PARAMETERS
4446 DO nh=1,dependent_variable%NUMBER_OF_COMPONENTS
4447 DO ns=1,dependent_basis%NUMBER_OF_ELEMENT_PARAMETERS
4450 DO nj=1,geometric_variable%NUMBER_OF_COMPONENTS
4453 DO ni=1,geometric_basis%NUMBER_OF_XI
4454 pgmj(nj)=pgmj(nj)+ &
4456 & equations%INTERPOLATION%GEOMETRIC_INTERP_POINT_METRICS(field_u_variable_type)%PTR%DXI_DX(ni,nj)
4457 pgnj(nj)=pgnj(nj)+ &
4459 & equations%INTERPOLATION%GEOMETRIC_INTERP_POINT_METRICS(field_u_variable_type)%PTR%DXI_DX(ni,nj)
4461 k_param=equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_u_variable_type)%PTR%VALUES(nj,
no_part_deriv)
4462 sum1=sum1+k_param*pgmj(nj)*pgnj(nj)
4464 equations_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)=equations_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)+sum1*rwg
4471 IF(rhs_vector%FIRST_ASSEMBLY)
THEN 4472 IF(rhs_vector%UPDATE_VECTOR)
THEN 4473 a_param=equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_u_variable_type)%PTR% &
4474 & values(geometric_variable%NUMBER_OF_COMPONENTS+1,
no_part_deriv)
4476 DO mh=1,dependent_variable%NUMBER_OF_COMPONENTS
4478 DO ms=1,dependent_basis%NUMBER_OF_ELEMENT_PARAMETERS
4480 rhs_vector%ELEMENT_VECTOR%VECTOR(mhs)=rhs_vector%ELEMENT_VECTOR%VECTOR(mhs)+ &
4481 & quadrature_scheme%GAUSS_BASIS_FNS(ms,
no_part_deriv,ng)*a_param*rwg
4486 IF(nonlinear_matrices%UPDATE_RESIDUAL)
THEN 4487 b_param=equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_u_variable_type)%PTR% &
4488 & values(geometric_variable%NUMBER_OF_COMPONENTS+2,
no_part_deriv)
4489 c_param=equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_u_variable_type)%PTR% &
4490 & values(geometric_variable%NUMBER_OF_COMPONENTS+3,
no_part_deriv)
4491 u_value=equations%INTERPOLATION%DEPENDENT_INTERP_POINT(field_u_variable_type)%PTR% &
4494 IF((c_param*u_value)>20000.0_dp)
THEN 4496 &
" is out of range for an exponential function." 4497 CALL flagerror(local_error,err,error,*999)
4500 DO mh=1,dependent_variable%NUMBER_OF_COMPONENTS
4502 DO ms=1,dependent_basis%NUMBER_OF_ELEMENT_PARAMETERS
4504 nonlinear_matrices%ELEMENT_RESIDUAL%VECTOR(mhs)=nonlinear_matrices%ELEMENT_RESIDUAL%VECTOR(mhs)- &
4505 & quadrature_scheme%GAUSS_BASIS_FNS(ms,
no_part_deriv,ng)*b_param*exp(c_param*u_value)*rwg
4511 local_error=
"Equations set subtype "//
trim(
number_to_vstring(equations_set%SPECIFICATION(3),
"*",err,error))// &
4512 &
" is not valid for a Poisson equation type of a classical field equations set class." 4513 CALL flagerror(local_error,err,error,*999)
4516 CALL flagerror(
"Equations set equations is not associated.",err,error,*999)
4519 CALL flagerror(
"Equations set is not associated.",err,error,*999)
4522 exits(
"Poisson_FiniteElementResidualEvaluate")
4524 999
errors(
"Poisson_FiniteElementResidualEvaluate",err,error)
4525 exits(
"Poisson_FiniteElementResidualEvaluate")
4539 INTEGER(INTG),
INTENT(IN) :: problemSpecification(:)
4540 INTEGER(INTG),
INTENT(OUT) :: err
4544 INTEGER(INTG) :: problemSubtype
4546 enters(
"Poisson_ProblemSpecificationSet",err,error,*999)
4548 IF(
ASSOCIATED(problem))
THEN 4549 IF(
SIZE(problemspecification,1)==3)
THEN 4550 problemsubtype=problemspecification(3)
4551 SELECT CASE(problemsubtype)
4561 localerror=
"The third problem specification of "//
trim(
numbertovstring(problemsubtype,
"*",err,error))// &
4562 &
" is not valid for a Poisson problem." 4563 CALL flagerror(localerror,err,error,*999)
4565 IF(
ALLOCATED(problem%specification))
THEN 4566 CALL flagerror(
"Problem specification is already allocated.",err,error,*999)
4568 ALLOCATE(problem%specification(3),stat=err)
4569 IF(err/=0)
CALL flagerror(
"Could not allocate problem specification.",err,error,*999)
4573 CALL flagerror(
"Poisson problem specification must have three entries.",err,error,*999)
4576 CALL flagerror(
"Problem is not associated.",err,error,*999)
4579 exits(
"Poisson_ProblemSpecificationSet")
4581 999 errorsexits(
"Poisson_ProblemSpecificationSet",err,error)
4596 INTEGER(INTG),
INTENT(OUT) :: ERR
4605 enters(
"Poisson_ProblemExtracellularBidomainSetup",err,error,*999)
4607 NULLIFY(control_loop)
4609 NULLIFY(solver_equations)
4611 IF(
ASSOCIATED(problem))
THEN 4612 IF(.NOT.
ALLOCATED(problem%SPECIFICATION))
THEN 4613 CALL flagerror(
"Problem specification is not allocated.",err,error,*999)
4614 ELSE IF(
SIZE(problem%SPECIFICATION,1)<3)
THEN 4615 CALL flagerror(
"Problem specification must have three entries for a Poisson problem.",err,error,*999)
4618 SELECT CASE(problem_setup%SETUP_TYPE)
4620 SELECT CASE(problem_setup%ACTION_TYPE)
4626 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
4628 &
" is invalid for a extracellular bidomain Poisson equation." 4629 CALL flagerror(local_error,err,error,*999)
4632 SELECT CASE(problem_setup%ACTION_TYPE)
4638 control_loop_root=>problem%CONTROL_LOOP
4642 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
4644 &
" is invalid for a extracellular bidomain Poisson equation." 4645 CALL flagerror(local_error,err,error,*999)
4649 control_loop_root=>problem%CONTROL_LOOP
4651 SELECT CASE(problem_setup%ACTION_TYPE)
4668 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
4670 &
" is invalid for a extracellular bidomain Poisson equation." 4671 CALL flagerror(local_error,err,error,*999)
4674 SELECT CASE(problem_setup%ACTION_TYPE)
4677 control_loop_root=>problem%CONTROL_LOOP
4689 control_loop_root=>problem%CONTROL_LOOP
4698 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
4700 &
" is invalid for a extracellular bidomain Poisson equation." 4701 CALL flagerror(local_error,err,error,*999)
4704 local_error=
"The setup type of "//
trim(
number_to_vstring(problem_setup%SETUP_TYPE,
"*",err,error))// &
4705 &
" is invalid for a extracellular bidomain Poisson equation." 4706 CALL flagerror(local_error,err,error,*999)
4709 local_error=
"The problem subtype of "//
trim(
number_to_vstring(problem%SPECIFICATION(3),
"*",err,error))// &
4710 &
" does not equal a extracellular bidomain Poisson equation subtype." 4711 CALL flagerror(local_error,err,error,*999)
4714 CALL flagerror(
"Problem is not associated.",err,error,*999)
4717 exits(
"Poisson_ProblemExtracellularBidomainSetup")
4719 999
errors(
"Poisson_ProblemExtracellularBidomainSetup",err,error)
4720 exits(
"Poisson_ProblemExtracellularBidomainSetup")
4735 INTEGER(INTG),
INTENT(OUT) :: ERR
4744 enters(
"Poisson_ProblemLinearSourceSetup",err,error,*999)
4746 NULLIFY(control_loop)
4748 NULLIFY(solver_equations)
4750 IF(
ASSOCIATED(problem))
THEN 4751 IF(.NOT.
ALLOCATED(problem%SPECIFICATION))
THEN 4752 CALL flagerror(
"Problem specification is not allocated.",err,error,*999)
4753 ELSE IF(
SIZE(problem%SPECIFICATION,1)<3)
THEN 4754 CALL flagerror(
"Problem specification must have three entries for a Poisson problem.",err,error,*999)
4757 SELECT CASE(problem_setup%SETUP_TYPE)
4759 SELECT CASE(problem_setup%ACTION_TYPE)
4765 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
4767 &
" is invalid for a linear source Poisson equation." 4768 CALL flagerror(local_error,err,error,*999)
4771 SELECT CASE(problem_setup%ACTION_TYPE)
4777 control_loop_root=>problem%CONTROL_LOOP
4781 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
4783 &
" is invalid for a linear source Poisson equation." 4784 CALL flagerror(local_error,err,error,*999)
4788 control_loop_root=>problem%CONTROL_LOOP
4790 SELECT CASE(problem_setup%ACTION_TYPE)
4807 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
4809 &
" is invalid for a linear source Poisson equation." 4810 CALL flagerror(local_error,err,error,*999)
4813 SELECT CASE(problem_setup%ACTION_TYPE)
4816 control_loop_root=>problem%CONTROL_LOOP
4828 control_loop_root=>problem%CONTROL_LOOP
4837 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
4839 &
" is invalid for a linear source Poisson equation." 4840 CALL flagerror(local_error,err,error,*999)
4843 local_error=
"The setup type of "//
trim(
number_to_vstring(problem_setup%SETUP_TYPE,
"*",err,error))// &
4844 &
" is invalid for a linear source Poisson equation." 4845 CALL flagerror(local_error,err,error,*999)
4848 local_error=
"The problem subtype of "//
trim(
number_to_vstring(problem%SPECIFICATION(3),
"*",err,error))// &
4849 &
" does not equal a linear source Poisson equation subtype." 4850 CALL flagerror(local_error,err,error,*999)
4853 CALL flagerror(
"Problem is not associated.",err,error,*999)
4856 exits(
"Poisson_ProblemLinearSourceSetup")
4858 999 errorsexits(
"Poisson_ProblemLinearSourceSetup",err,error)
4874 INTEGER(INTG),
INTENT(OUT) :: ERR
4878 TYPE(
solver_type),
POINTER :: SOLVER,FITTING_SOLVER
4883 enters(
"Poisson_ProblemPressurePoissonSetup",err,error,*999)
4885 NULLIFY(control_loop)
4887 NULLIFY(fitting_solver)
4888 NULLIFY(solver_equations)
4889 NULLIFY(fitting_solver_equations)
4891 IF(
ASSOCIATED(problem))
THEN 4892 IF(.NOT.
ALLOCATED(problem%SPECIFICATION))
THEN 4893 CALL flagerror(
"Problem specification is not allocated.",err,error,*999)
4894 ELSE IF(
SIZE(problem%SPECIFICATION,1)<3)
THEN 4895 CALL flagerror(
"Problem specification must have three entries for a Poisson problem.",err,error,*999)
4900 SELECT CASE(problem_setup%SETUP_TYPE)
4902 SELECT CASE(problem_setup%ACTION_TYPE)
4908 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
4910 &
" is invalid for a linear source Poisson equation." 4911 CALL flagerror(local_error,err,error,*999)
4914 SELECT CASE(problem_setup%ACTION_TYPE)
4916 NULLIFY(control_loop_root)
4929 control_loop_root=>problem%CONTROL_LOOP
4933 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
4935 &
" is invalid for a linear source Poisson equation." 4936 CALL flagerror(local_error,err,error,*999)
4940 control_loop_root=>problem%CONTROL_LOOP
4942 NULLIFY(control_loop)
4946 SELECT CASE(problem_setup%ACTION_TYPE)
4963 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
4965 &
" is invalid for a linear source Poisson equation." 4966 CALL flagerror(local_error,err,error,*999)
4969 SELECT CASE(problem_setup%ACTION_TYPE)
4972 control_loop_root=>problem%CONTROL_LOOP
4974 NULLIFY(control_loop)
4987 control_loop_root=>problem%CONTROL_LOOP
4989 NULLIFY(control_loop)
4999 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
5001 &
" is invalid for a linear source Poisson equation." 5002 CALL flagerror(local_error,err,error,*999)
5005 local_error=
"The setup type of "//
trim(
number_to_vstring(problem_setup%SETUP_TYPE,
"*",err,error))// &
5006 &
" is invalid for a linear source Poisson equation." 5007 CALL flagerror(local_error,err,error,*999)
5010 SELECT CASE(problem_setup%SETUP_TYPE)
5012 SELECT CASE(problem_setup%ACTION_TYPE)
5018 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
5020 &
" is invalid for a fitted PPE problem." 5021 CALL flagerror(local_error,err,error,*999)
5024 SELECT CASE(problem_setup%ACTION_TYPE)
5031 control_loop_root=>problem%CONTROL_LOOP
5035 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
5037 &
" is invalid for a Pressure Poisson problem." 5038 CALL flagerror(local_error,err,error,*999)
5042 control_loop_root=>problem%CONTROL_LOOP
5044 SELECT CASE(problem_setup%ACTION_TYPE)
5064 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
5066 &
" is invalid for a fitted PPE problem." 5067 CALL flagerror(local_error,err,error,*999)
5070 SELECT CASE(problem_setup%ACTION_TYPE)
5073 control_loop_root=>problem%CONTROL_LOOP
5091 control_loop_root=>problem%CONTROL_LOOP
5104 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
5106 &
" is invalid for a fitted PPE problem." 5107 CALL flagerror(local_error,err,error,*999)
5110 local_error=
"The setup type of "//
trim(
number_to_vstring(problem_setup%SETUP_TYPE,
"*",err,error))// &
5111 &
" is invalid for a fitted PPE problem." 5112 CALL flagerror(local_error,err,error,*999)
5115 local_error=
"The problem subtype of "//
trim(
number_to_vstring(problem%SPECIFICATION(3),
"*",err,error))// &
5116 &
" does not equal a linear source Poisson equation subtype." 5117 CALL flagerror(local_error,err,error,*999)
5120 CALL flagerror(
"Problem is not associated.",err,error,*999)
5123 exits(
"Poisson_ProblemPressurePoissonSetup")
5125 999 errorsexits(
"Poisson_ProblemPressurePoissonSetup",err,error)
5141 INTEGER(INTG),
INTENT(OUT) :: ERR
5150 enters(
"Poisson_ProblemNonlinearSourceSetup",err,error,*999)
5152 NULLIFY(control_loop)
5154 NULLIFY(solver_equations)
5156 IF(
ASSOCIATED(problem))
THEN 5157 IF(.NOT.
ALLOCATED(problem%SPECIFICATION))
THEN 5158 CALL flagerror(
"Problem specification is not allocated.",err,error,*999)
5159 ELSE IF(
SIZE(problem%SPECIFICATION,1)<3)
THEN 5160 CALL flagerror(
"Problem specification must have three entries for a Poisson problem.",err,error,*999)
5163 SELECT CASE(problem_setup%SETUP_TYPE)
5165 SELECT CASE(problem_setup%ACTION_TYPE)
5171 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
5173 &
" is invalid for a nonlinear source Poisson equation." 5174 CALL flagerror(local_error,err,error,*999)
5177 SELECT CASE(problem_setup%ACTION_TYPE)
5183 control_loop_root=>problem%CONTROL_LOOP
5187 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
5189 &
" is invalid for a nonlinear source Poisson equation." 5190 CALL flagerror(local_error,err,error,*999)
5194 control_loop_root=>problem%CONTROL_LOOP
5196 SELECT CASE(problem_setup%ACTION_TYPE)
5212 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
5214 &
" is invalid for a nonlinear source Poisson equation." 5215 CALL flagerror(local_error,err,error,*999)
5218 SELECT CASE(problem_setup%ACTION_TYPE)
5221 control_loop_root=>problem%CONTROL_LOOP
5233 control_loop_root=>problem%CONTROL_LOOP
5242 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
5244 &
" is invalid for a nonlinear source Poisson equation." 5245 CALL flagerror(local_error,err,error,*999)
5248 local_error=
"The setup type of "//
trim(
number_to_vstring(problem_setup%SETUP_TYPE,
"*",err,error))// &
5249 &
" is invalid for a nonlinear source Poisson equation." 5250 CALL flagerror(local_error,err,error,*999)
5253 local_error=
"The problem subtype of "//
trim(
number_to_vstring(problem%SPECIFICATION(3),
"*",err,error))// &
5254 &
" does not equal a nonlinear source Poisson equation subtype." 5255 CALL flagerror(local_error,err,error,*999)
5258 CALL flagerror(
"Problem is not associated.",err,error,*999)
5261 exits(
"Poisson_ProblemNonlinearSourceSetup")
5263 999 errorsexits(
"Poisson_ProblemNonlinearSourceSetup",err,error)
5278 INTEGER(INTG),
INTENT(OUT) :: ERR
5284 enters(
"POISSON_POST_SOLVE",err,error,*999)
5286 IF(
ASSOCIATED(control_loop))
THEN 5287 IF(
ASSOCIATED(solver))
THEN 5288 IF(
ASSOCIATED(control_loop%PROBLEM))
THEN 5289 IF(.NOT.
ALLOCATED(control_loop%PROBLEM%SPECIFICATION))
THEN 5290 CALL flagerror(
"Problem specification is not allocated.",err,error,*999)
5291 ELSE IF(
SIZE(control_loop%PROBLEM%SPECIFICATION,1)<3)
THEN 5292 CALL flagerror(
"Problem specification must have three entries for a Poisson problem.",err,error,*999)
5294 SELECT CASE(control_loop%PROBLEM%SPECIFICATION(3))
5306 IF(solver%GLOBAL_NUMBER==1)
THEN 5309 ELSE IF (solver%GLOBAL_NUMBER==2)
THEN 5314 local_error=
"Problem subtype "//
trim(
number_to_vstring(control_loop%PROBLEM%SPECIFICATION(3),
"*",err,error))// &
5315 &
" is not valid for a Poisson type of a classical field problem class." 5316 CALL flagerror(local_error,err,error,*999)
5319 CALL flagerror(
"Problem is not associated.",err,error,*999)
5322 CALL flagerror(
"Solver is not associated.",err,error,*999)
5325 CALL flagerror(
"Control loop is not associated.",err,error,*999)
5328 exits(
"POISSON_POST_SOLVE")
5330 999 errorsexits(
"POISSON_POST_SOLVE",err,error)
5345 INTEGER(INTG),
INTENT(OUT) :: ERR
5355 enters(
"POISSON_PRE_SOLVE",err,error,*999)
5358 IF(
ASSOCIATED(control_loop))
THEN 5359 IF(
ASSOCIATED(solver))
THEN 5360 IF(
ASSOCIATED(control_loop%PROBLEM))
THEN 5361 IF(.NOT.
ALLOCATED(control_loop%PROBLEM%SPECIFICATION))
THEN 5362 CALL flagerror(
"Problem specification is not allocated.",err,error,*999)
5363 ELSE IF(
SIZE(control_loop%PROBLEM%SPECIFICATION,1)<3)
THEN 5364 CALL flagerror(
"Problem specification must have three entries for a Poisson problem.",err,error,*999)
5366 SELECT CASE(control_loop%PROBLEM%SPECIFICATION(3))
5374 IF(control_loop%WHILE_LOOP%ITERATION_NUMBER==1)
THEN 5375 solver_equations=>solver%SOLVER_EQUATIONS
5376 IF(
ASSOCIATED(solver_equations))
THEN 5377 solver_mapping=>solver_equations%SOLVER_MAPPING
5378 equations=>solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(1)%EQUATIONS
5379 IF(
ASSOCIATED(equations))
THEN 5380 equations_set=>equations%EQUATIONS_SET
5381 IF(
ASSOCIATED(equations_set))
THEN 5382 IF(
ASSOCIATED(equations_set%ANALYTIC))
THEN 5405 IF(solver%GLOBAL_NUMBER==1)
THEN 5410 ELSE IF(solver%GLOBAL_NUMBER==2)
THEN 5418 CALL flagerror(
"Solver global number not associated for PPE problem.",err,error,*999)
5421 IF(control_loop%WHILE_LOOP%ITERATION_NUMBER==1)
THEN 5422 solver_equations=>solver%SOLVER_EQUATIONS
5423 IF(
ASSOCIATED(solver_equations))
THEN 5424 solver_mapping=>solver_equations%SOLVER_MAPPING
5425 equations=>solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(1)%EQUATIONS
5426 IF(
ASSOCIATED(equations))
THEN 5427 equations_set=>equations%EQUATIONS_SET
5428 IF(
ASSOCIATED(equations_set))
THEN 5429 IF(
ASSOCIATED(equations_set%ANALYTIC))
THEN 5451 local_error=
"Problem subtype "//
trim(
number_to_vstring(control_loop%PROBLEM%SPECIFICATION(3),
"*",err,error))// &
5452 &
" is not valid for a Poisson type of a classical field problem class." 5453 CALL flagerror(local_error,err,error,*999)
5456 CALL flagerror(
"Problem is not associated.",err,error,*999)
5459 CALL flagerror(
"Solver is not associated.",err,error,*999)
5462 CALL flagerror(
"Control loop is not associated.",err,error,*999)
5465 exits(
"POISSON_PRE_SOLVE")
5467 999 errorsexits(
"POISSON_PRE_SOLVE",err,error)
5481 INTEGER(INTG),
INTENT(OUT) :: ERR
5490 REAL(DP) :: CURRENT_TIME,TIME_INCREMENT
5492 INTEGER(INTG) :: NUMBER_OF_DIMENSIONS,CURRENT_LOOP_ITERATION
5493 INTEGER(INTG) :: INPUT_TYPE,INPUT_OPTION
5494 REAL(DP),
POINTER :: INPUT_VEL_NEW_DATA(:),INPUT_VEL_OLD_DATA(:)
5495 REAL(DP),
POINTER :: INPUT_VEL_LABEL_DATA(:),INPUT_VEL_U_DATA(:),INPUT_VEL_V_DATA(:),INPUT_VEL_W_DATA(:)
5498 LOGICAL :: BOUNDARY_UPDATE
5500 boundary_update=.false.
5502 enters(
"POISSON_PRE_SOLVE_UPDATE_INPUT_DATA",err,error,*999)
5504 IF(
ASSOCIATED(control_loop))
THEN 5505 IF(
ASSOCIATED(solver))
THEN 5506 IF(
ASSOCIATED(control_loop%PROBLEM))
THEN 5507 IF(.NOT.
ALLOCATED(control_loop%PROBLEM%SPECIFICATION))
THEN 5508 CALL flagerror(
"Problem specification is not allocated.",err,error,*999)
5509 ELSE IF(
SIZE(control_loop%PROBLEM%SPECIFICATION,1)<3)
THEN 5510 CALL flagerror(
"Problem specification must have three entries for a Poisson problem.",err,error,*999)
5512 SELECT CASE(control_loop%PROBLEM%SPECIFICATION(3))
5520 IF(solver%GLOBAL_NUMBER==1)
THEN 5522 control_time_loop=>control_loop
5524 solver_equations=>solver%SOLVER_EQUATIONS
5525 IF(
ASSOCIATED(solver_equations))
THEN 5526 solver_mapping=>solver_equations%SOLVER_MAPPING
5527 equations=>solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(1)%EQUATIONS
5528 IF(
ASSOCIATED(equations))
THEN 5529 equations_set=>equations%EQUATIONS_SET
5530 IF(
ASSOCIATED(equations_set))
THEN 5532 CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
5533 & number_of_dimensions,err,error,*999)
5534 current_loop_iteration=control_time_loop%TIME_LOOP%ITERATION_NUMBER
5539 CALL field_parameter_set_data_get(equations_set%SOURCE%SOURCE_FIELD,field_u_variable_type, &
5540 & field_values_set_type,input_vel_new_data,err,error,*999)
5542 & number_of_dimensions,input_type,input_option,control_time_loop%TIME_LOOP%ITERATION_NUMBER,1.0_dp)
5544 CALL flagerror(
"Equations set is not associated.",err,error,*999)
5547 CALL flagerror(
"Equations are not associated.",err,error,*999)
5550 CALL flagerror(
"Solver equations are not associated.",err,error,*999)
5552 ELSE IF(solver%GLOBAL_NUMBER==2)
THEN 5554 control_time_loop=>control_loop
5556 solver_equations=>solver%SOLVER_EQUATIONS
5557 IF(
ASSOCIATED(solver_equations))
THEN 5558 solver_mapping=>solver_equations%SOLVER_MAPPING
5559 equations=>solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(1)%EQUATIONS
5560 IF(
ASSOCIATED(equations))
THEN 5561 equations_set=>equations%EQUATIONS_SET
5562 IF(
ASSOCIATED(equations_set))
THEN 5564 CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
5565 & number_of_dimensions,err,error,*999)
5566 current_loop_iteration=control_time_loop%TIME_LOOP%ITERATION_NUMBER
5571 CALL field_parameter_set_data_get(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type, &
5572 & field_input_label_set_type,input_vel_label_data,err,error,*999)
5574 & number_of_dimensions,input_type,input_option,control_time_loop%TIME_LOOP%ITERATION_NUMBER,1.0_dp)
5578 CALL field_parameter_set_data_get(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type, &
5579 & field_input_vel1_set_type,input_vel_u_data,err,error,*999)
5581 & number_of_dimensions,input_type,input_option,control_time_loop%TIME_LOOP%ITERATION_NUMBER,1.0_dp)
5585 CALL field_parameter_set_data_get(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type, &
5586 & field_input_vel2_set_type,input_vel_v_data,err,error,*999)
5588 & number_of_dimensions,input_type,input_option,control_time_loop%TIME_LOOP%ITERATION_NUMBER,1.0_dp)
5592 CALL field_parameter_set_data_get(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type, &
5593 & field_input_vel3_set_type,input_vel_w_data,err,error,*999)
5595 & number_of_dimensions,input_type,input_option,control_time_loop%TIME_LOOP%ITERATION_NUMBER,1.0_dp)
5602 control_time_loop=>control_loop%PARENT_LOOP
5605 solver_equations=>solver%SOLVER_EQUATIONS
5606 IF(
ASSOCIATED(solver_equations))
THEN 5607 solver_mapping=>solver_equations%SOLVER_MAPPING
5608 equations=>solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(1)%EQUATIONS
5609 IF(
ASSOCIATED(equations))
THEN 5610 equations_set=>equations%EQUATIONS_SET
5611 IF(
ASSOCIATED(equations_set))
THEN 5612 CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
5613 & number_of_dimensions,err,error,*999)
5614 current_loop_iteration=control_time_loop%TIME_LOOP%ITERATION_NUMBER
5619 CALL field_parameter_set_data_get(equations_set%SOURCE%SOURCE_FIELD,field_u_variable_type, &
5620 & field_input_data1_set_type,input_vel_new_data,err,error,*999)
5622 & number_of_dimensions,input_type,input_option,control_time_loop%TIME_LOOP%ITERATION_NUMBER,1.0_dp)
5627 CALL field_parameter_set_data_get(equations_set%SOURCE%SOURCE_FIELD,field_u_variable_type, &
5628 & field_input_data2_set_type,input_vel_old_data,err,error,*999)
5630 & number_of_dimensions,input_type,input_option,control_time_loop%TIME_LOOP%ITERATION_NUMBER,1.0_dp)
5634 CALL field_parameter_set_data_get(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type, &
5635 & field_input_label_set_type,input_vel_label_data,err,error,*999)
5637 & number_of_dimensions,input_type,input_option,control_time_loop%TIME_LOOP%ITERATION_NUMBER,1.0_dp)
5641 CALL field_parameter_set_data_get(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type, &
5642 & field_input_vel1_set_type,input_vel_u_data,err,error,*999)
5644 & number_of_dimensions,input_type,input_option,control_time_loop%TIME_LOOP%ITERATION_NUMBER,1.0_dp)
5648 CALL field_parameter_set_data_get(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type, &
5649 & field_input_vel2_set_type,input_vel_v_data,err,error,*999)
5651 & number_of_dimensions,input_type,input_option,control_time_loop%TIME_LOOP%ITERATION_NUMBER,1.0_dp)
5655 CALL field_parameter_set_data_get(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type, &
5656 & field_input_vel3_set_type,input_vel_w_data,err,error,*999)
5658 & number_of_dimensions,input_type,input_option,control_time_loop%TIME_LOOP%ITERATION_NUMBER,1.0_dp)
5660 CALL flagerror(
"Equations set is not associated.",err,error,*999)
5663 CALL flagerror(
"Equations are not associated.",err,error,*999)
5666 CALL flagerror(
"Solver equations are not associated.",err,error,*999)
5669 local_error=
"Problem subtype "//
trim(
number_to_vstring(control_loop%PROBLEM%SPECIFICATION(3),
"*",err,error))// &
5670 &
" is not valid for a Poisson type of a classical field problem class." 5671 CALL flagerror(local_error,err,error,*999)
5673 CALL field_parameter_set_update_start(equations_set%SOURCE%SOURCE_FIELD,field_u_variable_type, &
5674 & field_input_data1_set_type,err,error,*999)
5675 CALL field_parameter_set_update_finish(equations_set%SOURCE%SOURCE_FIELD,field_u_variable_type, &
5676 & field_input_data1_set_type,err,error,*999)
5677 CALL field_parameter_set_update_start(equations_set%SOURCE%SOURCE_FIELD,field_u_variable_type, &
5678 & field_input_data2_set_type,err,error,*999)
5679 CALL field_parameter_set_update_finish(equations_set%SOURCE%SOURCE_FIELD,field_u_variable_type, &
5680 & field_input_data2_set_type,err,error,*999)
5682 CALL flagerror(
"Problem is not associated.",err,error,*999)
5685 CALL flagerror(
"Solver is not associated.",err,error,*999)
5688 CALL flagerror(
"Control loop is not associated.",err,error,*999)
5691 exits(
"POISSON_PRE_SOLVE_UPDATE_INPUT_DATA")
5693 999 errorsexits(
"POISSON_PRE_SOLVE_UPDATE_INPUT_DATA",err,error)
5707 INTEGER(INTG),
INTENT(OUT) :: ERR
5714 REAL(DP) :: CURRENT_TIME,TIME_INCREMENT
5715 INTEGER(INTG) :: EQUATIONS_SET_IDX,CURRENT_LOOP_ITERATION,OUTPUT_ITERATION_NUMBER
5717 LOGICAL :: EXPORT_FIELD
5719 CHARACTER(14) :: FILE
5720 CHARACTER(14) :: OUTPUT_FILE
5722 enters(
"POISSON_POST_SOLVE_OUTPUT_DATA",err,error,*999)
5724 IF(
ASSOCIATED(control_loop))
THEN 5727 IF(
ASSOCIATED(solver))
THEN 5728 IF(
ASSOCIATED(control_loop%PROBLEM))
THEN 5729 IF(.NOT.
ALLOCATED(control_loop%PROBLEM%SPECIFICATION))
THEN 5730 CALL flagerror(
"Problem specification is not allocated.",err,error,*999)
5731 ELSE IF(
SIZE(control_loop%PROBLEM%SPECIFICATION,1)<3)
THEN 5732 CALL flagerror(
"Problem specification must have three entries for a Poisson problem.",err,error,*999)
5734 SELECT CASE(control_loop%PROBLEM%SPECIFICATION(3))
5743 IF(control_loop%WHILE_LOOP%ITERATION_NUMBER==control_loop%WHILE_LOOP%MAXIMUM_NUMBER_OF_ITERATIONS)
THEN 5744 control_time_loop=>control_loop%PARENT_LOOP
5746 solver_equations=>solver%SOLVER_EQUATIONS
5747 IF(
ASSOCIATED(solver_equations))
THEN 5748 solver_mapping=>solver_equations%SOLVER_MAPPING
5749 IF(
ASSOCIATED(solver_mapping))
THEN 5751 DO equations_set_idx=1,solver_mapping%NUMBER_OF_EQUATIONS_SETS
5752 equations_set=>solver_mapping%EQUATIONS_SETS(equations_set_idx)%PTR
5753 current_loop_iteration=control_time_loop%TIME_LOOP%ITERATION_NUMBER
5754 output_iteration_number=control_time_loop%TIME_LOOP%OUTPUT_NUMBER
5755 IF(output_iteration_number/=0)
THEN 5756 IF(control_time_loop%TIME_LOOP%CURRENT_TIME<=control_time_loop%TIME_LOOP%STOP_TIME)
THEN 5757 IF(current_loop_iteration<10)
THEN 5758 WRITE(output_file,
'("TIME_STEP_000",I0)') current_loop_iteration
5759 ELSE IF(current_loop_iteration<100)
THEN 5760 WRITE(output_file,
'("TIME_STEP_00",I0)') current_loop_iteration
5761 ELSE IF(current_loop_iteration<1000)
THEN 5762 WRITE(output_file,
'("TIME_STEP_0",I0)') current_loop_iteration
5763 ELSE IF(current_loop_iteration<10000)
THEN 5764 WRITE(output_file,
'("TIME_STEP_",I0)') current_loop_iteration
5770 IF(export_field)
THEN 5771 IF(mod(current_loop_iteration,output_iteration_number)==0)
THEN 5775 & output_file,err,error,*999)
5787 control_time_loop=>control_loop
5789 solver_equations=>solver%SOLVER_EQUATIONS
5790 IF(
ASSOCIATED(solver_equations))
THEN 5791 solver_mapping=>solver_equations%SOLVER_MAPPING
5792 IF(
ASSOCIATED(solver_mapping))
THEN 5794 DO equations_set_idx=1,solver_mapping%NUMBER_OF_EQUATIONS_SETS
5795 equations_set=>solver_mapping%EQUATIONS_SETS(equations_set_idx)%PTR
5796 current_loop_iteration=control_time_loop%TIME_LOOP%ITERATION_NUMBER
5797 output_iteration_number=control_time_loop%TIME_LOOP%OUTPUT_NUMBER
5798 IF(output_iteration_number/=0)
THEN 5799 IF(control_time_loop%TIME_LOOP%CURRENT_TIME<=control_time_loop%TIME_LOOP%STOP_TIME)
THEN 5800 IF(current_loop_iteration<10)
THEN 5801 WRITE(output_file,
'("TIME_STEP_000",I0)') current_loop_iteration
5802 ELSE IF(current_loop_iteration<100)
THEN 5803 WRITE(output_file,
'("TIME_STEP_00",I0)') current_loop_iteration
5804 ELSE IF(current_loop_iteration<1000)
THEN 5805 WRITE(output_file,
'("TIME_STEP_0",I0)') current_loop_iteration
5806 ELSE IF(current_loop_iteration<10000)
THEN 5807 WRITE(output_file,
'("TIME_STEP_",I0)') current_loop_iteration
5813 IF(export_field)
THEN 5814 IF(mod(current_loop_iteration,output_iteration_number)==0)
THEN 5818 & output_file,err,error,*999)
5829 local_error=
"Problem subtype "//
trim(
number_to_vstring(control_loop%PROBLEM%SPECIFICATION(3),
"*",err,error))// &
5830 &
" is not valid for a Poisson equation fluid type of a fluid mechanics problem class." 5831 CALL flagerror(local_error,err,error,*999)
5834 CALL flagerror(
"Problem is not associated.",err,error,*999)
5837 CALL flagerror(
"Solver is not associated.",err,error,*999)
5840 CALL flagerror(
"Control loop is not associated.",err,error,*999)
5842 exits(
"POISSON_POST_SOLVE_OUTPUT_DATA")
5844 999 errorsexits(
"POISSON_POST_SOLVE_OUTPUT_DATA",err,error)
integer(intg), parameter equations_set_setup_dependent_type
Dependent variables.
integer(intg), parameter equations_set_fem_solution_method
Finite Element Method solution method.
This module contains all basis function routines.
integer(intg), parameter equations_set_setup_materials_type
Materials setup.
Contains information on the boundary conditions for the solver equations.
subroutine, public enters(NAME, ERR, ERROR,)
Records the entry into the named procedure and initialises the error code.
subroutine, public solvers_create_finish(SOLVERS, ERR, ERROR,)
Finish the creation of solvers.
integer, parameter ptr
Pointer integer kind.
integer(intg), parameter second_part_deriv
Second partial derivative i.e., d^2u/ds^2.
This module contains all coordinate transformation and support routines.
Contains information on the Jacobian matrix for nonlinear problems.
Contains information on the equations mapping i.e., how field variable DOFS are mapped to the rows an...
Contains information about the equations in an equations set.
integer(intg), parameter equations_set_gfem_solution_method
Grid-based Finite Element Method solution method.
integer(intg), parameter problem_control_time_loop_type
Time control loop.
integer(intg), parameter equations_set_poisson_equation_three_dim_2
u=tbd
integer(intg), parameter problem_setup_control_type
Solver setup for a problem.
integer(intg), parameter equations_set_quadratic_source_poisson_subtype
This module handles all problem wide constants.
integer(intg), parameter, public control_loop_node
The identifier for a each "leaf" node in a control loop.
integer(intg), parameter equations_set_ale_pressure_poisson_subtype
integer(intg), parameter no_global_deriv
No global derivative i.e., u.
subroutine poisson_pre_solve_update_ppe_mesh(CONTROL_LOOP, SOLVER, ERR, ERROR,)
Update mesh velocity and move mesh for ALE PPE problem.
subroutine, public control_loop_maximum_iterations_set(CONTROL_LOOP, MAXIMUM_ITERATIONS, ERR, ERROR,)
Sets the maximum number of iterations for a while or load increment control loop. ...
Converts a number to its equivalent varying string representation.
subroutine, public equations_create_start(EQUATIONS_SET, EQUATIONS, ERR, ERROR,)
Start the creation of equations for the equation set.
Contains information on the mesh decomposition.
subroutine, public poisson_equationssetsolutionmethodset(EQUATIONS_SET, SOLUTION_METHOD, ERR, ERROR,)
Sets/changes the solution method for a Poisson equation type of an classical field equations set clas...
integer(intg), parameter problem_fitted_pressure_poisson_subtype
subroutine, public fluid_mechanics_io_write_encas_block(REGION, EQUATIONS_SET_GLOBAL_NUMBER, NAME, ERR, ERROR,)
Writes solution into encas — BUT FOR PRESSURE POISSON ONLY — not for general use! ...
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...
subroutine, public equations_matrices_create_start(EQUATIONS, EQUATIONS_MATRICES, ERR, ERROR,)
Starts the creation of the equations matrices and rhs for the the equations.
Contains information on the type of solver to be used.
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.
real(dp), parameter pi
The double precision value of pi.
integer(intg), parameter no_part_deriv
No partial derivative i.e., u.
subroutine poisson_problempressurepoissonsetup(PROBLEM, PROBLEM_SETUP, ERR, ERROR,)
Sets up the Pressure Poisson equations problem.
This module handles all equations matrix and rhs routines.
subroutine, public solver_type_set(SOLVER, SOLVE_TYPE, ERR, ERROR,)
Sets/changes the type for a solver.
integer(intg), parameter equations_set_linear_source_poisson_subtype
integer(intg), parameter equations_static
The equations are static and have no time dependence.
Contains information on an equations set.
This module handles all equations routines.
integer(intg), parameter equations_set_setup_source_type
Source setup.
This module contains all string manipulation and transformation routines.
subroutine, public solvers_create_start(CONTROL_LOOP, SOLVERS, ERR, ERROR,)
Start the creation of a solvers for the control loop.
Contains information on the solvers to be used in a control loop.
integer(intg), parameter first_part_deriv
First partial derivative i.e., du/ds.
This module contains routines for timing the program.
subroutine, public control_loop_current_times_get(CONTROL_LOOP, CURRENT_TIME, TIME_INCREMENT, ERR, ERROR,)
Gets the current time parameters for a time control loop.
Contains information of the source vector for equations matrices.
subroutine poisson_problemlinearsourcesetup(PROBLEM, PROBLEM_SETUP, ERR, ERROR,)
Sets up the linear source Poisson equations problem.
integer(intg), parameter solver_equations_static
Solver equations are static.
integer(intg), parameter part_deriv_s2
First partial derivative in the s2 direction i.e., du/ds2.
subroutine, public equations_time_dependence_type_set(EQUATIONS, TIME_DEPENDENCE_TYPE, ERR, ERROR,)
Sets/changes the time dependence type for equations.
subroutine, public solver_equations_sparsity_type_set(SOLVER_EQUATIONS, SPARSITY_TYPE, ERR, ERROR,)
Sets/changes the sparsity type for solver equations.
subroutine, public poisson_pre_solve(CONTROL_LOOP, SOLVER, ERR, ERROR,)
Sets up the Poisson problem pre solve.
integer(intg), parameter equations_set_poisson_equation_type
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, public equations_matrices_full_matrices
Use fully populated equation matrices.
integer(intg), parameter equations_set_linear_pressure_poisson_subtype
subroutine, public equations_mapping_rhs_variable_type_set(EQUATIONS_MAPPING, RHS_VARIABLE_TYPE, ERR, ERROR,)
Sets the mapping between a dependent field variable and the equations set rhs vector.
integer(intg), parameter solver_equations_linear
Solver equations are linear.
integer(intg), parameter global_deriv_s2
First global derivative in the s2 direction i.e., du/ds2.
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 basis_default_quadrature_scheme
Identifier for the default quadrature scheme.
integer(intg), parameter problem_setup_solvers_type
Solver setup for a problem.
integer(intg), parameter equations_set_setup_equations_type
Equations setup.
integer(intg), parameter equations_set_setup_independent_type
Independent variables.
This module contains all program wide constants.
integer(intg), parameter solver_equations_nonlinear
Solver equations are nonlinear.
subroutine, public solver_library_type_set(SOLVER, SOLVER_LIBRARY_TYPE, ERR, ERROR,)
Sets/changes the type of library type to use for the solver.
integer(intg), parameter part_deriv_s1
First partial derivative in the s1 direction i.e., du/ds1.
subroutine, public equationsmapping_linearmatricesnumberset(EQUATIONS_MAPPING, NUMBER_OF_LINEAR_EQUATIONS_MATRICES, ERR, ERROR,)
Sets/changes the number of linear equations matrices.
subroutine, public poisson_equationssetspecificationset(equationsSet, specification, err, error,)
Sets the equation specification for a Poisson equation type of a classical field equations set class...
subroutine poisson_equationssetlinearsourcesetup(EQUATIONS_SET, EQUATIONS_SET_SETUP, ERR, ERROR,)
Sets up the standard Poisson equation for linear sources.
integer(intg), parameter problem_extracellular_bidomain_poisson_subtype
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 equations_set_constant_source_poisson_subtype
subroutine, public equationsmapping_linearmatricesvariabletypesset(EQUATIONS_MAPPING, LINEAR_MATRIX_VARIABLE_TYPES, ERR, ERROR,)
Sets the mapping between the dependent field variable types and the linear equations matrices...
integer(intg), parameter problem_linear_source_poisson_subtype
subroutine, public poisson_problemspecificationset(problem, problemSpecification, err, error,)
Sets the problem specification for a Poisson equation type.
subroutine, public fluid_mechanics_io_read_data(SOLVER_TYPE, INPUT_VALUES, NUMBER_OF_DIMENSIONS, INPUT_TYPE, INPUT_OPTION, TIME_STEP, LENGTH_SCALE)
Reads input data from a file.
integer(intg), parameter problem_linear_pressure_poisson_subtype
integer(intg), parameter problem_ale_pressure_poisson_subtype
This module handles all Poisson equations routines.
integer(intg), parameter solver_equations_quasistatic
Solver equations are quasistatic.
subroutine, public coordinates_materialsystemcalculate(geometricInterpPointMetrics, fibreInterpPoint, dNudX, dXdNu, dNudXi, dXidNu, err, error,)
Calculates the tensor to get from material coordinate system, nu, to local coordinate system...
subroutine, public solver_equations_linearity_type_set(SOLVER_EQUATIONS, LINEARITY_TYPE, ERR, ERROR,)
Sets/changes the linearity type for solver equations.
integer(intg), parameter equations_set_setup_start_action
Start setup action.
integer(intg), parameter problem_classical_field_class
Sets the storage type (sparsity) of the nonlinear (Jacobian) equations matrices.
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.
integer(intg), parameter equations_set_exponential_source_poisson_subtype
This module contains all type definitions in order to avoid cyclic module references.
Contains information on the equations mapping for nonlinear matrices i.e., how a field variable is ma...
Contains information on the equations matrices and vectors.
integer(intg), parameter, public equations_matrix_fem_structure
Finite element matrix structure.
integer(intg), parameter part_deriv_s3
First partial derivative in the s3 direction i.e., du/ds3.
This module contains all the low-level base routines e.g., all debug, control, and low-level communic...
Contains information of the linear matrices for equations matrices.
integer(intg), parameter, public general_output_type
General output type.
integer(intg), parameter part_deriv_s1_s1
Second partial derivative in the s1 direction i.e., d^2u/ds1ds1.
subroutine, public equations_matrices_linear_storage_type_set(EQUATIONS_MATRICES, STORAGE_TYPE, ERR, ERROR,)
Sets the storage type (sparsity) of the linear equations matrices.
subroutine, public equationsmatrices_linearstructuretypeset(EQUATIONS_MATRICES, STRUCTURE_TYPE, ERR, ERROR,)
Sets the structure (sparsity) of the linear equations matrices.
subroutine, public equations_mapping_create_finish(EQUATIONS_MAPPING, ERR, ERROR,)
Finishes the process of creating an equations mapping.
Returns the specified control loop as indexed by the control loop identifier from the control loop ro...
integer(intg), parameter equations_set_poisson_equation_three_dim_3
u=tbd
subroutine, public control_loop_type_set(CONTROL_LOOP, LOOP_TYPE, ERR, ERROR,)
Sets/changes the control loop type.
subroutine, public poisson_equation_problem_setup(PROBLEM, PROBLEM_SETUP, ERR, ERROR,)
Sets up the Poisson problem.
subroutine, public poisson_post_solve(CONTROL_LOOP, SOLVER, ERR, ERROR,)
Sets up the Poisson problem post solve.
integer(intg), parameter part_deriv_s2_s3
Cross derivative in the s2 and s3 direction i.e., d^2u/ds2ds3.
subroutine, public poisson_equation_equations_set_setup(EQUATIONS_SET, EQUATIONS_SET_SETUP, ERR, ERROR,)
Sets up the Poisson equation type of a classical field equations set class.
integer(intg), parameter, public solver_nonlinear_type
A nonlinear solver.
subroutine, public equations_mapping_source_variable_type_set(EQUATIONS_MAPPING, SOURCE_VARIABLE_TYPE, ERR, ERROR,)
Sets the mapping between a source field variable and the equations set source vector.
integer(intg), parameter, public equations_jacobian_analytic_calculated
Use an analytic Jacobian evaluation.
subroutine, public poisson_equation_finite_element_calculate(EQUATIONS_SET, ELEMENT_NUMBER, ERR, ERROR,)
Calculates the element stiffness matrices and RHS for a Poisson equation finite element equations set...
integer(intg), parameter part_deriv_s1_s3
Cross derivative in the s1 and s3 direction i.e., d^2u/ds1ds3.
subroutine, public equations_set_equations_get(EQUATIONS_SET, EQUATIONS, ERR, ERROR,)
Gets the equations for an equations set.
Sets the structure (sparsity) of the nonlinear (Jacobian) equations matrices.
integer(intg), dimension(4) partial_derivative_first_derivative_map
PARTIAL_DERIVATIVE_FIRST_DERIVATIVE_MAP(nic) gives the partial derivative index for the first derivat...
subroutine, public equations_create_finish(EQUATIONS, ERR, ERROR,)
Finish the creation of equations.
subroutine poisson_equationssetpressurepoissonsetup(EQUATIONS_SET, EQUATIONS_SET_SETUP, ERR, ERROR,)
Sets up the standard Poisson equation for Pressure Poisson Equation (PPE).
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.
integer(intg), parameter, public matrix_compressed_row_storage_type
Matrix compressed row storage type.
integer(intg), parameter equations_set_gfv_solution_method
Grid-based Finite Volume solution method.
subroutine poisson_problemextracellularbidomainsetup(PROBLEM, PROBLEM_SETUP, ERR, ERROR,)
Sets up the linear source Poisson equations problem.
integer(intg), parameter equations_set_fitted_pressure_poisson_subtype
integer(intg), parameter equations_set_setup_geometry_type
Geometry setup.
integer(intg), parameter global_deriv_s1_s2
Global Cross derivative in the s1 and s2 direction i.e., d^2u/ds1ds2.
Contains information for a problem.
integer(intg), parameter problem_nonlinear_pressure_poisson_subtype
integer(intg), parameter equations_set_classical_field_class
integer(intg), parameter equations_linear
The equations are linear.
Contains the topology information for the nodes of a domain.
integer(intg), parameter equations_set_poisson_equation_two_dim_1
u=ln(4/(x+y+1^2))
subroutine, public equations_matrices_create_finish(EQUATIONS_MATRICES, ERR, ERROR,)
Finishes the creation of the equations matrices and RHS for the the equations.
integer(intg), parameter equations_set_extracellular_bidomain_poisson_subtype
This module handles all distributed matrix vector routines.
integer(intg), parameter global_deriv_s1
First global derivative in the s1 direction i.e., du/ds1.
This module handles all boundary conditions routines.
This module handles all solver routines.
subroutine, public equations_mapping_create_start(EQUATIONS, EQUATIONS_MAPPING, ERR, ERROR,)
Finishes the process of creating an equations mapping for a equations set equations.
Contains the interpolated value (and the derivatives wrt xi) of a field at a point. Old CMISS name XG.
Contains information about an equations matrix.
Contains information for a particular quadrature scheme.
This module contains all routines dealing with (non-distributed) matrix and vectors types...
integer(intg), parameter problem_poisson_equation_type
integer(intg), parameter equations_set_poisson_equation_two_dim_2
u=tbd
subroutine, public equations_linearity_type_set(EQUATIONS, LINEARITY_TYPE, ERR, ERROR,)
Sets/changes the linearity type for equations.
subroutine, public control_loop_create_start(PROBLEM, CONTROL_LOOP, ERR, ERROR,)
Start the process of creating a control loop for a problem.
integer(intg), parameter problem_setup_solver_equations_type
Solver equations setup for a problem.
Sets a boundary condition on the specified local DOF.
Contains information on the solver mapping between the global equation sets and the solver matrices...
integer(intg), parameter part_deriv_s1_s2
Cross derivative in the s1 and s2 direction i.e., d^2u/ds1ds2.
integer(intg), parameter part_deriv_s2_s2
Second partial derivative in the s2 direction i.e., d^2u/ds2ds2.
integer(intg), parameter problem_nonlinear_source_poisson_subtype
Contains information for a field variable defined on a field.
integer(intg), parameter equations_set_fd_solution_method
Finite Difference solution method.
integer(intg), parameter, public equations_matrices_sparse_matrices
Use sparse equations matrices.
subroutine poisson_pre_solve_update_input_data(CONTROL_LOOP, SOLVER, ERR, ERROR,)
Update boundary conditions for Poisson pre solve.
integer(intg), parameter equations_set_poisson_equation_three_dim_1
u=ln(6/(x+y+z+1^2))
integer(intg), parameter part_deriv_s3_s3
Second partial derivative in the s3 direction i.e., d^2u/ds3ds3.
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.
Contains information of the nolinear matrices and vectors for equations matrices. ...
subroutine poisson_post_solve_output_data(CONTROL_LOOP, SOLVER, ERR, ERROR,)
Output data post solve.
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.
subroutine, public poisson_finiteelementjacobianevaluate(EQUATIONS_SET, ELEMENT_NUMBER, ERR, ERROR,)
Evaluates the Jacobian element stiffness matrices and RHS for a Poisson equation finite element equat...
Calculates and returns the matrix-product A*B in the matrix C.
subroutine, public equationsmatrices_jacobiantypesset(equationsMatrices, jacobianTypes, err, error,)
Sets the Jacobian calculation types of the residual variables.
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.
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_nonlinear_pressure_poisson_subtype
Contains all information about a basis .
integer(intg), parameter equations_set_fv_solution_method
Finite Volume solution method.
integer(intg), parameter, public matrix_block_storage_type
Matrix block storage type.
integer(intg), parameter equations_set_pressure_poisson_three_dim_2
u=tbd, Pressure Poisson Equation (PPE) without input data
subroutine poisson_equationssetnonlinearsourcesetup(EQUATIONS_SET, EQUATIONS_SET_SETUP, ERR, ERROR,)
Sets up the standard Poisson equation for nonlinear sources.
subroutine, public poisson_finiteelementresidualevaluate(EQUATIONS_SET, ELEMENT_NUMBER, ERR, ERROR,)
Evaluates the residual element stiffness matrices and RHS for a Poisson equation finite element equat...
subroutine poisson_pre_solve_update_ppe_source(CONTROL_LOOP, SOLVER, ERR, ERROR,)
Update source for fitted PPE problem.
integer(intg), parameter equations_set_setup_initial_type
Initial setup.
recursive subroutine, public control_loop_create_finish(CONTROL_LOOP, ERR, ERROR,)
Finish the process of creating a control loop.
subroutine poisson_problemnonlinearsourcesetup(PROBLEM, PROBLEM_SETUP, ERR, ERROR,)
Sets up the nonlinear source Poisson equations problem.
subroutine poisson_equationssetextracellularbidomainsetup(EQUATIONS_SET, EQUATIONS_SET_SETUP, ERR, ERROR,)
Sets up the extracellular Bidomain equation.
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.
integer(intg), parameter equations_quasistatic
The equations are quasi-static.
integer(intg), parameter equations_set_setup_analytic_type
Analytic setup.
Flags an error condition.
integer(intg), parameter equations_set_poisson_equation_two_dim_3
u=tbd
subroutine, public poisson_boundaryconditionsanalyticcalculate(EQUATIONS_SET, BOUNDARY_CONDITIONS, ERR, ERROR,)
Calculates the analytic solution and sets the boundary conditions for an analytic problem...
integer(intg), parameter equations_set_pressure_poisson_three_dim_1
u=tbd, Pressure Poisson Equation (PPE) analytic
integer(intg), parameter problem_control_while_loop_type
While control loop.
integer(intg), parameter, public solver_linear_type
A linear solver.
Contains information of the RHS vector for equations matrices.
integer(intg), parameter equations_nonlinear
The equations are non-linear.
Contains information for mapping field variables to the linear matrices in the equations set of the m...
This module contains all kind definitions.
Temporary IO routines for fluid mechanics.
integer(intg), parameter equations_set_setup_finish_action
Finish setup action.