130 INTEGER(INTG),
INTENT(OUT) :: ERR
133 INTEGER(INTG) :: component_idx,deriv_idx,dim_idx,local_ny,node_idx,NUMBER_OF_DIMENSIONS,variable_idx,variable_type,version_idx
134 REAL(DP) ::
VALUE,X(3),INITIAL_VALUE
135 REAL(DP),
POINTER :: ANALYTIC_PARAMETERS(:),GEOMETRIC_PARAMETERS(:),MATERIALS_PARAMETERS(:)
138 TYPE(
field_type),
POINTER :: ANALYTIC_FIELD,DEPENDENT_FIELD,EQUATIONS_SET_FIELD_FIELD,GEOMETRIC_FIELD,MATERIALS_FIELD
139 TYPE(
field_variable_type),
POINTER :: ANALYTIC_VARIABLE,FIELD_VARIABLE,GEOMETRIC_VARIABLE,MATERIALS_VARIABLE
140 INTEGER(INTG),
POINTER :: EQUATIONS_SET_FIELD_DATA(:)
142 INTEGER(INTG) :: GLOBAL_DERIV_INDEX,ANALYTIC_FUNCTION_TYPE,imy_matrix
144 REAL(DP) :: TIME,NORMAL(3),TANGENTS(3,3)
147 enters(
"Diffusion_BoundaryConditionAnalyticCalculate",err,error,*999)
149 IF(
ASSOCIATED(equations_set))
THEN 150 IF(
ASSOCIATED(equations_set%ANALYTIC))
THEN 151 dependent_field=>equations_set%DEPENDENT%DEPENDENT_FIELD
152 IF(
ASSOCIATED(dependent_field))
THEN 153 geometric_field=>equations_set%GEOMETRY%GEOMETRIC_FIELD
154 IF(
ASSOCIATED(geometric_field))
THEN 155 analytic_function_type=equations_set%ANALYTIC%ANALYTIC_FUNCTION_TYPE
156 analytic_field=>equations_set%ANALYTIC%ANALYTIC_FIELD
157 CALL field_number_of_components_get(geometric_field,field_u_variable_type,number_of_dimensions,err,error,*999)
158 NULLIFY(geometric_variable)
159 NULLIFY(geometric_parameters)
160 CALL field_variable_get(geometric_field,field_u_variable_type,geometric_variable,err,error,*999)
161 CALL field_parameter_set_data_get(geometric_field,field_u_variable_type,field_values_set_type,geometric_parameters, &
163 NULLIFY(analytic_variable)
164 NULLIFY(analytic_parameters)
165 IF(
ASSOCIATED(analytic_field))
THEN 166 CALL field_variable_get(analytic_field,field_u_variable_type,analytic_variable,err,error,*999)
167 CALL field_parameter_set_data_get(analytic_field,field_u_variable_type,field_values_set_type, &
168 & analytic_parameters,err,error,*999)
170 NULLIFY(materials_field)
171 NULLIFY(materials_variable)
172 NULLIFY(materials_parameters)
173 IF(
ASSOCIATED(equations_set%MATERIALS))
THEN 174 materials_field=>equations_set%MATERIALS%MATERIALS_FIELD
175 CALL field_variable_get(materials_field,field_u_variable_type,materials_variable,err,error,*999)
176 CALL field_parameter_set_data_get(materials_field,field_u_variable_type,field_values_set_type, &
177 & materials_parameters,err,error,*999)
179 IF(
ASSOCIATED(boundary_conditions))
THEN 180 IF(.NOT.
ALLOCATED(equations_set%SPECIFICATION))
THEN 181 CALL flagerror(
"Equations set specification is not allocated.",err,error,*999)
182 ELSE IF(
SIZE(equations_set%SPECIFICATION,1)/=3)
THEN 183 CALL flagerror(
"Equations set specification must have three entries for a diffusion type equations set.", &
189 time=equations_set%ANALYTIC%ANALYTIC_USER_PARAMS(1)
191 equations_set_field_field=>equations_set%EQUATIONS_SET_FIELD%EQUATIONS_SET_FIELD_FIELD
192 CALL field_parameter_set_data_get(equations_set_field_field,field_u_variable_type, &
193 & field_values_set_type,equations_set_field_data,err,error,*999)
194 imy_matrix = equations_set_field_data(1)
196 variable_type=field_u_variable_type+(field_number_of_variable_subtypes*(imy_matrix-1))+variable_idx
198 field_variable=>dependent_field%VARIABLE_TYPE_MAP(variable_type)%PTR
199 IF(
ASSOCIATED(field_variable))
THEN 200 CALL field_parameter_set_create(dependent_field,variable_type,field_analytic_values_set_type,err,error,*999)
201 DO component_idx=1,field_variable%NUMBER_OF_COMPONENTS
202 IF(field_variable%COMPONENTS(component_idx)%INTERPOLATION_TYPE==field_node_based_interpolation)
THEN 203 domain=>field_variable%COMPONENTS(component_idx)%DOMAIN
204 IF(
ASSOCIATED(domain))
THEN 205 IF(
ASSOCIATED(domain%TOPOLOGY))
THEN 206 domain_nodes=>domain%TOPOLOGY%NODES
207 IF(
ASSOCIATED(domain_nodes))
THEN 209 DO node_idx=1,domain_nodes%NUMBER_OF_NODES
211 DO dim_idx=1,number_of_dimensions
213 local_ny=geometric_variable%COMPONENTS(dim_idx)%PARAM_TO_DOF_MAP%NODE_PARAM2DOF_MAP% &
214 & nodes(node_idx)%DERIVATIVES(1)%VERSIONS(1)
215 x(dim_idx)=geometric_parameters(local_ny)
218 DO deriv_idx=1,domain_nodes%NODES(node_idx)%NUMBER_OF_DERIVATIVES
219 global_deriv_index=domain_nodes%NODES(node_idx)%DERIVATIVES(deriv_idx)%GLOBAL_DERIVATIVE_INDEX
221 & x,tangents,normal,time,variable_type,global_deriv_index,component_idx, &
222 & analytic_parameters,materials_parameters,
VALUE,err,error,*999)
224 local_ny=field_variable%COMPONENTS(component_idx)%PARAM_TO_DOF_MAP% &
225 & node_param2dof_map%NODES(node_idx)%DERIVATIVES(deriv_idx)%VERSIONS(1)
226 CALL field_parameter_set_update_local_dof(dependent_field,variable_type, &
227 & field_analytic_values_set_type,local_ny,
VALUE,err,error,*999)
228 IF(mod(variable_type,field_number_of_variable_subtypes)==field_u_variable_type)
THEN 229 IF(domain_nodes%NODES(node_idx)%BOUNDARY_NODE)
THEN 234 CALL field_parameter_set_update_local_dof(dependent_field,variable_type, &
235 & field_values_set_type,local_ny,
VALUE,err,error,*999)
241 CALL flagerror(
"Domain topology nodes is not associated.",err,error,*999)
244 CALL flagerror(
"Domain topology is not associated.",err,error,*999)
247 CALL flagerror(
"Domain is not associated.",err,error,*999)
250 CALL flagerror(
"Only node based interpolation is implemented.",err,error,*999)
253 CALL field_parameter_set_update_start(dependent_field,variable_type,field_analytic_values_set_type, &
255 CALL field_parameter_set_update_finish(dependent_field,variable_type,field_analytic_values_set_type, &
257 CALL field_parameter_set_update_start(dependent_field,variable_type,field_values_set_type, &
259 CALL field_parameter_set_update_finish(dependent_field,variable_type,field_values_set_type, &
262 CALL flagerror(
"Field variable is not associated.",err,error,*999)
265 CALL field_parameter_set_data_restore(geometric_field,field_u_variable_type,field_values_set_type, &
266 & geometric_parameters,err,error,*999)
269 analytic_function_type=equations_set%ANALYTIC%ANALYTIC_FUNCTION_TYPE
270 time=equations_set%ANALYTIC%ANALYTIC_TIME
271 DO variable_idx=1,dependent_field%NUMBER_OF_VARIABLES
272 variable_type=dependent_field%VARIABLES(variable_idx)%VARIABLE_TYPE
273 field_variable=>dependent_field%VARIABLE_TYPE_MAP(variable_type)%PTR
274 IF(
ASSOCIATED(field_variable))
THEN 275 CALL field_parametersetensurecreated(dependent_field,variable_type,field_analytic_values_set_type, &
277 DO component_idx=1,field_variable%NUMBER_OF_COMPONENTS
278 IF(field_variable%COMPONENTS(component_idx)%INTERPOLATION_TYPE==field_node_based_interpolation)
THEN 279 domain=>field_variable%COMPONENTS(component_idx)%DOMAIN
280 IF(
ASSOCIATED(domain))
THEN 281 IF(
ASSOCIATED(domain%TOPOLOGY))
THEN 282 domain_nodes=>domain%TOPOLOGY%NODES
283 IF(
ASSOCIATED(domain_nodes))
THEN 285 DO node_idx=1,domain_nodes%NUMBER_OF_NODES
287 DO dim_idx=1,number_of_dimensions
289 local_ny=geometric_variable%COMPONENTS(dim_idx)%PARAM_TO_DOF_MAP%NODE_PARAM2DOF_MAP% &
290 & nodes(node_idx)%DERIVATIVES(1)%VERSIONS(1)
291 x(dim_idx)=geometric_parameters(local_ny)
294 DO deriv_idx=1,domain_nodes%NODES(node_idx)%NUMBER_OF_DERIVATIVES
295 global_deriv_index=domain_nodes%NODES(node_idx)%DERIVATIVES(deriv_idx)%GLOBAL_DERIVATIVE_INDEX
297 & x,tangents,normal,0.0_dp,variable_type,global_deriv_index,component_idx, &
298 & analytic_parameters,materials_parameters,initial_value,err,error,*999)
300 & x,tangents,normal,time,variable_type,global_deriv_index,component_idx, &
301 & analytic_parameters,materials_parameters,
VALUE,err,error,*999)
302 DO version_idx=1,domain_nodes%NODES(node_idx)%DERIVATIVES(deriv_idx)%numberOfVersions
303 local_ny=field_variable%COMPONENTS(component_idx)%PARAM_TO_DOF_MAP% &
304 & node_param2dof_map%NODES(node_idx)%DERIVATIVES(deriv_idx)%VERSIONS(version_idx)
305 CALL field_parameter_set_update_local_dof(dependent_field,variable_type, &
306 & field_analytic_values_set_type,local_ny,
VALUE,err,error,*999)
307 IF(variable_type==field_u_variable_type)
THEN 308 IF(domain_nodes%NODES(node_idx)%BOUNDARY_NODE)
THEN 314 CALL field_parameter_set_update_local_dof(dependent_field,variable_type, &
315 & field_values_set_type,local_ny,initial_value,err,error,*999)
322 CALL flagerror(
"Domain topology nodes is not associated.",err,error,*999)
325 CALL flagerror(
"Domain topology is not associated.",err,error,*999)
328 CALL flagerror(
"Domain is not associated.",err,error,*999)
331 CALL flagerror(
"Only node based interpolation is implemented.",err,error,*999)
334 CALL field_parameter_set_update_start(dependent_field,variable_type,field_analytic_values_set_type, &
336 CALL field_parameter_set_update_finish(dependent_field,variable_type,field_analytic_values_set_type, &
339 CALL flagerror(
"Field variable is not associated.",err,error,*999)
344 CALL field_parameter_set_data_restore(geometric_field,field_u_variable_type,field_values_set_type, &
345 & geometric_parameters,err,error,*999)
347 CALL flagerror(
"Equations set geometric field is not associated.",err,error,*999)
350 CALL flagerror(
"Equations set dependent field is not associated.",err,error,*999)
353 CALL flagerror(
"Equations set analytic is not associated.",err,error,*999)
356 CALL flagerror(
"Equations set is not associated.",err,error,*999)
359 exits(
"Diffusion_BoundaryConditionAnalyticCalculate")
361 999
errors(
"Diffusion_BoundaryConditionAnalyticCalculate",err,error)
362 exits(
"Diffusion_BoundaryConditionAnalyticCalculate")
373 & tangents,normal,time,variable_type,global_derivative,component_number,analytic_parameters,materials_parameters, &
378 INTEGER(INTG),
INTENT(IN) :: ANALYTIC_FUNCTION_TYPE
379 REAL(DP),
INTENT(IN) :: X(:)
380 REAL(DP),
INTENT(IN) :: TANGENTS(:,:)
381 REAL(DP),
INTENT(IN) :: NORMAL(:)
382 REAL(DP),
INTENT(IN) :: TIME
383 INTEGER(INTG),
INTENT(IN) :: VARIABLE_TYPE
384 INTEGER(INTG),
INTENT(IN) :: GLOBAL_DERIVATIVE
385 INTEGER(INTG),
INTENT(IN) :: COMPONENT_NUMBER
386 REAL(DP),
INTENT(IN) :: ANALYTIC_PARAMETERS(:)
387 REAL(DP),
INTENT(IN) :: MATERIALS_PARAMETERS(:)
388 REAL(DP),
INTENT(OUT) ::
VALUE 389 INTEGER(INTG),
INTENT(OUT) :: ERR
392 REAL(DP) :: k,phi,A,B,C,D,A1,A2,A3,A4
393 REAL(DP) :: A_PARAM,B_PARAM,C_PARAM,K_PARAM,L_PARAM,CONST_PARAM,BETA_PARAM,LAMBDA_PARAM,MU_PARAM
394 INTEGER(INTG) :: EQUATIONS_SUBTYPE
409 enters(
"Diffusion_AnalyticFunctionsEvaluate",err,error,*999)
411 IF(.NOT.
ASSOCIATED(equations_set))
THEN 412 CALL flagerror(
"Equations set is not associated.",err,error,*999)
414 IF(.NOT.
ALLOCATED(equations_set%SPECIFICATION))
THEN 415 CALL flagerror(
"Equations set specification is not allocated.",err,error,*999)
416 ELSE IF(
SIZE(equations_set%SPECIFICATION,1)/=3)
THEN 417 CALL flagerror(
"Equations set specification must have three entries for a diffusion type equations set.", &
420 equations_subtype=equations_set%SPECIFICATION(3)
423 SELECT CASE(equations_subtype)
425 SELECT CASE(analytic_function_type)
432 k_param=materials_parameters(1)
433 a_param=analytic_parameters(1)
434 b_param=analytic_parameters(2)
435 c_param=analytic_parameters(3)
436 l_param=analytic_parameters(4)
437 SELECT CASE(variable_type)
438 CASE(field_u_variable_type)
439 SELECT CASE(global_derivative)
441 VALUE=a_param*exp(4.0_dp*
pi**2*k_param*time/l_param**2)*cos(2.0_dp*
pi*x(1)/l_param+b_param)+c_param
443 CALL flagerror(
"Not implemented.",err,error,*999)
445 local_error=
"The global derivative index of "//
trim(
number_to_vstring(global_derivative,
"*",err,error))// &
447 CALL flagerror(local_error,err,error,*999)
449 CASE(field_deludeln_variable_type)
450 SELECT CASE(global_derivative)
454 CALL flagerror(
"Not implemented.",err,error,*999)
456 local_error=
"The global derivative index of "//
trim(
number_to_vstring(global_derivative,
"*",err,error))// &
458 CALL flagerror(local_error,err,error,*999)
463 CALL flagerror(local_error,err,error,*999)
467 SELECT CASE(variable_type)
468 CASE(field_u_variable_type)
469 SELECT CASE(global_derivative)
471 VALUE=exp(-k*time)*sin((sqrt(k))*(x(1)*cos(phi)+x(2)*sin(phi)))
473 CALL flagerror(
"Not implemented.",err,error,*999)
475 CALL flagerror(
"Not implemented.",err,error,*999)
477 CALL flagerror(
"Not implmented.",err,error,*999)
479 local_error=
"The global derivative index of "//
trim(
number_to_vstring(global_derivative,
"*",err,error))// &
481 CALL flagerror(local_error,err,error,*999)
483 CASE(field_deludeln_variable_type)
484 SELECT CASE(global_derivative)
488 CALL flagerror(
"Not implemented.",err,error,*999)
490 CALL flagerror(
"Not implemented.",err,error,*999)
492 CALL flagerror(
"Not implemented.",err,error,*999)
494 local_error=
"The global derivative index of "//
trim(
number_to_vstring(global_derivative,
"*",err,error))// &
496 CALL flagerror(local_error,err,error,*999)
501 CALL flagerror(local_error,err,error,*999)
505 SELECT CASE(variable_type)
506 CASE(field_u_variable_type)
507 SELECT CASE(global_derivative)
509 VALUE=a1*exp(-1.0_dp*time)*(x(1)*x(1)+x(2)*x(2)+x(3)*x(3))
511 CALL flagerror(
"Not implemented.",err,error,*999)
513 CALL flagerror(
"Not implemented.",err,error,*999)
515 CALL flagerror(
"Not implmented.",err,error,*999)
517 local_error=
"The global derivative index of "//
trim(
number_to_vstring(global_derivative,
"*",err,error))// &
519 CALL flagerror(local_error,err,error,*999)
521 CASE(field_deludeln_variable_type)
522 SELECT CASE(global_derivative)
526 CALL flagerror(
"Not implemented.",err,error,*999)
528 CALL flagerror(
"Not implemented.",err,error,*999)
530 CALL flagerror(
"Not implemented.",err,error,*999)
532 local_error=
"The global derivative index of "//
trim(
number_to_vstring(global_derivative,
"*",err,error))// &
534 CALL flagerror(local_error,err,error,*999)
539 CALL flagerror(local_error,err,error,*999)
542 local_error=
"The analytic function type of "// &
545 CALL flagerror(local_error,err,error,*999)
548 CALL flagerror(
"Not implemented.",err,error,*999)
550 SELECT CASE(analytic_function_type)
558 SELECT CASE(variable_type)
559 CASE(field_u_variable_type)
560 SELECT CASE(global_derivative)
562 VALUE=exp(a*time)*exp(b*x(1))*exp(c*x(2))*exp(d*x(3))
564 CALL flagerror(
"Not implemented.",err,error,*999)
566 CALL flagerror(
"Not implemented.",err,error,*999)
568 CALL flagerror(
"Not implmented.",err,error,*999)
570 local_error=
"The global derivative index of "//
trim(
number_to_vstring(global_derivative,
"*",err,error))// &
572 CALL flagerror(local_error,err,error,*999)
574 CASE(field_deludeln_variable_type)
575 SELECT CASE(global_derivative)
579 CALL flagerror(
"Not implemented.",err,error,*999)
581 CALL flagerror(
"Not implemented.",err,error,*999)
583 CALL flagerror(
"Not implemented.",err,error,*999)
585 local_error=
"The global derivative index of "//
trim(
number_to_vstring(global_derivative,
"*",err,error))// &
587 CALL flagerror(local_error,err,error,*999)
592 CALL flagerror(local_error,err,error,*999)
595 local_error=
"The analytic function type of "// &
598 CALL flagerror(local_error,err,error,*999)
601 SELECT CASE(analytic_function_type)
607 a_param=materials_parameters(1)
608 b_param=materials_parameters(2)
609 c_param=materials_parameters(3)
610 beta_param=sqrt(-c_param/b_param)
611 lambda_param=-5.0_dp*b_param/6.0_dp
612 mu_param=sqrt(b_param/6.0_dp)
614 SELECT CASE(variable_type)
615 CASE(field_u_variable_type)
616 SELECT CASE(global_derivative)
618 VALUE=1.0_dp/(beta_param+const_param*exp(lambda_param*time+mu_param*x(1)))**2
620 CALL flagerror(
"Not implemented.",err,error,*999)
622 local_error=
"The global derivative index of "//
trim(
number_to_vstring(global_derivative,
"*",err,error))// &
624 CALL flagerror(local_error,err,error,*999)
626 CASE(field_deludeln_variable_type)
627 SELECT CASE(global_derivative)
631 CALL flagerror(
"Not implemented.",err,error,*999)
633 local_error=
"The global derivative index of "//
trim(
number_to_vstring(global_derivative,
"*",err,error))// &
635 CALL flagerror(local_error,err,error,*999)
640 CALL flagerror(local_error,err,error,*999)
643 local_error=
"The analytic function type of "// &
646 CALL flagerror(local_error,err,error,*999)
649 SELECT CASE(analytic_function_type)
655 a_param=materials_parameters(1)
656 b_param=materials_parameters(2)
657 c_param=materials_parameters(3)
659 beta_param=sqrt(-b_param/a_param)
660 mu_param=sqrt(a_param*c_param/2.0_dp)
661 SELECT CASE(variable_type)
662 CASE(field_u_variable_type)
663 SELECT CASE(global_derivative)
665 VALUE=-2.0_dp/c_param*log(beta_param+const_param*exp(mu_param*x(1)-a_param*c_param*time/2.0_dp))
667 CALL flagerror(
"Not implemented.",err,error,*999)
669 local_error=
"The global derivative index of "//
trim(
number_to_vstring(global_derivative,
"*",err,error))// &
671 CALL flagerror(local_error,err,error,*999)
673 CASE(field_deludeln_variable_type)
674 SELECT CASE(global_derivative)
678 CALL flagerror(
"Not implemented.",err,error,*999)
680 local_error=
"The global derivative index of "//
trim(
number_to_vstring(global_derivative,
"*",err,error))// &
682 CALL flagerror(local_error,err,error,*999)
687 CALL flagerror(local_error,err,error,*999)
690 local_error=
"The analytic function type of "// &
693 CALL flagerror(local_error,err,error,*999)
696 CALL flagerror(
"Not implemented.",err,error,*999)
698 CALL flagerror(
"Not implemented.",err,error,*999)
700 CALL flagerror(
"Not implemented.",err,error,*999)
702 CALL flagerror(
"Not implemented.",err,error,*999)
704 SELECT CASE(analytic_function_type)
706 SELECT CASE(variable_type)
707 CASE(field_u_variable_type)
708 SELECT CASE(global_derivative)
710 VALUE=a1*exp(-1.0_dp*time)*(x(1)*x(1)+x(2)*x(2))
712 CALL flagerror(
"Not implemented.",err,error,*999)
714 CALL flagerror(
"Not implemented.",err,error,*999)
716 CALL flagerror(
"Not implmented.",err,error,*999)
718 local_error=
"The global derivative index of "//
trim(
number_to_vstring(global_derivative,
"*",err,error))// &
720 CALL flagerror(local_error,err,error,*999)
722 CASE(field_deludeln_variable_type)
723 SELECT CASE(global_derivative)
727 CALL flagerror(
"Not implemented.",err,error,*999)
729 CALL flagerror(
"Not implemented.",err,error,*999)
731 CALL flagerror(
"Not implemented.",err,error,*999)
733 local_error=
"The global derivative index of "//
trim(
number_to_vstring(global_derivative,
"*",err,error))// &
735 CALL flagerror(local_error,err,error,*999)
737 CASE(field_v_variable_type)
738 SELECT CASE(global_derivative)
740 VALUE=a2*exp(-1.0_dp*time)*(x(1)*x(1)+x(2)*x(2))
742 CALL flagerror(
"Not implemented.",err,error,*999)
744 CALL flagerror(
"Not implemented.",err,error,*999)
746 CALL flagerror(
"Not implmented.",err,error,*999)
748 local_error=
"The global derivative index of "//
trim(
number_to_vstring(global_derivative,
"*",err,error))// &
750 CALL flagerror(local_error,err,error,*999)
752 CASE(field_delvdeln_variable_type)
753 SELECT CASE(global_derivative)
757 CALL flagerror(
"Not implemented.",err,error,*999)
759 CALL flagerror(
"Not implemented.",err,error,*999)
761 CALL flagerror(
"Not implemented.",err,error,*999)
763 local_error=
"The global derivative index of "//
trim(
number_to_vstring(global_derivative,
"*",err,error))// &
765 CALL flagerror(local_error,err,error,*999)
770 CALL flagerror(local_error,err,error,*999)
773 SELECT CASE(variable_type)
774 CASE(field_u_variable_type)
775 SELECT CASE(global_derivative)
777 VALUE=a1*exp(-1.0_dp*time)*(x(1)*x(1)+x(2)*x(2)+x(3)*x(3))
779 CALL flagerror(
"Not implemented.",err,error,*999)
781 CALL flagerror(
"Not implemented.",err,error,*999)
783 CALL flagerror(
"Not implmented.",err,error,*999)
785 local_error=
"The global derivative index of "//
trim(
number_to_vstring(global_derivative,
"*",err,error))// &
787 CALL flagerror(local_error,err,error,*999)
789 CASE(field_deludeln_variable_type)
790 SELECT CASE(global_derivative)
794 CALL flagerror(
"Not implemented.",err,error,*999)
796 CALL flagerror(
"Not implemented.",err,error,*999)
798 CALL flagerror(
"Not implemented.",err,error,*999)
800 local_error=
"The global derivative index of "//
trim(
number_to_vstring(global_derivative,
"*",err,error))// &
802 CALL flagerror(local_error,err,error,*999)
804 CASE(field_v_variable_type)
805 SELECT CASE(global_derivative)
807 VALUE=a2*exp(-1.0_dp*time)*(x(1)*x(1)+x(2)*x(2)+x(3)*x(3))
809 CALL flagerror(
"Not implemented.",err,error,*999)
811 CALL flagerror(
"Not implemented.",err,error,*999)
813 CALL flagerror(
"Not implmented.",err,error,*999)
815 local_error=
"The global derivative index of "//
trim(
number_to_vstring(global_derivative,
"*",err,error))// &
817 CALL flagerror(local_error,err,error,*999)
819 CASE(field_delvdeln_variable_type)
820 SELECT CASE(global_derivative)
824 CALL flagerror(
"Not implemented.",err,error,*999)
826 CALL flagerror(
"Not implemented.",err,error,*999)
828 CALL flagerror(
"Not implemented.",err,error,*999)
830 local_error=
"The global derivative index of "//
trim(
number_to_vstring(global_derivative,
"*",err,error))// &
832 CALL flagerror(local_error,err,error,*999)
837 CALL flagerror(local_error,err,error,*999)
840 SELECT CASE(variable_type)
841 CASE(field_u_variable_type)
842 SELECT CASE(global_derivative)
844 VALUE=a1*exp(-1.0_dp*time)*(x(1)*x(1)+x(2)*x(2)+x(3)*x(3))
846 CALL flagerror(
"Not implemented.",err,error,*999)
848 CALL flagerror(
"Not implemented.",err,error,*999)
850 CALL flagerror(
"Not implmented.",err,error,*999)
852 local_error=
"The global derivative index of "//
trim(
number_to_vstring(global_derivative,
"*",err,error))// &
854 CALL flagerror(local_error,err,error,*999)
856 CASE(field_deludeln_variable_type)
857 SELECT CASE(global_derivative)
861 CALL flagerror(
"Not implemented.",err,error,*999)
863 CALL flagerror(
"Not implemented.",err,error,*999)
865 CALL flagerror(
"Not implemented.",err,error,*999)
867 local_error=
"The global derivative index of "//
trim(
number_to_vstring(global_derivative,
"*",err,error))// &
869 CALL flagerror(local_error,err,error,*999)
871 CASE(field_v_variable_type)
872 SELECT CASE(global_derivative)
874 VALUE=a2*exp(-1.0_dp*time)*(x(1)*x(1)+x(2)*x(2)+x(3)*x(3))
876 CALL flagerror(
"Not implemented.",err,error,*999)
878 CALL flagerror(
"Not implemented.",err,error,*999)
880 CALL flagerror(
"Not implmented.",err,error,*999)
882 local_error=
"The global derivative index of "//
trim(
number_to_vstring(global_derivative,
"*",err,error))// &
884 CALL flagerror(local_error,err,error,*999)
886 CASE(field_delvdeln_variable_type)
887 SELECT CASE(global_derivative)
891 CALL flagerror(
"Not implemented.",err,error,*999)
893 CALL flagerror(
"Not implemented.",err,error,*999)
895 CALL flagerror(
"Not implemented.",err,error,*999)
897 local_error=
"The global derivative index of "//
trim(
number_to_vstring(global_derivative,
"*",err,error))// &
899 CALL flagerror(local_error,err,error,*999)
901 CASE(field_u1_variable_type)
902 SELECT CASE(global_derivative)
904 VALUE=a3*exp(-1.0_dp*time)*(x(1)*x(1)+x(2)*x(2)+x(3)*x(3))
906 CALL flagerror(
"Not implemented.",err,error,*999)
908 CALL flagerror(
"Not implemented.",err,error,*999)
910 CALL flagerror(
"Not implmented.",err,error,*999)
912 local_error=
"The global derivative index of "//
trim(
number_to_vstring(global_derivative,
"*",err,error))// &
914 CALL flagerror(local_error,err,error,*999)
916 CASE(field_delu1deln_variable_type)
917 SELECT CASE(global_derivative)
921 CALL flagerror(
"Not implemented.",err,error,*999)
923 CALL flagerror(
"Not implemented.",err,error,*999)
925 CALL flagerror(
"Not implemented.",err,error,*999)
927 local_error=
"The global derivative index of "//
trim(
number_to_vstring(global_derivative,
"*",err,error))// &
929 CALL flagerror(local_error,err,error,*999)
931 CASE(field_u2_variable_type)
932 SELECT CASE(global_derivative)
934 VALUE=a4*exp(-1.0_dp*time)*(x(1)*x(1)+x(2)*x(2)+x(3)*x(3))
936 CALL flagerror(
"Not implemented.",err,error,*999)
938 CALL flagerror(
"Not implemented.",err,error,*999)
940 CALL flagerror(
"Not implmented.",err,error,*999)
942 local_error=
"The global derivative index of "//
trim(
number_to_vstring(global_derivative,
"*",err,error))// &
944 CALL flagerror(local_error,err,error,*999)
946 CASE(field_delu2deln_variable_type)
947 SELECT CASE(global_derivative)
951 CALL flagerror(
"Not implemented.",err,error,*999)
953 CALL flagerror(
"Not implemented.",err,error,*999)
955 CALL flagerror(
"Not implemented.",err,error,*999)
957 local_error=
"The global derivative index of "//
trim(
number_to_vstring(global_derivative,
"*",err,error))// &
959 CALL flagerror(local_error,err,error,*999)
964 CALL flagerror(local_error,err,error,*999)
967 local_error=
"The analytic function type of "// &
970 CALL flagerror(local_error,err,error,*999)
973 local_error=
"The equations set subtype of "//
trim(
number_to_vstring(equations_subtype,
"*",err,error))// &
975 CALL flagerror(local_error,err,error,*999)
978 exits(
"Diffusion_AnalyticFunctionsEvaluate")
980 999 errorsexits(
"Diffusion_AnalyticFunctionsEvaluate",err,error)
994 INTEGER(INTG),
INTENT(OUT) :: ERR
999 enters(
"DIFFUSION_EQUATION_EQUATIONS_SET_SETUP",err,error,*999)
1001 IF(
ASSOCIATED(equations_set))
THEN 1002 IF(.NOT.
ALLOCATED(equations_set%SPECIFICATION))
THEN 1003 CALL flagerror(
"Equations set specification is not allocated.",err,error,*999)
1004 ELSE IF(
SIZE(equations_set%SPECIFICATION,1)/=3)
THEN 1005 CALL flagerror(
"Equations set specification must have three entries for a diffusion type equations set.", &
1008 SELECT CASE(equations_set%SPECIFICATION(3))
1036 CALL flagerror(
"Not implemented.",err,error,*999)
1039 CALL flagerror(
"Not implemented.",err,error,*999)
1042 local_error=
"Equations set subtype "//
trim(
number_to_vstring(equations_set%SPECIFICATION(3),
"*",err,error))// &
1043 &
" is not valid for a diffusion equation type of a classical field equation set class." 1044 CALL flagerror(local_error,err,error,*999)
1047 CALL flagerror(
"Equations set is not associated.",err,error,*999)
1050 exits(
"DIFFUSION_EQUATION_EQUATIONS_SET_SETUP")
1052 999 errorsexits(
"DIFFUSION_EQUATION_EQUATIONS_SET_SETUP",err,error)
1065 INTEGER(INTG),
INTENT(IN) :: SOLUTION_METHOD
1066 INTEGER(INTG),
INTENT(OUT) :: ERR
1071 enters(
"Diffusion_EquationsSetSolutionMethodSet",err,error,*999)
1073 IF(
ASSOCIATED(equations_set))
THEN 1074 IF(.NOT.
ALLOCATED(equations_set%SPECIFICATION))
THEN 1075 CALL flagerror(
"Equations set specification is not allocated.",err,error,*999)
1076 ELSE IF(
SIZE(equations_set%SPECIFICATION,1)/=3)
THEN 1077 CALL flagerror(
"Equations set specification must have three entries for a diffusion type equations set.", &
1080 SELECT CASE(equations_set%SPECIFICATION(3))
1089 SELECT CASE(solution_method)
1093 CALL flagerror(
"Not implemented.",err,error,*999)
1095 CALL flagerror(
"Not implemented.",err,error,*999)
1097 CALL flagerror(
"Not implemented.",err,error,*999)
1099 CALL flagerror(
"Not implemented.",err,error,*999)
1101 CALL flagerror(
"Not implemented.",err,error,*999)
1103 local_error=
"The specified solution method of "//
trim(
number_to_vstring(solution_method,
"*",err,error))//
" is invalid." 1104 CALL flagerror(local_error,err,error,*999)
1107 local_error=
"Equations set subtype of "//
trim(
number_to_vstring(equations_set%SPECIFICATION(3),
"*",err,error))// &
1108 &
" is not valid for a diffusion equation type of an classical field equations set class." 1109 CALL flagerror(local_error,err,error,*999)
1112 CALL flagerror(
"Equations set is not associated.",err,error,*999)
1115 exits(
"Diffusion_EquationsSetSolutionMethodSet")
1117 999
errors(
"Diffusion_EquationsSetSolutionMethodSet",err,error)
1118 exits(
"Diffusion_EquationsSetSolutionMethodSet")
1132 INTEGER(INTG),
INTENT(IN) :: specification(:)
1133 INTEGER(INTG),
INTENT(OUT) :: err
1137 INTEGER(INTG) :: subtype
1139 enters(
"Diffusion_EquationsSetSpecificationSet",err,error,*999)
1141 IF(
ASSOCIATED(equationsset))
THEN 1142 IF(
SIZE(specification,1)/=3)
THEN 1143 CALL flagerror(
"Equations set specification must have three entries for a diffusion type equations set.", &
1146 subtype=specification(3)
1147 SELECT CASE(subtype)
1164 localerror=
"The third equations set specification of "//
trim(
numbertovstring(subtype,
"*",err,error))// &
1165 &
" is not valid for a diffusion type of a classical field equations set." 1166 CALL flagerror(localerror,err,error,*999)
1169 IF(
ALLOCATED(equationsset%specification))
THEN 1170 CALL flagerror(
"Equations set specification is already allocated.",err,error,*999)
1172 ALLOCATE(equationsset%specification(3),stat=err)
1173 IF(err/=0)
CALL flagerror(
"Could not allocate equations set specification.",err,error,*999)
1177 CALL flagerror(
"Equations set is not associated.",err,error,*999)
1180 exits(
"Diffusion_EquationsSetSpecificationSet")
1182 999
errors(
"Diffusion_EquationsSetSpecificationSet",err,error)
1183 exits(
"Diffusion_EquationsSetSpecificationSet")
1198 INTEGER(INTG),
INTENT(OUT) :: ERR
1201 INTEGER(INTG) :: component_idx,GEOMETRIC_MESH_COMPONENT,GEOMETRIC_SCALING_TYPE,NUMBER_OF_ANALYTIC_COMPONENTS, &
1202 & NUMBER_OF_DIMENSIONS, NUMBER_OF_MATERIALS_COMPONENTS, NUMBER_OF_SOURCE_COMPONENTS,imy_matrix,Ncompartments, &
1203 & GEOMETRIC_COMPONENT_NUMBER
1212 TYPE(
field_type),
POINTER :: ANALYTIC_FIELD,DEPENDENT_FIELD,GEOMETRIC_FIELD,EQUATIONS_SET_FIELD_FIELD
1214 INTEGER(INTG) :: num_var,num_var_count,NUMBER_OF_MATERIALS_COUPLING_COMPONENTS
1215 INTEGER(INTG) :: EQUATIONS_SET_FIELD_NUMBER_OF_VARIABLES,EQUATIONS_SET_FIELD_NUMBER_OF_COMPONENTS
1216 INTEGER(INTG),
POINTER :: EQUATIONS_SET_FIELD_DATA(:)
1217 INTEGER(INTG),
ALLOCATABLE :: VARIABLE_TYPES(:),VARIABLE_U_TYPES(:),COUPLING_MATRIX_STORAGE_TYPE(:), &
1218 & COUPLING_MATRIX_STRUCTURE_TYPE(:)
1220 enters(
"Diffusion_EquationsSetLinearSetup",err,error,*999)
1223 NULLIFY(equations_mapping)
1224 NULLIFY(equations_matrices)
1225 NULLIFY(geometric_decomposition)
1227 IF(
ASSOCIATED(equations_set))
THEN 1228 IF(.NOT.
ALLOCATED(equations_set%SPECIFICATION))
THEN 1229 CALL flagerror(
"Equations set specification is not allocated.",err,error,*999)
1230 ELSE IF(
SIZE(equations_set%SPECIFICATION,1)/=3)
THEN 1231 CALL flagerror(
"Equations set specification must have three entries for a diffusion type equations set.", &
1244 SELECT CASE(equations_set_setup%SETUP_TYPE)
1246 SELECT CASE(equations_set_setup%ACTION_TYPE)
1253 equations_set_field_number_of_variables = 1
1254 equations_set_field_number_of_components = 2
1255 equations_equations_set_field=>equations_set%EQUATIONS_SET_FIELD
1256 IF(equations_equations_set_field%EQUATIONS_SET_FIELD_AUTO_CREATED)
THEN 1258 CALL field_create_start(equations_set_setup%FIELD_USER_NUMBER,equations_set%REGION, &
1259 & equations_equations_set_field%EQUATIONS_SET_FIELD_FIELD,err,error,*999)
1260 CALL field_label_set(equations_equations_set_field%EQUATIONS_SET_FIELD_FIELD,
"Equations Set Field",err,error,*999)
1261 CALL field_type_set_and_lock(equations_equations_set_field%EQUATIONS_SET_FIELD_FIELD,field_general_type,&
1263 CALL field_dependent_type_set_and_lock(equations_equations_set_field%EQUATIONS_SET_FIELD_FIELD,&
1264 & field_independent_type,err,error,*999)
1265 CALL field_number_of_variables_set(equations_equations_set_field%EQUATIONS_SET_FIELD_FIELD, &
1266 & equations_set_field_number_of_variables,err,error,*999)
1267 CALL field_variable_types_set_and_lock(equations_equations_set_field%EQUATIONS_SET_FIELD_FIELD,&
1268 & [field_u_variable_type],err,error,*999)
1269 CALL field_variable_label_set(equations_equations_set_field%EQUATIONS_SET_FIELD_FIELD,field_u_variable_type, &
1270 &
"Equations",err,error,*999)
1271 CALL field_dimension_set_and_lock(equations_equations_set_field%EQUATIONS_SET_FIELD_FIELD,field_u_variable_type, &
1272 & field_vector_dimension_type,err,error,*999)
1273 CALL field_data_type_set_and_lock(equations_equations_set_field%EQUATIONS_SET_FIELD_FIELD,field_u_variable_type, &
1274 & field_intg_type,err,error,*999)
1275 CALL field_number_of_components_set_and_lock(equations_equations_set_field%EQUATIONS_SET_FIELD_FIELD,&
1276 & field_u_variable_type,equations_set_field_number_of_components,err,error,*999)
1279 CALL field_type_check(equations_set_setup%FIELD,field_general_type,err,error,*999)
1280 CALL field_dependent_type_check(equations_set_setup%FIELD,field_independent_type,err,error,*999)
1281 CALL field_number_of_variables_check(equations_set_setup%FIELD,equations_set_field_number_of_variables, &
1283 CALL field_variable_types_check(equations_set_setup%FIELD,[field_u_variable_type],err,error,*999)
1284 CALL field_dimension_check(equations_set_setup%FIELD,field_u_variable_type,field_vector_dimension_type, &
1286 CALL field_data_type_check(equations_set_setup%FIELD,field_u_variable_type,field_intg_type,err,error,*999)
1287 CALL field_number_of_components_check(equations_set_setup%FIELD,field_u_variable_type, &
1288 & equations_set_field_number_of_components,err,error,*999)
1295 IF(equations_set%EQUATIONS_SET_FIELD%EQUATIONS_SET_FIELD_AUTO_CREATED)
THEN 1296 CALL field_create_finish(equations_set%EQUATIONS_SET_FIELD%EQUATIONS_SET_FIELD_FIELD,err,error,*999)
1297 CALL field_component_values_initialise(equations_set%EQUATIONS_SET_FIELD%EQUATIONS_SET_FIELD_FIELD,&
1298 & field_u_variable_type,field_values_set_type, 1, 1_intg, err, error, *999)
1299 CALL field_component_values_initialise(equations_set%EQUATIONS_SET_FIELD%EQUATIONS_SET_FIELD_FIELD,&
1300 & field_u_variable_type,field_values_set_type, 2, 1_intg, err, error, *999)
1305 local_error=
"The action type of "//
trim(
number_to_vstring(equations_set_setup%ACTION_TYPE,
"*",err,error))// &
1306 &
" for a setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
1307 &
" is invalid for a linear diffusion equation." 1308 CALL flagerror(local_error,err,error,*999)
1311 SELECT CASE(equations_set%SPECIFICATION(3))
1318 SELECT CASE(equations_set_setup%ACTION_TYPE)
1320 equations_set_field_number_of_components = 2
1321 equations_equations_set_field=>equations_set%EQUATIONS_SET_FIELD
1322 IF(equations_equations_set_field%EQUATIONS_SET_FIELD_AUTO_CREATED)
THEN 1323 CALL field_mesh_decomposition_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_decomposition,err,error,*999)
1324 CALL field_mesh_decomposition_set_and_lock(equations_equations_set_field%EQUATIONS_SET_FIELD_FIELD,&
1325 & geometric_decomposition,err,error,*999)
1326 CALL field_geometric_field_set_and_lock(equations_equations_set_field%EQUATIONS_SET_FIELD_FIELD,&
1327 & equations_set%GEOMETRY%GEOMETRIC_FIELD,err,error,*999)
1328 CALL field_component_mesh_component_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
1329 & 1,geometric_component_number,err,error,*999)
1330 DO component_idx = 1, equations_set_field_number_of_components
1331 CALL field_component_mesh_component_set_and_lock(equations_set%EQUATIONS_SET_FIELD%EQUATIONS_SET_FIELD_FIELD, &
1332 & field_u_variable_type,component_idx,geometric_component_number,err,error,*999)
1333 CALL field_component_interpolation_set_and_lock(equations_set%EQUATIONS_SET_FIELD%EQUATIONS_SET_FIELD_FIELD, &
1334 & field_u_variable_type,component_idx,field_constant_interpolation,err,error,*999)
1337 CALL field_scaling_type_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_scaling_type,err,error,*999)
1338 CALL field_scaling_type_set(equations_set%EQUATIONS_SET_FIELD%EQUATIONS_SET_FIELD_FIELD,geometric_scaling_type, &
1346 local_error=
"The action type of "//
trim(
number_to_vstring(equations_set_setup%ACTION_TYPE,
"*",err,error))// &
1347 &
" for a setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
1348 &
" is invalid for a linear diffusion equation." 1349 CALL flagerror(local_error,err,error,*999)
1354 SELECT CASE(equations_set_setup%ACTION_TYPE)
1356 CALL field_parameter_set_create(equations_set%GEOMETRY%GEOMETRIC_FIELD, field_u_variable_type, &
1357 & field_mesh_displacement_set_type, err, error, *999)
1358 CALL field_parameter_set_create(equations_set%GEOMETRY%GEOMETRIC_FIELD, field_u_variable_type, &
1359 & field_mesh_velocity_set_type, err, error, *999)
1363 local_error=
"The action type of "//
trim(
number_to_vstring(equations_set_setup%ACTION_TYPE,
"*",err,error))// &
1364 &
" for a setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
1365 &
" is invalid for a linear diffusion equation." 1366 CALL flagerror(local_error,err,error,*999)
1373 SELECT CASE(equations_set_setup%ACTION_TYPE)
1375 SELECT CASE(equations_set%SPECIFICATION(3))
1384 IF(equations_set%DEPENDENT%DEPENDENT_FIELD_AUTO_CREATED)
THEN 1386 CALL field_create_start(equations_set_setup%FIELD_USER_NUMBER,equations_set%REGION,equations_set%DEPENDENT% &
1387 & dependent_field,err,error,*999)
1388 CALL field_label_set(equations_set%DEPENDENT%DEPENDENT_FIELD,
"Dependent Field",err,error,*999)
1389 CALL field_type_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_general_type,err,error,*999)
1390 CALL field_dependent_type_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_dependent_type,err,error,*999)
1391 CALL field_mesh_decomposition_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_decomposition,err,error,*999)
1392 CALL field_mesh_decomposition_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,geometric_decomposition, &
1394 CALL field_geometric_field_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,equations_set%GEOMETRY% &
1395 & geometric_field,err,error,*999)
1396 CALL field_number_of_variables_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,2,err,error,*999)
1397 CALL field_variable_types_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,[field_u_variable_type, &
1398 & field_deludeln_variable_type],err,error,*999)
1399 CALL field_variable_label_set(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type, &
1400 &
"U",err,error,*999)
1401 CALL field_variable_label_set(equations_set%DEPENDENT%DEPENDENT_FIELD,field_deludeln_variable_type, &
1402 &
"del U/del n",err,error,*999)
1403 CALL field_dimension_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type, &
1404 & field_scalar_dimension_type,err,error,*999)
1405 CALL field_dimension_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_deludeln_variable_type, &
1406 & field_scalar_dimension_type,err,error,*999)
1407 CALL field_data_type_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type, &
1408 & field_dp_type,err,error,*999)
1409 CALL field_data_type_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_deludeln_variable_type, &
1410 & field_dp_type,err,error,*999)
1411 CALL field_number_of_components_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type,1, &
1413 CALL field_number_of_components_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD, &
1414 & field_deludeln_variable_type,1,err,error,*999)
1416 CALL field_component_mesh_component_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type,1, &
1417 & geometric_mesh_component,err,error,*999)
1418 CALL field_component_mesh_component_set(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type,1, &
1419 & geometric_mesh_component,err,error,*999)
1420 CALL field_component_mesh_component_set(equations_set%DEPENDENT%DEPENDENT_FIELD,field_deludeln_variable_type,1, &
1421 & geometric_mesh_component,err,error,*999)
1422 SELECT CASE(equations_set%SOLUTION_METHOD)
1424 CALL field_component_interpolation_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD, &
1425 & field_u_variable_type,1,field_node_based_interpolation,err,error,*999)
1426 CALL field_component_interpolation_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD, &
1427 & field_deludeln_variable_type,1,field_node_based_interpolation,err,error,*999)
1429 CALL field_scaling_type_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_scaling_type,err,error,*999)
1430 CALL field_scaling_type_set(equations_set%DEPENDENT%DEPENDENT_FIELD,geometric_scaling_type,err,error,*999)
1432 CALL flagerror(
"Not implemented.",err,error,*999)
1434 CALL flagerror(
"Not implemented.",err,error,*999)
1436 CALL flagerror(
"Not implemented.",err,error,*999)
1438 CALL flagerror(
"Not implemented.",err,error,*999)
1440 CALL flagerror(
"Not implemented.",err,error,*999)
1442 local_error=
"The solution method of "//
trim(
number_to_vstring(equations_set%SOLUTION_METHOD,
"*",err,error))// &
1444 CALL flagerror(local_error,err,error,*999)
1447 SELECT CASE(equations_set%SPECIFICATION(3))
1450 CALL field_type_check(equations_set_setup%FIELD,field_general_type,err,error,*999)
1451 CALL field_dependent_type_check(equations_set_setup%FIELD,field_dependent_type,err,error,*999)
1452 CALL field_number_of_variables_check(equations_set_setup%FIELD,4,err,error,*999)
1453 CALL field_variable_types_check(equations_set_setup%FIELD,[field_u_variable_type,field_deludeln_variable_type, &
1454 & field_v_variable_type,field_delvdeln_variable_type],err,error,*999)
1455 CALL field_dimension_check(equations_set_setup%FIELD,field_u_variable_type, &
1456 & field_scalar_dimension_type,err,error,*999)
1457 CALL field_dimension_check(equations_set_setup%FIELD,field_deludeln_variable_type,field_scalar_dimension_type, &
1459 CALL field_dimension_check(equations_set_setup%FIELD,field_v_variable_type, &
1460 & field_scalar_dimension_type,err,error,*999)
1461 CALL field_dimension_check(equations_set_setup%FIELD,field_delvdeln_variable_type,field_scalar_dimension_type, &
1463 CALL field_data_type_check(equations_set_setup%FIELD,field_u_variable_type,field_dp_type,err,error,*999)
1464 CALL field_data_type_check(equations_set_setup%FIELD,field_deludeln_variable_type,field_dp_type,err,error,*999)
1465 CALL field_data_type_check(equations_set_setup%FIELD,field_v_variable_type,field_dp_type,err,error,*999)
1466 CALL field_data_type_check(equations_set_setup%FIELD,field_delvdeln_variable_type,field_dp_type,err,error,*999)
1467 CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
1468 & number_of_dimensions,err,error,*999)
1469 CALL field_number_of_components_check(equations_set_setup%FIELD,field_u_variable_type,1, &
1471 CALL field_number_of_components_check(equations_set_setup%FIELD,field_deludeln_variable_type,1, &
1473 CALL field_number_of_components_check(equations_set_setup%FIELD,field_v_variable_type,1, &
1475 CALL field_number_of_components_check(equations_set_setup%FIELD,field_delvdeln_variable_type,1, &
1477 SELECT CASE(equations_set%SOLUTION_METHOD)
1480 CALL field_component_interpolation_check(equations_set_setup%FIELD,field_u_variable_type,component_idx, &
1481 & field_node_based_interpolation,err,error,*999)
1482 CALL field_component_interpolation_check(equations_set_setup%FIELD,field_deludeln_variable_type, &
1483 & component_idx,field_node_based_interpolation,err,error,*999)
1484 CALL field_component_interpolation_check(equations_set_setup%FIELD,field_v_variable_type,component_idx, &
1485 & field_node_based_interpolation,err,error,*999)
1486 CALL field_component_interpolation_check(equations_set_setup%FIELD,field_delvdeln_variable_type, &
1487 & component_idx,field_node_based_interpolation,err,error,*999)
1489 CALL flagerror(
"Not implemented.",err,error,*999)
1491 CALL flagerror(
"Not implemented.",err,error,*999)
1493 CALL flagerror(
"Not implemented.",err,error,*999)
1495 CALL flagerror(
"Not implemented.",err,error,*999)
1497 CALL flagerror(
"Not implemented.",err,error,*999)
1499 local_error=
"The solution method of "//
trim(
number_to_vstring(equations_set%SOLUTION_METHOD,
"*",err,error))// &
1501 CALL flagerror(local_error,err,error,*999)
1507 CALL field_type_check(equations_set_setup%FIELD,field_general_type,err,error,*999)
1508 CALL field_dependent_type_check(equations_set_setup%FIELD,field_dependent_type,err,error,*999)
1509 equations_set_field_field=>equations_set%EQUATIONS_SET_FIELD%EQUATIONS_SET_FIELD_FIELD
1510 CALL field_parameter_set_data_get(equations_set_field_field,field_u_variable_type, &
1511 & field_values_set_type,equations_set_field_data,err,error,*999)
1512 ncompartments=equations_set_field_data(2)
1513 CALL field_number_of_variables_check(equations_set_setup%FIELD,2*ncompartments,err,error,*999)
1515 ALLOCATE(variable_types(2*ncompartments))
1516 DO num_var=1,ncompartments
1517 variable_types(2*num_var-1)=field_u_variable_type+(field_number_of_variable_subtypes*(num_var-1))
1518 variable_types(2*num_var)=field_deludeln_variable_type+(field_number_of_variable_subtypes*(num_var-1))
1520 CALL field_variable_types_check(equations_set_setup%FIELD,variable_types,err,error,*999)
1522 DO num_var=1,2*ncompartments
1523 CALL field_dimension_check(equations_set_setup%FIELD,variable_types(num_var), &
1524 & field_scalar_dimension_type,err,error,*999)
1525 CALL field_data_type_check(equations_set_setup%FIELD,variable_types(num_var),field_dp_type,err,error,*999)
1526 CALL field_number_of_components_check(equations_set_setup%FIELD,variable_types(num_var),1, &
1529 CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
1530 & number_of_dimensions,err,error,*999)
1531 SELECT CASE(equations_set%SOLUTION_METHOD)
1534 DO num_var=1,2*ncompartments
1535 CALL field_component_interpolation_check(equations_set_setup%FIELD,variable_types(num_var),component_idx, &
1536 & field_node_based_interpolation,err,error,*999)
1539 CALL flagerror(
"Not implemented.",err,error,*999)
1541 CALL flagerror(
"Not implemented.",err,error,*999)
1543 CALL flagerror(
"Not implemented.",err,error,*999)
1545 CALL flagerror(
"Not implemented.",err,error,*999)
1547 CALL flagerror(
"Not implemented.",err,error,*999)
1549 local_error=
"The solution method of "//
trim(
number_to_vstring(equations_set%SOLUTION_METHOD,
"*",err,error))// &
1551 CALL flagerror(local_error,err,error,*999)
1555 CALL flagerror(
"Not implemented.",err,error,*999)
1558 CALL field_type_check(equations_set_setup%FIELD,field_general_type,err,error,*999)
1559 CALL field_dependent_type_check(equations_set_setup%FIELD,field_dependent_type,err,error,*999)
1560 CALL field_number_of_variables_check(equations_set_setup%FIELD,2,err,error,*999)
1561 CALL field_variable_types_check(equations_set_setup%FIELD,[field_u_variable_type, &
1562 & field_deludeln_variable_type],err,error,*999)
1563 CALL field_dimension_check(equations_set_setup%FIELD,field_u_variable_type,field_scalar_dimension_type, &
1565 CALL field_dimension_check(equations_set_setup%FIELD,field_deludeln_variable_type,field_scalar_dimension_type, &
1567 CALL field_data_type_check(equations_set_setup%FIELD,field_u_variable_type,field_dp_type,err,error,*999)
1568 CALL field_data_type_check(equations_set_setup%FIELD,field_deludeln_variable_type,field_dp_type,err,error,*999)
1569 CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
1570 & number_of_dimensions,err,error,*999)
1571 CALL field_number_of_components_check(equations_set_setup%FIELD,field_u_variable_type,number_of_dimensions, &
1573 CALL field_number_of_components_check(equations_set_setup%FIELD,field_deludeln_variable_type, &
1574 & number_of_dimensions,err,error,*999)
1575 SELECT CASE(equations_set%SOLUTION_METHOD)
1577 DO component_idx=1,number_of_dimensions
1578 CALL field_component_interpolation_check(equations_set_setup%FIELD,field_u_variable_type,component_idx, &
1579 & field_node_based_interpolation,err,error,*999)
1580 CALL field_component_interpolation_check(equations_set_setup%FIELD,field_deludeln_variable_type, &
1581 & component_idx,field_node_based_interpolation,err,error,*999)
1584 CALL flagerror(
"Not implemented.",err,error,*999)
1586 CALL flagerror(
"Not implemented.",err,error,*999)
1588 CALL flagerror(
"Not implemented.",err,error,*999)
1590 CALL flagerror(
"Not implemented.",err,error,*999)
1592 CALL flagerror(
"Not implemented.",err,error,*999)
1594 local_error=
"The solution method of "//
trim(
number_to_vstring(equations_set%SOLUTION_METHOD,
"*",err,error))// &
1596 CALL flagerror(local_error,err,error,*999)
1602 IF(equations_set%DEPENDENT%DEPENDENT_FIELD_AUTO_CREATED)
THEN 1603 CALL field_create_finish(equations_set%DEPENDENT%DEPENDENT_FIELD,err,error,*999)
1606 local_error=
"The action type of "//
trim(
number_to_vstring(equations_set_setup%ACTION_TYPE,
"*",err,error))// &
1607 &
" for a setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
1608 &
" is invalid for a linear diffusion equation" 1609 CALL flagerror(local_error,err,error,*999)
1615 SELECT CASE(equations_set_setup%ACTION_TYPE)
1617 equations_materials=>equations_set%MATERIALS
1618 IF(
ASSOCIATED(equations_materials))
THEN 1619 IF(equations_materials%MATERIALS_FIELD_AUTO_CREATED)
THEN 1621 SELECT CASE(equations_set%SPECIFICATION(3))
1629 CALL field_create_start(equations_set_setup%FIELD_USER_NUMBER,equations_set%REGION,equations_materials% &
1630 & materials_field,err,error,*999)
1631 CALL field_label_set(equations_materials%MATERIALS_FIELD,
"Materials Field",err,error,*999)
1632 CALL field_type_set_and_lock(equations_materials%MATERIALS_FIELD,field_material_type,err,error,*999)
1633 CALL field_dependent_type_set_and_lock(equations_materials%MATERIALS_FIELD,field_independent_type,err,error,*999)
1634 CALL field_mesh_decomposition_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_decomposition,err,error,*999)
1635 CALL field_mesh_decomposition_set_and_lock(equations_materials%MATERIALS_FIELD,geometric_decomposition, &
1637 CALL field_geometric_field_set_and_lock(equations_materials%MATERIALS_FIELD,equations_set%GEOMETRY% &
1638 & geometric_field,err,error,*999)
1639 CALL field_number_of_variables_set_and_lock(equations_materials%MATERIALS_FIELD,1,err,error,*999)
1640 CALL field_variable_types_set_and_lock(equations_materials%MATERIALS_FIELD,[field_u_variable_type], &
1642 CALL field_variable_label_set(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
1643 &
"Materials",err,error,*999)
1644 CALL field_dimension_set_and_lock(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
1645 & field_vector_dimension_type,err,error,*999)
1646 CALL field_data_type_set_and_lock(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
1647 & field_dp_type,err,error,*999)
1648 CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
1649 & number_of_dimensions,err,error,*999)
1654 number_of_materials_components=number_of_dimensions
1659 number_of_materials_components=number_of_dimensions+1
1661 number_of_materials_components=number_of_dimensions+2
1664 CALL field_number_of_components_set_and_lock(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
1665 & number_of_materials_components,err,error,*999)
1667 DO component_idx=1,number_of_dimensions
1668 CALL field_component_mesh_component_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
1669 & component_idx,geometric_mesh_component,err,error,*999)
1670 CALL field_component_interpolation_set(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
1671 & component_idx,field_constant_interpolation,err,error,*999)
1672 CALL field_component_mesh_component_set(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
1673 & component_idx,geometric_mesh_component,err,error,*999)
1679 CALL field_component_mesh_component_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
1680 & 1,geometric_mesh_component,err,error,*999)
1681 DO component_idx=number_of_dimensions+1,number_of_materials_components
1682 CALL field_component_mesh_component_set(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
1683 & component_idx,geometric_mesh_component,err,error,*999)
1684 CALL field_component_interpolation_set(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
1685 & component_idx,field_constant_interpolation,err,error,*999)
1689 CALL field_scaling_type_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_scaling_type,err,error,*999)
1690 CALL field_scaling_type_set(equations_materials%MATERIALS_FIELD,geometric_scaling_type,err,error,*999)
1692 CALL field_create_start(equations_set_setup%FIELD_USER_NUMBER,equations_set%REGION,equations_materials% &
1693 & materials_field,err,error,*999)
1694 CALL field_label_set(equations_materials%MATERIALS_FIELD,
"Materials Field",err,error,*999)
1695 CALL field_type_set_and_lock(equations_materials%MATERIALS_FIELD,field_material_type,err,error,*999)
1696 CALL field_dependent_type_set_and_lock(equations_materials%MATERIALS_FIELD,field_independent_type,err,error,*999)
1697 CALL field_mesh_decomposition_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_decomposition,err,error,*999)
1698 CALL field_mesh_decomposition_set_and_lock(equations_materials%MATERIALS_FIELD,geometric_decomposition, &
1700 CALL field_geometric_field_set_and_lock(equations_materials%MATERIALS_FIELD,equations_set%GEOMETRY% &
1701 & geometric_field,err,error,*999)
1702 CALL field_number_of_variables_set_and_lock(equations_materials%MATERIALS_FIELD,2,err,error,*999)
1703 CALL field_variable_types_set_and_lock(equations_materials%MATERIALS_FIELD,[field_u_variable_type, &
1704 & field_v_variable_type],err,error,*999)
1705 CALL field_variable_label_set(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
1706 &
"Materials",err,error,*999)
1707 CALL field_dimension_set_and_lock(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
1708 & field_vector_dimension_type,err,error,*999)
1709 CALL field_data_type_set_and_lock(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
1710 & field_dp_type,err,error,*999)
1711 CALL field_dimension_set_and_lock(equations_materials%MATERIALS_FIELD,field_v_variable_type, &
1712 & field_vector_dimension_type,err,error,*999)
1713 CALL field_data_type_set_and_lock(equations_materials%MATERIALS_FIELD,field_v_variable_type, &
1714 & field_dp_type,err,error,*999)
1715 CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
1716 & number_of_dimensions,err,error,*999)
1717 number_of_materials_components=number_of_dimensions
1719 CALL field_number_of_components_set_and_lock(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
1720 & number_of_materials_components,err,error,*999)
1721 equations_set_field_field=>equations_set%EQUATIONS_SET_FIELD%EQUATIONS_SET_FIELD_FIELD
1722 CALL field_parameter_set_data_get(equations_set_field_field,field_u_variable_type, &
1723 & field_values_set_type,equations_set_field_data,err,error,*999)
1724 ncompartments=equations_set_field_data(2)
1725 number_of_materials_coupling_components=ncompartments
1726 CALL field_number_of_components_set_and_lock(equations_materials%MATERIALS_FIELD,field_v_variable_type, &
1727 & number_of_materials_coupling_components,err,error,*999)
1729 DO component_idx=1,number_of_dimensions
1730 CALL field_component_mesh_component_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
1731 & component_idx,geometric_mesh_component,err,error,*999)
1732 CALL field_component_interpolation_set(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
1733 & component_idx,field_constant_interpolation,err,error,*999)
1734 CALL field_component_mesh_component_set(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
1735 & component_idx,geometric_mesh_component,err,error,*999)
1737 CALL field_component_mesh_component_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
1738 & 1,geometric_mesh_component,err,error,*999)
1739 DO component_idx=1,number_of_materials_coupling_components
1740 CALL field_component_interpolation_set(equations_materials%MATERIALS_FIELD,field_v_variable_type, &
1741 & component_idx,field_constant_interpolation,err,error,*999)
1742 CALL field_component_mesh_component_set(equations_materials%MATERIALS_FIELD,field_v_variable_type, &
1743 & component_idx,geometric_mesh_component,err,error,*999)
1746 CALL field_scaling_type_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_scaling_type,err,error,*999)
1747 CALL field_scaling_type_set(equations_materials%MATERIALS_FIELD,geometric_scaling_type,err,error,*999)
1751 SELECT CASE(equations_set%SPECIFICATION(3))
1760 CALL field_type_check(equations_set_setup%FIELD,field_material_type,err,error,*999)
1761 CALL field_dependent_type_check(equations_set_setup%FIELD,field_independent_type,err,error,*999)
1762 CALL field_number_of_variables_check(equations_set_setup%FIELD,1,err,error,*999)
1763 CALL field_variable_types_check(equations_set_setup%FIELD,[field_u_variable_type],err,error,*999)
1764 CALL field_dimension_check(equations_set_setup%FIELD,field_u_variable_type,field_vector_dimension_type, &
1766 CALL field_data_type_check(equations_set_setup%FIELD,field_u_variable_type,field_dp_type,err,error,*999)
1767 CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
1768 & number_of_dimensions,err,error,*999)
1773 CALL field_number_of_components_check(equations_set_setup%FIELD,field_u_variable_type,number_of_dimensions, &
1776 CALL field_number_of_components_check(equations_set_setup%FIELD,field_u_variable_type,number_of_dimensions+1, &
1780 CALL field_type_check(equations_set_setup%FIELD,field_material_type,err,error,*999)
1781 CALL field_dependent_type_check(equations_set_setup%FIELD,field_independent_type,err,error,*999)
1782 CALL field_number_of_variables_check(equations_set_setup%FIELD,2,err,error,*999)
1783 CALL field_variable_types_check(equations_set_setup%FIELD,[field_u_variable_type, &
1784 & field_v_variable_type],err,error,*999)
1785 CALL field_dimension_check(equations_set_setup%FIELD,field_u_variable_type,field_vector_dimension_type, &
1787 CALL field_data_type_check(equations_set_setup%FIELD,field_u_variable_type,field_dp_type,err,error,*999)
1788 CALL field_dimension_check(equations_set_setup%FIELD,field_v_variable_type,field_vector_dimension_type, &
1790 CALL field_data_type_check(equations_set_setup%FIELD,field_v_variable_type,field_dp_type,err,error,*999)
1791 CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
1792 & number_of_dimensions,err,error,*999)
1793 CALL field_number_of_components_check(equations_set_setup%FIELD,field_u_variable_type,number_of_dimensions, &
1795 equations_set_field_field=>equations_set%EQUATIONS_SET_FIELD%EQUATIONS_SET_FIELD_FIELD
1796 CALL field_parameter_set_data_get(equations_set_field_field,field_u_variable_type, &
1797 & field_values_set_type,equations_set_field_data,err,error,*999)
1798 ncompartments=equations_set_field_data(2)
1799 number_of_materials_coupling_components=ncompartments
1800 CALL field_number_of_components_check(equations_set_setup%FIELD,field_v_variable_type, &
1801 & number_of_materials_coupling_components,err,error,*999)
1805 CALL flagerror(
"Equations set materials is not associated.",err,error,*999)
1808 equations_materials=>equations_set%MATERIALS
1809 IF(
ASSOCIATED(equations_materials))
THEN 1810 IF(equations_materials%MATERIALS_FIELD_AUTO_CREATED)
THEN 1812 CALL field_create_finish(equations_materials%MATERIALS_FIELD,err,error,*999)
1814 CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
1815 & number_of_dimensions,err,error,*999)
1820 number_of_materials_components=number_of_dimensions
1825 number_of_materials_components=number_of_dimensions+1
1828 DO component_idx=1,number_of_dimensions
1829 CALL field_component_values_initialise(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
1830 & field_values_set_type,component_idx,1.0_dp,err,error,*999)
1833 equations_set_field_field=>equations_set%EQUATIONS_SET_FIELD%EQUATIONS_SET_FIELD_FIELD
1834 CALL field_parameter_set_data_get(equations_set_field_field,field_u_variable_type, &
1835 & field_values_set_type,equations_set_field_data,err,error,*999)
1836 ncompartments=equations_set_field_data(2)
1837 DO component_idx=1,ncompartments
1838 CALL field_component_values_initialise(equations_materials%MATERIALS_FIELD,field_v_variable_type, &
1839 & field_values_set_type,component_idx,0.0_dp,err,error,*999)
1845 DO component_idx=number_of_dimensions+1,number_of_materials_components
1846 CALL field_component_values_initialise(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
1847 & field_values_set_type,component_idx,1.0_dp,err,error,*999)
1852 CALL flagerror(
"Equations set materials is not associated.",err,error,*999)
1855 local_error=
"The action type of "//
trim(
number_to_vstring(equations_set_setup%ACTION_TYPE,
"*",err,error))// &
1856 &
" for a setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
1857 &
" is invalid for a linear diffusion equation." 1858 CALL flagerror(local_error,err,error,*999)
1864 SELECT CASE(equations_set_setup%ACTION_TYPE)
1866 equations_source=>equations_set%SOURCE
1867 IF(
ASSOCIATED(equations_source))
THEN 1868 IF(equations_source%SOURCE_FIELD_AUTO_CREATED)
THEN 1870 CALL field_create_start(equations_set_setup%FIELD_USER_NUMBER,equations_set%REGION,equations_source% &
1872 CALL field_label_set(equations_source%SOURCE_FIELD,
"Source Field",err,error,*999)
1873 CALL field_type_set_and_lock(equations_source%SOURCE_FIELD,field_general_type,err,error,*999)
1874 CALL field_dependent_type_set_and_lock(equations_source%SOURCE_FIELD,field_independent_type,err,error,*999)
1875 CALL field_mesh_decomposition_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_decomposition,err,error,*999)
1876 CALL field_mesh_decomposition_set_and_lock(equations_source%SOURCE_FIELD,geometric_decomposition, &
1878 CALL field_geometric_field_set_and_lock(equations_source%SOURCE_FIELD,equations_set%GEOMETRY% &
1879 & geometric_field,err,error,*999)
1880 CALL field_number_of_variables_set_and_lock(equations_source%SOURCE_FIELD,1,err,error,*999)
1881 CALL field_variable_types_set_and_lock(equations_source%SOURCE_FIELD,[field_u_variable_type], &
1883 CALL field_variable_label_set(equations_source%SOURCE_FIELD,field_u_variable_type, &
1884 &
"Source",err,error,*999)
1885 CALL field_dimension_set_and_lock(equations_source%SOURCE_FIELD,field_u_variable_type, &
1886 & field_scalar_dimension_type,err,error,*999)
1887 CALL field_data_type_set_and_lock(equations_source%SOURCE_FIELD,field_u_variable_type, &
1888 & field_dp_type,err,error,*999)
1889 number_of_source_components=1
1891 CALL field_number_of_components_set_and_lock(equations_source%SOURCE_FIELD,field_u_variable_type, &
1892 & number_of_source_components,err,error,*999)
1900 DO component_idx=1,number_of_source_components
1901 CALL field_component_mesh_component_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
1902 & component_idx,geometric_mesh_component,err,error,*999)
1903 CALL field_component_mesh_component_set(equations_source%SOURCE_FIELD,field_u_variable_type, &
1904 & component_idx,geometric_mesh_component,err,error,*999)
1905 CALL field_component_interpolation_set(equations_source%SOURCE_FIELD,field_u_variable_type, &
1906 & component_idx,field_node_based_interpolation,err,error,*999)
1910 CALL field_scaling_type_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_scaling_type,err,error,*999)
1911 CALL field_scaling_type_set(equations_source%SOURCE_FIELD,geometric_scaling_type,err,error,*999)
1914 CALL field_type_check(equations_set_setup%FIELD,field_general_type,err,error,*999)
1915 CALL field_dependent_type_check(equations_set_setup%FIELD,field_independent_type,err,error,*999)
1916 CALL field_number_of_variables_check(equations_set_setup%FIELD,1,err,error,*999)
1917 CALL field_variable_types_check(equations_set_setup%FIELD,[field_u_variable_type],err,error,*999)
1918 CALL field_dimension_check(equations_set_setup%FIELD,field_u_variable_type,field_scalar_dimension_type, &
1920 CALL field_data_type_check(equations_set_setup%FIELD,field_u_variable_type,field_dp_type,err,error,*999)
1921 CALL field_number_of_components_check(equations_set_setup%FIELD,field_u_variable_type,1, &
1925 CALL flagerror(
"Equations set source is not associated.",err,error,*999)
1928 equations_source=>equations_set%SOURCE
1929 IF(
ASSOCIATED(equations_source))
THEN 1930 IF(equations_source%SOURCE_FIELD_AUTO_CREATED)
THEN 1932 CALL field_create_finish(equations_source%SOURCE_FIELD,err,error,*999)
1934 CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
1935 & number_of_dimensions,err,error,*999)
1942 number_of_source_components=1
1944 number_of_source_components=0
1947 DO component_idx=1,number_of_source_components
1948 CALL field_component_values_initialise(equations_source%SOURCE_FIELD,field_u_variable_type, &
1949 & field_values_set_type,component_idx,1.0_dp,err,error,*999)
1953 CALL flagerror(
"Equations set source is not associated.",err,error,*999)
1956 local_error=
"The action type of "//
trim(
number_to_vstring(equations_set_setup%ACTION_TYPE,
"*",err,error))// &
1957 &
" for a setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
1958 &
" is invalid for a linear diffusion equation." 1959 CALL flagerror(local_error,err,error,*999)
1965 SELECT CASE(equations_set_setup%ACTION_TYPE)
1967 equations_analytic=>equations_set%ANALYTIC
1968 IF(
ASSOCIATED(equations_analytic))
THEN 1969 IF(equations_set%DEPENDENT%DEPENDENT_FINISHED)
THEN 1970 dependent_field=>equations_set%DEPENDENT%DEPENDENT_FIELD
1971 IF(
ASSOCIATED(dependent_field))
THEN 1972 geometric_field=>equations_set%GEOMETRY%GEOMETRIC_FIELD
1973 IF(
ASSOCIATED(geometric_field))
THEN 1974 equations_materials=>equations_set%MATERIALS
1975 IF(
ASSOCIATED(equations_materials))
THEN 1976 IF(equations_materials%MATERIALS_FINISHED)
THEN 1977 CALL field_number_of_components_get(geometric_field,field_u_variable_type,number_of_dimensions, &
1979 equations_set%ANALYTIC%ANALYTIC_USER_PARAMS(1)=0.0_dp
1980 SELECT CASE(equations_set%SPECIFICATION(3))
1982 SELECT CASE(equations_set_setup%ANALYTIC_FUNCTION_TYPE)
1984 IF(number_of_dimensions/=1)
THEN 1985 local_error=
"The number of geometric dimensions of "// &
1987 &
" is invalid. The analytic function type of "// &
1989 &
" for a no source diffusion equation requires that there be 1 geometric dimension." 1990 CALL flagerror(local_error,err,error,*999)
1993 CALL field_component_interpolation_check(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
1994 & 1,field_constant_interpolation,err,error,*999)
1996 number_of_analytic_components=4
2001 IF(number_of_dimensions/=2)
THEN 2002 local_error=
"The number of geometric dimensions of "// &
2004 &
" is invalid. The analytic function type of "// &
2006 &
" for a no source diffusion equation requires that there be 2 geometric dimensions." 2007 CALL flagerror(local_error,err,error,*999)
2010 number_of_analytic_components=0
2014 local_error=
"The specified analytic function type of "// &
2016 &
" is invalid for a no source diffusion equation." 2017 CALL flagerror(local_error,err,error,*999)
2020 SELECT CASE(equations_set_setup%ANALYTIC_FUNCTION_TYPE)
2023 IF(number_of_dimensions/=3)
THEN 2024 local_error=
"The number of geometric dimensions of "// &
2026 &
" is invalid. The analytic function type of "// &
2028 &
" for a constant source diffusion equation requires that there be 3 geometric dimensions." 2029 CALL flagerror(local_error,err,error,*999)
2032 number_of_analytic_components=0
2036 local_error=
"The specified analytic function type of "// &
2038 &
" is invalid for a constant source diffusion equation." 2039 CALL flagerror(local_error,err,error,*999)
2042 SELECT CASE(equations_set_setup%ANALYTIC_FUNCTION_TYPE)
2045 IF(number_of_dimensions/=3)
THEN 2046 local_error=
"The number of geometric dimensions of "// &
2048 &
" is invalid. The analytic function type of "// &
2050 &
" for a linear source diffusion equation requires that there be 3 geometric dimensions." 2051 CALL flagerror(local_error,err,error,*999)
2054 number_of_analytic_components=0
2056 equations_set%ANALYTIC%ANALYTIC_FUNCTION_TYPE= &
2059 local_error=
"The specified analytic function type of "// &
2061 &
" is invalid for a linear source diffusion equation." 2062 CALL flagerror(local_error,err,error,*999)
2065 SELECT CASE(equations_set_setup%ANALYTIC_FUNCTION_TYPE)
2068 IF(number_of_dimensions/=2)
THEN 2069 local_error=
"The number of geometric dimensions of "// &
2071 &
" is invalid. The analytic function type of "// &
2073 &
" for a multi-compartment diffusion equation requires that there be 2 geometric dimensions." 2074 CALL flagerror(local_error,err,error,*999)
2077 number_of_analytic_components=0
2079 equations_set%ANALYTIC%ANALYTIC_FUNCTION_TYPE= &
2083 IF(number_of_dimensions/=3)
THEN 2084 local_error=
"The number of geometric dimensions of "// &
2086 &
" is invalid. The analytic function type of "// &
2088 &
" for a multi-compartment diffusion equation requires that there be 3 geometric dimensions." 2089 CALL flagerror(local_error,err,error,*999)
2092 number_of_analytic_components=0
2094 equations_set%ANALYTIC%ANALYTIC_FUNCTION_TYPE= &
2098 IF(number_of_dimensions/=3)
THEN 2099 local_error=
"The number of geometric dimensions of "// &
2101 &
" is invalid. The analytic function type of "// &
2103 &
" for a multi-compartment diffusion equation requires that there be 3 geometric dimensions." 2104 CALL flagerror(local_error,err,error,*999)
2107 number_of_analytic_components=0
2109 equations_set%ANALYTIC%ANALYTIC_FUNCTION_TYPE= &
2113 IF(number_of_dimensions/=3)
THEN 2114 local_error=
"The number of geometric dimensions of "// &
2116 &
" is invalid. The analytic function type of "// &
2118 &
" for a multi-compartment diffusion requires that there be 3 geometric dimensions." 2119 CALL flagerror(local_error,err,error,*999)
2122 number_of_analytic_components=0
2124 equations_set%ANALYTIC%ANALYTIC_FUNCTION_TYPE= &
2127 local_error=
"The specified analytic function type of "// &
2129 &
" is invalid for a multi-compartment diffusion equation." 2130 CALL flagerror(local_error,err,error,*999)
2133 local_error=
"The equation set subtype of "// &
2135 &
" is invalid for an analytical diffusion equation." 2136 CALL flagerror(local_error,err,error,*999)
2139 IF(number_of_analytic_components>=1)
THEN 2140 IF(equations_analytic%ANALYTIC_FIELD_AUTO_CREATED)
THEN 2142 CALL field_create_start(equations_set_setup%FIELD_USER_NUMBER,equations_set%REGION, &
2143 & equations_analytic%ANALYTIC_FIELD,err,error,*999)
2144 CALL field_label_set(equations_analytic%ANALYTIC_FIELD,
"Analytic Field",err,error,*999)
2145 CALL field_type_set_and_lock(equations_analytic%ANALYTIC_FIELD,field_general_type,err,error,*999)
2146 CALL field_dependent_type_set_and_lock(equations_analytic%ANALYTIC_FIELD,field_independent_type, &
2148 CALL field_mesh_decomposition_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_decomposition, &
2150 CALL field_mesh_decomposition_set_and_lock(equations_analytic%ANALYTIC_FIELD, &
2151 & geometric_decomposition,err,error,*999)
2152 CALL field_geometric_field_set_and_lock(equations_analytic%ANALYTIC_FIELD,equations_set%GEOMETRY% &
2153 & geometric_field,err,error,*999)
2154 CALL field_number_of_variables_set_and_lock(equations_analytic%ANALYTIC_FIELD,1,err,error,*999)
2155 CALL field_variable_types_set_and_lock(equations_analytic%ANALYTIC_FIELD,[field_u_variable_type], &
2157 CALL field_variable_label_set(equations_analytic%ANALYTIC_FIELD,field_u_variable_type, &
2158 &
"Analytic",err,error,*999)
2159 CALL field_dimension_set_and_lock(equations_analytic%ANALYTIC_FIELD,field_u_variable_type, &
2160 & field_vector_dimension_type,err,error,*999)
2161 CALL field_data_type_set_and_lock(equations_analytic%ANALYTIC_FIELD,field_u_variable_type, &
2162 & field_dp_type,err,error,*999)
2164 CALL field_number_of_components_set_and_lock(equations_analytic%ANALYTIC_FIELD,field_u_variable_type, &
2165 & number_of_analytic_components,err,error,*999)
2167 CALL field_component_mesh_component_get(equations_set%GEOMETRY%GEOMETRIC_FIELD, &
2168 & field_u_variable_type,1,geometric_mesh_component,err,error,*999)
2169 DO component_idx=1,number_of_analytic_components
2170 CALL field_component_mesh_component_set(equations_analytic%ANALYTIC_FIELD,field_u_variable_type, &
2171 & component_idx,geometric_mesh_component,err,error,*999)
2172 CALL field_component_interpolation_set(equations_analytic%ANALYTIC_FIELD,field_u_variable_type, &
2173 & component_idx,field_constant_interpolation,err,error,*999)
2176 CALL field_scaling_type_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_scaling_type, &
2178 CALL field_scaling_type_set(equations_analytic%ANALYTIC_FIELD,geometric_scaling_type,err,error,*999)
2181 CALL field_type_check(equations_set_setup%FIELD,field_general_type,err,error,*999)
2182 CALL field_dependent_type_check(equations_set_setup%FIELD,field_independent_type,err,error,*999)
2183 CALL field_number_of_variables_check(equations_set_setup%FIELD,1,err,error,*999)
2184 CALL field_variable_types_check(equations_set_setup%FIELD,[field_u_variable_type],err,error,*999)
2185 IF(number_of_analytic_components==1)
THEN 2186 CALL field_dimension_check(equations_set_setup%FIELD,field_u_variable_type, &
2187 & field_scalar_dimension_type,err,error,*999)
2189 CALL field_dimension_check(equations_set_setup%FIELD,field_u_variable_type, &
2190 & field_vector_dimension_type,err,error,*999)
2192 CALL field_data_type_check(equations_set_setup%FIELD,field_u_variable_type,field_dp_type, &
2194 CALL field_number_of_components_check(equations_set_setup%FIELD,field_u_variable_type, &
2195 & number_of_analytic_components,err,error,*999)
2199 CALL flagerror(
"Equations set materials has not been finished.",err,error,*999)
2202 CALL flagerror(
"Equations set materials is not associated.",err,error,*999)
2205 CALL flagerror(
"Equations set geometric field is not associated.",err,error,*999)
2208 CALL flagerror(
"Equations set dependent field is not associated.",err,error,*999)
2211 CALL flagerror(
"Equations set dependent field has not been finished.",err,error,*999)
2214 CALL flagerror(
"Equations set analytic is not associated.",err,error,*999)
2217 equations_analytic=>equations_set%ANALYTIC
2218 IF(
ASSOCIATED(equations_analytic))
THEN 2219 analytic_field=>equations_analytic%ANALYTIC_FIELD
2220 IF(
ASSOCIATED(analytic_field))
THEN 2221 IF(equations_analytic%ANALYTIC_FIELD_AUTO_CREATED)
THEN 2223 CALL field_create_finish(equations_analytic%ANALYTIC_FIELD,err,error,*999)
2225 CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
2226 & number_of_dimensions,err,error,*999)
2227 SELECT CASE(equations_set%SPECIFICATION(3))
2229 SELECT CASE(equations_analytic%ANALYTIC_FUNCTION_TYPE)
2232 CALL field_component_values_initialise(equations_analytic%ANALYTIC_FIELD,field_u_variable_type, &
2233 & field_values_set_type,1,1.0_dp,err,error,*999)
2235 CALL field_component_values_initialise(equations_analytic%ANALYTIC_FIELD,field_u_variable_type, &
2236 & field_values_set_type,2,1.0_dp,err,error,*999)
2238 CALL field_component_values_initialise(equations_analytic%ANALYTIC_FIELD,field_u_variable_type, &
2239 & field_values_set_type,3,1.0_dp,err,error,*999)
2241 CALL field_component_values_initialise(equations_analytic%ANALYTIC_FIELD,field_u_variable_type, &
2242 & field_values_set_type,4,1.0_dp,err,error,*999)
2246 local_error=
"The specified analytic function type of "// &
2248 &
" is invalid for a no source diffusion equation." 2249 CALL flagerror(local_error,err,error,*999)
2258 local_error=
"The equation set subtype of "// &
2260 &
" is invalid for an analytical linear diffusion equation." 2261 CALL flagerror(local_error,err,error,*999)
2266 CALL flagerror(
"Equations set analytic is not associated.",err,error,*999)
2269 local_error=
"The action type of "//
trim(
number_to_vstring(equations_set_setup%ACTION_TYPE,
"*",err,error))// &
2270 &
" for a setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
2271 &
" is invalid for a linear diffusion equation." 2272 CALL flagerror(local_error,err,error,*999)
2278 SELECT CASE(equations_set_setup%ACTION_TYPE)
2280 IF(equations_set%DEPENDENT%DEPENDENT_FINISHED)
THEN 2285 CALL flagerror(
"Equations set dependent field has not been finished.",err,error,*999)
2288 SELECT CASE(equations_set%SOLUTION_METHOD)
2296 SELECT CASE(equations_set%SPECIFICATION(3))
2301 CALL flagerror(
"Not implemented.",err,error,*999)
2303 equations_set_field_field=>equations_set%EQUATIONS_SET_FIELD%EQUATIONS_SET_FIELD_FIELD
2304 CALL field_parameter_set_data_get(equations_set_field_field,field_u_variable_type, &
2305 & field_values_set_type,equations_set_field_data,err,error,*999)
2306 imy_matrix = equations_set_field_data(1)
2307 ncompartments = equations_set_field_data(2)
2310 ALLOCATE(variable_types(2*ncompartments))
2311 ALLOCATE(variable_u_types(ncompartments-1))
2312 DO num_var=1,ncompartments
2313 variable_types(2*num_var-1)=field_u_variable_type+(field_number_of_variable_subtypes*(num_var-1))
2314 variable_types(2*num_var)=field_deludeln_variable_type+(field_number_of_variable_subtypes*(num_var-1))
2317 DO num_var=1,ncompartments
2318 IF(num_var/=imy_matrix)
THEN 2319 num_var_count=num_var_count+1
2320 variable_u_types(num_var_count)=variable_types(2*num_var-1)
2351 SELECT CASE(equations%SPARSITY_TYPE)
2362 ALLOCATE(coupling_matrix_storage_type(ncompartments-1))
2363 ALLOCATE(coupling_matrix_structure_type(ncompartments-1))
2364 DO num_var=1,ncompartments-1
2369 & coupling_matrix_storage_type, &
2372 coupling_matrix_structure_type,err,error,*999)
2375 local_error=
"The equations matrices sparsity type of "// &
2377 CALL flagerror(local_error,err,error,*999)
2382 CALL flagerror(
"Not implemented.",err,error,*999)
2384 CALL flagerror(
"Not implemented.",err,error,*999)
2386 CALL flagerror(
"Not implemented.",err,error,*999)
2388 CALL flagerror(
"Not implemented.",err,error,*999)
2390 CALL flagerror(
"Not implemented.",err,error,*999)
2392 local_error=
"The solution method of "//
trim(
number_to_vstring(equations_set%SOLUTION_METHOD,
"*",err,error))// &
2394 CALL flagerror(local_error,err,error,*999)
2397 local_error=
"The action type of "//
trim(
number_to_vstring(equations_set_setup%ACTION_TYPE,
"*",err,error))// &
2398 &
" for a setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
2399 &
" is invalid for a linear diffusion equation." 2400 CALL flagerror(local_error,err,error,*999)
2403 local_error=
"The setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
2404 &
" is invalid for a linear diffusion equation." 2405 CALL flagerror(local_error,err,error,*999)
2408 local_error=
"The equations set subtype of "//
trim(
number_to_vstring(equations_set%SPECIFICATION(3),
"*",err,error))// &
2409 &
" is not a linear diffusion equation subtype." 2410 CALL flagerror(local_error,err,error,*999)
2413 CALL flagerror(
"Equations set is not associated.",err,error,*999)
2416 exits(
"Diffusion_EquationsSetLinearSetup")
2418 999 errorsexits(
"Diffusion_EquationsSetLinearSetup",err,error)
2433 INTEGER(INTG),
INTENT(OUT) :: ERR
2436 INTEGER(INTG) :: component_idx,GEOMETRIC_MESH_COMPONENT,GEOMETRIC_SCALING_TYPE,NUMBER_OF_ANALYTIC_COMPONENTS, &
2437 & NUMBER_OF_DIMENSIONS,NUMBER_OF_MATERIALS_COMPONENTS
2438 REAL(DP) :: A_PARAM,B_PARAM,C_PARAM
2445 TYPE(
field_type),
POINTER :: ANALYTIC_FIELD,DEPENDENT_FIELD,GEOMETRIC_FIELD
2448 enters(
"Diffusion_EquationsSetNonlinearSetup",err,error,*999)
2451 NULLIFY(equations_mapping)
2452 NULLIFY(equations_matrices)
2453 NULLIFY(geometric_decomposition)
2455 IF(
ASSOCIATED(equations_set))
THEN 2456 IF(.NOT.
ALLOCATED(equations_set%SPECIFICATION))
THEN 2457 CALL flagerror(
"Equations set specification is not allocated.",err,error,*999)
2458 ELSE IF(
SIZE(equations_set%SPECIFICATION,1)/=3)
THEN 2459 CALL flagerror(
"Equations set specification must have three entries for a diffusion type equations set.", &
2464 SELECT CASE(equations_set_setup%SETUP_TYPE)
2466 SELECT CASE(equations_set_setup%ACTION_TYPE)
2473 local_error=
"The action type of "//
trim(
number_to_vstring(equations_set_setup%ACTION_TYPE,
"*",err,error))// &
2474 &
" for a setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
2475 &
" is invalid for a nonlinear diffusion equation." 2476 CALL flagerror(local_error,err,error,*999)
2484 SELECT CASE(equations_set_setup%ACTION_TYPE)
2486 IF(equations_set%DEPENDENT%DEPENDENT_FIELD_AUTO_CREATED)
THEN 2488 CALL field_create_start(equations_set_setup%FIELD_USER_NUMBER,equations_set%REGION,equations_set%DEPENDENT% &
2489 & dependent_field,err,error,*999)
2490 CALL field_label_set(equations_set%DEPENDENT%DEPENDENT_FIELD,
"Dependent Field",err,error,*999)
2491 CALL field_type_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_general_type,err,error,*999)
2492 CALL field_dependent_type_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_dependent_type,err,error,*999)
2493 CALL field_mesh_decomposition_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_decomposition,err,error,*999)
2494 CALL field_mesh_decomposition_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,geometric_decomposition, &
2496 CALL field_geometric_field_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,equations_set%GEOMETRY% &
2497 & geometric_field,err,error,*999)
2498 CALL field_number_of_variables_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,2,err,error,*999)
2499 CALL field_variable_types_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,[field_u_variable_type, &
2500 & field_deludeln_variable_type],err,error,*999)
2501 CALL field_variable_label_set(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type, &
2502 &
"U",err,error,*999)
2503 CALL field_variable_label_set(equations_set%DEPENDENT%DEPENDENT_FIELD,field_deludeln_variable_type, &
2504 &
"del U/del n",err,error,*999)
2505 CALL field_dimension_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type, &
2506 & field_scalar_dimension_type,err,error,*999)
2507 CALL field_dimension_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_deludeln_variable_type, &
2508 & field_scalar_dimension_type,err,error,*999)
2509 CALL field_data_type_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type, &
2510 & field_dp_type,err,error,*999)
2511 CALL field_data_type_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_deludeln_variable_type, &
2512 & field_dp_type,err,error,*999)
2513 CALL field_number_of_components_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type,1, &
2515 CALL field_number_of_components_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD, &
2516 & field_deludeln_variable_type,1,err,error,*999)
2518 CALL field_component_mesh_component_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type,1, &
2519 & geometric_mesh_component,err,error,*999)
2520 CALL field_component_mesh_component_set(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type,1, &
2521 & geometric_mesh_component,err,error,*999)
2522 CALL field_component_mesh_component_set(equations_set%DEPENDENT%DEPENDENT_FIELD,field_deludeln_variable_type,1, &
2523 & geometric_mesh_component,err,error,*999)
2524 SELECT CASE(equations_set%SOLUTION_METHOD)
2526 CALL field_component_interpolation_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD, &
2527 & field_u_variable_type,1,field_node_based_interpolation,err,error,*999)
2528 CALL field_component_interpolation_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD, &
2529 & field_deludeln_variable_type,1,field_node_based_interpolation,err,error,*999)
2531 CALL field_scaling_type_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_scaling_type,err,error,*999)
2532 CALL field_scaling_type_set(equations_set%DEPENDENT%DEPENDENT_FIELD,geometric_scaling_type,err,error,*999)
2534 CALL flagerror(
"Not implemented.",err,error,*999)
2536 CALL flagerror(
"Not implemented.",err,error,*999)
2538 CALL flagerror(
"Not implemented.",err,error,*999)
2540 CALL flagerror(
"Not implemented.",err,error,*999)
2542 CALL flagerror(
"Not implemented.",err,error,*999)
2544 local_error=
"The solution method of "//
trim(
number_to_vstring(equations_set%SOLUTION_METHOD,
"*",err,error))// &
2546 CALL flagerror(local_error,err,error,*999)
2550 CALL field_type_check(equations_set_setup%FIELD,field_general_type,err,error,*999)
2551 CALL field_dependent_type_check(equations_set_setup%FIELD,field_dependent_type,err,error,*999)
2552 CALL field_number_of_variables_check(equations_set_setup%FIELD,2,err,error,*999)
2553 CALL field_variable_types_check(equations_set_setup%FIELD,[field_u_variable_type, &
2554 & field_deludeln_variable_type],err,error,*999)
2555 CALL field_dimension_check(equations_set_setup%FIELD,field_u_variable_type,field_scalar_dimension_type, &
2557 CALL field_dimension_check(equations_set_setup%FIELD,field_deludeln_variable_type,field_scalar_dimension_type, &
2559 CALL field_data_type_check(equations_set_setup%FIELD,field_u_variable_type,field_dp_type,err,error,*999)
2560 CALL field_data_type_check(equations_set_setup%FIELD,field_deludeln_variable_type,field_dp_type,err,error,*999)
2561 CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
2562 & number_of_dimensions,err,error,*999)
2563 CALL field_number_of_components_check(equations_set_setup%FIELD,field_u_variable_type,number_of_dimensions, &
2565 CALL field_number_of_components_check(equations_set_setup%FIELD,field_deludeln_variable_type, &
2566 & number_of_dimensions,err,error,*999)
2567 SELECT CASE(equations_set%SOLUTION_METHOD)
2569 DO component_idx=1,number_of_dimensions
2570 CALL field_component_interpolation_check(equations_set_setup%FIELD,field_u_variable_type,component_idx, &
2571 & field_node_based_interpolation,err,error,*999)
2572 CALL field_component_interpolation_check(equations_set_setup%FIELD,field_deludeln_variable_type, &
2573 & component_idx,field_node_based_interpolation,err,error,*999)
2576 CALL flagerror(
"Not implemented.",err,error,*999)
2578 CALL flagerror(
"Not implemented.",err,error,*999)
2580 CALL flagerror(
"Not implemented.",err,error,*999)
2582 CALL flagerror(
"Not implemented.",err,error,*999)
2584 CALL flagerror(
"Not implemented.",err,error,*999)
2586 local_error=
"The solution method of "//
trim(
number_to_vstring(equations_set%SOLUTION_METHOD,
"*",err,error))// &
2588 CALL flagerror(local_error,err,error,*999)
2592 IF(equations_set%DEPENDENT%DEPENDENT_FIELD_AUTO_CREATED)
THEN 2593 CALL field_create_finish(equations_set%DEPENDENT%DEPENDENT_FIELD,err,error,*999)
2596 local_error=
"The action type of "//
trim(
number_to_vstring(equations_set_setup%ACTION_TYPE,
"*",err,error))// &
2597 &
" for a setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
2598 &
" is invalid for a nonlinear diffusion equation" 2599 CALL flagerror(local_error,err,error,*999)
2605 SELECT CASE(equations_set_setup%ACTION_TYPE)
2607 equations_materials=>equations_set%MATERIALS
2608 IF(
ASSOCIATED(equations_materials))
THEN 2609 IF(equations_materials%MATERIALS_FIELD_AUTO_CREATED)
THEN 2611 CALL field_create_start(equations_set_setup%FIELD_USER_NUMBER,equations_set%REGION,equations_materials% &
2612 & materials_field,err,error,*999)
2613 CALL field_label_set(equations_materials%MATERIALS_FIELD,
"Materials Field",err,error,*999)
2614 CALL field_type_set_and_lock(equations_materials%MATERIALS_FIELD,field_material_type,err,error,*999)
2615 CALL field_dependent_type_set_and_lock(equations_materials%MATERIALS_FIELD,field_independent_type,err,error,*999)
2616 CALL field_mesh_decomposition_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_decomposition,err,error,*999)
2617 CALL field_mesh_decomposition_set_and_lock(equations_materials%MATERIALS_FIELD,geometric_decomposition, &
2619 CALL field_geometric_field_set_and_lock(equations_materials%MATERIALS_FIELD,equations_set%GEOMETRY% &
2620 & geometric_field,err,error,*999)
2621 CALL field_number_of_variables_set_and_lock(equations_materials%MATERIALS_FIELD,1,err,error,*999)
2622 CALL field_variable_types_set_and_lock(equations_materials%MATERIALS_FIELD,[field_u_variable_type], &
2624 CALL field_variable_label_set(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
2625 &
"Materials",err,error,*999)
2626 CALL field_dimension_set_and_lock(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
2627 & field_vector_dimension_type,err,error,*999)
2628 CALL field_data_type_set_and_lock(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
2629 & field_dp_type,err,error,*999)
2630 CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
2631 & number_of_dimensions,err,error,*999)
2635 number_of_materials_components=number_of_dimensions+3
2639 number_of_materials_components=number_of_dimensions+3
2642 CALL field_number_of_components_set_and_lock(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
2643 & number_of_materials_components,err,error,*999)
2645 DO component_idx=1,number_of_dimensions
2646 CALL field_component_mesh_component_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
2647 & component_idx,geometric_mesh_component,err,error,*999)
2648 CALL field_component_interpolation_set(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
2649 & component_idx,field_constant_interpolation,err,error,*999)
2650 CALL field_component_mesh_component_set(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
2651 & component_idx,geometric_mesh_component,err,error,*999)
2655 CALL field_component_mesh_component_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
2656 & 1,geometric_mesh_component,err,error,*999)
2657 DO component_idx=number_of_dimensions+1,number_of_materials_components
2658 CALL field_component_mesh_component_set(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
2659 & component_idx,geometric_mesh_component,err,error,*999)
2660 CALL field_component_interpolation_set(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
2661 & component_idx,field_constant_interpolation,err,error,*999)
2664 CALL field_scaling_type_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_scaling_type,err,error,*999)
2665 CALL field_scaling_type_set(equations_materials%MATERIALS_FIELD,geometric_scaling_type,err,error,*999)
2668 CALL field_type_check(equations_set_setup%FIELD,field_material_type,err,error,*999)
2669 CALL field_dependent_type_check(equations_set_setup%FIELD,field_independent_type,err,error,*999)
2670 CALL field_number_of_variables_check(equations_set_setup%FIELD,1,err,error,*999)
2671 CALL field_variable_types_check(equations_set_setup%FIELD,[field_u_variable_type],err,error,*999)
2672 CALL field_dimension_check(equations_set_setup%FIELD,field_u_variable_type,field_vector_dimension_type, &
2674 CALL field_data_type_check(equations_set_setup%FIELD,field_u_variable_type,field_dp_type,err,error,*999)
2675 CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
2676 & number_of_dimensions,err,error,*999)
2677 number_of_materials_components=number_of_dimensions+2
2678 CALL field_number_of_components_check(equations_set_setup%FIELD,field_u_variable_type, &
2679 & number_of_materials_components,err,error,*999)
2682 CALL flagerror(
"Equations set materials is not associated.",err,error,*999)
2685 equations_materials=>equations_set%MATERIALS
2686 IF(
ASSOCIATED(equations_materials))
THEN 2687 IF(equations_materials%MATERIALS_FIELD_AUTO_CREATED)
THEN 2689 CALL field_create_finish(equations_materials%MATERIALS_FIELD,err,error,*999)
2691 CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
2692 & number_of_dimensions,err,error,*999)
2696 number_of_materials_components=number_of_dimensions+3
2700 number_of_materials_components=number_of_dimensions+3
2703 DO component_idx=1,number_of_dimensions
2704 CALL field_component_values_initialise(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
2705 & field_values_set_type,component_idx,1.0_dp,err,error,*999)
2708 DO component_idx=number_of_dimensions+1,number_of_materials_components
2709 CALL field_component_values_initialise(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
2710 & field_values_set_type,component_idx,1.0_dp,err,error,*999)
2714 CALL flagerror(
"Equations set materials is not associated.",err,error,*999)
2717 local_error=
"The action type of "//
trim(
number_to_vstring(equations_set_setup%ACTION_TYPE,
"*",err,error))// &
2718 &
" for a setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
2719 &
" is invalid for a linear diffusion equation." 2720 CALL flagerror(local_error,err,error,*999)
2726 SELECT CASE(equations_set_setup%ACTION_TYPE)
2732 local_error=
"The action type of "//
trim(
number_to_vstring(equations_set_setup%ACTION_TYPE,
"*",err,error))// &
2733 &
" for a setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
2734 &
" is invalid for a linear diffusion equation." 2735 CALL flagerror(local_error,err,error,*999)
2741 SELECT CASE(equations_set_setup%ACTION_TYPE)
2743 equations_analytic=>equations_set%ANALYTIC
2744 IF(
ASSOCIATED(equations_analytic))
THEN 2745 IF(equations_set%DEPENDENT%DEPENDENT_FINISHED)
THEN 2746 dependent_field=>equations_set%DEPENDENT%DEPENDENT_FIELD
2747 IF(
ASSOCIATED(dependent_field))
THEN 2748 equations_materials=>equations_set%MATERIALS
2749 IF(
ASSOCIATED(equations_materials))
THEN 2750 IF(equations_materials%MATERIALS_FINISHED)
THEN 2751 geometric_field=>equations_set%GEOMETRY%GEOMETRIC_FIELD
2752 IF(
ASSOCIATED(geometric_field))
THEN 2753 CALL field_number_of_components_get(geometric_field,field_u_variable_type,number_of_dimensions, &
2756 SELECT CASE(equations_set_setup%ANALYTIC_FUNCTION_TYPE)
2759 IF(number_of_dimensions/=1)
THEN 2760 local_error=
"The number of geometric dimensions of "// &
2762 &
" is invalid. The analytic function type of "// &
2764 &
" requires that there be 1 geometric dimension." 2765 CALL flagerror(local_error,err,error,*999)
2768 CALL field_component_interpolation_check(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
2769 & 1,field_constant_interpolation,err,error,*999)
2770 CALL field_component_interpolation_check(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
2771 & 2,field_constant_interpolation,err,error,*999)
2772 CALL field_component_interpolation_check(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
2773 & 3,field_constant_interpolation,err,error,*999)
2775 CALL field_parameter_set_get_constant(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
2776 & field_values_set_type,1,a_param,err,error,*999)
2778 &
CALL flagerror(
"The 1st material component must be zero.",err,error,*999)
2780 CALL field_parameter_set_get_constant(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
2781 & field_values_set_type,2,b_param,err,error,*999)
2783 &
CALL flagerror(
"The 2nd material component must be greater than zero.",err,error,*999)
2785 CALL field_parameter_set_get_constant(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
2786 & field_values_set_type,2,b_param,err,error,*999)
2788 &
CALL flagerror(
"The product of the 2nd and 3rd material components must not be positive.", &
2791 number_of_analytic_components=1
2793 equations_set%ANALYTIC%ANALYTIC_FUNCTION_TYPE= &
2796 local_error=
"The specified analytic function type of "// &
2798 &
" is invalid for a nonlinear diffusion equation with a quadratic source." 2799 CALL flagerror(local_error,err,error,*999)
2802 SELECT CASE(equations_set_setup%ANALYTIC_FUNCTION_TYPE)
2805 IF(number_of_dimensions/=1)
THEN 2806 local_error=
"The number of geometric dimensions of "// &
2808 &
" is invalid. The analytic function type of "// &
2810 &
" requires that there be 1 geometric dimension." 2811 CALL flagerror(local_error,err,error,*999)
2814 CALL field_component_interpolation_check(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
2815 & 1,field_constant_interpolation,err,error,*999)
2816 CALL field_component_interpolation_check(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
2817 & 2,field_constant_interpolation,err,error,*999)
2818 CALL field_component_interpolation_check(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
2819 & 3,field_constant_interpolation,err,error,*999)
2821 CALL field_parameter_set_get_constant(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
2822 & field_values_set_type,1,a_param,err,error,*999)
2824 &
CALL flagerror(
"The 1st material component must not be zero.",err,error,*999)
2826 CALL field_parameter_set_get_constant(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
2827 & field_values_set_type,3,c_param,err,error,*999)
2829 &
CALL flagerror(
"The 3rd material component must not be zero.",err,error,*999)
2831 CALL field_parameter_set_get_constant(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
2832 & field_values_set_type,2,b_param,err,error,*999)
2834 &
CALL flagerror(
"The product of the 1st and 2nd material components must not be positive.", &
2837 &
CALL flagerror(
"The product of the 1st and 3rd material components must not be negative.", &
2840 number_of_analytic_components=0
2842 equations_set%ANALYTIC%ANALYTIC_FUNCTION_TYPE= &
2845 local_error=
"The specified analytic function type of "// &
2847 &
" is invalid for a nonlinear diffusion equation with an exponential source." 2848 CALL flagerror(local_error,err,error,*999)
2852 IF(number_of_analytic_components>=1)
THEN 2853 IF(equations_analytic%ANALYTIC_FIELD_AUTO_CREATED)
THEN 2855 CALL field_create_start(equations_set_setup%FIELD_USER_NUMBER,equations_set%REGION, &
2856 & equations_analytic%ANALYTIC_FIELD,err,error,*999)
2857 CALL field_label_set(equations_analytic%ANALYTIC_FIELD,
"Analytic Field",err,error,*999)
2858 CALL field_type_set_and_lock(equations_analytic%ANALYTIC_FIELD,field_general_type,err,error,*999)
2859 CALL field_dependent_type_set_and_lock(equations_analytic%ANALYTIC_FIELD,field_independent_type, &
2861 CALL field_mesh_decomposition_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_decomposition, &
2863 CALL field_mesh_decomposition_set_and_lock(equations_analytic%ANALYTIC_FIELD, &
2864 & geometric_decomposition,err,error,*999)
2865 CALL field_geometric_field_set_and_lock(equations_analytic%ANALYTIC_FIELD,equations_set%GEOMETRY% &
2866 & geometric_field,err,error,*999)
2867 CALL field_number_of_variables_set_and_lock(equations_analytic%ANALYTIC_FIELD,1,err,error,*999)
2868 CALL field_variable_types_set_and_lock(equations_analytic%ANALYTIC_FIELD,[field_u_variable_type], &
2870 CALL field_variable_label_set(equations_analytic%ANALYTIC_FIELD,field_u_variable_type, &
2871 &
"Analytic",err,error,*999)
2872 CALL field_dimension_set_and_lock(equations_analytic%ANALYTIC_FIELD,field_u_variable_type, &
2873 & field_vector_dimension_type,err,error,*999)
2874 CALL field_data_type_set_and_lock(equations_analytic%ANALYTIC_FIELD,field_u_variable_type, &
2875 & field_dp_type,err,error,*999)
2877 CALL field_number_of_components_set_and_lock(equations_analytic%ANALYTIC_FIELD,field_u_variable_type, &
2878 & number_of_analytic_components,err,error,*999)
2880 CALL field_component_mesh_component_get(equations_set%GEOMETRY%GEOMETRIC_FIELD, &
2881 & field_u_variable_type,1,geometric_mesh_component,err,error,*999)
2882 DO component_idx=1,number_of_analytic_components
2883 CALL field_component_mesh_component_set(equations_analytic%ANALYTIC_FIELD,field_u_variable_type, &
2884 & component_idx,geometric_mesh_component,err,error,*999)
2885 CALL field_component_interpolation_set(equations_analytic%ANALYTIC_FIELD,field_u_variable_type, &
2886 & component_idx,field_constant_interpolation,err,error,*999)
2889 CALL field_scaling_type_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_scaling_type, &
2891 CALL field_scaling_type_set(equations_analytic%ANALYTIC_FIELD,geometric_scaling_type,err,error,*999)
2894 CALL field_type_check(equations_set_setup%FIELD,field_general_type,err,error,*999)
2895 CALL field_dependent_type_check(equations_set_setup%FIELD,field_independent_type,err,error,*999)
2896 CALL field_number_of_variables_check(equations_set_setup%FIELD,1,err,error,*999)
2897 CALL field_variable_types_check(equations_set_setup%FIELD,[field_u_variable_type],err,error,*999)
2898 IF(number_of_analytic_components==1)
THEN 2899 CALL field_dimension_check(equations_set_setup%FIELD,field_u_variable_type, &
2900 & field_scalar_dimension_type,err,error,*999)
2902 CALL field_dimension_check(equations_set_setup%FIELD,field_u_variable_type, &
2903 & field_vector_dimension_type,err,error,*999)
2905 CALL field_data_type_check(equations_set_setup%FIELD,field_u_variable_type,field_dp_type, &
2907 CALL field_number_of_components_check(equations_set_setup%FIELD,field_u_variable_type, &
2908 & number_of_analytic_components,err,error,*999)
2912 CALL flagerror(
"Equations set materials is not finished.",err,error,*999)
2915 CALL flagerror(
"Equations set materials is not associated.",err,error,*999)
2918 CALL flagerror(
"Equations set geometric field is not associated.",err,error,*999)
2921 CALL flagerror(
"Equations set dependent field is not associated.",err,error,*999)
2924 CALL flagerror(
"Equations set dependent field has not been finished.",err,error,*999)
2927 CALL flagerror(
"Equations analytic is not associated.",err,error,*999)
2930 equations_analytic=>equations_set%ANALYTIC
2931 IF(
ASSOCIATED(equations_analytic))
THEN 2932 analytic_field=>equations_analytic%ANALYTIC_FIELD
2933 IF(
ASSOCIATED(analytic_field))
THEN 2934 IF(equations_analytic%ANALYTIC_FIELD_AUTO_CREATED)
THEN 2936 CALL field_create_finish(equations_analytic%ANALYTIC_FIELD,err,error,*999)
2938 SELECT CASE(equations_set%SPECIFICATION(3))
2944 local_error=
"The equation set subtype of "// &
2946 &
" is invalid for an analytical nonlinear diffusion equation." 2947 CALL flagerror(local_error,err,error,*999)
2952 CALL flagerror(
"Equations set analytic is not associated.",err,error,*999)
2955 local_error=
"The action type of "//
trim(
number_to_vstring(equations_set_setup%ACTION_TYPE,
"*",err,error))// &
2956 &
" for a setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
2957 &
" is invalid for a linear diffusion equation." 2958 CALL flagerror(local_error,err,error,*999)
2964 SELECT CASE(equations_set_setup%ACTION_TYPE)
2966 IF(equations_set%DEPENDENT%DEPENDENT_FINISHED)
THEN 2971 CALL flagerror(
"Equations set dependent field has not been finished.",err,error,*999)
2974 SELECT CASE(equations_set%SOLUTION_METHOD)
2996 SELECT CASE(equations%SPARSITY_TYPE)
3014 local_error=
"The equations matrices sparsity type of "// &
3016 CALL flagerror(local_error,err,error,*999)
3019 SELECT CASE(equations%SPARSITY_TYPE)
3036 local_error=
"The equations matrices sparsity type of "// &
3038 CALL flagerror(local_error,err,error,*999)
3043 CALL flagerror(
"Not implemented.",err,error,*999)
3045 CALL flagerror(
"Not implemented.",err,error,*999)
3047 CALL flagerror(
"Not implemented.",err,error,*999)
3049 CALL flagerror(
"Not implemented.",err,error,*999)
3051 CALL flagerror(
"Not implemented.",err,error,*999)
3053 local_error=
"The solution method of "//
trim(
number_to_vstring(equations_set%SOLUTION_METHOD,
"*",err,error))// &
3055 CALL flagerror(local_error,err,error,*999)
3058 local_error=
"The action type of "//
trim(
number_to_vstring(equations_set_setup%ACTION_TYPE,
"*",err,error))// &
3059 &
" for a setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
3060 &
" is invalid for a nonlinear diffusion equation." 3061 CALL flagerror(local_error,err,error,*999)
3064 local_error=
"The setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
3065 &
" is invalid for a nonlinear diffusion equation." 3066 CALL flagerror(local_error,err,error,*999)
3069 local_error=
"The equations set subtype of "//
trim(
number_to_vstring(equations_set%SPECIFICATION(3),
"*",err,error))// &
3070 &
" is not a nonlinear diffusion equation subtype." 3071 CALL flagerror(local_error,err,error,*999)
3074 CALL flagerror(
"Equations set is not associated.",err,error,*999)
3077 exits(
"Diffusion_EquationsSetNonlinearSetup")
3079 999
errors(
"Diffusion_EquationsSetNonlinearSetup",err,error)
3080 exits(
"Diffusion_EquationsSetNonlinearSetup")
3095 INTEGER(INTG),
INTENT(OUT) :: ERR
3100 enters(
"DIFFUSION_EQUATION_PROBLEM_SETUP",err,error,*999)
3102 IF(
ASSOCIATED(problem))
THEN 3103 IF(.NOT.
ALLOCATED(problem%SPECIFICATION))
THEN 3104 CALL flagerror(
"Problem specification is not allocated.",err,error,*999)
3105 ELSE IF(
SIZE(problem%SPECIFICATION,1)<3)
THEN 3106 CALL flagerror(
"Problem specification must have three entries for a Diffusion problem.",err,error,*999)
3108 SELECT CASE(problem%SPECIFICATION(3))
3120 CALL flagerror(
"Not implemented.",err,error,*999)
3123 &
" is not valid for a diffusion equation type of a classical field problem class." 3124 CALL flagerror(local_error,err,error,*999)
3127 CALL flagerror(
"Problem is not associated.",err,error,*999)
3130 exits(
"DIFFUSION_EQUATION_PROBLEM_SETUP")
3132 999 errorsexits(
"DIFFUSION_EQUATION_PROBLEM_SETUP",err,error)
3146 INTEGER(INTG),
INTENT(OUT) :: ERR
3150 LOGICAL :: UPDATE_MATERIALS
3151 LOGICAL :: UPDATE_BOUNDARY_CONDITIONS
3154 update_materials = .false.
3155 update_boundary_conditions = .true.
3157 IF( update_materials )
THEN 3165 IF(
ASSOCIATED(control_loop))
THEN 3166 IF(
ASSOCIATED(solver))
THEN 3167 IF(
ASSOCIATED(control_loop%PROBLEM))
THEN 3168 IF(.NOT.
ALLOCATED(control_loop%PROBLEM%SPECIFICATION))
THEN 3169 CALL flagerror(
"Problem specification is not allocated.",err,error,*999)
3170 ELSE IF(
SIZE(control_loop%PROBLEM%SPECIFICATION,1)<3)
THEN 3171 CALL flagerror(
"Problem specification must have three entries for a Diffusion problem.",err,error,*999)
3173 SELECT CASE(control_loop%PROBLEM%SPECIFICATION(3))
3181 IF(solver%DYNAMIC_SOLVER%ALE)
THEN 3187 CALL flagerror(
"Mesh motion calculation not successful for ALE problem.",err,error,*999)
3190 local_error=
"Problem subtype "//
trim(
number_to_vstring(control_loop%PROBLEM%SPECIFICATION(3),
"*",err,error))// &
3191 &
" is not valid for a diffusion equation type of a classical field problem class." 3192 CALL flagerror(local_error,err,error,*999)
3195 CALL flagerror(
"Problem is not associated.",err,error,*999)
3198 CALL flagerror(
"Solver is not associated.",err,error,*999)
3201 CALL flagerror(
"Control loop is not associated.",err,error,*999)
3204 exits(
"DIFFUSION_EQUATION_PRE_SOLVE")
3206 999 errorsexits(
"DIFFUSION_EQUATION_PRE_SOLVE",err,error)
3219 INTEGER(INTG),
INTENT(OUT) :: ERR
3254 enters(
"Diffusion_PreSolveUpdateBoundaryConditions",err,error,*999)
3256 CALL flagerror(
"Not implemented.",err,error,*999)
3526 exits(
"Diffusion_PreSolveUpdateBoundaryConditions")
3528 999
errors(
"Diffusion_PreSolveUpdateBoundaryConditions",err,error)
3529 exits(
"Diffusion_PreSolveUpdateBoundaryConditions")
3543 INTEGER(INTG),
INTENT(OUT) :: ERR
3546 TYPE(
field_type),
POINTER :: ANALYTIC_FIELD,DEPENDENT_FIELD,GEOMETRIC_FIELD,MATERIALS_FIELD,SOURCE_FIELD
3548 TYPE(
field_variable_type),
POINTER :: ANALYTIC_VARIABLE,FIELD_VARIABLE,GEOMETRIC_VARIABLE,MATERIALS_VARIABLE
3561 REAL(DP),
POINTER :: ANALYTIC_PARAMETERS(:),GEOMETRIC_PARAMETERS(:),MATERIALS_PARAMETERS(:)
3562 INTEGER(INTG) :: NUMBER_OF_DIMENSIONS,BOUNDARY_CONDITION_CHECK_VARIABLE
3564 REAL(DP) :: CURRENT_TIME,TIME_INCREMENT
3565 REAL(DP) :: NORMAL(3),TANGENTS(3,3),
VALUE,X(3),VALUE_SOURCE
3567 INTEGER(INTG) :: component_idx,deriv_idx,dim_idx,local_ny,node_idx,eqnset_idx
3568 INTEGER(INTG) :: VARIABLE_TYPE
3569 INTEGER(INTG) :: ANALYTIC_FUNCTION_TYPE
3570 INTEGER(INTG) :: GLOBAL_DERIV_INDEX
3580 enters(
"Diffusion_PreSolveUpdateAnalyticValues",err,error,*999)
3585 IF(
ASSOCIATED(control_loop))
THEN 3587 IF(
ASSOCIATED(solver))
THEN 3588 IF(
ASSOCIATED(control_loop%PROBLEM))
THEN 3589 IF(.NOT.
ALLOCATED(control_loop%PROBLEM%SPECIFICATION))
THEN 3590 CALL flagerror(
"Problem specification is not allocated.",err,error,*999)
3591 ELSE IF(
SIZE(control_loop%PROBLEM%SPECIFICATION,1)<3)
THEN 3592 CALL flagerror(
"Problem specification must have three entries for a Diffusion problem.",err,error,*999)
3594 SELECT CASE(control_loop%PROBLEM%SPECIFICATION(3))
3597 solver_equations=>solver%SOLVER_EQUATIONS
3598 IF(
ASSOCIATED(solver_equations))
THEN 3601 DO eqnset_idx=1,solver_equations%SOLVER_MAPPING%NUMBER_OF_EQUATIONS_SETS
3602 solver_mapping=>solver_equations%SOLVER_MAPPING
3603 equations=>solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(eqnset_idx)%EQUATIONS
3604 IF(
ASSOCIATED(equations))
THEN 3605 equations_set=>equations%EQUATIONS_SET
3606 IF(
ASSOCIATED(equations_set))
THEN 3607 IF(
ASSOCIATED(equations_set%ANALYTIC))
THEN 3608 dependent_field=>equations_set%DEPENDENT%DEPENDENT_FIELD
3609 IF(
ASSOCIATED(dependent_field))
THEN 3610 geometric_field=>equations_set%GEOMETRY%GEOMETRIC_FIELD
3611 IF(
ASSOCIATED(geometric_field))
THEN 3612 analytic_field=>equations_set%ANALYTIC%ANALYTIC_FIELD
3613 CALL field_number_of_components_get(geometric_field,field_u_variable_type,&
3614 & number_of_dimensions,err,error,*999)
3615 NULLIFY(geometric_variable)
3616 NULLIFY(geometric_parameters)
3617 CALL field_variable_get(geometric_field,field_u_variable_type,geometric_variable,err,error,*999)
3618 CALL field_parameter_set_data_get(geometric_field,field_u_variable_type,field_values_set_type,&
3619 & geometric_parameters,err,error,*999)
3620 equations_set%ANALYTIC%ANALYTIC_USER_PARAMS(1)=current_time
3621 NULLIFY(analytic_variable)
3622 NULLIFY(analytic_parameters)
3623 IF(
ASSOCIATED(analytic_field))
THEN 3624 CALL field_variable_get(analytic_field,field_u_variable_type,analytic_variable,err,error,*999)
3625 CALL field_parameter_set_data_get(analytic_field,field_u_variable_type,field_values_set_type, &
3626 & analytic_parameters,err,error,*999)
3628 NULLIFY(materials_field)
3629 NULLIFY(materials_variable)
3630 NULLIFY(materials_parameters)
3631 IF(
ASSOCIATED(equations_set%MATERIALS))
THEN 3632 materials_field=>equations_set%MATERIALS%MATERIALS_FIELD
3633 CALL field_variable_get(materials_field,field_u_variable_type,materials_variable,err,error,*999)
3634 CALL field_parameter_set_data_get(materials_field,field_u_variable_type,field_values_set_type, &
3635 & materials_parameters,err,error,*999)
3638 variable_type=dependent_field%VARIABLES(2*eqnset_idx-1)%VARIABLE_TYPE
3639 field_variable=>dependent_field%VARIABLE_TYPE_MAP(variable_type)%PTR
3640 IF(
ASSOCIATED(field_variable))
THEN 3641 boundary_conditions=>solver_equations%BOUNDARY_CONDITIONS
3642 IF(
ASSOCIATED(boundary_conditions))
THEN 3644 & field_variable,boundary_conditions_variable,err,error,*999)
3645 IF(
ASSOCIATED(boundary_conditions_variable))
THEN 3646 DO component_idx=1,field_variable%NUMBER_OF_COMPONENTS
3647 IF(field_variable%COMPONENTS(component_idx)%INTERPOLATION_TYPE== &
3648 & field_node_based_interpolation)
THEN 3649 domain=>field_variable%COMPONENTS(component_idx)%DOMAIN
3650 IF(
ASSOCIATED(domain))
THEN 3651 IF(
ASSOCIATED(domain%TOPOLOGY))
THEN 3652 domain_nodes=>domain%TOPOLOGY%NODES
3653 IF(
ASSOCIATED(domain_nodes))
THEN 3655 DO node_idx=1,domain_nodes%NUMBER_OF_NODES
3657 DO dim_idx=1,number_of_dimensions
3659 local_ny=geometric_variable%COMPONENTS(dim_idx)%PARAM_TO_DOF_MAP% &
3660 & node_param2dof_map%NODES(node_idx)%DERIVATIVES(1)%VERSIONS(1)
3661 x(dim_idx)=geometric_parameters(local_ny)
3664 DO deriv_idx=1,domain_nodes%NODES(node_idx)%NUMBER_OF_DERIVATIVES
3665 analytic_function_type=equations_set%ANALYTIC%ANALYTIC_FUNCTION_TYPE
3666 global_deriv_index=domain_nodes%NODES(node_idx)%DERIVATIVES(deriv_idx)% &
3667 & global_derivative_index
3669 & analytic_function_type,x,tangents,normal,current_time,variable_type, &
3670 & global_deriv_index,component_idx,analytic_parameters,materials_parameters, &
3671 &
VALUE,err,error,*999)
3673 local_ny=field_variable%COMPONENTS(component_idx)%PARAM_TO_DOF_MAP% &
3674 & node_param2dof_map%NODES(node_idx)%DERIVATIVES(deriv_idx)%VERSIONS(1)
3675 CALL field_parameter_set_update_local_dof(dependent_field,variable_type, &
3676 & field_analytic_values_set_type,local_ny,
VALUE,err,error,*999)
3677 boundary_condition_check_variable=boundary_conditions_variable% &
3678 & condition_types(local_ny)
3680 CALL field_parameter_set_update_local_dof(dependent_field, &
3681 & variable_type,field_values_set_type,local_ny, &
3682 &
VALUE,err,error,*999)
3695 CALL flagerror(
"Domain topology nodes is not associated.",err,error,*999)
3698 CALL flagerror(
"Domain topology is not associated.",err,error,*999)
3701 CALL flagerror(
"Domain is not associated.",err,error,*999)
3704 CALL flagerror(
"Only node based interpolation is implemented.",err,error,*999)
3708 CALL flagerror(
"Boundary conditions variable is not associated",err,error,*999)
3711 CALL flagerror(
"Boundary conditions are not associated",err,error,*999)
3713 CALL field_parameter_set_update_start(dependent_field,variable_type, &
3714 & field_analytic_values_set_type,err,error,*999)
3715 CALL field_parameter_set_update_finish(dependent_field,variable_type, &
3716 & field_analytic_values_set_type,err,error,*999)
3717 CALL field_parameter_set_update_start(dependent_field,variable_type, &
3718 & field_values_set_type,err,error,*999)
3719 CALL field_parameter_set_update_finish(dependent_field,variable_type, &
3720 & field_values_set_type,err,error,*999)
3722 CALL flagerror(
"Field variable is not associated.",err,error,*999)
3726 CALL field_parameter_set_data_restore(geometric_field,field_u_variable_type,&
3727 & field_values_set_type,geometric_parameters,err,error,*999)
3729 CALL flagerror(
"Equations set geometric field is not associated.",err,error,*999)
3732 CALL flagerror(
"Equations set dependent field is not associated.",err,error,*999)
3738 CALL flagerror(
"Equations set is not associated.",err,error,*999)
3741 CALL flagerror(
"Equations are not associated.",err,error,*999)
3746 CALL field_parameter_set_update_start(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type, &
3747 & field_values_set_type,err,error,*999)
3748 CALL field_parameter_set_update_finish(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type, &
3749 & field_values_set_type,err,error,*999)
3752 IF(
ASSOCIATED(equations_set))
THEN 3753 IF(
ASSOCIATED(equations_set%ANALYTIC))
THEN 3754 equations_source=>equations_set%SOURCE
3755 IF(
ASSOCIATED(equations_source))
THEN 3756 source_field=>equations_source%SOURCE_FIELD
3757 IF(
ASSOCIATED(source_field))
THEN 3758 geometric_field=>equations_set%GEOMETRY%GEOMETRIC_FIELD
3759 IF(
ASSOCIATED(geometric_field))
THEN 3760 CALL field_number_of_components_get(geometric_field,field_u_variable_type,number_of_dimensions, &
3762 NULLIFY(geometric_variable)
3763 CALL field_variable_get(geometric_field,field_u_variable_type,geometric_variable,err,error,*999)
3764 CALL field_parameter_set_data_get(geometric_field,field_u_variable_type,field_values_set_type, &
3765 & geometric_parameters,err,error,*999)
3766 variable_type=field_u_variable_type
3767 field_variable=>source_field%VARIABLE_TYPE_MAP(variable_type)%PTR
3768 IF(
ASSOCIATED(field_variable))
THEN 3769 DO component_idx=1,field_variable%NUMBER_OF_COMPONENTS
3770 IF(field_variable%COMPONENTS(component_idx)%INTERPOLATION_TYPE==field_node_based_interpolation)
THEN 3771 domain=>field_variable%COMPONENTS(component_idx)%DOMAIN
3772 IF(
ASSOCIATED(domain))
THEN 3773 IF(
ASSOCIATED(domain%TOPOLOGY))
THEN 3774 domain_nodes=>domain%TOPOLOGY%NODES
3775 IF(
ASSOCIATED(domain_nodes))
THEN 3777 DO node_idx=1,domain_nodes%NUMBER_OF_NODES
3779 DO dim_idx=1,number_of_dimensions
3781 local_ny=geometric_variable%COMPONENTS(dim_idx)%PARAM_TO_DOF_MAP%NODE_PARAM2DOF_MAP% &
3782 & nodes(node_idx)%DERIVATIVES(1)%VERSIONS(1)
3783 x(dim_idx)=geometric_parameters(local_ny)
3786 DO deriv_idx=1,domain_nodes%NODES(node_idx)%NUMBER_OF_DERIVATIVES
3787 SELECT CASE(equations_set%ANALYTIC%ANALYTIC_FUNCTION_TYPE)
3789 value_source=-1*a1*exp(-1*current_time)*(x(1)*x(1)+x(2)*x(2)+x(3)*x(3)+6)
3791 local_error=
"The analytic function type of "// &
3793 & err,error))//
" is invalid." 3794 CALL flagerror(local_error,err,error,*999)
3797 local_ny=field_variable%COMPONENTS(component_idx)%PARAM_TO_DOF_MAP% &
3798 & node_param2dof_map%NODES(node_idx)%DERIVATIVES(deriv_idx)%VERSIONS(1)
3799 CALL field_parameter_set_update_local_dof(source_field,field_u_variable_type, &
3800 & field_values_set_type,local_ny,value_source,err,error,*999)
3804 CALL flagerror(
"Domain topology nodes is not associated.",err,error,*999)
3807 CALL flagerror(
"Domain topology is not associated.",err,error,*999)
3810 CALL flagerror(
"Domain is not associated.",err,error,*999)
3813 CALL flagerror(
"Only node based interpolation is implemented.",err,error,*999)
3816 CALL field_parameter_set_update_start(source_field,field_u_variable_type,field_values_set_type, &
3818 CALL field_parameter_set_update_finish(source_field,field_u_variable_type,field_values_set_type, &
3821 CALL flagerror(
"Field variable is not associated.",err,error,*999)
3823 CALL field_parameter_set_data_restore(geometric_field,field_u_variable_type,field_values_set_type, &
3824 & geometric_parameters,err,error,*999)
3826 CALL flagerror(
"Equations set geometric field is not associated.",err,error,*999)
3829 CALL flagerror(
"Equations set source field is not associated.",err,error,*999)
3833 CALL flagerror(
"Equations set analytic is not associated.",err,error,*999)
3836 CALL flagerror(
"Equations set is not associated.",err,error,*999)
3841 CALL flagerror(
"Solver equations are not associated.",err,error,*999)
3844 local_error=
"Problem subtype "//
trim(
number_to_vstring(control_loop%PROBLEM%SPECIFICATION(3),
"*",err,error))// &
3845 &
" is not valid for a diffusion equation type of a classical field problem class." 3846 CALL flagerror(local_error,err,error,*999)
3849 CALL flagerror(
"Problem is not associated.",err,error,*999)
3852 CALL flagerror(
"Solver is not associated.",err,error,*999)
3855 CALL flagerror(
"Control loop is not associated.",err,error,*999)
3858 exits(
"Diffusion_PreSolveUpdateAnalyticValues")
3860 999
errors(
"Diffusion_PreSolveUpdateAnalyticValues",err,error)
3861 exits(
"Diffusion_PreSolveUpdateAnalyticValues")
3875 INTEGER(INTG),
INTENT(OUT) :: ERR
3879 TYPE(
solver_type),
POINTER :: SOLVER_ALE_DIFFUSION
3885 REAL(DP) :: CURRENT_TIME,TIME_INCREMENT,ALPHA
3886 REAL(DP),
POINTER :: MESH_DISPLACEMENT_VALUES(:)
3888 INTEGER(INTG) :: dof_number,TOTAL_NUMBER_OF_DOFS,NDOFS_TO_PRINT
3890 INTEGER(INTG) :: NUMBER_OF_DIMENSIONS
3891 INTEGER(INTG) :: INPUT_TYPE,INPUT_OPTION
3892 REAL(DP),
POINTER :: INPUT_DATA1(:)
3894 enters(
"Diffusion_PreSolveALEUpdateMesh",err,error,*999)
3896 NULLIFY(solver_ale_diffusion)
3897 NULLIFY(solver_equations)
3898 NULLIFY(solver_mapping)
3899 NULLIFY(equations_set)
3901 IF(
ASSOCIATED(control_loop))
THEN 3904 ELSE IF(control_loop%CONTROL_LOOP_LEVEL>1)
THEN 3907 IF(
ASSOCIATED(solver))
THEN 3908 IF(
ASSOCIATED(control_loop%PROBLEM))
THEN 3909 IF(.NOT.
ALLOCATED(control_loop%PROBLEM%SPECIFICATION))
THEN 3910 CALL flagerror(
"Problem specification is not allocated.",err,error,*999)
3911 ELSE IF(
SIZE(control_loop%PROBLEM%SPECIFICATION,1)<3)
THEN 3912 CALL flagerror(
"Problem specification must have three entries for a Diffusion problem.",err,error,*999)
3914 SELECT CASE(control_loop%PROBLEM%SPECIFICATION(3))
3920 solver_equations=>solver%SOLVER_EQUATIONS
3921 IF(
ASSOCIATED(solver_equations))
THEN 3922 solver_mapping=>solver_equations%SOLVER_MAPPING
3923 IF(
ASSOCIATED(solver_mapping))
THEN 3924 equations_set=>solver_mapping%EQUATIONS_SETS(1)%PTR
3925 IF(
ASSOCIATED(equations_set))
THEN 3926 IF(.NOT.
ALLOCATED(equations_set%SPECIFICATION))
THEN 3927 CALL flagerror(
"Equations set specification is not allocated.",err,error,*999)
3928 ELSE IF(
SIZE(equations_set%SPECIFICATION,1)/=3)
THEN 3929 CALL flagerror(
"Equations set specification must have three entries for a diffusion type equations set.", &
3932 SELECT CASE(equations_set%SPECIFICATION(3))
3942 geometric_field=>equations_set%GEOMETRY%GEOMETRIC_FIELD
3943 IF(
ASSOCIATED(geometric_field))
THEN 3946 CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
3947 & number_of_dimensions,err,error,*999)
3951 NULLIFY(input_data1)
3957 NULLIFY(mesh_displacement_values)
3958 CALL field_parameter_set_data_get(geometric_field,field_u_variable_type, &
3959 & field_mesh_displacement_set_type,mesh_displacement_values,err,error,*999)
3961 ndofs_to_print =
SIZE(mesh_displacement_values,1)
3963 & mesh_displacement_values,
'(" MESH_DISPLACEMENT_VALUES = ",3(X,E13.6))',
'3(3(X,E13.6))', &
3970 total_number_of_dofs = geometric_field%VARIABLE_TYPE_MAP(field_u_variable_type)%PTR% &
3971 & total_number_of_dofs
3974 DO dof_number=1,total_number_of_dofs
3975 CALL field_parameter_set_add_local_dof(geometric_field, &
3976 & field_u_variable_type,field_values_set_type,dof_number, &
3977 & mesh_displacement_values(dof_number), &
3980 CALL field_parameter_set_update_start(geometric_field, &
3981 & field_u_variable_type, field_values_set_type,err,error,*999)
3982 CALL field_parameter_set_update_finish(geometric_field, &
3983 & field_u_variable_type, field_values_set_type,err,error,*999)
3986 alpha=1.0_dp/time_increment
3987 CALL field_parameter_sets_copy(geometric_field,field_u_variable_type, &
3988 & field_mesh_displacement_set_type,field_mesh_velocity_set_type,alpha,err,error,*999)
3989 CALL field_parameter_set_data_restore(geometric_field,field_u_variable_type, &
3990 & field_mesh_displacement_set_type,mesh_displacement_values,err,error,*999)
3992 CALL flagerror(
"Geometric field is not associated.",err,error,*999)
3995 local_error=
"Equations set subtype " &
3997 &
" is not valid for a diffusion equation type of a classical field problem class." 3998 CALL flagerror(local_error,err,error,*999)
4001 CALL flagerror(
"Equations set is not associated.",err,error,*999)
4004 CALL flagerror(
"Solver mapping is not associated.",err,error,*999)
4007 CALL flagerror(
"Solver equations is not associated.",err,error,*999)
4010 local_error=
"Problem subtype "//
trim(
number_to_vstring(control_loop%PROBLEM%SPECIFICATION(3),
"*",err,error))// &
4011 &
" is not valid for a diffusion equation type of a classical field problem class." 4012 CALL flagerror(local_error,err,error,*999)
4015 CALL flagerror(
"Problem is not associated.",err,error,*999)
4018 CALL flagerror(
"Solver is not associated.",err,error,*999)
4021 CALL flagerror(
"Control loop is not associated.",err,error,*999)
4024 exits(
"Diffusion_PreSolveALEUpdateMesh")
4026 999 errorsexits(
"Diffusion_PreSolveALEUpdateMesh",err,error)
4038 INTEGER(INTG),
INTENT(OUT) :: ERR
4042 TYPE(
solver_type),
POINTER :: SOLVER_DIFFUSION_ONE
4043 TYPE(
field_type),
POINTER :: DEPENDENT_FIELD_DIFFUSION_ONE
4049 INTEGER(INTG) :: NUMBER_OF_COMPONENTS_DEPENDENT_FIELD_DIFFUSION_ONE
4052 enters(
"Diffusion_PreSolveStoreCurrentSolution",err,error,*999)
4054 IF(
ASSOCIATED(control_loop))
THEN 4056 NULLIFY(solver_diffusion_one)
4058 IF(
ASSOCIATED(solver))
THEN 4059 IF(
ASSOCIATED(control_loop%PROBLEM))
THEN 4060 IF(.NOT.
ALLOCATED(control_loop%PROBLEM%SPECIFICATION))
THEN 4061 CALL flagerror(
"Problem specification is not allocated.",err,error,*999)
4062 ELSE IF(
SIZE(control_loop%PROBLEM%SPECIFICATION,1)<3)
THEN 4063 CALL flagerror(
"Problem specification must have three entries for a Diffusion problem.",err,error,*999)
4065 SELECT CASE(control_loop%PROBLEM%SPECIFICATION(3))
4073 IF(solver%GLOBAL_NUMBER==1)
THEN 4077 solver_equations_diffusion_one=>solver_diffusion_one%SOLVER_EQUATIONS
4078 IF(
ASSOCIATED(solver_equations_diffusion_one))
THEN 4079 solver_mapping_diffusion_one=>solver_equations_diffusion_one%SOLVER_MAPPING
4080 IF(
ASSOCIATED(solver_mapping_diffusion_one))
THEN 4081 equations_set_diffusion_one=>solver_mapping_diffusion_one%EQUATIONS_SETS(1)%PTR
4082 IF(
ASSOCIATED(equations_set_diffusion_one))
THEN 4083 dependent_field_diffusion_one=>equations_set_diffusion_one%DEPENDENT%DEPENDENT_FIELD
4084 IF(
ASSOCIATED(dependent_field_diffusion_one))
THEN 4085 CALL field_number_of_components_get(dependent_field_diffusion_one, &
4086 & field_u_variable_type,number_of_components_dependent_field_diffusion_one,err,error,*999)
4088 CALL flagerror(
"DEPENDENT_FIELD_DIFFUSION_ONE is not associated.",err,error,*999)
4091 CALL flagerror(
"Diffusion-one equations set is not associated.",err,error,*999)
4094 CALL flagerror(
"Diffusion-one solver mapping is not associated.",err,error,*999)
4097 CALL flagerror(
"Diffusion-one solver equations are not associated.",err,error,*999)
4101 DO i=1,number_of_components_dependent_field_diffusion_one
4102 CALL field_parameterstofieldparameterscopy(dependent_field_diffusion_one, &
4103 & field_u_variable_type,field_values_set_type,i,dependent_field_diffusion_one, &
4104 & field_u_variable_type,field_previous_values_set_type,i,err,error,*999)
4122 IF(solver%GLOBAL_NUMBER==2)
THEN 4125 & (dependent field - V variable_type) at time, t ... ",err,error,*999)
4127 solver_equations_diffusion_one=>solver_diffusion_one%SOLVER_EQUATIONS
4128 IF(
ASSOCIATED(solver_equations_diffusion_one))
THEN 4129 solver_mapping_diffusion_one=>solver_equations_diffusion_one%SOLVER_MAPPING
4130 IF(
ASSOCIATED(solver_mapping_diffusion_one))
THEN 4131 equations_set_diffusion_one=>solver_mapping_diffusion_one%EQUATIONS_SETS(1)%PTR
4132 IF(
ASSOCIATED(equations_set_diffusion_one))
THEN 4133 dependent_field_diffusion_one=>equations_set_diffusion_one%DEPENDENT%DEPENDENT_FIELD
4134 IF(
ASSOCIATED(dependent_field_diffusion_one))
THEN 4135 CALL field_number_of_components_get(dependent_field_diffusion_one, &
4136 & field_v_variable_type,number_of_components_dependent_field_diffusion_one,err,error,*999)
4138 CALL flagerror(
"DEPENDENT_FIELD_DIFFUSION_ONE is not associated.",err,error,*999)
4141 CALL flagerror(
"Diffusion equations set is not associated.",err,error,*999)
4144 CALL flagerror(
"Diffusion solver mapping is not associated.",err,error,*999)
4147 CALL flagerror(
"Diffusion solver equations are not associated.",err,error,*999)
4151 DO i=1,number_of_components_dependent_field_diffusion_one
4152 CALL field_parameterstofieldparameterscopy(dependent_field_diffusion_one, &
4153 & field_v_variable_type,field_values_set_type,i,dependent_field_diffusion_one, &
4154 & field_v_variable_type,field_previous_values_set_type,i,err,error,*999)
4172 local_error=
"Problem subtype "//
trim(
number_to_vstring(control_loop%PROBLEM%SPECIFICATION(3),
"*",err,error))// &
4173 &
" is not valid for a diffusion equation type of a classical field problem class." 4174 CALL flagerror(local_error,err,error,*999)
4177 CALL flagerror(
"Problem is not associated.",err,error,*999)
4180 CALL flagerror(
"Solver is not associated.",err,error,*999)
4183 CALL flagerror(
"Control loop is not associated.",err,error,*999)
4186 exits(
"Diffusion_PreSolveStoreCurrentSolution")
4188 999
errors(
"Diffusion_PreSolveStoreCurrentSolution",err,error)
4189 exits(
"Diffusion_PreSolveStoreCurrentSolution")
4202 INTEGER(INTG),
INTENT(OUT) :: ERR
4206 TYPE(
solver_type),
POINTER :: SOLVER_DIFFUSION_ONE, SOLVER_DIFFUSION_TWO
4207 TYPE(
field_type),
POINTER :: DEPENDENT_FIELD_DIFFUSION_TWO, SOURCE_FIELD_DIFFUSION_ONE
4208 TYPE(
solver_equations_type),
POINTER :: SOLVER_EQUATIONS_DIFFUSION_ONE, SOLVER_EQUATIONS_DIFFUSION_TWO
4209 TYPE(
solver_mapping_type),
POINTER :: SOLVER_MAPPING_DIFFUSION_ONE, SOLVER_MAPPING_DIFFUSION_TWO
4210 TYPE(
equations_set_type),
POINTER :: EQUATIONS_SET_DIFFUSION_ONE, EQUATIONS_SET_DIFFUSION_TWO
4213 INTEGER(INTG) :: NUMBER_OF_COMPONENTS_DEPENDENT_FIELD_DIFFUSION_TWO,NUMBER_OF_COMPONENTS_SOURCE_FIELD_DIFFUSION_ONE
4217 enters(
"Diffusion_PreSolveGetSourceValue",err,error,*999)
4219 IF(
ASSOCIATED(control_loop))
THEN 4221 NULLIFY(solver_diffusion_one)
4222 NULLIFY(solver_diffusion_two)
4224 IF(
ASSOCIATED(solver))
THEN 4225 IF(
ASSOCIATED(control_loop%PROBLEM))
THEN 4226 IF(.NOT.
ALLOCATED(control_loop%PROBLEM%SPECIFICATION))
THEN 4227 CALL flagerror(
"Problem specification is not allocated.",err,error,*999)
4228 ELSE IF(
SIZE(control_loop%PROBLEM%SPECIFICATION,1)<3)
THEN 4229 CALL flagerror(
"Problem specification must have three entries for a Diffusion problem.",err,error,*999)
4231 SELECT CASE(control_loop%PROBLEM%SPECIFICATION(3))
4239 IF(solver%GLOBAL_NUMBER==1)
THEN 4243 solver_equations_diffusion_two=>solver_diffusion_two%SOLVER_EQUATIONS
4244 IF(
ASSOCIATED(solver_equations_diffusion_two))
THEN 4245 solver_mapping_diffusion_two=>solver_equations_diffusion_two%SOLVER_MAPPING
4246 IF(
ASSOCIATED(solver_mapping_diffusion_two))
THEN 4247 equations_set_diffusion_two=>solver_mapping_diffusion_two%EQUATIONS_SETS(1)%PTR
4248 IF(
ASSOCIATED(equations_set_diffusion_two))
THEN 4249 dependent_field_diffusion_two=>equations_set_diffusion_two%DEPENDENT%DEPENDENT_FIELD
4250 IF(
ASSOCIATED(dependent_field_diffusion_two))
THEN 4251 CALL field_number_of_components_get(dependent_field_diffusion_two, &
4252 & field_u_variable_type,number_of_components_dependent_field_diffusion_two,err,error,*999)
4254 CALL flagerror(
"DEPENDENT_FIELD_DIFFUSION_TWO is not associated.",err,error,*999)
4257 CALL flagerror(
"Diffusion-two equations set is not associated.",err,error,*999)
4260 CALL flagerror(
"Diffusion-two solver mapping is not associated.",err,error,*999)
4263 CALL flagerror(
"Diffusion-two solver equations are not associated.",err,error,*999)
4269 solver_equations_diffusion_one=>solver_diffusion_one%SOLVER_EQUATIONS
4270 IF(
ASSOCIATED(solver_equations_diffusion_one))
THEN 4271 solver_mapping_diffusion_one=>solver_equations_diffusion_one%SOLVER_MAPPING
4272 IF(
ASSOCIATED(solver_mapping_diffusion_one))
THEN 4273 equations_set_diffusion_one=>solver_mapping_diffusion_one%EQUATIONS_SETS(1)%PTR
4274 IF(
ASSOCIATED(equations_set_diffusion_one))
THEN 4275 source_field_diffusion_one=>equations_set_diffusion_one%SOURCE%SOURCE_FIELD
4276 IF(
ASSOCIATED(source_field_diffusion_one))
THEN 4277 CALL field_number_of_components_get(source_field_diffusion_one, &
4278 & field_u_variable_type,number_of_components_source_field_diffusion_one,err,error,*999)
4280 CALL flagerror(
"SOURCE_FIELD_DIFFUSION_ONE is not associated.",err,error,*999)
4283 CALL flagerror(
"Diffusion-one equations set is not associated.",err,error,*999)
4286 CALL flagerror(
"Diffusion-one solver mapping is not associated.",err,error,*999)
4289 CALL flagerror(
"Diffusion-one solver equations are not associated.",err,error,*999)
4293 IF(number_of_components_source_field_diffusion_one==number_of_components_dependent_field_diffusion_two)
THEN 4294 DO i=1,number_of_components_source_field_diffusion_one
4295 CALL field_parameterstofieldparameterscopy(dependent_field_diffusion_two, &
4296 & field_u_variable_type,field_values_set_type,i,source_field_diffusion_one, &
4297 & field_u_variable_type,field_values_set_type,i,err,error,*999)
4301 local_error=
"Number of components of diffusion-two dependent field "// &
4302 &
"is not consistent with diffusion-one-equation source field." 4303 CALL flagerror(local_error,err,error,*999)
4320 local_error=
"Problem subtype "//
trim(
number_to_vstring(control_loop%PROBLEM%SPECIFICATION(3),
"*",err,error))// &
4321 &
" is not valid for a diffusion equation type of a classical field problem class." 4322 CALL flagerror(local_error,err,error,*999)
4325 CALL flagerror(
"Problem is not associated.",err,error,*999)
4328 CALL flagerror(
"Solver is not associated.",err,error,*999)
4331 CALL flagerror(
"Control loop is not associated.",err,error,*999)
4334 exits(
"Diffusion_PreSolveGetSourceValue")
4336 999 errorsexits(
"Diffusion_PreSolveGetSourceValue",err,error)
4349 INTEGER(INTG),
INTENT(OUT) :: ERR
4355 enters(
"DIFFUSION_EQUATION_POST_SOLVE",err,error,*999)
4359 IF(
ASSOCIATED(control_loop))
THEN 4360 IF(
ASSOCIATED(solver))
THEN 4361 IF(
ASSOCIATED(control_loop%PROBLEM))
THEN 4362 IF(.NOT.
ALLOCATED(control_loop%PROBLEM%SPECIFICATION))
THEN 4363 CALL flagerror(
"Problem specification is not allocated.",err,error,*999)
4364 ELSE IF(
SIZE(control_loop%PROBLEM%SPECIFICATION,1)<3)
THEN 4365 CALL flagerror(
"Problem specification must have three entries for a Diffusion problem.",err,error,*999)
4367 SELECT CASE(control_loop%PROBLEM%SPECIFICATION(3))
4374 CALL flagerror(
"Not implemented.",err,error,*999)
4376 local_error=
"Problem subtype "//
trim(
number_to_vstring(control_loop%PROBLEM%SPECIFICATION(3),
"*",err,error))// &
4377 &
" is not valid for a diffusion type of a classical field problem class." 4378 CALL flagerror(local_error,err,error,*999)
4381 CALL flagerror(
"Problem is not associated.",err,error,*999)
4384 CALL flagerror(
"Solver is not associated.",err,error,*999)
4387 CALL flagerror(
"Control loop is not associated.",err,error,*999)
4390 exits(
"DIFFUSION_EQUATION_POST_SOLVE")
4392 999 errorsexits(
"DIFFUSION_EQUATION_POST_SOLVE",err,error)
4407 INTEGER(INTG),
INTENT(OUT) :: ERR
4415 REAL(DP) :: CURRENT_TIME,TIME_INCREMENT
4416 INTEGER(INTG) :: EQUATIONS_SET_IDX,CURRENT_LOOP_ITERATION,OUTPUT_ITERATION_NUMBER
4418 CHARACTER(14) :: FILE
4419 CHARACTER(14) :: OUTPUT_FILE
4421 enters(
"DIFFUSION_EQUATION_POST_SOLVE_OUTPUT_DATA",err,error,*999)
4423 IF(
ASSOCIATED(control_loop))
THEN 4426 IF(
ASSOCIATED(solver))
THEN 4427 IF(
ASSOCIATED(control_loop%PROBLEM))
THEN 4428 IF(.NOT.
ALLOCATED(control_loop%PROBLEM%SPECIFICATION))
THEN 4429 CALL flagerror(
"Problem specification is not allocated.",err,error,*999)
4430 ELSE IF(
SIZE(control_loop%PROBLEM%SPECIFICATION,1)<3)
THEN 4431 CALL flagerror(
"Problem specification must have three entries for a Diffusion problem.",err,error,*999)
4433 SELECT CASE(control_loop%PROBLEM%SPECIFICATION(3))
4436 solver_equations=>solver%SOLVER_EQUATIONS
4437 IF(
ASSOCIATED(solver_equations))
THEN 4438 solver_mapping=>solver_equations%SOLVER_MAPPING
4439 IF(
ASSOCIATED(solver_mapping))
THEN 4441 DO equations_set_idx=1,solver_mapping%NUMBER_OF_EQUATIONS_SETS
4442 equations_set=>solver_mapping%EQUATIONS_SETS(equations_set_idx)%PTR
4444 current_loop_iteration=control_loop%TIME_LOOP%ITERATION_NUMBER
4445 output_iteration_number=control_loop%TIME_LOOP%OUTPUT_NUMBER
4447 IF(output_iteration_number/=0)
THEN 4448 IF(control_loop%TIME_LOOP%CURRENT_TIME<=control_loop%TIME_LOOP%STOP_TIME)
THEN 4449 IF(current_loop_iteration<10)
THEN 4450 WRITE(output_file,
'("TIME_STEP_000",I0)') current_loop_iteration
4451 ELSE IF(current_loop_iteration<100)
THEN 4452 WRITE(output_file,
'("TIME_STEP_00",I0)') current_loop_iteration
4453 ELSE IF(current_loop_iteration<1000)
THEN 4454 WRITE(output_file,
'("TIME_STEP_0",I0)') current_loop_iteration
4455 ELSE IF(current_loop_iteration<10000)
THEN 4456 WRITE(output_file,
'("TIME_STEP_",I0)') current_loop_iteration
4474 IF(
ASSOCIATED(equations_set%ANALYTIC))
THEN 4476 & equations_set%ANALYTIC%ANALYTIC_FUNCTION_TYPE== &
4488 CALL flagerror(
"Not implemented.",err,error,*999)
4490 local_error=
"Problem subtype "//
trim(
number_to_vstring(control_loop%PROBLEM%SPECIFICATION(3),
"*",err,error))// &
4491 &
" is not valid for a diffusion equation type of a classical field problem class." 4492 CALL flagerror(local_error,err,error,*999)
4495 CALL flagerror(
"Problem is not associated.",err,error,*999)
4498 CALL flagerror(
"Solver is not associated.",err,error,*999)
4501 CALL flagerror(
"Control loop is not associated.",err,error,*999)
4503 exits(
"DIFFUSION_EQUATION_POST_SOLVE_OUTPUT_DATA")
4505 999 errorsexits(
"DIFFUSION_EQUATION_POST_SOLVE_OUTPUT_DATA",err,error)
4517 INTEGER(INTG),
INTENT(IN) :: ELEMENT_NUMBER
4518 INTEGER(INTG),
INTENT(OUT) :: ERR
4521 INTEGER(INTG) FIELD_VAR_TYPE,mh,mhs,ms,ng,nh,nhs,ni,nj,ns,my_compartment,Ncompartments,imatrix,num_var_count
4522 INTEGER(INTG) :: MESH_COMPONENT_1, MESH_COMPONENT_2
4523 REAL(DP) :: C_PARAM,K_PARAM,RWG,SUM,PGMJ(3),PGNJ(3),A_PARAM,COUPLING_PARAM,PGM,PGN
4524 TYPE(
basis_type),
POINTER :: DEPENDENT_BASIS,GEOMETRIC_BASIS
4525 TYPE(
basis_type),
POINTER :: DEPENDENT_BASIS_1, DEPENDENT_BASIS_2
4536 TYPE(
field_type),
POINTER :: DEPENDENT_FIELD,GEOMETRIC_FIELD,MATERIALS_FIELD,SOURCE_FIELD,EQUATIONS_SET_FIELD
4540 INTEGER(INTG) :: FIELD_VAR_TYPES(99)
4545 & ADVEC_DIFF_DEPENDENT_PREVIOUS_INTERPOLATION_PARAMETERS,DIFFUSION_DEPENDENT_PREVIOUS_INTERPOLATION_PARAMETERS
4547 & ADVEC_DIFF_DEPENDENT_PREVIOUS_INTERPOLATED_POINT,DIFFUSION_DEPENDENT_PREVIOUS_INTERPOLATED_POINT
4548 INTEGER(INTG),
POINTER :: EQUATIONS_SET_FIELD_DATA(:)
4550 enters(
"DIFFUSION_EQUATION_FINITE_ELEMENT_CALCULATE",err,error,*999)
4552 IF(
ASSOCIATED(equations_set))
THEN 4553 IF(.NOT.
ALLOCATED(equations_set%SPECIFICATION))
THEN 4554 CALL flagerror(
"Equations set specification is not allocated.",err,error,*999)
4555 ELSE IF(
SIZE(equations_set%SPECIFICATION,1)/=3)
THEN 4556 CALL flagerror(
"Equations set specification must have three entries for a diffusion type equations set.", &
4559 equations=>equations_set%EQUATIONS
4560 IF(
ASSOCIATED(equations))
THEN 4561 SELECT CASE(equations_set%SPECIFICATION(3))
4566 dependent_field=>equations%INTERPOLATION%DEPENDENT_FIELD
4567 geometric_field=>equations%INTERPOLATION%GEOMETRIC_FIELD
4568 materials_field=>equations%INTERPOLATION%MATERIALS_FIELD
4574 source_field=>equations%INTERPOLATION%SOURCE_FIELD
4576 equations_matrices=>equations%EQUATIONS_MATRICES
4577 dynamic_matrices=>equations_matrices%DYNAMIC_MATRICES
4578 stiffness_matrix=>dynamic_matrices%MATRICES(1)%PTR
4579 damping_matrix=>dynamic_matrices%MATRICES(2)%PTR
4580 rhs_vector=>equations_matrices%RHS_VECTOR
4586 source_vector=>equations_matrices%SOURCE_VECTOR
4588 equations_mapping=>equations%EQUATIONS_MAPPING
4589 dynamic_mapping=>equations_mapping%DYNAMIC_MAPPING
4590 field_variable=>dynamic_mapping%EQUATIONS_MATRIX_TO_VAR_MAPS(1)%VARIABLE
4591 field_var_type=field_variable%VARIABLE_TYPE
4592 geometric_variable=>geometric_field%VARIABLE_TYPE_MAP(field_u_variable_type)%PTR
4593 dependent_basis=>dependent_field%DECOMPOSITION%DOMAIN(dependent_field%DECOMPOSITION%MESH_COMPONENT_NUMBER)%PTR% &
4594 & topology%ELEMENTS%ELEMENTS(element_number)%BASIS
4595 geometric_basis=>geometric_field%DECOMPOSITION%DOMAIN(geometric_field%DECOMPOSITION%MESH_COMPONENT_NUMBER)%PTR% &
4596 & topology%ELEMENTS%ELEMENTS(element_number)%BASIS
4598 CALL field_interpolation_parameters_element_get(field_values_set_type,element_number,equations%INTERPOLATION% &
4599 & geometric_interp_parameters(field_u_variable_type)%PTR,err,error,*999)
4600 CALL field_interpolation_parameters_element_get(field_values_set_type,element_number,equations%INTERPOLATION% &
4601 & materials_interp_parameters(field_u_variable_type)%PTR,err,error,*999)
4607 CALL field_interpolation_parameters_element_get(field_values_set_type,element_number,equations%INTERPOLATION% &
4608 & source_interp_parameters(field_u_variable_type)%PTR,err,error,*999)
4611 advec_diff_dependent_current_interpolation_parameters=> &
4612 & equations%INTERPOLATION%DEPENDENT_INTERP_PARAMETERS(field_u_variable_type)%PTR
4613 CALL field_interpolation_parameters_element_get(field_values_set_type,element_number, &
4614 & advec_diff_dependent_current_interpolation_parameters,err,error,*999)
4615 advec_diff_dependent_current_interpolated_point=> &
4616 & equations%INTERPOLATION%DEPENDENT_INTERP_POINT(field_u_variable_type)%PTR
4617 diffusion_dependent_previous_interpolation_parameters=> &
4618 & equations%INTERPOLATION%DEPENDENT_INTERP_PARAMETERS(field_v_variable_type)%PTR
4619 CALL field_interpolation_parameters_element_get(field_previous_values_set_type,element_number, &
4620 & diffusion_dependent_previous_interpolation_parameters,err,error,*999)
4621 diffusion_dependent_previous_interpolated_point=> &
4622 & equations%INTERPOLATION%DEPENDENT_INTERP_POINT(field_v_variable_type)%PTR
4625 DO ng=1,quadrature_scheme%NUMBER_OF_GAUSS
4627 & geometric_interp_point(field_u_variable_type)%PTR,err,error,*999)
4628 CALL field_interpolated_point_metrics_calculate(geometric_basis%NUMBER_OF_XI,equations%INTERPOLATION% &
4629 & geometric_interp_point_metrics(field_u_variable_type)%PTR,err,error,*999)
4631 & materials_interp_point(field_u_variable_type)%PTR,err,error,*999)
4638 & source_interp_point(field_u_variable_type)%PTR,err,error,*999)
4642 rwg=equations%INTERPOLATION%GEOMETRIC_INTERP_POINT_METRICS(field_u_variable_type)%PTR%JACOBIAN* &
4643 & quadrature_scheme%GAUSS_WEIGHTS(ng)
4646 DO mh=1,field_variable%NUMBER_OF_COMPONENTS
4648 DO ms=1,dependent_basis%NUMBER_OF_ELEMENT_PARAMETERS
4651 IF(stiffness_matrix%UPDATE_MATRIX.OR.damping_matrix%UPDATE_MATRIX)
THEN 4653 DO nh=1,field_variable%NUMBER_OF_COMPONENTS
4654 DO ns=1,dependent_basis%NUMBER_OF_ELEMENT_PARAMETERS
4656 IF(stiffness_matrix%UPDATE_MATRIX)
THEN 4658 DO nj=1,geometric_variable%NUMBER_OF_COMPONENTS
4661 DO ni=1,dependent_basis%NUMBER_OF_XI
4662 pgmj(nj)=pgmj(nj)+ &
4664 & equations%INTERPOLATION%GEOMETRIC_INTERP_POINT_METRICS(field_u_variable_type)%PTR%DXI_DX(ni,nj)
4665 pgnj(nj)=pgnj(nj)+ &
4667 & equations%INTERPOLATION%GEOMETRIC_INTERP_POINT_METRICS(field_u_variable_type)%PTR%DXI_DX(ni,nj)
4669 k_param=equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_u_variable_type)%PTR% &
4671 sum=sum+k_param*pgmj(nj)*pgnj(nj)
4678 stiffness_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)=stiffness_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)+sum*rwg
4681 a_param=equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_u_variable_type)%PTR% &
4682 & values(geometric_variable%NUMBER_OF_COMPONENTS,
no_part_deriv)
4683 stiffness_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)=stiffness_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)+sum*rwg- &
4684 & a_param*quadrature_scheme%GAUSS_BASIS_FNS(ms,
no_part_deriv,ng)* &
4685 & quadrature_scheme%GAUSS_BASIS_FNS(ns,
no_part_deriv,ng)*rwg
4688 IF(damping_matrix%UPDATE_MATRIX)
THEN 4689 damping_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)=damping_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)+ &
4691 & quadrature_scheme%GAUSS_BASIS_FNS(ns,
no_part_deriv,ng)*rwg
4696 IF(rhs_vector%UPDATE_VECTOR) rhs_vector%ELEMENT_VECTOR%VECTOR(mhs)=0.0_dp
4703 IF(source_vector%UPDATE_VECTOR)
THEN 4704 c_param=equations%INTERPOLATION%SOURCE_INTERP_POINT(field_u_variable_type)%PTR%VALUES(1,
no_part_deriv)
4706 DO mh=1,field_variable%NUMBER_OF_COMPONENTS
4708 DO ms=1,dependent_basis%NUMBER_OF_ELEMENT_PARAMETERS
4710 source_vector%ELEMENT_VECTOR%VECTOR(mhs)=source_vector%ELEMENT_VECTOR%VECTOR(mhs)+ &
4711 & quadrature_scheme%GAUSS_BASIS_FNS(ms,
no_part_deriv,ng)*c_param*rwg
4716 IF(source_vector%UPDATE_VECTOR)
THEN 4719 & advec_diff_dependent_current_interpolated_point,err,error,*999)
4721 & diffusion_dependent_previous_interpolated_point,err,error,*999)
4722 write(*,*) advec_diff_dependent_current_interpolated_point%VALUES(1,
no_part_deriv)
4723 write(*,*) diffusion_dependent_previous_interpolated_point%VALUES(1,
no_part_deriv)
4724 c_param=0.5_dp*advec_diff_dependent_current_interpolated_point%VALUES(1,
no_part_deriv)- &
4725 & diffusion_dependent_previous_interpolated_point%VALUES(1,
no_part_deriv)
4731 DO mh=1,field_variable%NUMBER_OF_COMPONENTS
4733 DO ms=1,dependent_basis%NUMBER_OF_ELEMENT_PARAMETERS
4735 source_vector%ELEMENT_VECTOR%VECTOR(mhs)=source_vector%ELEMENT_VECTOR%VECTOR(mhs)+ &
4736 & quadrature_scheme%GAUSS_BASIS_FNS(ms,
no_part_deriv,ng)*c_param*rwg
4741 IF(rhs_vector%UPDATE_VECTOR) rhs_vector%ELEMENT_VECTOR%VECTOR(mhs)=0.0_dp
4745 advec_diff_dependent_previous_interpolation_parameters=> &
4746 & equations%INTERPOLATION%DEPENDENT_INTERP_PARAMETERS(field_u_variable_type)%PTR
4747 CALL field_interpolation_parameters_element_get(field_previous_values_set_type,element_number, &
4748 & advec_diff_dependent_previous_interpolation_parameters,err,error,*999)
4749 advec_diff_dependent_previous_interpolated_point=> &
4750 & equations%INTERPOLATION%DEPENDENT_INTERP_POINT(field_u_variable_type)%PTR
4751 DO ng=1,quadrature_scheme%NUMBER_OF_GAUSS
4752 IF(source_vector%UPDATE_VECTOR)
THEN 4755 & advec_diff_dependent_previous_interpolated_point,err,error,*999)
4756 write(*,*) advec_diff_dependent_previous_interpolated_point%VALUES(1,
no_part_deriv)
4757 c_param=0.5_dp*advec_diff_dependent_previous_interpolated_point%VALUES(1,
no_part_deriv)
4759 DO mh=1,field_variable%NUMBER_OF_COMPONENTS
4761 DO ms=1,dependent_basis%NUMBER_OF_ELEMENT_PARAMETERS
4763 source_vector%ELEMENT_VECTOR%VECTOR(mhs)=source_vector%ELEMENT_VECTOR%VECTOR(mhs)+ &
4764 & quadrature_scheme%GAUSS_BASIS_FNS(ms,
no_part_deriv,ng)*c_param*rwg
4768 IF(rhs_vector%UPDATE_VECTOR) rhs_vector%ELEMENT_VECTOR%VECTOR(mhs)=0.0_dp
4773 IF(dependent_field%SCALINGS%SCALING_TYPE/=field_no_scaling)
THEN 4774 CALL field_interpolationparametersscalefactorselementget(element_number,equations%INTERPOLATION% &
4775 & dependent_interp_parameters(field_var_type)%PTR,err,error,*999)
4777 DO mh=1,field_variable%NUMBER_OF_COMPONENTS
4779 DO ms=1,dependent_basis%NUMBER_OF_ELEMENT_PARAMETERS
4782 IF(stiffness_matrix%UPDATE_MATRIX.OR.damping_matrix%UPDATE_MATRIX)
THEN 4784 DO nh=1,field_variable%NUMBER_OF_COMPONENTS
4785 DO ns=1,dependent_basis%NUMBER_OF_ELEMENT_PARAMETERS
4787 IF(stiffness_matrix%UPDATE_MATRIX)
THEN 4788 stiffness_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)=stiffness_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)* &
4789 & equations%INTERPOLATION%DEPENDENT_INTERP_PARAMETERS(field_var_type)%PTR%SCALE_FACTORS(ms,mh)* &
4790 & equations%INTERPOLATION%DEPENDENT_INTERP_PARAMETERS(field_var_type)%PTR%SCALE_FACTORS(ns,nh)
4792 IF(damping_matrix%UPDATE_MATRIX)
THEN 4793 damping_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)=damping_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)* &
4794 & equations%INTERPOLATION%DEPENDENT_INTERP_PARAMETERS(field_var_type)%PTR%SCALE_FACTORS(ms,mh)* &
4795 & equations%INTERPOLATION%DEPENDENT_INTERP_PARAMETERS(field_var_type)%PTR%SCALE_FACTORS(ns,nh)
4800 IF(rhs_vector%UPDATE_VECTOR) rhs_vector%ELEMENT_VECTOR%VECTOR(mhs)=rhs_vector%ELEMENT_VECTOR%VECTOR(mhs)* &
4801 & equations%INTERPOLATION%DEPENDENT_INTERP_PARAMETERS(field_var_type)%PTR%SCALE_FACTORS(ms,mh)
4807 IF(source_vector%UPDATE_VECTOR) source_vector%ELEMENT_VECTOR%VECTOR(mhs)= &
4808 & source_vector%ELEMENT_VECTOR%VECTOR(mhs)* &
4809 & equations%INTERPOLATION%DEPENDENT_INTERP_PARAMETERS(field_var_type)%PTR%SCALE_FACTORS(ms,mh)
4818 dependent_field=>equations%INTERPOLATION%DEPENDENT_FIELD
4819 geometric_field=>equations%INTERPOLATION%GEOMETRIC_FIELD
4820 materials_field=>equations%INTERPOLATION%MATERIALS_FIELD
4821 source_field=>equations%INTERPOLATION%SOURCE_FIELD
4822 equations_set_field=>equations_set%EQUATIONS_SET_FIELD%EQUATIONS_SET_FIELD_FIELD
4824 equations_matrices=>equations%EQUATIONS_MATRICES
4825 dynamic_matrices=>equations_matrices%DYNAMIC_MATRICES
4826 stiffness_matrix=>dynamic_matrices%MATRICES(1)%PTR
4827 damping_matrix=>dynamic_matrices%MATRICES(2)%PTR
4828 rhs_vector=>equations_matrices%RHS_VECTOR
4829 source_vector=>equations_matrices%SOURCE_VECTOR
4830 stiffness_matrix%ELEMENT_MATRIX%MATRIX=0.0_dp
4831 damping_matrix%ELEMENT_MATRIX%MATRIX=0.0_dp
4832 equations_mapping=>equations%EQUATIONS_MAPPING
4835 CALL field_parameter_set_data_get(equations_set_field,field_u_variable_type, &
4836 & field_values_set_type,equations_set_field_data,err,error,*999)
4838 my_compartment = equations_set_field_data(1)
4839 ncompartments = equations_set_field_data(2)
4841 linear_matrices=>equations_matrices%LINEAR_MATRICES
4842 linear_mapping=>equations_mapping%LINEAR_MAPPING
4846 DO imatrix = 1,ncompartments
4847 IF(imatrix/=my_compartment)
THEN 4848 num_var_count=num_var_count+1
4849 coupling_matrices(num_var_count)%PTR=>linear_matrices%MATRICES(num_var_count)%PTR
4850 field_variables(num_var_count)%PTR=>linear_mapping%EQUATIONS_MATRIX_TO_VAR_MAPS(num_var_count)%VARIABLE
4851 field_var_types(num_var_count)=field_variables(num_var_count)%PTR%VARIABLE_TYPE
4852 coupling_matrices(num_var_count)%PTR%ELEMENT_MATRIX%MATRIX=0.0_dp
4857 dynamic_mapping=>equations_mapping%DYNAMIC_MAPPING
4858 field_variable=>dynamic_mapping%EQUATIONS_MATRIX_TO_VAR_MAPS(1)%VARIABLE
4859 field_var_type=field_variable%VARIABLE_TYPE
4860 geometric_variable=>geometric_field%VARIABLE_TYPE_MAP(field_u_variable_type)%PTR
4861 dependent_basis=>dependent_field%DECOMPOSITION%DOMAIN(dependent_field%DECOMPOSITION%MESH_COMPONENT_NUMBER)%PTR% &
4862 & topology%ELEMENTS%ELEMENTS(element_number)%BASIS
4863 geometric_basis=>geometric_field%DECOMPOSITION%DOMAIN(geometric_field%DECOMPOSITION%MESH_COMPONENT_NUMBER)%PTR% &
4864 & topology%ELEMENTS%ELEMENTS(element_number)%BASIS
4866 CALL field_interpolation_parameters_element_get(field_values_set_type,element_number,equations%INTERPOLATION% &
4867 & geometric_interp_parameters(field_u_variable_type)%PTR,err,error,*999)
4868 CALL field_interpolation_parameters_element_get(field_values_set_type,element_number,equations%INTERPOLATION% &
4869 & materials_interp_parameters(field_u_variable_type)%PTR,err,error,*999)
4870 CALL field_interpolation_parameters_element_get(field_values_set_type,element_number,equations%INTERPOLATION% &
4871 & materials_interp_parameters(field_v_variable_type)%PTR,err,error,*999)
4872 CALL field_interpolation_parameters_element_get(field_values_set_type,element_number,equations%INTERPOLATION% &
4873 & source_interp_parameters(field_u_variable_type)%PTR,err,error,*999)
4876 DO ng=1,quadrature_scheme%NUMBER_OF_GAUSS
4878 & geometric_interp_point(field_u_variable_type)%PTR,err,error,*999)
4879 CALL field_interpolated_point_metrics_calculate(geometric_basis%NUMBER_OF_XI,equations%INTERPOLATION% &
4880 & geometric_interp_point_metrics(field_u_variable_type)%PTR,err,error,*999)
4882 & materials_interp_point(field_u_variable_type)%PTR,err,error,*999)
4884 & materials_interp_point(field_v_variable_type)%PTR,err,error,*999)
4886 & source_interp_point(field_u_variable_type)%PTR,err,error,*999)
4889 rwg=equations%INTERPOLATION%GEOMETRIC_INTERP_POINT_METRICS(field_u_variable_type)%PTR%JACOBIAN* &
4890 & quadrature_scheme%GAUSS_WEIGHTS(ng)
4893 DO mh=1,field_variable%NUMBER_OF_COMPONENTS
4895 DO ms=1,dependent_basis%NUMBER_OF_ELEMENT_PARAMETERS
4898 IF(stiffness_matrix%UPDATE_MATRIX.OR.damping_matrix%UPDATE_MATRIX)
THEN 4900 DO nh=1,field_variable%NUMBER_OF_COMPONENTS
4901 DO ns=1,dependent_basis%NUMBER_OF_ELEMENT_PARAMETERS
4903 IF(stiffness_matrix%UPDATE_MATRIX)
THEN 4905 DO nj=1,geometric_variable%NUMBER_OF_COMPONENTS
4908 DO ni=1,dependent_basis%NUMBER_OF_XI
4909 pgmj(nj)=pgmj(nj)+ &
4911 & equations%INTERPOLATION%GEOMETRIC_INTERP_POINT_METRICS(field_u_variable_type)%PTR%DXI_DX(ni,nj)
4912 pgnj(nj)=pgnj(nj)+ &
4914 & equations%INTERPOLATION%GEOMETRIC_INTERP_POINT_METRICS(field_u_variable_type)%PTR%DXI_DX(ni,nj)
4916 k_param=equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_u_variable_type)%PTR% &
4918 sum=sum+k_param*pgmj(nj)*pgnj(nj)
4920 coupling_param=equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_v_variable_type)%PTR% &
4922 stiffness_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)=stiffness_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)+ &
4923 & sum*rwg + quadrature_scheme%GAUSS_BASIS_FNS(ms,
no_part_deriv,ng)* &
4924 & quadrature_scheme%GAUSS_BASIS_FNS(ns,
no_part_deriv,ng)*rwg*coupling_param
4926 IF(damping_matrix%UPDATE_MATRIX)
THEN 4927 damping_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)=damping_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)+ &
4929 & quadrature_scheme%GAUSS_BASIS_FNS(ns,
no_part_deriv,ng)*rwg
4934 IF(rhs_vector%UPDATE_VECTOR) rhs_vector%ELEMENT_VECTOR%VECTOR(mhs)=0.0_dp
4937 IF(source_vector%UPDATE_VECTOR)
THEN 4938 c_param=equations%INTERPOLATION%SOURCE_INTERP_POINT(field_u_variable_type)%PTR%VALUES(1,
no_part_deriv)
4940 DO mh=1,field_variable%NUMBER_OF_COMPONENTS
4942 DO ms=1,dependent_basis%NUMBER_OF_ELEMENT_PARAMETERS
4944 source_vector%ELEMENT_VECTOR%VECTOR(mhs)=source_vector%ELEMENT_VECTOR%VECTOR(mhs)+ &
4945 & quadrature_scheme%GAUSS_BASIS_FNS(ms,
no_part_deriv,ng)*c_param*rwg
4949 IF(rhs_vector%UPDATE_VECTOR) rhs_vector%ELEMENT_VECTOR%VECTOR(mhs)=0.0_dp
4954 DO mh=1,field_variable%NUMBER_OF_COMPONENTS
4956 mesh_component_1 = field_variable%COMPONENTS(mh)%MESH_COMPONENT_NUMBER
4957 dependent_basis_1 => dependent_field%DECOMPOSITION%DOMAIN(mesh_component_1)%PTR% &
4958 & topology%ELEMENTS%ELEMENTS(element_number)%BASIS
4959 quadrature_scheme_1 => dependent_basis_1%QUADRATURE% &
4961 rwg = equations%INTERPOLATION%GEOMETRIC_INTERP_POINT_METRICS(field_u_variable_type)%PTR%JACOBIAN * &
4962 & quadrature_scheme_1%GAUSS_WEIGHTS(ng)
4964 DO ms=1,dependent_basis_1%NUMBER_OF_ELEMENT_PARAMETERS
4968 DO imatrix = 1,ncompartments
4969 IF(imatrix/=my_compartment)
THEN 4970 num_var_count=num_var_count+1
4974 IF(coupling_matrices(num_var_count)%PTR%UPDATE_MATRIX)
THEN 4979 DO nh=1,field_variables(num_var_count)%PTR%NUMBER_OF_COMPONENTS
4981 mesh_component_2 = field_variable%COMPONENTS(nh)%MESH_COMPONENT_NUMBER
4982 dependent_basis_2 => dependent_field%DECOMPOSITION%DOMAIN(mesh_component_2)%PTR% &
4983 & topology%ELEMENTS%ELEMENTS(element_number)%BASIS
4985 quadrature_scheme_2 => dependent_basis_2%QUADRATURE% &
4990 DO ns=1,dependent_basis_2%NUMBER_OF_ELEMENT_PARAMETERS
5000 pgm=quadrature_scheme_1%GAUSS_BASIS_FNS(ms,
no_part_deriv,ng)
5001 pgn=quadrature_scheme_2%GAUSS_BASIS_FNS(ns,
no_part_deriv,ng)
5004 coupling_param=equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_v_variable_type)%PTR% &
5009 coupling_matrices(num_var_count)%PTR%ELEMENT_MATRIX%MATRIX(mhs,nhs) = &
5010 & coupling_matrices(num_var_count)%PTR%ELEMENT_MATRIX%MATRIX(mhs,nhs) + &
5011 & coupling_param * pgm * pgn * rwg
5026 IF(dependent_field%SCALINGS%SCALING_TYPE/=field_no_scaling)
THEN 5027 CALL field_interpolationparametersscalefactorselementget(element_number,equations%INTERPOLATION% &
5028 & dependent_interp_parameters(field_var_type)%PTR,err,error,*999)
5030 DO mh=1,field_variable%NUMBER_OF_COMPONENTS
5032 DO ms=1,dependent_basis%NUMBER_OF_ELEMENT_PARAMETERS
5035 IF(stiffness_matrix%UPDATE_MATRIX.OR.damping_matrix%UPDATE_MATRIX)
THEN 5037 DO nh=1,field_variable%NUMBER_OF_COMPONENTS
5038 DO ns=1,dependent_basis%NUMBER_OF_ELEMENT_PARAMETERS
5040 IF(stiffness_matrix%UPDATE_MATRIX)
THEN 5041 stiffness_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)=stiffness_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)* &
5042 & equations%INTERPOLATION%DEPENDENT_INTERP_PARAMETERS(field_var_type)%PTR%SCALE_FACTORS(ms,mh)* &
5043 & equations%INTERPOLATION%DEPENDENT_INTERP_PARAMETERS(field_var_type)%PTR%SCALE_FACTORS(ns,nh)
5045 IF(damping_matrix%UPDATE_MATRIX)
THEN 5046 damping_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)=damping_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)* &
5047 & equations%INTERPOLATION%DEPENDENT_INTERP_PARAMETERS(field_var_type)%PTR%SCALE_FACTORS(ms,mh)* &
5048 & equations%INTERPOLATION%DEPENDENT_INTERP_PARAMETERS(field_var_type)%PTR%SCALE_FACTORS(ns,nh)
5053 IF(rhs_vector%UPDATE_VECTOR) rhs_vector%ELEMENT_VECTOR%VECTOR(mhs)=rhs_vector%ELEMENT_VECTOR%VECTOR(mhs)* &
5054 & equations%INTERPOLATION%DEPENDENT_INTERP_PARAMETERS(field_var_type)%PTR%SCALE_FACTORS(ms,mh)
5055 IF(source_vector%UPDATE_VECTOR) source_vector%ELEMENT_VECTOR%VECTOR(mhs)= &
5056 & source_vector%ELEMENT_VECTOR%VECTOR(mhs)* &
5057 & equations%INTERPOLATION%DEPENDENT_INTERP_PARAMETERS(field_var_type)%PTR%SCALE_FACTORS(ms,mh)
5064 CALL flagerror(
"Can not calculate finite element stiffness matrices for a nonlinear source.",err,error,*999)
5066 local_error=
"Equations set subtype "//
trim(
number_to_vstring(equations_set%SPECIFICATION(3),
"*",err,error))// &
5067 &
" is not valid for a diffusion equation type of a classical field equations set class." 5068 CALL flagerror(local_error,err,error,*999)
5071 CALL flagerror(
"Equations set equations is not associated.",err,error,*999)
5074 CALL flagerror(
"Equations set is not associated.",err,error,*999)
5077 exits(
"DIFFUSION_EQUATION_FINITE_ELEMENT_CALCULATE")
5079 999 errorsexits(
"DIFFUSION_EQUATION_FINITE_ELEMENT_CALCULATE",err,error)
5092 INTEGER(INTG),
INTENT(IN) :: problemSpecification(:)
5093 INTEGER(INTG),
INTENT(OUT) :: err
5097 INTEGER(INTG) :: problemSubtype
5099 enters(
"Diffusion_ProblemSpecificationSet",err,error,*999)
5101 IF(
ASSOCIATED(problem))
THEN 5102 IF(
SIZE(problemspecification,1)==3)
THEN 5103 problemsubtype=problemspecification(3)
5104 SELECT CASE(problemsubtype)
5113 localerror=
"The third problem specification of "//
trim(
numbertovstring(problemsubtype,
"*",err,error))// &
5114 &
" is not valid for a diffusion type of a classical field problem." 5115 CALL flagerror(localerror,err,error,*999)
5117 IF(
ALLOCATED(problem%specification))
THEN 5118 CALL flagerror(
"Problem specification is already allocated.",err,error,*999)
5120 ALLOCATE(problem%specification(3),stat=err)
5121 IF(err/=0)
CALL flagerror(
"Could not allocate problem specification.",err,error,*999)
5125 CALL flagerror(
"Diffusion equation problem specification must have three entries.",err,error,*999)
5128 CALL flagerror(
"Problem is not associated.",err,error,*999)
5131 exits(
"Diffusion_ProblemSpecificationSet")
5133 999
errors(
"Diffusion_ProblemSpecificationSet",err,error)
5134 exits(
"Diffusion_ProblemSpecificationSet")
5149 INTEGER(INTG),
INTENT(OUT) :: ERR
5152 INTEGER(INTG) :: PROBLEM_SUBTYPE
5159 enters(
"DIFFUSION_EQUATION_PROBLEM_LINEAR_SETUP",err,error,*999)
5162 NULLIFY(control_loop)
5164 NULLIFY(solver_equations)
5166 IF(
ASSOCIATED(problem))
THEN 5167 IF(.NOT.
ALLOCATED(problem%SPECIFICATION))
THEN 5168 CALL flagerror(
"Problem specification is not allocated.",err,error,*999)
5169 ELSE IF(
SIZE(problem%SPECIFICATION,1)<3)
THEN 5170 CALL flagerror(
"Problem specification must have three entries for a Diffusion problem.",err,error,*999)
5172 problem_subtype=problem%SPECIFICATION(3)
5177 SELECT CASE(problem_setup%SETUP_TYPE)
5179 SELECT CASE(problem_setup%ACTION_TYPE)
5185 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
5187 &
" is invalid for a linear diffusion equation." 5188 CALL flagerror(local_error,err,error,*999)
5191 SELECT CASE(problem_setup%ACTION_TYPE)
5198 control_loop_root=>problem%CONTROL_LOOP
5202 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
5204 &
" is invalid for a linear diffusion equation." 5205 CALL flagerror(local_error,err,error,*999)
5209 control_loop_root=>problem%CONTROL_LOOP
5211 SELECT CASE(problem_setup%ACTION_TYPE)
5231 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
5233 &
" is invalid for a linear diffusion equation." 5234 CALL flagerror(local_error,err,error,*999)
5237 SELECT CASE(problem_setup%ACTION_TYPE)
5240 control_loop_root=>problem%CONTROL_LOOP
5252 control_loop_root=>problem%CONTROL_LOOP
5261 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
5263 &
" is invalid for a linear diffusion equation." 5264 CALL flagerror(local_error,err,error,*999)
5267 local_error=
"The setup type of "//
trim(
number_to_vstring(problem_setup%SETUP_TYPE,
"*",err,error))// &
5268 &
" is invalid for a linear diffusion equation." 5269 CALL flagerror(local_error,err,error,*999)
5273 &
" does not equal a linear diffusion equation subtype." 5274 CALL flagerror(local_error,err,error,*999)
5277 CALL flagerror(
"Problem is not associated.",err,error,*999)
5280 exits(
"DIFFUSION_EQUATION_PROBLEM_LINEAR_SETUP")
5282 999 errorsexits(
"DIFFUSION_EQUATION_PROBLEM_LINEAR_SETUP",err,error)
5296 INTEGER(INTG),
INTENT(OUT) :: ERR
5305 enters(
"DIFFUSION_EQUATION_PROBLEM_NONLINEAR_SETUP",err,error,*999)
5307 NULLIFY(control_loop)
5309 NULLIFY(solver_equations)
5311 IF(
ASSOCIATED(problem))
THEN 5312 IF(.NOT.
ALLOCATED(problem%SPECIFICATION))
THEN 5313 CALL flagerror(
"Problem specification is not allocated.",err,error,*999)
5314 ELSE IF(
SIZE(problem%SPECIFICATION,1)<3)
THEN 5315 CALL flagerror(
"Problem specification must have three entries for a Diffusion problem.",err,error,*999)
5318 SELECT CASE(problem_setup%SETUP_TYPE)
5320 SELECT CASE(problem_setup%ACTION_TYPE)
5326 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
5328 &
" is invalid for a nonlinear diffusion problem." 5329 CALL flagerror(local_error,err,error,*999)
5332 SELECT CASE(problem_setup%ACTION_TYPE)
5339 control_loop_root=>problem%CONTROL_LOOP
5343 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
5345 &
" is invalid for a nonlinear diffusion problem." 5346 CALL flagerror(local_error,err,error,*999)
5350 control_loop_root=>problem%CONTROL_LOOP
5352 SELECT CASE(problem_setup%ACTION_TYPE)
5373 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
5375 &
" is invalid for a nonlinear diffusion problem." 5376 CALL flagerror(local_error,err,error,*999)
5379 SELECT CASE(problem_setup%ACTION_TYPE)
5382 control_loop_root=>problem%CONTROL_LOOP
5394 control_loop_root=>problem%CONTROL_LOOP
5403 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
5405 &
" is invalid for a nonlinear diffusion problem." 5406 CALL flagerror(local_error,err,error,*999)
5409 local_error=
"The setup type of "//
trim(
number_to_vstring(problem_setup%SETUP_TYPE,
"*",err,error))// &
5410 &
" is invalid for a nonlinear diffusion problem." 5411 CALL flagerror(local_error,err,error,*999)
5414 local_error=
"The problem subtype of "//
trim(
number_to_vstring(problem%SPECIFICATION(3),
"*",err,error))// &
5415 &
" does not equal a nonlinear diffusion problem subtype." 5416 CALL flagerror(local_error,err,error,*999)
5419 CALL flagerror(
"Problem is not associated.",err,error,*999)
5422 exits(
"DIFFUSION_EQUATION_PROBLEM_NONLINEAR_SETUP")
5424 999 errorsexits(
"DIFFUSION_EQUATION_PROBLEM_NONLINEAR_SETUP",err,error)
5437 INTEGER(INTG),
INTENT(IN) :: ELEMENT_NUMBER
5438 INTEGER(INTG),
INTENT(OUT) :: ERR
5441 INTEGER(INTG) FIELD_VAR_TYPE,ng,mh,mhs,ms,nh,nhs,ns
5442 REAL(DP) :: B_PARAM,C_PARAM,RWG,U_VALUE,VALUE
5443 TYPE(
basis_type),
POINTER :: DEPENDENT_BASIS,GEOMETRIC_BASIS
5450 TYPE(
field_type),
POINTER :: DEPENDENT_FIELD,GEOMETRIC_FIELD,MATERIALS_FIELD
5455 enters(
"Diffusion_FiniteElementJacobianEvaluate",err,error,*999)
5457 IF(
ASSOCIATED(equations_set))
THEN 5458 IF(.NOT.
ALLOCATED(equations_set%SPECIFICATION))
THEN 5459 CALL flagerror(
"Equations set specification is not allocated.",err,error,*999)
5460 ELSE IF(
SIZE(equations_set%SPECIFICATION,1)/=3)
THEN 5461 CALL flagerror(
"Equations set specification must have three entries for a diffusion type equations set.", &
5464 equations=>equations_set%EQUATIONS
5465 IF(
ASSOCIATED(equations))
THEN 5466 SELECT CASE(equations_set%SPECIFICATION(3))
5468 CALL flagerror(
"Can not evaluate a residual for a diffusion equation with no source.",err,error,*999)
5470 CALL flagerror(
"Can not evaluate a residual for a diffusion equation with a constant source.",err,error,*999)
5472 CALL flagerror(
"Can not evaluate a residual for a diffusion equation with a linear source.",err,error,*999)
5474 equations_matrices=>equations%EQUATIONS_MATRICES
5475 nonlinear_matrices=>equations_matrices%NONLINEAR_MATRICES
5476 jacobian_matrix=>nonlinear_matrices%JACOBIANS(1)%PTR
5477 IF(jacobian_matrix%UPDATE_JACOBIAN)
THEN 5479 dependent_field=>equations%INTERPOLATION%DEPENDENT_FIELD
5480 geometric_field=>equations%INTERPOLATION%GEOMETRIC_FIELD
5481 materials_field=>equations%INTERPOLATION%MATERIALS_FIELD
5482 equations_mapping=>equations%EQUATIONS_MAPPING
5483 nonlinear_mapping=>equations_mapping%NONLINEAR_MAPPING
5484 dependent_variable=>nonlinear_mapping%RESIDUAL_VARIABLES(1)%PTR
5485 field_var_type=dependent_variable%VARIABLE_TYPE
5486 geometric_variable=>geometric_field%VARIABLE_TYPE_MAP(field_u_variable_type)%PTR
5487 dependent_basis=>dependent_field%DECOMPOSITION%DOMAIN(dependent_field%DECOMPOSITION%MESH_COMPONENT_NUMBER)%PTR% &
5488 & topology%ELEMENTS%ELEMENTS(element_number)%BASIS
5489 geometric_basis=>geometric_field%DECOMPOSITION%DOMAIN(geometric_field%DECOMPOSITION%MESH_COMPONENT_NUMBER)%PTR% &
5490 & topology%ELEMENTS%ELEMENTS(element_number)%BASIS
5492 CALL field_interpolation_parameters_element_get(field_values_set_type,element_number,equations%INTERPOLATION% &
5493 & dependent_interp_parameters(field_var_type)%PTR,err,error,*999)
5494 CALL field_interpolation_parameters_element_get(field_values_set_type,element_number,equations%INTERPOLATION% &
5495 & geometric_interp_parameters(field_u_variable_type)%PTR,err,error,*999)
5496 CALL field_interpolation_parameters_element_get(field_values_set_type,element_number,equations%INTERPOLATION% &
5497 & materials_interp_parameters(field_u_variable_type)%PTR,err,error,*999)
5499 DO ng=1,quadrature_scheme%NUMBER_OF_GAUSS
5501 & dependent_interp_point(field_var_type)%PTR,err,error,*999)
5503 & geometric_interp_point(field_u_variable_type)%PTR,err,error,*999)
5504 CALL field_interpolated_point_metrics_calculate(geometric_basis%NUMBER_OF_XI,equations%INTERPOLATION% &
5505 & geometric_interp_point_metrics(field_u_variable_type)%PTR,err,error,*999)
5507 & materials_interp_point(field_u_variable_type)%PTR,err,error,*999)
5509 rwg=equations%INTERPOLATION%GEOMETRIC_INTERP_POINT_METRICS(field_u_variable_type)%PTR%JACOBIAN* &
5510 & quadrature_scheme%GAUSS_WEIGHTS(ng)
5512 b_param=equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_u_variable_type)%PTR% &
5513 & values(geometric_variable%NUMBER_OF_COMPONENTS+2,
no_part_deriv)
5514 u_value=equations%INTERPOLATION%DEPENDENT_INTERP_POINT(field_var_type)%PTR%VALUES(1,
no_part_deriv)
5517 DO mh=1,dependent_variable%NUMBER_OF_COMPONENTS
5519 DO ms=1,dependent_basis%NUMBER_OF_ELEMENT_PARAMETERS
5523 DO nh=1,dependent_variable%NUMBER_OF_COMPONENTS
5524 DO ns=1,dependent_basis%NUMBER_OF_ELEMENT_PARAMETERS
5526 VALUE=-2.0_dp*b_param*quadrature_scheme%GAUSS_BASIS_FNS(ms,
no_part_deriv,ng)* &
5527 & quadrature_scheme%GAUSS_BASIS_FNS(ns,
no_part_deriv,ng)*u_value
5528 jacobian_matrix%ELEMENT_JACOBIAN%MATRIX(mhs,nhs)=jacobian_matrix%ELEMENT_JACOBIAN%MATRIX(mhs,nhs)+
VALUE*rwg
5536 equations_matrices=>equations%EQUATIONS_MATRICES
5537 nonlinear_matrices=>equations_matrices%NONLINEAR_MATRICES
5538 jacobian_matrix=>nonlinear_matrices%JACOBIANS(1)%PTR
5539 IF(jacobian_matrix%UPDATE_JACOBIAN)
THEN 5541 dependent_field=>equations%INTERPOLATION%DEPENDENT_FIELD
5542 geometric_field=>equations%INTERPOLATION%GEOMETRIC_FIELD
5543 materials_field=>equations%INTERPOLATION%MATERIALS_FIELD
5544 equations_mapping=>equations%EQUATIONS_MAPPING
5545 nonlinear_mapping=>equations_mapping%NONLINEAR_MAPPING
5546 dependent_variable=>nonlinear_mapping%RESIDUAL_VARIABLES(1)%PTR
5547 field_var_type=dependent_variable%VARIABLE_TYPE
5548 geometric_variable=>geometric_field%VARIABLE_TYPE_MAP(field_u_variable_type)%PTR
5549 dependent_basis=>dependent_field%DECOMPOSITION%DOMAIN(dependent_field%DECOMPOSITION%MESH_COMPONENT_NUMBER)%PTR% &
5550 & topology%ELEMENTS%ELEMENTS(element_number)%BASIS
5551 geometric_basis=>geometric_field%DECOMPOSITION%DOMAIN(geometric_field%DECOMPOSITION%MESH_COMPONENT_NUMBER)%PTR% &
5552 & topology%ELEMENTS%ELEMENTS(element_number)%BASIS
5554 CALL field_interpolation_parameters_element_get(field_values_set_type,element_number,equations%INTERPOLATION% &
5555 & dependent_interp_parameters(field_var_type)%PTR,err,error,*999)
5556 CALL field_interpolation_parameters_element_get(field_values_set_type,element_number,equations%INTERPOLATION% &
5557 & geometric_interp_parameters(field_u_variable_type)%PTR,err,error,*999)
5558 CALL field_interpolation_parameters_element_get(field_values_set_type,element_number,equations%INTERPOLATION% &
5559 & materials_interp_parameters(field_u_variable_type)%PTR,err,error,*999)
5561 DO ng=1,quadrature_scheme%NUMBER_OF_GAUSS
5563 & dependent_interp_point(field_var_type)%PTR,err,error,*999)
5565 & geometric_interp_point(field_u_variable_type)%PTR,err,error,*999)
5566 CALL field_interpolated_point_metrics_calculate(geometric_basis%NUMBER_OF_XI,equations%INTERPOLATION% &
5567 & geometric_interp_point_metrics(field_u_variable_type)%PTR,err,error,*999)
5569 & materials_interp_point(field_u_variable_type)%PTR,err,error,*999)
5571 rwg=equations%INTERPOLATION%GEOMETRIC_INTERP_POINT_METRICS(field_u_variable_type)%PTR%JACOBIAN* &
5572 & quadrature_scheme%GAUSS_WEIGHTS(ng)
5574 b_param=equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_u_variable_type)%PTR% &
5575 & values(geometric_variable%NUMBER_OF_COMPONENTS+2,
no_part_deriv)
5576 c_param=equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_u_variable_type)%PTR% &
5577 & values(geometric_variable%NUMBER_OF_COMPONENTS+3,
no_part_deriv)
5578 u_value=equations%INTERPOLATION%DEPENDENT_INTERP_POINT(field_var_type)%PTR%VALUES(1,
no_part_deriv)
5581 DO mh=1,dependent_variable%NUMBER_OF_COMPONENTS
5583 DO ms=1,dependent_basis%NUMBER_OF_ELEMENT_PARAMETERS
5587 DO nh=1,dependent_variable%NUMBER_OF_COMPONENTS
5588 DO ns=1,dependent_basis%NUMBER_OF_ELEMENT_PARAMETERS
5590 VALUE=-b_param*c_param*quadrature_scheme%GAUSS_BASIS_FNS(ms,
no_part_deriv,ng)* &
5591 & quadrature_scheme%GAUSS_BASIS_FNS(ns,
no_part_deriv,ng)*exp(c_param*u_value)
5592 jacobian_matrix%ELEMENT_JACOBIAN%MATRIX(mhs,nhs)=jacobian_matrix%ELEMENT_JACOBIAN%MATRIX(mhs,nhs)+
VALUE*rwg
5600 CALL flagerror(
"Can not evaluate a residual for an ALE diffusion equation with no source.",err,error,*999)
5602 CALL flagerror(
"Can not evaluate a residual for an ALE diffusion equation with a constant source.",err,error,*999)
5604 CALL flagerror(
"Can not evaluate a residual for an ALE diffusion equation with a linear source.",err,error,*999)
5606 CALL flagerror(
"Not implemented.",err,error,*999)
5608 CALL flagerror(
"Not implemented.",err,error,*999)
5610 CALL flagerror(
"Can not evaluate a residual for a multi component transport diffusion equation.",err,error,*999)
5612 local_error=
"Equations set subtype "//
trim(
number_to_vstring(equations_set%SPECIFICATION(3),
"*",err,error))// &
5613 &
" is not valid for a diffusion equation type of a classical field equations set class." 5614 CALL flagerror(local_error,err,error,*999)
5617 CALL flagerror(
"Equations set equations is not associated.",err,error,*999)
5620 CALL flagerror(
"Equations set is not associated.",err,error,*999)
5623 exits(
"Diffusion_FiniteElementJacobianEvaluate")
5625 999
errors(
"Diffusion_FiniteElementJacobianEvaluate",err,error)
5626 exits(
"Diffusion_FiniteElementJacobianEvaluate")
5640 INTEGER(INTG),
INTENT(IN) :: ELEMENT_NUMBER
5641 INTEGER(INTG),
INTENT(OUT) :: ERR
5644 INTEGER(INTG) FIELD_VAR_TYPE,ng,mh,mhs,ms,nj,nh,nhs,ni,ns
5645 REAL(DP) :: A_PARAM,B_PARAM,C_PARAM,K_PARAM,RWG,SUM1,SUM2,PGMJ(3),PGNJ(3),U_VALUE
5646 TYPE(
basis_type),
POINTER :: DEPENDENT_BASIS,GEOMETRIC_BASIS
5656 TYPE(
field_type),
POINTER :: DEPENDENT_FIELD,GEOMETRIC_FIELD,MATERIALS_FIELD
5661 enters(
"Diffusion_FiniteElementResidualEvaluate",err,error,*999)
5663 IF(
ASSOCIATED(equations_set))
THEN 5664 IF(.NOT.
ALLOCATED(equations_set%SPECIFICATION))
THEN 5665 CALL flagerror(
"Equations set specification is not allocated.",err,error,*999)
5666 ELSE IF(
SIZE(equations_set%SPECIFICATION,1)/=3)
THEN 5667 CALL flagerror(
"Equations set specification must have three entries for a diffusion type equations set.", &
5670 equations=>equations_set%EQUATIONS
5671 IF(
ASSOCIATED(equations))
THEN 5672 SELECT CASE(equations_set%SPECIFICATION(3))
5674 CALL flagerror(
"Can not evaluate a residual for a diffusion equation with no source.",err,error,*999)
5676 CALL flagerror(
"Can not evaluate a residual for a diffusion equation with a constant source.",err,error,*999)
5678 CALL flagerror(
"Can not evaluate a residual for a diffusion equation with a linear source.",err,error,*999)
5681 dependent_field=>equations%INTERPOLATION%DEPENDENT_FIELD
5682 geometric_field=>equations%INTERPOLATION%GEOMETRIC_FIELD
5683 materials_field=>equations%INTERPOLATION%MATERIALS_FIELD
5684 equations_matrices=>equations%EQUATIONS_MATRICES
5685 dynamic_matrices=>equations_matrices%DYNAMIC_MATRICES
5686 nonlinear_matrices=>equations_matrices%NONLINEAR_MATRICES
5687 stiffness_matrix=>dynamic_matrices%MATRICES(1)%PTR
5688 damping_matrix=>dynamic_matrices%MATRICES(1)%PTR
5689 rhs_vector=>equations_matrices%RHS_VECTOR
5690 equations_mapping=>equations%EQUATIONS_MAPPING
5691 dynamic_mapping=>equations_mapping%DYNAMIC_MAPPING
5692 nonlinear_mapping=>equations_mapping%NONLINEAR_MAPPING
5693 dependent_variable=>nonlinear_mapping%RESIDUAL_VARIABLES(1)%PTR
5694 field_var_type=dependent_variable%VARIABLE_TYPE
5695 geometric_variable=>geometric_field%VARIABLE_TYPE_MAP(field_u_variable_type)%PTR
5696 dependent_basis=>dependent_field%DECOMPOSITION%DOMAIN(dependent_field%DECOMPOSITION%MESH_COMPONENT_NUMBER)%PTR% &
5697 & topology%ELEMENTS%ELEMENTS(element_number)%BASIS
5698 geometric_basis=>geometric_field%DECOMPOSITION%DOMAIN(geometric_field%DECOMPOSITION%MESH_COMPONENT_NUMBER)%PTR% &
5699 & topology%ELEMENTS%ELEMENTS(element_number)%BASIS
5701 CALL field_interpolation_parameters_element_get(field_values_set_type,element_number,equations%INTERPOLATION% &
5702 & dependent_interp_parameters(field_var_type)%PTR,err,error,*999)
5703 CALL field_interpolation_parameters_element_get(field_values_set_type,element_number,equations%INTERPOLATION% &
5704 & geometric_interp_parameters(field_u_variable_type)%PTR,err,error,*999)
5705 CALL field_interpolation_parameters_element_get(field_values_set_type,element_number,equations%INTERPOLATION% &
5706 & materials_interp_parameters(field_u_variable_type)%PTR,err,error,*999)
5708 DO ng=1,quadrature_scheme%NUMBER_OF_GAUSS
5710 & dependent_interp_point(field_var_type)%PTR,err,error,*999)
5712 & geometric_interp_point(field_u_variable_type)%PTR,err,error,*999)
5713 CALL field_interpolated_point_metrics_calculate(geometric_basis%NUMBER_OF_XI,equations%INTERPOLATION% &
5714 & geometric_interp_point_metrics(field_u_variable_type)%PTR,err,error,*999)
5716 & materials_interp_point(field_u_variable_type)%PTR,err,error,*999)
5719 rwg=equations%INTERPOLATION%GEOMETRIC_INTERP_POINT_METRICS(field_u_variable_type)%PTR%JACOBIAN* &
5720 & quadrature_scheme%GAUSS_WEIGHTS(ng)
5722 IF(stiffness_matrix%FIRST_ASSEMBLY.OR.damping_matrix%FIRST_ASSEMBLY.OR.rhs_vector%FIRST_ASSEMBLY)
THEN 5723 b_param=equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_u_variable_type)%PTR% &
5724 & values(geometric_variable%NUMBER_OF_COMPONENTS+2,
no_part_deriv)
5726 DO mh=1,dependent_variable%NUMBER_OF_COMPONENTS
5728 DO ms=1,dependent_basis%NUMBER_OF_ELEMENT_PARAMETERS
5730 IF(stiffness_matrix%UPDATE_MATRIX.OR.damping_matrix%UPDATE_MATRIX)
THEN 5733 DO nh=1,dependent_variable%NUMBER_OF_COMPONENTS
5734 DO ns=1,dependent_basis%NUMBER_OF_ELEMENT_PARAMETERS
5736 IF(stiffness_matrix%UPDATE_MATRIX)
THEN 5738 DO nj=1,geometric_variable%NUMBER_OF_COMPONENTS
5741 DO ni=1,geometric_basis%NUMBER_OF_XI
5742 pgmj(nj)=pgmj(nj)+ &
5744 & equations%INTERPOLATION%GEOMETRIC_INTERP_POINT_METRICS(field_u_variable_type)%PTR%DXI_DX(ni,nj)
5745 pgnj(nj)=pgnj(nj)+ &
5747 & equations%INTERPOLATION%GEOMETRIC_INTERP_POINT_METRICS(field_u_variable_type)%PTR%DXI_DX(ni,nj)
5749 k_param=equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_u_variable_type)%PTR% &
5751 sum1=sum1+k_param*pgmj(nj)*pgnj(nj)
5753 sum2=b_param*quadrature_scheme%GAUSS_BASIS_FNS(ms,
no_part_deriv,ng)* &
5755 stiffness_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)=stiffness_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)+ &
5758 IF(damping_matrix%UPDATE_MATRIX)
THEN 5759 damping_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)=damping_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)+ &
5761 & quadrature_scheme%GAUSS_BASIS_FNS(ns,
no_part_deriv,ng)*rwg
5769 IF(rhs_vector%FIRST_ASSEMBLY)
THEN 5770 IF(rhs_vector%UPDATE_VECTOR)
THEN 5771 a_param=equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_u_variable_type)%PTR% &
5772 & values(geometric_variable%NUMBER_OF_COMPONENTS+1,
no_part_deriv)
5774 DO mh=1,dependent_variable%NUMBER_OF_COMPONENTS
5776 DO ms=1,dependent_basis%NUMBER_OF_ELEMENT_PARAMETERS
5778 rhs_vector%ELEMENT_VECTOR%VECTOR(mhs)=rhs_vector%ELEMENT_VECTOR%VECTOR(mhs)+ &
5779 & quadrature_scheme%GAUSS_BASIS_FNS(ms,
no_part_deriv,ng)*a_param*rwg
5784 IF(nonlinear_matrices%UPDATE_RESIDUAL)
THEN 5785 c_param=equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_u_variable_type)%PTR% &
5786 & values(geometric_variable%NUMBER_OF_COMPONENTS+3,
no_part_deriv)
5787 u_value=equations%INTERPOLATION%DEPENDENT_INTERP_POINT(field_u_variable_type)%PTR% &
5790 DO mh=1,dependent_variable%NUMBER_OF_COMPONENTS
5792 DO ms=1,dependent_basis%NUMBER_OF_ELEMENT_PARAMETERS
5794 nonlinear_matrices%ELEMENT_RESIDUAL%VECTOR(mhs)=nonlinear_matrices%ELEMENT_RESIDUAL%VECTOR(mhs)- &
5795 & quadrature_scheme%GAUSS_BASIS_FNS(ms,
no_part_deriv,ng)*c_param*u_value**2*rwg
5802 dependent_field=>equations%INTERPOLATION%DEPENDENT_FIELD
5803 geometric_field=>equations%INTERPOLATION%GEOMETRIC_FIELD
5804 materials_field=>equations%INTERPOLATION%MATERIALS_FIELD
5805 equations_matrices=>equations%EQUATIONS_MATRICES
5806 dynamic_matrices=>equations_matrices%DYNAMIC_MATRICES
5807 nonlinear_matrices=>equations_matrices%NONLINEAR_MATRICES
5808 stiffness_matrix=>dynamic_matrices%MATRICES(1)%PTR
5809 damping_matrix=>dynamic_matrices%MATRICES(1)%PTR
5810 rhs_vector=>equations_matrices%RHS_VECTOR
5811 equations_mapping=>equations%EQUATIONS_MAPPING
5812 dynamic_mapping=>equations_mapping%DYNAMIC_MAPPING
5813 nonlinear_mapping=>equations_mapping%NONLINEAR_MAPPING
5814 dependent_variable=>nonlinear_mapping%RESIDUAL_VARIABLES(1)%PTR
5815 field_var_type=dependent_variable%VARIABLE_TYPE
5816 geometric_variable=>geometric_field%VARIABLE_TYPE_MAP(field_u_variable_type)%PTR
5817 dependent_basis=>dependent_field%DECOMPOSITION%DOMAIN(dependent_field%DECOMPOSITION%MESH_COMPONENT_NUMBER)%PTR% &
5818 & topology%ELEMENTS%ELEMENTS(element_number)%BASIS
5819 geometric_basis=>geometric_field%DECOMPOSITION%DOMAIN(geometric_field%DECOMPOSITION%MESH_COMPONENT_NUMBER)%PTR% &
5820 & topology%ELEMENTS%ELEMENTS(element_number)%BASIS
5822 CALL field_interpolation_parameters_element_get(field_values_set_type,element_number,equations%INTERPOLATION% &
5823 & dependent_interp_parameters(field_var_type)%PTR,err,error,*999)
5824 CALL field_interpolation_parameters_element_get(field_values_set_type,element_number,equations%INTERPOLATION% &
5825 & geometric_interp_parameters(field_u_variable_type)%PTR,err,error,*999)
5826 CALL field_interpolation_parameters_element_get(field_values_set_type,element_number,equations%INTERPOLATION% &
5827 & materials_interp_parameters(field_u_variable_type)%PTR,err,error,*999)
5829 DO ng=1,quadrature_scheme%NUMBER_OF_GAUSS
5831 & dependent_interp_point(field_var_type)%PTR,err,error,*999)
5833 & geometric_interp_point(field_u_variable_type)%PTR,err,error,*999)
5834 CALL field_interpolated_point_metrics_calculate(geometric_basis%NUMBER_OF_XI,equations%INTERPOLATION% &
5835 & geometric_interp_point_metrics(field_u_variable_type)%PTR,err,error,*999)
5837 & materials_interp_point(field_u_variable_type)%PTR,err,error,*999)
5840 rwg=equations%INTERPOLATION%GEOMETRIC_INTERP_POINT_METRICS(field_u_variable_type)%PTR%JACOBIAN* &
5841 & quadrature_scheme%GAUSS_WEIGHTS(ng)
5843 IF(stiffness_matrix%FIRST_ASSEMBLY.OR.damping_matrix%FIRST_ASSEMBLY.OR.rhs_vector%FIRST_ASSEMBLY)
THEN 5845 DO mh=1,dependent_variable%NUMBER_OF_COMPONENTS
5847 DO ms=1,dependent_basis%NUMBER_OF_ELEMENT_PARAMETERS
5849 IF(stiffness_matrix%UPDATE_MATRIX.OR.damping_matrix%UPDATE_MATRIX)
THEN 5852 DO nh=1,dependent_variable%NUMBER_OF_COMPONENTS
5853 DO ns=1,dependent_basis%NUMBER_OF_ELEMENT_PARAMETERS
5855 IF(stiffness_matrix%UPDATE_MATRIX)
THEN 5857 DO nj=1,geometric_variable%NUMBER_OF_COMPONENTS
5860 DO ni=1,geometric_basis%NUMBER_OF_XI
5861 pgmj(nj)=pgmj(nj)+ &
5863 & equations%INTERPOLATION%GEOMETRIC_INTERP_POINT_METRICS(field_u_variable_type)%PTR%DXI_DX(ni,nj)
5864 pgnj(nj)=pgnj(nj)+ &
5866 & equations%INTERPOLATION%GEOMETRIC_INTERP_POINT_METRICS(field_u_variable_type)%PTR%DXI_DX(ni,nj)
5868 k_param=equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_u_variable_type)%PTR% &
5870 sum1=sum1+k_param*pgmj(nj)*pgnj(nj)
5872 stiffness_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)=stiffness_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)+sum1*rwg
5874 IF(damping_matrix%UPDATE_MATRIX)
THEN 5875 damping_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)=damping_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)+ &
5877 & quadrature_scheme%GAUSS_BASIS_FNS(ns,
no_part_deriv,ng)*rwg
5882 IF(rhs_vector%UPDATE_VECTOR) rhs_vector%ELEMENT_VECTOR%VECTOR(mhs)=0.0_dp
5886 IF(rhs_vector%FIRST_ASSEMBLY)
THEN 5887 IF(rhs_vector%UPDATE_VECTOR)
THEN 5888 a_param=equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_u_variable_type)%PTR% &
5889 & values(geometric_variable%NUMBER_OF_COMPONENTS+1,
no_part_deriv)
5891 DO mh=1,dependent_variable%NUMBER_OF_COMPONENTS
5893 DO ms=1,dependent_basis%NUMBER_OF_ELEMENT_PARAMETERS
5895 rhs_vector%ELEMENT_VECTOR%VECTOR(mhs)=rhs_vector%ELEMENT_VECTOR%VECTOR(mhs)+ &
5896 & quadrature_scheme%GAUSS_BASIS_FNS(ms,
no_part_deriv,ng)*a_param*rwg
5901 IF(nonlinear_matrices%UPDATE_RESIDUAL)
THEN 5902 b_param=equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_u_variable_type)%PTR% &
5903 & values(geometric_variable%NUMBER_OF_COMPONENTS+2,
no_part_deriv)
5904 c_param=equations%INTERPOLATION%MATERIALS_INTERP_POINT(field_u_variable_type)%PTR% &
5905 & values(geometric_variable%NUMBER_OF_COMPONENTS+3,
no_part_deriv)
5906 u_value=equations%INTERPOLATION%DEPENDENT_INTERP_POINT(field_u_variable_type)%PTR% &
5909 IF((c_param*u_value)>20000.0_dp)
THEN 5911 &
" is out of range for an exponential function." 5912 CALL flagerror(local_error,err,error,*999)
5915 DO mh=1,dependent_variable%NUMBER_OF_COMPONENTS
5917 DO ms=1,dependent_basis%NUMBER_OF_ELEMENT_PARAMETERS
5919 nonlinear_matrices%ELEMENT_RESIDUAL%VECTOR(mhs)=nonlinear_matrices%ELEMENT_RESIDUAL%VECTOR(mhs)- &
5920 & quadrature_scheme%GAUSS_BASIS_FNS(ms,
no_part_deriv,ng)*b_param*exp(c_param*u_value)*rwg
5926 CALL flagerror(
"Can not evaluate a residual for an ALE diffusion equation with no source.",err,error,*999)
5928 CALL flagerror(
"Can not evaluate a residual for an ALE diffusion equation with a constant source.",err,error,*999)
5930 CALL flagerror(
"Can not evaluate a residual for an ALE diffusion equation with a linear source.",err,error,*999)
5932 CALL flagerror(
"Not implemented.",err,error,*999)
5934 CALL flagerror(
"Not implemented.",err,error,*999)
5936 CALL flagerror(
"Can not evaluate a residual for a multi component transport diffusion equation.",err,error,*999)
5938 local_error=
"Equations set subtype "//
trim(
number_to_vstring(equations_set%SPECIFICATION(3),
"*",err,error))// &
5939 &
" is not valid for a diffusion equation type of a classical field equations set class." 5940 CALL flagerror(local_error,err,error,*999)
5943 CALL flagerror(
"Equations set equations is not associated.",err,error,*999)
5946 CALL flagerror(
"Equations set is not associated.",err,error,*999)
5949 exits(
"Diffusion_FiniteElementResidualEvaluate")
5951 999
errors(
"Diffusion_FiniteElementResidualEvaluate",err,error)
5952 exits(
"Diffusion_FiniteElementResidualEvaluate")
5966 INTEGER(INTG),
INTENT(OUT) :: ERR
5969 INTEGER(INTG) :: equations_set_idx
5981 INTEGER(INTG) :: OUTPUT_ITERATION_NUMBER,CURRENT_LOOP_ITERATION
5983 enters(
"DIFFUSION_EQUATION_CONTROL_LOOP_POST_LOOP",err,error,*999)
5984 IF(
ASSOCIATED(control_loop))
THEN 5986 SELECT CASE(control_loop%LOOP_TYPE)
5993 time_loop=>control_loop%TIME_LOOP
5994 IF(
ASSOCIATED(time_loop))
THEN 5995 problem=>control_loop%PROBLEM
5996 IF(
ASSOCIATED(problem))
THEN 6003 solver_equations=>solver%SOLVER_EQUATIONS
6004 IF(
ASSOCIATED(solver_equations))
THEN 6005 solver_mapping=>solver_equations%SOLVER_MAPPING
6006 IF(
ASSOCIATED(solver_mapping))
THEN 6007 DO equations_set_idx=1,solver_mapping%NUMBER_OF_EQUATIONS_SETS
6008 equations_set=>solver_mapping%EQUATIONS_SETS(equations_set_idx)%PTR
6009 IF(
ASSOCIATED(equations_set))
THEN 6010 dependent_field=>equations_set%DEPENDENT%DEPENDENT_FIELD
6011 NULLIFY(dependent_region)
6012 CALL field_region_get(dependent_field,dependent_region,err,error,*999)
6013 NULLIFY(parent_loop)
6014 parent_loop=>control_loop%PARENT_LOOP
6015 IF(
ASSOCIATED(parent_loop))
THEN 6017 NULLIFY(time_loop_parent)
6018 time_loop_parent=>parent_loop%TIME_LOOP
6019 IF(
ASSOCIATED(time_loop_parent))
THEN 6020 output_iteration_number=time_loop_parent%OUTPUT_NUMBER
6021 current_loop_iteration=time_loop_parent%GLOBAL_ITERATION_NUMBER
6026 output_iteration_number=time_loop%OUTPUT_NUMBER
6027 current_loop_iteration=time_loop%GLOBAL_ITERATION_NUMBER
6032 output_iteration_number=time_loop%OUTPUT_NUMBER
6033 current_loop_iteration=time_loop%GLOBAL_ITERATION_NUMBER
6038 IF(output_iteration_number/=0.AND.mod(current_loop_iteration,output_iteration_number)==0)
THEN 6043 local_error=
"Equations set is not associated for equations set index "// &
6045 &
" in the solver mapping." 6046 CALL flagerror(local_error,err,error,*999)
6050 CALL flagerror(
"Solver equations solver mapping is not associated.",err,error,*999)
6053 CALL flagerror(
"Solver solver equations are not associated.",err,error,*999)
6056 CALL flagerror(
"Control loop problem is not associated.",err,error,*999)
6059 CALL flagerror(
"Time loop is not associated.",err,error,*999)
6066 local_error=
"The control loop type of "//
trim(
number_to_vstring(control_loop%LOOP_TYPE,
"*",err,error))// &
6068 CALL flagerror(local_error,err,error,*999)
6072 CALL flagerror(
"Control loop is not associated.",err,error,*999)
6075 exits(
"DIFFUSION_EQUATION_LOOP_POST_LOOP")
6077 999 errorsexits(
"DIFFUSION_EQUATION_CONTROL_LOOP_POST_LOOP",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(intg), parameter, public control_loop_progress_output
Progress output from control loop.
integer(intg), parameter equations_set_diffusion_equation_two_dim_1
u=exp(-kt)*sin(sqrt(k)*(x*cos(phi)+y*sin(phi)))
subroutine, public diffusion_equation_control_loop_post_loop(CONTROL_LOOP, ERR, ERROR,)
Runs after each control loop iteration.
subroutine, public equations_mapping_dynamic_variable_type_set(EQUATIONS_MAPPING, DYNAMIC_VARIABLE_TYPE, ERR, ERROR,)
Sets the mapping between a dependent field variable and the equations set dynamic matrices...
Contains information on the Jacobian matrix for nonlinear problems.
integer(intg), parameter equations_set_quadratic_source_diffusion_subtype
Contains information on the equations mapping i.e., how field variable DOFS are mapped to the rows an...
integer(intg), parameter equations_set_quadratic_source_diffusion_equation_one_dim_1
Solution to a diffusion equation with a quadratic source.
Contains information about the equations in an equations set.
integer(intg), parameter equations_set_gfem_solution_method
Grid-based Finite Element Method solution method.
Contains information for a region.
integer(intg), parameter problem_control_time_loop_type
Time control loop.
Contains information on a time iteration control loop.
integer(intg), parameter problem_setup_control_type
Solver setup for a problem.
This module handles all problem wide constants.
integer(intg), parameter solver_equations_first_order_dynamic
Solver equations are first order dynamic.
integer(intg), parameter, public control_loop_node
The identifier for a each "leaf" node in a control loop.
subroutine, public solver_dynamic_order_set(SOLVER, ORDER, ERR, ERROR,)
Sets/changes the order for a dynamic solver.
integer(intg), parameter no_global_deriv
No global derivative i.e., u.
integer(intg), parameter problem_coupled_source_diffusion_diffusion_subtype
Converts a number to its equivalent varying string representation.
subroutine, public equations_create_start(EQUATIONS_SET, EQUATIONS, ERR, ERROR,)
Start the creation of equations for the equation set.
Contains information on the mesh decomposition.
integer(intg), parameter equations_set_diffusion_equation_three_dim_1
subroutine, public equations_matrices_create_start(EQUATIONS, EQUATIONS_MATRICES, ERR, ERROR,)
Starts the creation of the equations matrices and rhs for the the equations.
Contains information on the type of solver to be used.
subroutine, public solvers_number_set(SOLVERS, NUMBER_OF_SOLVERS, ERR, ERROR,)
Sets/changes the number of solvers.
real(dp), parameter pi
The double precision value of pi.
integer(intg), parameter no_part_deriv
No partial derivative i.e., u.
integer(intg), parameter, public solver_dynamic_crank_nicolson_scheme
Crank-Nicolson dynamic solver.
subroutine, public solver_dynamic_degree_set(SOLVER, DEGREE, ERR, ERROR,)
Sets/changes the degree of the polynomial used to interpolate time for a dynamic solver.
subroutine, public diffusion_equation_pre_solve(CONTROL_LOOP, SOLVER, ERR, ERROR,)
Sets up the diffusion problem pre-solve.
This module handles all equations matrix and rhs routines.
integer(intg), parameter, public solver_dynamic_first_order
Dynamic solver has first order terms.
integer(intg), parameter equations_set_constant_source_ale_diffusion_subtype
subroutine, public solver_type_set(SOLVER, SOLVE_TYPE, ERR, ERROR,)
Sets/changes the type for a solver.
integer(intg), parameter equations_set_multi_comp_diffusion_four_comp_three_dim
Prescribed solution, using a source term to correct for error - 3D with 4 compartments.
subroutine, public diffusion_boundaryconditionanalyticcalculate(EQUATIONS_SET, BOUNDARY_CONDITIONS, ERR, ERROR,)
Calculates the analytic solution and sets the boundary conditions for an analytic problem...
subroutine diffusion_equationssetnonlinearsetup(EQUATIONS_SET, EQUATIONS_SET_SETUP, ERR, ERROR,)
Sets up the non-linear diffusion equation.
Contains information on an equations set.
This module handles all equations routines.
subroutine diffusion_equation_problem_nonlinear_setup(PROBLEM, PROBLEM_SETUP, ERR, ERROR,)
Sets up the nonlinear diffusion problem.
integer(intg), parameter equations_set_setup_source_type
Source setup.
integer(intg), parameter problem_control_fixed_loop_type
Fixed iteration control loop.
integer(intg), parameter equations_set_linear_source_diffusion_equation_three_dim_1
This module contains all string manipulation and transformation routines.
type(field_type), pointer source_field
subroutine, public solvers_create_start(CONTROL_LOOP, SOLVERS, ERR, ERROR,)
Start the creation of a solvers for the control loop.
Contains information on the solvers to be used in a control loop.
integer(intg), parameter problem_control_simple_type
Simple, one iteration control loop.
integer(intg), parameter first_part_deriv
First partial derivative i.e., du/ds.
subroutine, public solver_dynamic_linearity_type_set(SOLVER, LINEARITY_TYPE, ERR, ERROR,)
Sets/changes the linearity type for the dynamic solver.
integer(intg), parameter equations_set_quadratic_source_ale_diffusion_subtype
integer(intg), parameter equations_set_exponential_source_diffusion_equation_one_dim_1
Solution to a diffusion equation with an exponential source.
This module contains routines for timing the program.
subroutine, public control_loop_current_times_get(CONTROL_LOOP, CURRENT_TIME, TIME_INCREMENT, ERR, ERROR,)
Gets the current time parameters for a time control loop.
Contains information of the source vector for equations matrices.
subroutine, public equations_matrices_dynamic_lumping_type_set(EQUATIONS_MATRICES, LUMPING_TYPE, ERR, ERROR,)
Sets the lumping of the linear equations matrices.
subroutine, public equations_time_dependence_type_set(EQUATIONS, TIME_DEPENDENCE_TYPE, ERR, ERROR,)
Sets/changes the time dependence type for equations.
subroutine, public solver_equations_sparsity_type_set(SOLVER_EQUATIONS, SPARSITY_TYPE, ERR, ERROR,)
Sets/changes the sparsity type for solver equations.
This module handles all analytic analysis 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.
subroutine, public diffusion_problemspecificationset(problem, problemSpecification, err, error,)
Sets the problem specification for a diffusion equation problem.
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 equations_set_multi_comp_diffusion_two_comp_two_dim
Prescribed solution, using a source term to correct for error - 2D with 2 compartments.
integer(intg), parameter, public solver_sparse_matrices
Use sparse solver matrices.
subroutine, public solver_equations_create_start(SOLVER, SOLVER_EQUATIONS, ERR, ERROR,)
Starts the process of creating solver equations.
integer(intg), parameter, public solver_dynamic_type
A dynamic solver.
subroutine diffusion_presolveupdateanalyticvalues(CONTROL_LOOP, SOLVER, ERR, ERROR,)
integer(intg), parameter, public basis_default_quadrature_scheme
Identifier for the default quadrature scheme.
integer(intg), parameter equations_set_constant_source_diffusion_subtype
integer(intg), parameter problem_setup_solvers_type
Solver setup for a problem.
integer(intg), parameter equations_set_setup_equations_type
Equations setup.
Contains information for mapping field variables to the dynamic matrices in the equations set of the ...
This module contains all program wide constants.
integer(intg), parameter solver_equations_nonlinear
Solver equations are nonlinear.
subroutine, public solver_library_type_set(SOLVER, SOLVER_LIBRARY_TYPE, ERR, ERROR,)
Sets/changes the type of library type to use for the solver.
integer(intg), parameter equations_set_no_source_ale_diffusion_subtype
integer(intg), parameter equations_set_multi_comp_diffusion_two_comp_three_dim
Prescribed solution, using a source term to correct for error - 3D with 2 compartments.
subroutine, public equationsmapping_linearmatricesnumberset(EQUATIONS_MAPPING, NUMBER_OF_LINEAR_EQUATIONS_MATRICES, ERR, ERROR,)
Sets/changes the number of linear equations matrices.
integer(intg), parameter, public equations_lumped_matrices
The equations matrices are "mass" lumped.
integer(intg), parameter problem_setup_initial_type
Initial setup for a problem.
integer(intg), parameter problem_coupled_source_diffusion_advec_diffusion_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 equations_set_diffusion_equation_one_dim_1
subroutine, public diffusion_finiteelementjacobianevaluate(EQUATIONS_SET, ELEMENT_NUMBER, ERR, ERROR,)
Evaluates the Jacobian element stiffness matrices for a diffusion equation finite element equations s...
integer(intg), parameter problem_nonlinear_source_diffusion_subtype
integer(intg), parameter problem_nonlinear_source_ale_diffusion_subtype
integer(intg), parameter equations_first_order_dynamic
The equations are first order dynamic.
Contains information on the boundary conditions for a dependent field variable.
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_multi_comp_transport_advec_diff_supg_subtype
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.
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.
subroutine diffusion_presolveupdateboundaryconditions(CONTROL_LOOP, SOLVER, ERR, ERROR,)
Within the diffusion pre-solve, update the boundary conditions.
integer(intg), parameter, public equations_matrix_fem_structure
Finite element matrix structure.
subroutine, public diffusion_analyticfunctionsevaluate(EQUATIONS_SET, ANALYTIC_FUNCTION_TYPE, X, TANGENTS, NORMAL, TIME, VARIABLE_TYPE, GLOBAL_DERIVATIVE, COMPONENT_NUMBER, ANALYTIC_PARAMETERS, MATERIALS_PARAMETERS, VALUE, ERR, ERROR,)
Evaluate the analytic solutions for a diffusion equation.
This module contains all the low-level base routines e.g., all debug, control, and low-level communic...
Contains information of the linear matrices for equations matrices.
integer(intg), parameter, public general_output_type
General output type.
subroutine, public equationsmatrices_dynamicstructuretypeset(EQUATIONS_MATRICES, STRUCTURE_TYPE, ERR, ERROR,)
Sets the structure (sparsity) of the dynamic equations matrices.
integer(intg), parameter equations_set_linear_source_ale_diffusion_subtype
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.
subroutine diffusion_equationssetlinearsetup(EQUATIONS_SET, EQUATIONS_SET_SETUP, ERR, ERROR,)
Sets up the linear diffusion equation.
Returns the specified control loop as indexed by the control loop identifier from the control loop ro...
A buffer type to allow for an array of pointers to a FIELD_VARIABLE_TYPE.
subroutine, public control_loop_type_set(CONTROL_LOOP, LOOP_TYPE, ERR, ERROR,)
Sets/changes the control loop type.
subroutine, public diffusion_presolvegetsourcevalue(CONTROL_LOOP, SOLVER, ERR, ERROR,)
integer(intg), parameter equations_set_no_source_diffusion_subtype
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.
Contains information on the source for the equations set.
subroutine, public diffusion_equation_equations_set_setup(EQUATIONS_SET, EQUATIONS_SET_SETUP, ERR, ERROR,)
Sets up the diffusion equation type of a classical field equations set class.
subroutine, public equations_set_equations_get(EQUATIONS_SET, EQUATIONS, ERR, ERROR,)
Gets the equations for an equations set.
integer(intg), parameter problem_no_source_diffusion_subtype
Sets the structure (sparsity) of the nonlinear (Jacobian) equations matrices.
subroutine diffusion_equation_problem_linear_setup(PROBLEM, PROBLEM_SETUP, ERR, ERROR,)
Sets up the diffusion equations.
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 diffusion_presolvestorecurrentsolution(CONTROL_LOOP, SOLVER, ERR, ERROR,)
subroutine, public equations_create_finish(EQUATIONS, ERR, ERROR,)
Finish the creation of equations.
This module handles all domain mappings routines.
integer(intg), parameter problem_setup_finish_action
Finish setup action.
This module handles all equations mapping routines.
Contains information about the solver equations for a solver.
subroutine diffusion_presolvealeupdatemesh(CONTROL_LOOP, SOLVER, ERR, ERROR,)
Update mesh position and velocity for ALE diffusion problem.
subroutine, public equations_matrices_dynamic_storage_type_set(EQUATIONS_MATRICES, STORAGE_TYPE, ERR, ERROR,)
Sets the storage type (sparsity) of the dynamic equations matrices.
integer(intg), parameter, public equations_matrix_diagonal_structure
Diagonal matrix structure.
Contains information on the analytic setup for the equations set.
integer(intg), parameter equations_set_gfv_solution_method
Grid-based Finite Volume solution method.
subroutine, public diffusion_equation_finite_element_calculate(EQUATIONS_SET, ELEMENT_NUMBER, ERR, ERROR,)
Calculates the element stiffness matrices and RHS for a diffusion equation finite element equations s...
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 equations_set_linear_source_diffusion_subtype
integer(intg), parameter equations_set_classical_field_class
integer(intg), parameter equations_linear
The equations are linear.
subroutine, public diffusion_equationssetsolutionmethodset(EQUATIONS_SET, SOLUTION_METHOD, ERR, ERROR,)
Sets/changes the solution method for a diffusion equation type of an classical field equations set cl...
subroutine, public analyticanalysis_output(FIELD, FILENAME, ERR, ERROR,)
Output the analytic error analysis for a dependent field compared to the analytic values parameter se...
Contains the topology information for the nodes of a domain.
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_coupled_source_diffusion_advec_diffusion_subtype
logical, save, public diagnostics1
.TRUE. if level 1 diagnostic output is active in the current routine
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.
integer(intg), parameter equations_set_multi_comp_transport_advec_diff_subtype
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.
integer(intg), parameter, public equations_matrix_unlumped
The matrix is not lumped.
Contains information about an equations matrix.
Contains information for a particular quadrature scheme.
integer(intg), parameter equations_set_diffusion_equation_type
integer(intg), parameter problem_linear_source_diffusion_subtype
Implements lists of Field IO operation.
This module contains all routines dealing with (non-distributed) matrix and vectors types...
integer(intg), parameter, public distributed_matrix_block_storage_type
Distributed matrix block storage type.
A buffer type to allow for an array of pointers to a EQUATIONS_MATRIX_TYPE.
integer(intg), parameter, public equations_matrix_lumped
The matrix is "mass" lumped.
subroutine, public equations_linearity_type_set(EQUATIONS, LINEARITY_TYPE, ERR, ERROR,)
Sets/changes the linearity type for equations.
subroutine, public control_loop_create_start(PROBLEM, CONTROL_LOOP, ERR, ERROR,)
Start the process of creating a control loop for a problem.
integer(intg), parameter problem_setup_solver_equations_type
Solver equations setup for a problem.
integer(intg), parameter, public diagnostic_output_type
Diagnostic output type.
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 equations_set_multi_comp_transport_diffusion_subtype
subroutine, public solver_dynamic_scheme_set(SOLVER, SCHEME, ERR, ERROR,)
Sets/changes the scheme for a dynamic solver.
subroutine, public diffusion_equation_problem_setup(PROBLEM, PROBLEM_SETUP, ERR, ERROR,)
Sets up the diffusion problem.
Contains information for a field variable defined on a field.
integer(intg), parameter, public solver_dynamic_nonlinear
Dynamic solver has nonlinear terms.
integer(intg), parameter equations_set_fd_solution_method
Finite Difference solution method.
integer(intg), parameter, public equations_matrices_sparse_matrices
Use sparse equations matrices.
integer(intg), parameter problem_control_load_increment_loop_type
Load increment control loop.
Contains the parameters required to interpolate a field variable within an element. Old CMISS name XE.
Contains information on the setup information for an equations set.
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, public solver_equations_time_dependence_type_set(SOLVER_EQUATIONS, TIME_DEPENDENCE_TYPE, ERR, ERROR,)
Sets/changes the time dependence type for solver equations.
This module handles all control loop routines.
integer(intg), parameter, public solver_cmiss_library
CMISS (internal) solver library.
subroutine, public 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_exponential_source_diffusion_subtype
integer(intg), parameter problem_no_source_ale_diffusion_subtype
subroutine, public diffusion_finiteelementresidualevaluate(EQUATIONS_SET, ELEMENT_NUMBER, ERR, ERROR,)
Evaluates the residual element stiffness matrices and RHS for a Diffusion equation finite element equ...
Contains all information about a basis .
subroutine, public boundary_conditions_variable_get(BOUNDARY_CONDITIONS, FIELD_VARIABLE, BOUNDARY_CONDITIONS_VARIABLE, ERR, ERROR,)
Find the boundary conditions variable for a given field variable.
integer(intg), parameter equations_set_exponential_source_ale_diffusion_subtype
integer(intg), parameter equations_set_fv_solution_method
Finite Volume solution method.
integer(intg), parameter equations_set_multi_comp_diffusion_three_comp_three_dim
Prescribed solution, using a source term to correct for error - 3D with 3 compartments.
integer(intg), parameter, public solver_dynamic_first_degree
Dynamic solver uses a first degree polynomial for time interpolation.
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, public equationsmapping_residualvariabletypesset(EQUATIONS_MAPPING, RESIDUAL_VARIABLE_TYPES, ERR, ERROR,)
Sets the mapping between a dependent field variable and the equations set residual vector...
integer(intg), parameter equations_set_setup_analytic_type
Analytic setup.
Flags an error condition.
integer(intg), parameter problem_control_while_loop_type
While control loop.
Contains information of the RHS vector for equations matrices.
subroutine, public diffusion_equation_post_solve(CONTROL_LOOP, SOLVER, ERR, ERROR,)
Sets up the diffusion problem post solve.
This module handles all diffusion equation routines.
integer(intg), parameter equations_nonlinear
The equations are non-linear.
subroutine, public diffusion_equationssetspecificationset(equationsSet, specification, err, error,)
Sets the equation specification for a diffusion equation type of a classical field equations set clas...
real(dp), parameter zero_tolerance
integer(intg), parameter, public distributed_matrix_diagonal_storage_type
Distributed matrix diagonal storage type.
Contains information for mapping field variables to the linear matrices in the equations set of the m...
subroutine diffusion_equation_post_solve_output_data(CONTROL_LOOP, SOLVER, ERR, ERROR,)
Output data post solve.
This module contains all kind definitions.
Temporary IO routines for fluid mechanics.
subroutine, public field_io_nodes_export(FIELDS, FILE_NAME, METHOD, ERR, ERROR,)
Export nodal information.
integer(intg), parameter equations_set_setup_finish_action
Finish setup action.
integer(intg), parameter, public distributed_matrix_compressed_row_storage_type
Distributed matrix compressed row storage type.
integer(intg), parameter problem_linear_source_ale_diffusion_subtype
integer(intg), parameter problem_diffusion_equation_type
Contains information of the dynamic matrices for equations matrices.