87 PUBLIC hj_boundaryconditionsanalyticcalculate
89 PUBLIC hjequation_equationssetsolutionmethodset
91 PUBLIC hj_equation_equations_set_setup
93 PUBLIC hjequation_equationssetspecificationset
95 PUBLIC hj_equation_finite_element_calculate
97 PUBLIC hj_equation_problem_setup
99 PUBLIC hjequation_problemspecificationset
101 PUBLIC number_of_input_nodes,pre_process_information,solve_problem_fmm,solve_problem_geodesic
102 PUBLIC solve_problem_geodesic_connectivity,solve_problem_fmm_connectivity
103 PUBLIC find_minimax,post_process_data
113 SUBROUTINE hj_boundaryconditionsanalyticcalculate(EQUATIONS_SET,BOUNDARY_CONDITIONS,ERR,ERROR,*)
118 INTEGER(INTG),
INTENT(OUT) :: ERR
121 INTEGER(INTG) :: component_idx,deriv_idx,dim_idx,local_ny,node_idx,NUMBER_OF_DIMENSIONS,variable_idx,variable_type
122 REAL(DP) ::
VALUE,X(3)
123 REAL(DP),
POINTER :: GEOMETRIC_PARAMETERS(:)
126 TYPE(
field_type),
POINTER :: DEPENDENT_FIELD,GEOMETRIC_FIELD
130 enters(
"HJ_BoundaryConditionsAnalyticCalculate",err,error,*999)
132 IF(
ASSOCIATED(equations_set))
THEN 133 IF(
ASSOCIATED(equations_set%ANALYTIC))
THEN 134 dependent_field=>equations_set%DEPENDENT%DEPENDENT_FIELD
135 IF(
ASSOCIATED(dependent_field))
THEN 136 geometric_field=>equations_set%GEOMETRY%GEOMETRIC_FIELD
137 IF(
ASSOCIATED(geometric_field))
THEN 138 CALL field_number_of_components_get(geometric_field,field_u_variable_type,number_of_dimensions,err,error,*999)
139 NULLIFY(geometric_variable)
140 CALL field_variable_get(geometric_field,field_u_variable_type,geometric_variable,err,error,*999)
141 CALL field_parameter_set_data_get(geometric_field,field_u_variable_type,field_values_set_type,geometric_parameters, &
143 IF(
ASSOCIATED(boundary_conditions))
THEN 144 DO variable_idx=1,dependent_field%NUMBER_OF_VARIABLES
145 variable_type=dependent_field%VARIABLES(variable_idx)%VARIABLE_TYPE
146 field_variable=>dependent_field%VARIABLE_TYPE_MAP(variable_type)%PTR
147 IF(
ASSOCIATED(field_variable))
THEN 148 CALL field_parameter_set_create(dependent_field,variable_type,field_analytic_values_set_type,err,error,*999)
149 DO component_idx=1,field_variable%NUMBER_OF_COMPONENTS
150 IF(field_variable%COMPONENTS(component_idx)%INTERPOLATION_TYPE==field_node_based_interpolation)
THEN 151 domain=>field_variable%COMPONENTS(component_idx)%DOMAIN
152 IF(
ASSOCIATED(domain))
THEN 153 IF(
ASSOCIATED(domain%TOPOLOGY))
THEN 154 domain_nodes=>domain%TOPOLOGY%NODES
155 IF(
ASSOCIATED(domain_nodes))
THEN 157 DO node_idx=1,domain_nodes%NUMBER_OF_NODES
159 DO dim_idx=1,number_of_dimensions
161 local_ny=geometric_variable%COMPONENTS(dim_idx)%PARAM_TO_DOF_MAP%NODE_PARAM2DOF_MAP% &
162 & nodes(node_idx)%DERIVATIVES(1)%VERSIONS(1)
163 x(dim_idx)=geometric_parameters(local_ny)
166 DO deriv_idx=1,domain_nodes%NODES(node_idx)%NUMBER_OF_DERIVATIVES
167 SELECT CASE(equations_set%ANALYTIC%ANALYTIC_FUNCTION_TYPE)
170 SELECT CASE(variable_type)
171 CASE(field_u_variable_type)
172 SELECT CASE(domain_nodes%NODES(node_idx)%DERIVATIVES(deriv_idx)%GLOBAL_DERIVATIVE_INDEX)
174 VALUE=x(1)*x(1)-2.0_dp*x(1)*x(2)-x(2)*x(2)
176 VALUE=2.0_dp*x(1)+2.0_dp*x(2)
178 VALUE=2.0_dp*x(1)-2.0_dp*x(2)
183 domain_nodes%NODES(node_idx)%DERIVATIVES(deriv_idx)%GLOBAL_DERIVATIVE_INDEX,
"*", &
184 & err,error))//
" is invalid." 185 CALL flagerror(local_error,err,error,*999)
187 CASE(field_deludeln_variable_type)
188 SELECT CASE(domain_nodes%NODES(node_idx)%DERIVATIVES(deriv_idx)%GLOBAL_DERIVATIVE_INDEX)
192 CALL flagerror(
"Not implemented.",err,error,*999)
194 CALL flagerror(
"Not implemented.",err,error,*999)
196 CALL flagerror(
"Not implemented.",err,error,*999)
199 domain_nodes%NODES(node_idx)%DERIVATIVES(deriv_idx)%GLOBAL_DERIVATIVE_INDEX,
"*", &
200 & err,error))//
" is invalid." 201 CALL flagerror(local_error,err,error,*999)
206 CALL flagerror(local_error,err,error,*999)
210 SELECT CASE(variable_type)
211 CASE(field_u_variable_type)
212 SELECT CASE(domain_nodes%NODES(node_idx)%DERIVATIVES(deriv_idx)%GLOBAL_DERIVATIVE_INDEX)
214 VALUE=cos(x(1))*cosh(x(2))
216 VALUE=-sin(x(1))*cosh(x(2))
218 VALUE=cos(x(1))*sinh(x(2))
220 VALUE=-sin(x(1))*sinh(x(2))
223 domain_nodes%NODES(node_idx)%DERIVATIVES(deriv_idx)%GLOBAL_DERIVATIVE_INDEX,
"*", &
224 & err,error))//
" is invalid." 225 CALL flagerror(local_error,err,error,*999)
227 CASE(field_deludeln_variable_type)
228 SELECT CASE(domain_nodes%NODES(node_idx)%DERIVATIVES(deriv_idx)%GLOBAL_DERIVATIVE_INDEX)
239 domain_nodes%NODES(node_idx)%DERIVATIVES(deriv_idx)%GLOBAL_DERIVATIVE_INDEX,
"*", &
240 & err,error))//
" is invalid." 241 CALL flagerror(local_error,err,error,*999)
246 CALL flagerror(local_error,err,error,*999)
250 SELECT CASE(variable_type)
251 CASE(field_u_variable_type)
252 SELECT CASE(domain_nodes%NODES(node_idx)%DERIVATIVES(deriv_idx)%GLOBAL_DERIVATIVE_INDEX)
254 VALUE=x(1)*x(1)+x(2)*x(2)-2.0_dp*x(3)*x(3)
271 domain_nodes%NODES(node_idx)%DERIVATIVES(deriv_idx)%GLOBAL_DERIVATIVE_INDEX,
"*", &
272 & err,error))//
" is invalid." 273 CALL flagerror(local_error,err,error,*999)
275 CASE(field_deludeln_variable_type)
276 SELECT CASE(domain_nodes%NODES(node_idx)%DERIVATIVES(deriv_idx)%GLOBAL_DERIVATIVE_INDEX)
280 CALL flagerror(
"Not implemented.",err,error,*999)
282 CALL flagerror(
"Not implemented.",err,error,*999)
284 CALL flagerror(
"Not implemented.",err,error,*999)
286 CALL flagerror(
"Not implemented.",err,error,*999)
288 CALL flagerror(
"Not implemented.",err,error,*999)
290 CALL flagerror(
"Not implemented.",err,error,*999)
292 CALL flagerror(
"Not implemented.",err,error,*999)
295 domain_nodes%NODES(node_idx)%DERIVATIVES(deriv_idx)%GLOBAL_DERIVATIVE_INDEX,
"*", &
296 & err,error))//
" is invalid." 297 CALL flagerror(local_error,err,error,*999)
302 CALL flagerror(local_error,err,error,*999)
306 SELECT CASE(variable_type)
307 CASE(field_u_variable_type)
308 SELECT CASE(domain_nodes%NODES(node_idx)%DERIVATIVES(deriv_idx)%GLOBAL_DERIVATIVE_INDEX)
310 VALUE=cos(x(1))*cosh(x(2))*x(3)
312 VALUE=-sin(x(1))*cosh(x(2))*x(3)
314 VALUE=cos(x(1))*sinh(x(2))*x(3)
316 VALUE=-sin(x(1))*sinh(x(2))*x(3)
318 VALUE=cos(x(1))*cosh(x(2))
320 VALUE=-sin(x(1))*cosh(x(2))
322 VALUE=cos(x(1))*sinh(x(2))
324 VALUE=-sin(x(1))*sinh(x(2))
327 domain_nodes%NODES(node_idx)%DERIVATIVES(deriv_idx)%GLOBAL_DERIVATIVE_INDEX,
"*", &
328 & err,error))//
" is invalid." 329 CALL flagerror(local_error,err,error,*999)
331 CASE(field_deludeln_variable_type)
332 SELECT CASE(domain_nodes%NODES(node_idx)%DERIVATIVES(deriv_idx)%GLOBAL_DERIVATIVE_INDEX)
351 domain_nodes%NODES(node_idx)%DERIVATIVES(deriv_idx)%GLOBAL_DERIVATIVE_INDEX,
"*", &
352 & err,error))//
" is invalid." 353 CALL flagerror(local_error,err,error,*999)
358 CALL flagerror(local_error,err,error,*999)
361 local_error=
"The analytic function type of "// &
364 CALL flagerror(local_error,err,error,*999)
367 local_ny=field_variable%COMPONENTS(component_idx)%PARAM_TO_DOF_MAP% &
368 & node_param2dof_map%NODES(node_idx)%DERIVATIVES(deriv_idx)%VERSIONS(1)
369 CALL field_parameter_set_update_local_dof(dependent_field,variable_type, &
370 & field_analytic_values_set_type,local_ny,
VALUE,err,error,*999)
371 IF(variable_type==field_u_variable_type)
THEN 372 IF(domain_nodes%NODES(node_idx)%BOUNDARY_NODE)
THEN 381 CALL flagerror(
"Domain topology nodes is not associated.",err,error,*999)
384 CALL flagerror(
"Domain topology is not associated.",err,error,*999)
387 CALL flagerror(
"Domain is not associated.",err,error,*999)
390 CALL flagerror(
"Only node based interpolation is implemented.",err,error,*999)
393 CALL field_parameter_set_update_start(dependent_field,variable_type,field_analytic_values_set_type, &
395 CALL field_parameter_set_update_finish(dependent_field,variable_type,field_analytic_values_set_type, &
398 CALL flagerror(
"Field variable is not associated.",err,error,*999)
402 CALL field_parameter_set_data_restore(geometric_field,field_u_variable_type,field_values_set_type, &
403 & geometric_parameters,err,error,*999)
405 CALL flagerror(
"Boundary conditions is not associated.",err,error,*999)
408 CALL flagerror(
"Equations set geometric field is not associated.",err,error,*999)
411 CALL flagerror(
"Equations set dependent field is not associated.",err,error,*999)
414 CALL flagerror(
"Equations set analytic is not associated.",err,error,*999)
417 CALL flagerror(
"Equations set is not associated.",err,error,*999)
420 exits(
"HJ_BoundaryConditionsAnalyticCalculate")
422 999 errorsexits(
"HJ_BoundaryConditionsAnalyticCalculate",err,error)
424 END SUBROUTINE hj_boundaryconditionsanalyticcalculate
431 SUBROUTINE hj_equation_finite_element_calculate(EQUATIONS_SET,ELEMENT_NUMBER,ERR,ERROR,*)
435 INTEGER(INTG),
INTENT(IN) :: ELEMENT_NUMBER
436 INTEGER(INTG),
INTENT(OUT) :: ERR
439 INTEGER(INTG) FIELD_VAR_TYPE,ng,mh,mhs,mi,ms,nh,nhs,ni,ns
440 REAL(DP) :: RWG,SUM,PGMSI(3),PGNSI(3)
441 TYPE(
basis_type),
POINTER :: DEPENDENT_BASIS,GEOMETRIC_BASIS
449 TYPE(
field_type),
POINTER :: DEPENDENT_FIELD,GEOMETRIC_FIELD
455 CHARACTER(26) :: CVAR
456 INTEGER :: GAUSS_POINT_LOOP_PHASE(2) = (/ 0, 0 /)
457 SAVE gauss_point_loop_phase
460 enters(
"HJ_EQUATION_FINITE_ELEMENT_CALCULATE",err,error,*999)
462 IF(
ASSOCIATED(equations_set))
THEN 463 IF(.NOT.
ALLOCATED(equations_set%SPECIFICATION))
THEN 464 CALL flagerror(
"Equations set specification is not allocated.",err,error,*999)
465 ELSE IF(
SIZE(equations_set%SPECIFICATION,1)/=3)
THEN 466 CALL flagerror(
"Equations set specification must have three entries for a Hamilton-Jacobi type equations set.", &
469 equations=>equations_set%EQUATIONS
470 IF(
ASSOCIATED(equations))
THEN 471 SELECT CASE(equations_set%SPECIFICATION(3))
475 dependent_field=>equations%INTERPOLATION%DEPENDENT_FIELD
476 geometric_field=>equations%INTERPOLATION%GEOMETRIC_FIELD
477 equations_matrices=>equations%EQUATIONS_MATRICES
478 linear_matrices=>equations_matrices%LINEAR_MATRICES
479 equations_matrix=>linear_matrices%MATRICES(1)%PTR
480 rhs_vector=>equations_matrices%RHS_VECTOR
481 equations_mapping=>equations%EQUATIONS_MAPPING
482 linear_mapping=>equations_mapping%LINEAR_MAPPING
483 field_variable=>linear_mapping%EQUATIONS_MATRIX_TO_VAR_MAPS(1)%VARIABLE
484 field_var_type=field_variable%VARIABLE_TYPE
485 dependent_basis=>dependent_field%DECOMPOSITION%DOMAIN(dependent_field%DECOMPOSITION%MESH_COMPONENT_NUMBER)%PTR% &
486 & topology%ELEMENTS%ELEMENTS(element_number)%BASIS
487 geometric_basis=>geometric_field%DECOMPOSITION%DOMAIN(geometric_field%DECOMPOSITION%MESH_COMPONENT_NUMBER)%PTR% &
488 & topology%ELEMENTS%ELEMENTS(element_number)%BASIS
490 CALL field_interpolation_parameters_element_get(field_values_set_type,element_number,equations%INTERPOLATION% &
491 & geometric_interp_parameters(field_u_variable_type)%PTR,err,error,*999)
493 DO ng=1,quadrature_scheme%NUMBER_OF_GAUSS
495 WRITE (cvar,
'(a17,i2)')
'Gauss Point Loop ',ng
496 CALL tau_phase_create_dynamic(gauss_point_loop_phase,cvar)
497 CALL tau_phase_start(gauss_point_loop_phase)
500 & geometric_interp_point(field_u_variable_type)%PTR,err,error,*999)
501 CALL field_interpolated_point_metrics_calculate(geometric_basis%NUMBER_OF_XI,equations%INTERPOLATION% &
502 & geometric_interp_point_metrics(field_u_variable_type)%PTR,err,error,*999)
505 rwg=equations%INTERPOLATION%GEOMETRIC_INTERP_POINT_METRICS(field_u_variable_type)%PTR%JACOBIAN* &
506 & quadrature_scheme%GAUSS_WEIGHTS(ng)
509 DO mh=1,field_variable%NUMBER_OF_COMPONENTS
512 DO ms=1,dependent_basis%NUMBER_OF_ELEMENT_PARAMETERS
515 IF(equations_matrix%UPDATE_MATRIX)
THEN 517 DO nh=1,field_variable%NUMBER_OF_COMPONENTS
518 DO ns=1,dependent_basis%NUMBER_OF_ELEMENT_PARAMETERS
520 DO ni=1,dependent_basis%NUMBER_OF_XI
526 DO mi=1,dependent_basis%NUMBER_OF_XI
527 DO ni=1,dependent_basis%NUMBER_OF_XI
528 sum=sum+pgmsi(mi)*pgnsi(ni)*equations%INTERPOLATION% &
529 & geometric_interp_point_metrics(field_u_variable_type)%PTR%GU(mi,ni)
532 equations_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)=equations_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)+sum*rwg
537 IF(rhs_vector%UPDATE_VECTOR) rhs_vector%ELEMENT_VECTOR%VECTOR(mhs)=0.0_dp
541 CALL tau_phase_stop(gauss_point_loop_phase)
546 IF(dependent_field%SCALINGS%SCALING_TYPE/=field_no_scaling)
THEN 547 CALL field_interpolationparametersscalefactorselementget(element_number,equations%INTERPOLATION% &
548 & dependent_interp_parameters(field_var_type)%PTR,err,error,*999)
550 DO mh=1,field_variable%NUMBER_OF_COMPONENTS
552 DO ms=1,dependent_basis%NUMBER_OF_ELEMENT_PARAMETERS
555 IF(equations_matrix%UPDATE_MATRIX)
THEN 557 DO nh=1,field_variable%NUMBER_OF_COMPONENTS
558 DO ns=1,dependent_basis%NUMBER_OF_ELEMENT_PARAMETERS
560 equations_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)=equations_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)* &
561 & equations%INTERPOLATION%DEPENDENT_INTERP_PARAMETERS(field_var_type)%PTR%SCALE_FACTORS(ms,mh)* &
562 & equations%INTERPOLATION%DEPENDENT_INTERP_PARAMETERS(field_var_type)%PTR%SCALE_FACTORS(ns,nh)
566 IF(rhs_vector%UPDATE_VECTOR) rhs_vector%ELEMENT_VECTOR%VECTOR(mhs)=rhs_vector%ELEMENT_VECTOR%VECTOR(mhs)* &
567 & equations%INTERPOLATION%DEPENDENT_INTERP_PARAMETERS(field_var_type)%PTR%SCALE_FACTORS(ms,mh)
572 CALL flagerror(
"Not implemented.",err,error,*999)
574 local_error=
"Equations set subtype "//
trim(
number_to_vstring(equations_set%SPECIFICATION(3),
"*",err,error))// &
575 &
" is not valid for a Hamilton-Jacobi equation type of a classical field equations set class." 576 CALL flagerror(local_error,err,error,*999)
580 CALL flagerror(
"Equations set equations is not associated.",err,error,*999)
583 CALL flagerror(
"Equations set is not associated.",err,error,*999)
586 exits(
"HJ_EQUATION_FINITE_ELEMENT_CALCULATE")
588 999 errorsexits(
"HJ_EQUATION_FINITE_ELEMENT_CALCULATE",err,error)
590 END SUBROUTINE hj_equation_finite_element_calculate
597 SUBROUTINE hj_equation_fast_marching_calculate(EQUATIONS_SET,ELEMENT_NUMBER,ERR,ERROR,*)
601 INTEGER(INTG),
INTENT(IN) :: ELEMENT_NUMBER
602 INTEGER(INTG),
INTENT(OUT) :: ERR
605 INTEGER(INTG) FIELD_VAR_TYPE,ng,mh,mhs,mi,ms,nh,nhs,ni,ns
606 REAL(DP) :: RWG,SUM,PGMSI(3),PGNSI(3)
607 TYPE(
basis_type),
POINTER :: DEPENDENT_BASIS,GEOMETRIC_BASIS
615 TYPE(
field_type),
POINTER :: DEPENDENT_FIELD,GEOMETRIC_FIELD
621 CHARACTER(26) :: CVAR
622 INTEGER :: GAUSS_POINT_LOOP_PHASE(2) = (/ 0, 0 /)
623 SAVE gauss_point_loop_phase
626 enters(
"HJ_EQUATION_FAST_MARCHING_CALCULATE",err,error,*999)
628 IF(
ASSOCIATED(equations_set))
THEN 629 IF(.NOT.
ALLOCATED(equations_set%SPECIFICATION))
THEN 630 CALL flagerror(
"Equations set specification is not allocated.",err,error,*999)
631 ELSE IF(
SIZE(equations_set%SPECIFICATION,1)/=3)
THEN 632 CALL flagerror(
"Equations set specification must have three entries for a Hamilton-Jacobi type equations set.", &
635 equations=>equations_set%EQUATIONS
636 IF(
ASSOCIATED(equations))
THEN 637 SELECT CASE(equations_set%SPECIFICATION(3))
641 dependent_field=>equations%INTERPOLATION%DEPENDENT_FIELD
643 geometric_field=>equations%INTERPOLATION%GEOMETRIC_FIELD
644 equations_matrices=>equations%EQUATIONS_MATRICES
645 linear_matrices=>equations_matrices%LINEAR_MATRICES
646 equations_matrix=>linear_matrices%MATRICES(1)%PTR
647 rhs_vector=>equations_matrices%RHS_VECTOR
648 equations_mapping=>equations%EQUATIONS_MAPPING
649 linear_mapping=>equations_mapping%LINEAR_MAPPING
650 field_variable=>linear_mapping%EQUATIONS_MATRIX_TO_VAR_MAPS(1)%VARIABLE
651 field_var_type=field_variable%VARIABLE_TYPE
652 dependent_basis=>dependent_field%DECOMPOSITION%DOMAIN(dependent_field%DECOMPOSITION%MESH_COMPONENT_NUMBER)%PTR% &
653 & topology%ELEMENTS%ELEMENTS(element_number)%BASIS
654 geometric_basis=>geometric_field%DECOMPOSITION%DOMAIN(geometric_field%DECOMPOSITION%MESH_COMPONENT_NUMBER)%PTR% &
655 & topology%ELEMENTS%ELEMENTS(element_number)%BASIS
657 CALL field_interpolation_parameters_element_get(field_values_set_type,element_number,equations%INTERPOLATION% &
658 & geometric_interp_parameters(field_u_variable_type)%PTR,err,error,*999)
660 DO ng=1,quadrature_scheme%NUMBER_OF_GAUSS
662 WRITE (cvar,
'(a17,i2)')
'Gauss Point Loop ',ng
663 CALL tau_phase_create_dynamic(gauss_point_loop_phase,cvar)
664 CALL tau_phase_start(gauss_point_loop_phase)
667 & geometric_interp_point(field_u_variable_type)%PTR,err,error,*999)
668 CALL field_interpolated_point_metrics_calculate(geometric_basis%NUMBER_OF_XI,equations%INTERPOLATION% &
669 & geometric_interp_point_metrics(field_u_variable_type)%PTR,err,error,*999)
672 rwg=equations%INTERPOLATION%GEOMETRIC_INTERP_POINT_METRICS(field_u_variable_type)%PTR%JACOBIAN* &
673 & quadrature_scheme%GAUSS_WEIGHTS(ng)
676 DO mh=1,field_variable%NUMBER_OF_COMPONENTS
679 DO ms=1,dependent_basis%NUMBER_OF_ELEMENT_PARAMETERS
682 IF(equations_matrix%UPDATE_MATRIX)
THEN 684 DO nh=1,field_variable%NUMBER_OF_COMPONENTS
685 DO ns=1,dependent_basis%NUMBER_OF_ELEMENT_PARAMETERS
687 DO ni=1,dependent_basis%NUMBER_OF_XI
693 DO mi=1,dependent_basis%NUMBER_OF_XI
694 DO ni=1,dependent_basis%NUMBER_OF_XI
695 sum=sum+pgmsi(mi)*pgnsi(ni)*equations%INTERPOLATION% &
696 & geometric_interp_point_metrics(field_u_variable_type)%PTR%GU(mi,ni)
699 equations_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)=equations_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)+sum*rwg
704 IF(rhs_vector%UPDATE_VECTOR) rhs_vector%ELEMENT_VECTOR%VECTOR(mhs)=0.0_dp
708 CALL tau_phase_stop(gauss_point_loop_phase)
713 IF(dependent_field%SCALINGS%SCALING_TYPE/=field_no_scaling)
THEN 714 CALL field_interpolationparametersscalefactorselementget(element_number,equations%INTERPOLATION% &
715 & dependent_interp_parameters(field_var_type)%PTR,err,error,*999)
717 DO mh=1,field_variable%NUMBER_OF_COMPONENTS
719 DO ms=1,dependent_basis%NUMBER_OF_ELEMENT_PARAMETERS
722 IF(equations_matrix%UPDATE_MATRIX)
THEN 724 DO nh=1,field_variable%NUMBER_OF_COMPONENTS
725 DO ns=1,dependent_basis%NUMBER_OF_ELEMENT_PARAMETERS
727 equations_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)=equations_matrix%ELEMENT_MATRIX%MATRIX(mhs,nhs)* &
728 & equations%INTERPOLATION%DEPENDENT_INTERP_PARAMETERS(field_var_type)%PTR%SCALE_FACTORS(ms,mh)* &
729 & equations%INTERPOLATION%DEPENDENT_INTERP_PARAMETERS(field_var_type)%PTR%SCALE_FACTORS(ns,nh)
733 IF(rhs_vector%UPDATE_VECTOR) rhs_vector%ELEMENT_VECTOR%VECTOR(mhs)=rhs_vector%ELEMENT_VECTOR%VECTOR(mhs)* &
734 & equations%INTERPOLATION%DEPENDENT_INTERP_PARAMETERS(field_var_type)%PTR%SCALE_FACTORS(ms,mh)
739 CALL flagerror(
"Not implemented.",err,error,*999)
741 local_error=
"Equations set subtype "//
trim(
number_to_vstring(equations_set%SPECIFICATION(3),
"*",err,error))// &
742 &
" is not valid for a Hamilton-Jacobi equation type of a classical field equations set class." 743 CALL flagerror(local_error,err,error,*999)
747 CALL flagerror(
"Equations set equations is not associated.",err,error,*999)
750 CALL flagerror(
"Equations set is not associated.",err,error,*999)
753 exits(
"HJ_EQUATION_FAST_MARCHING_CALCULATE")
755 999 errorsexits(
"HJ_EQUATION_FAST_MARCHING_CALCULATE",err,error)
757 END SUBROUTINE hj_equation_fast_marching_calculate
764 SUBROUTINE hj_equation_equations_set_setup(EQUATIONS_SET,EQUATIONS_SET_SETUP,ERR,ERROR,*)
769 INTEGER(INTG),
INTENT(OUT) :: ERR
774 enters(
"HJ_EQUATION_EQUATIONS_SET_SETUP",err,error,*999)
776 IF(
ASSOCIATED(equations_set))
THEN 777 IF(.NOT.
ALLOCATED(equations_set%SPECIFICATION))
THEN 778 CALL flagerror(
"Equations set specification is not allocated.",err,error,*999)
779 ELSE IF(
SIZE(equations_set%SPECIFICATION,1)/=3)
THEN 780 CALL flagerror(
"Equations set specification must have three entries for a Hamilton-Jacobi type equations set.", &
783 SELECT CASE(equations_set%SPECIFICATION(3))
786 CALL hj_equation_equations_set_standard_setup(equations_set,equations_set_setup,err,error,*999)
788 CALL flagerror(
"Not implemented.",err,error,*999)
790 local_error=
"Equations set subtype "//
trim(
number_to_vstring(equations_set%SPECIFICATION(3),
"*",err,error))// &
791 &
" is not valid for a Hamilton-Jacobi equation type of a classical field equation set class." 792 CALL flagerror(local_error,err,error,*999)
795 CALL flagerror(
"Equations set is not associated.",err,error,*999)
798 exits(
"HJ_EQUATION_EQUATIONS_SET_SETUP")
800 999 errorsexits(
"HJ_EQUATION_EQUATIONS_SET_SETUP",err,error)
802 END SUBROUTINE hj_equation_equations_set_setup
809 SUBROUTINE hjequation_equationssetsolutionmethodset(EQUATIONS_SET,SOLUTION_METHOD,ERR,ERROR,*)
813 INTEGER(INTG),
INTENT(IN) :: SOLUTION_METHOD
814 INTEGER(INTG),
INTENT(OUT) :: ERR
819 enters(
"HJEquation_EquationsSetSolutionMethodSet",err,error,*999)
821 IF(
ASSOCIATED(equations_set))
THEN 822 IF(.NOT.
ALLOCATED(equations_set%SPECIFICATION))
THEN 823 CALL flagerror(
"Equations set specification is not allocated.",err,error,*999)
824 ELSE IF(
SIZE(equations_set%SPECIFICATION,1)/=3)
THEN 825 CALL flagerror(
"Equations set specification must have three entries for a Hamilton-Jacobi type equations set.", &
828 SELECT CASE(equations_set%SPECIFICATION(3))
830 SELECT CASE(solution_method)
836 CALL flagerror(
"Not implemented.",err,error,*999)
838 CALL flagerror(
"Not implemented.",err,error,*999)
840 CALL flagerror(
"Not implemented.",err,error,*999)
842 CALL flagerror(
"Not implemented.",err,error,*999)
844 CALL flagerror(
"Not implemented.",err,error,*999)
846 local_error=
"The specified solution method of "//
trim(
number_to_vstring(solution_method,
"*",err,error))//
" is invalid." 847 CALL flagerror(local_error,err,error,*999)
850 SELECT CASE(solution_method)
856 CALL flagerror(
"Not implemented.",err,error,*999)
858 CALL flagerror(
"Not implemented.",err,error,*999)
860 CALL flagerror(
"Not implemented.",err,error,*999)
862 CALL flagerror(
"Not implemented.",err,error,*999)
864 CALL flagerror(
"Not implemented.",err,error,*999)
866 local_error=
"The specified solution method of "//
trim(
number_to_vstring(solution_method,
"*",err,error))//
" is invalid." 867 CALL flagerror(local_error,err,error,*999)
870 local_error=
"Equations set subtype of "//
trim(
number_to_vstring(equations_set%SPECIFICATION(3),
"*",err,error))// &
871 &
" is not valid for a Hamilton-Jacobi equation type of an classical field equations set class." 872 CALL flagerror(local_error,err,error,*999)
875 CALL flagerror(
"Equations set is not associated.",err,error,*999)
878 exits(
"HJEquation_EquationsSetSolutionMethodSet")
880 999 errorsexits(
"HJEquation_EquationsSetSolutionMethodSet",err,error)
882 END SUBROUTINE hjequation_equationssetsolutionmethodset
889 SUBROUTINE hjequation_equationssetspecificationset(equationsSet,specification,err,error,*)
893 INTEGER(INTG),
INTENT(IN) :: specification(:)
894 INTEGER(INTG),
INTENT(OUT) :: err
898 INTEGER(INTG) :: subtype
900 CALL enters(
"HJEquation_EquationsSetSpecificationSet",err,error,*999)
902 IF(
ASSOCIATED(equationsset))
THEN 903 IF(
SIZE(specification,1)/=3)
THEN 904 CALL flagerror(
"Equations set specification must have three entries for a Hamilton-Jacobi type equations set.", &
907 subtype=specification(3)
912 CALL flagerror(
"Not implemented.",err,error,*999)
914 localerror=
"The third equations set specification of "//
trim(
numbertovstring(subtype,
"*",err,error))// &
915 &
" is not valid for a Hamilton-Jacobi type of a classical field equations set." 916 CALL flagerror(localerror,err,error,*999)
919 IF(
ALLOCATED(equationsset%specification))
THEN 920 CALL flagerror(
"Equations set specification is already allocated.",err,error,*999)
922 ALLOCATE(equationsset%specification(3),stat=err)
923 IF(err/=0)
CALL flagerror(
"Could not allocate equations set specification.",err,error,*999)
927 CALL flagerror(
"Equations set is not associated.",err,error,*999)
930 exits(
"HJEquation_EquationsSetSpecificationSet")
932 999
errors(
"HJEquation_EquationsSetSpecificationSet",err,error)
933 exits(
"HJEquation_EquationsSetSpecificationSet")
936 END SUBROUTINE hjequation_equationssetspecificationset
943 SUBROUTINE hj_equation_equations_set_standard_setup(EQUATIONS_SET,EQUATIONS_SET_SETUP,ERR,ERROR,*)
948 INTEGER(INTG),
INTENT(OUT) :: ERR
951 INTEGER(INTG) :: component_idx,GEOMETRIC_COMPONENT_NUMBER,GEOMETRIC_SCALING_TYPE,NUMBER_OF_DIMENSIONS, &
952 & NUMBER_OF_MATERIALS_COMPONENTS, GEOMETRIC_MESH_COMPONENT
954 TYPE(
field_type),
POINTER :: ANALYTIC_FIELD,DEPENDENT_FIELD,GEOMETRIC_FIELD
962 enters(
"HJ_EQUATION_EQUATION_SET_STANDARD_SETUP",err,error,*999)
965 NULLIFY(equations_mapping)
966 NULLIFY(equations_matrices)
967 NULLIFY(geometric_decomposition)
969 IF(
ASSOCIATED(equations_set))
THEN 970 IF(.NOT.
ALLOCATED(equations_set%SPECIFICATION))
THEN 971 CALL flagerror(
"Equations set specification is not allocated.",err,error,*999)
972 ELSE IF(
SIZE(equations_set%SPECIFICATION,1)/=3)
THEN 973 CALL flagerror(
"Equations set specification must have three entries for a Hamilton-Jacobi type equations set.", &
977 SELECT CASE(equations_set_setup%SETUP_TYPE)
979 SELECT CASE(equations_set_setup%ACTION_TYPE)
985 local_error=
"The action type of "//
trim(
number_to_vstring(equations_set_setup%ACTION_TYPE,
"*",err,error))// &
987 &
" is invalid for a standard Hamilton-Jacobi equation." 988 CALL flagerror(local_error,err,error,*999)
993 SELECT CASE(equations_set_setup%ACTION_TYPE)
995 IF(equations_set%DEPENDENT%DEPENDENT_FIELD_AUTO_CREATED)
THEN 997 CALL field_create_start(equations_set_setup%FIELD_USER_NUMBER,equations_set%REGION,equations_set%DEPENDENT% &
998 & dependent_field,err,error,*999)
999 CALL field_label_set(equations_set%DEPENDENT%DEPENDENT_FIELD,
"Dependent Field",err,error,*999)
1000 CALL field_type_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_general_type,err,error,*999)
1001 CALL field_dependent_type_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_dependent_type,err,error,*999)
1002 CALL field_mesh_decomposition_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_decomposition,err,error,*999)
1003 CALL field_mesh_decomposition_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,geometric_decomposition, &
1005 CALL field_geometric_field_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,equations_set%GEOMETRY% &
1006 & geometric_field,err,error,*999)
1007 CALL field_number_of_variables_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,2,err,error,*999)
1008 CALL field_variable_types_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,(/field_u_variable_type, &
1009 & field_deludeln_variable_type/),err,error,*999)
1010 CALL field_variable_label_set(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type,
"Phi",err,error,*999)
1011 CALL field_variable_label_set(equations_set%DEPENDENT%DEPENDENT_FIELD,field_deludeln_variable_type,
"del Phi/del n", &
1013 CALL field_dimension_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type, &
1014 & field_scalar_dimension_type,err,error,*999)
1015 CALL field_dimension_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_deludeln_variable_type, &
1016 & field_scalar_dimension_type,err,error,*999)
1017 CALL field_data_type_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type, &
1018 & field_dp_type,err,error,*999)
1019 CALL field_data_type_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_deludeln_variable_type, &
1020 & field_dp_type,err,error,*999)
1021 CALL field_number_of_components_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type,1, &
1023 CALL field_number_of_components_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD,field_deludeln_variable_type,1, &
1025 CALL field_component_label_set(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type,1,
"Phi",err,error,*999)
1026 CALL field_component_label_set(equations_set%DEPENDENT%DEPENDENT_FIELD,field_deludeln_variable_type,1, &
1027 &
"del Phi/del n",err,error,*999)
1029 CALL field_component_mesh_component_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type,1, &
1030 & geometric_mesh_component,err,error,*999)
1031 CALL field_component_mesh_component_set(equations_set%DEPENDENT%DEPENDENT_FIELD,field_u_variable_type,1, &
1032 & geometric_mesh_component,err,error,*999)
1033 CALL field_component_mesh_component_set(equations_set%DEPENDENT%DEPENDENT_FIELD,field_deludeln_variable_type,1, &
1034 & geometric_mesh_component,err,error,*999)
1035 SELECT CASE(equations_set%SOLUTION_METHOD)
1037 CALL field_component_interpolation_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD, &
1038 & field_u_variable_type,1,field_node_based_interpolation,err,error,*999)
1039 CALL field_component_interpolation_set_and_lock(equations_set%DEPENDENT%DEPENDENT_FIELD, &
1040 & field_deludeln_variable_type,1,field_node_based_interpolation,err,error,*999)
1042 CALL field_scaling_type_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_scaling_type,err,error,*999)
1043 CALL field_scaling_type_set(equations_set%DEPENDENT%DEPENDENT_FIELD,geometric_scaling_type,err,error,*999)
1047 CALL flagerror(
"Not implemented.",err,error,*999)
1049 CALL flagerror(
"Not implemented.",err,error,*999)
1051 CALL flagerror(
"Not implemented.",err,error,*999)
1053 CALL flagerror(
"Not implemented.",err,error,*999)
1055 CALL flagerror(
"Not implemented.",err,error,*999)
1057 local_error=
"The solution method of "//
trim(
number_to_vstring(equations_set%SOLUTION_METHOD,
"*",err,error))// &
1059 CALL flagerror(local_error,err,error,*999)
1063 CALL field_type_check(equations_set_setup%FIELD,field_general_type,err,error,*999)
1064 CALL field_dependent_type_check(equations_set_setup%FIELD,field_dependent_type,err,error,*999)
1065 CALL field_number_of_variables_check(equations_set_setup%FIELD,2,err,error,*999)
1066 CALL field_variable_types_check(equations_set_setup%FIELD,(/field_u_variable_type,field_deludeln_variable_type/), &
1068 CALL field_dimension_check(equations_set_setup%FIELD,field_u_variable_type,field_scalar_dimension_type,err,error,*999)
1069 CALL field_dimension_check(equations_set_setup%FIELD,field_deludeln_variable_type,field_scalar_dimension_type, &
1071 CALL field_data_type_check(equations_set_setup%FIELD,field_u_variable_type,field_dp_type,err,error,*999)
1072 CALL field_data_type_check(equations_set_setup%FIELD,field_deludeln_variable_type,field_dp_type,err,error,*999)
1073 CALL field_number_of_components_check(equations_set_setup%FIELD,field_u_variable_type,1,err,error,*999)
1074 CALL field_number_of_components_check(equations_set_setup%FIELD,field_deludeln_variable_type,1,err,error,*999)
1075 SELECT CASE(equations_set%SOLUTION_METHOD)
1077 CALL field_component_interpolation_check(equations_set_setup%FIELD,field_u_variable_type,1, &
1078 & field_node_based_interpolation,err,error,*999)
1079 CALL field_component_interpolation_check(equations_set_setup%FIELD,field_deludeln_variable_type,1, &
1080 & field_node_based_interpolation,err,error,*999)
1084 CALL flagerror(
"Not implemented.",err,error,*999)
1086 CALL flagerror(
"Not implemented.",err,error,*999)
1088 CALL flagerror(
"Not implemented.",err,error,*999)
1090 CALL flagerror(
"Not implemented.",err,error,*999)
1092 CALL flagerror(
"Not implemented.",err,error,*999)
1094 local_error=
"The solution method of "//
trim(
number_to_vstring(equations_set%SOLUTION_METHOD,
"*",err,error))// &
1096 CALL flagerror(local_error,err,error,*999)
1100 IF(equations_set%DEPENDENT%DEPENDENT_FIELD_AUTO_CREATED)
THEN 1101 CALL field_create_finish(equations_set%DEPENDENT%DEPENDENT_FIELD,err,error,*999)
1104 local_error=
"The action type of "//
trim(
number_to_vstring(equations_set_setup%ACTION_TYPE,
"*",err,error))// &
1105 &
" for a setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
1106 &
" is invalid for a standard Hamilton-Jacobi equation" 1107 CALL flagerror(local_error,err,error,*999)
1110 SELECT CASE(equations_set_setup%ACTION_TYPE)
1117 equations_materials=>equations_set%MATERIALS
1118 IF(
ASSOCIATED(equations_materials))
THEN 1119 IF(equations_materials%MATERIALS_FIELD_AUTO_CREATED)
THEN 1121 CALL field_create_start(equations_set_setup%FIELD_USER_NUMBER,equations_set%REGION,equations_materials% &
1122 & materials_field,err,error,*999)
1123 CALL field_type_set_and_lock(equations_materials%MATERIALS_FIELD,field_material_type,err,error,*999)
1124 CALL field_dependent_type_set_and_lock(equations_materials%MATERIALS_FIELD,field_independent_type,err,error,*999)
1125 CALL field_mesh_decomposition_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_decomposition,err,error,*999)
1126 CALL field_mesh_decomposition_set_and_lock(equations_materials%MATERIALS_FIELD,geometric_decomposition, &
1128 CALL field_geometric_field_set_and_lock(equations_materials%MATERIALS_FIELD,equations_set%GEOMETRY% &
1129 & geometric_field,err,error,*999)
1130 CALL field_number_of_variables_set_and_lock(equations_materials%MATERIALS_FIELD,1,err,error,*999)
1131 CALL field_variable_types_set_and_lock(equations_materials%MATERIALS_FIELD,(/field_u_variable_type/), &
1133 CALL field_dimension_set_and_lock(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
1134 & field_vector_dimension_type,err,error,*999)
1135 CALL field_data_type_set_and_lock(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
1136 & field_dp_type,err,error,*999)
1137 CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
1138 & number_of_dimensions,err,error,*999)
1142 number_of_materials_components=number_of_dimensions+1
1146 number_of_materials_components=number_of_dimensions+2
1149 CALL field_number_of_components_set_and_lock(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
1150 & number_of_materials_components,err,error,*999)
1152 DO component_idx=1,number_of_dimensions
1153 CALL field_component_mesh_component_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
1154 & component_idx,geometric_component_number,err,error,*999)
1155 CALL field_component_mesh_component_set(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
1156 & component_idx,geometric_component_number,err,error,*999)
1157 CALL field_component_interpolation_set(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
1158 & component_idx,field_constant_interpolation,err,error,*999)
1161 CALL field_component_mesh_component_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
1162 & 1,geometric_component_number,err,error,*999)
1163 DO component_idx=number_of_dimensions+1,number_of_materials_components
1164 CALL field_component_mesh_component_set(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
1165 & component_idx,geometric_component_number,err,error,*999)
1166 CALL field_component_interpolation_set(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
1167 & component_idx,field_constant_interpolation,err,error,*999)
1170 CALL field_scaling_type_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,geometric_scaling_type,err,error,*999)
1171 CALL field_scaling_type_set(equations_materials%MATERIALS_FIELD,geometric_scaling_type,err,error,*999)
1174 CALL field_type_check(equations_set_setup%FIELD,field_material_type,err,error,*999)
1175 CALL field_dependent_type_check(equations_set_setup%FIELD,field_independent_type,err,error,*999)
1176 CALL field_number_of_variables_check(equations_set_setup%FIELD,1,err,error,*999)
1177 CALL field_variable_types_check(equations_set_setup%FIELD,(/field_u_variable_type/),err,error,*999)
1178 CALL field_dimension_check(equations_set_setup%FIELD,field_u_variable_type,field_vector_dimension_type, &
1180 CALL field_data_type_check(equations_set_setup%FIELD,field_u_variable_type,field_dp_type,err,error,*999)
1181 CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
1182 & number_of_dimensions,err,error,*999)
1184 CALL field_number_of_components_check(equations_set_setup%FIELD,field_u_variable_type,number_of_dimensions+1, &
1187 CALL field_number_of_components_check(equations_set_setup%FIELD,field_u_variable_type,number_of_dimensions+2, &
1192 CALL flagerror(
"Equations set materials is not associated.",err,error,*999)
1202 equations_materials=>equations_set%MATERIALS
1203 IF(
ASSOCIATED(equations_materials))
THEN 1204 IF(equations_materials%MATERIALS_FIELD_AUTO_CREATED)
THEN 1206 CALL field_create_finish(equations_materials%MATERIALS_FIELD,err,error,*999)
1208 CALL field_number_of_components_get(equations_set%GEOMETRY%GEOMETRIC_FIELD,field_u_variable_type, &
1209 & number_of_dimensions,err,error,*999)
1213 number_of_materials_components=number_of_dimensions+1
1217 number_of_materials_components=number_of_dimensions+2
1220 DO component_idx=1,number_of_dimensions
1221 CALL field_component_values_initialise(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
1222 & field_values_set_type,component_idx,1.0_dp,err,error,*999)
1225 DO component_idx=number_of_dimensions+1,number_of_materials_components
1226 CALL field_component_values_initialise(equations_materials%MATERIALS_FIELD,field_u_variable_type, &
1227 & field_values_set_type,component_idx,1.0_dp,err,error,*999)
1231 CALL flagerror(
"Equations set materials is not associated.",err,error,*999)
1237 local_error=
"The action type of "//
trim(
number_to_vstring(equations_set_setup%ACTION_TYPE,
"*",err,error))// &
1238 &
" for a setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
1239 &
" is invalid for a standard Hamilton-Jacobi equation." 1240 CALL flagerror(local_error,err,error,*999)
1243 SELECT CASE(equations_set_setup%ACTION_TYPE)
1249 local_error=
"The action type of "//
trim(
number_to_vstring(equations_set_setup%ACTION_TYPE,
"*",err,error))// &
1250 &
" for a setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
1251 &
" is invalid for a standard Hamilton-Jacobi equation." 1252 CALL flagerror(local_error,err,error,*999)
1255 SELECT CASE(equations_set_setup%ACTION_TYPE)
1257 IF(equations_set%DEPENDENT%DEPENDENT_FINISHED)
THEN 1258 dependent_field=>equations_set%DEPENDENT%DEPENDENT_FIELD
1259 IF(
ASSOCIATED(dependent_field))
THEN 1260 geometric_field=>equations_set%GEOMETRY%GEOMETRIC_FIELD
1261 IF(
ASSOCIATED(geometric_field))
THEN 1262 CALL field_number_of_components_get(geometric_field,field_u_variable_type,number_of_dimensions,err,error,*999)
1263 SELECT CASE(equations_set_setup%ANALYTIC_FUNCTION_TYPE)
1266 IF(number_of_dimensions/=2)
THEN 1267 local_error=
"The number of geometric dimensions of "// &
1269 &
" is invalid. The analytic function type of "// &
1271 &
" requires that there be 2 geometric dimensions." 1272 CALL flagerror(local_error,err,error,*999)
1279 IF(number_of_dimensions/=2)
THEN 1280 local_error=
"The number of geometric dimensions of "// &
1282 &
" is invalid. The analytic function type of "// &
1284 &
" requires that there be 2 geometric dimensions." 1285 CALL flagerror(local_error,err,error,*999)
1292 IF(number_of_dimensions/=3)
THEN 1293 local_error=
"The number of geometric dimensions of "// &
1295 &
" is invalid. The analytic function type of "// &
1297 &
" requires that there be 3 geometric dimensions." 1298 CALL flagerror(local_error,err,error,*999)
1305 IF(number_of_dimensions/=3)
THEN 1306 local_error=
"The number of geometric dimensions of "// &
1308 &
" is invalid. The analytic function type of "// &
1310 &
" requires that there be 3 geometric dimensions." 1311 CALL flagerror(local_error,err,error,*999)
1317 local_error=
"The specified analytic function type of "// &
1319 &
" is invalid for a standard Hamilton-Jacobi equation." 1320 CALL flagerror(local_error,err,error,*999)
1323 CALL flagerror(
"Equations set geometric field is not associated.",err,error,*999)
1326 CALL flagerror(
"Equations set dependent field is not associated.",err,error,*999)
1329 CALL flagerror(
"Equations set dependent field has not been finished.",err,error,*999)
1332 IF(
ASSOCIATED(equations_set%ANALYTIC))
THEN 1333 analytic_field=>equations_set%ANALYTIC%ANALYTIC_FIELD
1334 IF(
ASSOCIATED(analytic_field))
THEN 1335 IF(equations_set%ANALYTIC%ANALYTIC_FIELD_AUTO_CREATED)
THEN 1336 CALL field_create_finish(equations_set%DEPENDENT%DEPENDENT_FIELD,err,error,*999)
1340 CALL flagerror(
"Equations set analytic is not associated.",err,error,*999)
1343 local_error=
"The action type of "//
trim(
number_to_vstring(equations_set_setup%ACTION_TYPE,
"*",err,error))// &
1344 &
" for a setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
1345 &
" is invalid for a standard Hamilton-Jacobi equation." 1346 CALL flagerror(local_error,err,error,*999)
1349 SELECT CASE(equations_set_setup%ACTION_TYPE)
1351 IF(equations_set%DEPENDENT%DEPENDENT_FINISHED)
THEN 1356 CALL flagerror(
"Equations set dependent field has not been finished.",err,error,*999)
1359 SELECT CASE(equations_set%SOLUTION_METHOD)
1373 SELECT CASE(equations%SPARSITY_TYPE)
1383 local_error=
"The equations matrices sparsity type of "// &
1385 CALL flagerror(local_error,err,error,*999)
1391 CALL flagerror(
"Not implemented.",err,error,*999)
1393 CALL flagerror(
"Not implemented.",err,error,*999)
1395 CALL flagerror(
"Not implemented.",err,error,*999)
1397 CALL flagerror(
"Not implemented.",err,error,*999)
1399 CALL flagerror(
"Not implemented.",err,error,*999)
1401 local_error=
"The solution method of "//
trim(
number_to_vstring(equations_set%SOLUTION_METHOD,
"*",err,error))// &
1403 CALL flagerror(local_error,err,error,*999)
1406 local_error=
"The action type of "//
trim(
number_to_vstring(equations_set_setup%ACTION_TYPE,
"*",err,error))// &
1407 &
" for a setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
1408 &
" is invalid for a standard Hamilton-Jacobi equation." 1409 CALL flagerror(local_error,err,error,*999)
1412 local_error=
"The setup type of "//
trim(
number_to_vstring(equations_set_setup%SETUP_TYPE,
"*",err,error))// &
1413 &
" is invalid for a standard Hamilton-Jacobi equation." 1414 CALL flagerror(local_error,err,error,*999)
1417 local_error=
"The equations set subtype of "//
trim(
number_to_vstring(equations_set%SPECIFICATION(3),
"*",err,error))// &
1418 &
" does not equal a standard Hamilton-Jacobi equation subtype." 1419 CALL flagerror(local_error,err,error,*999)
1422 CALL flagerror(
"Equations set is not associated.",err,error,*999)
1425 exits(
"HJ_EQUATION_EQUATIONS_SET_STANDARD_SETUP")
1427 999 errorsexits(
"HJ_EQUATION_EQUATIONS_SET_STANDARD_SETUP",err,error)
1429 END SUBROUTINE hj_equation_equations_set_standard_setup
1436 SUBROUTINE hj_equation_problem_setup(PROBLEM,PROBLEM_SETUP,ERR,ERROR,*)
1441 INTEGER(INTG),
INTENT(OUT) :: ERR
1446 enters(
"HJ_EQUATION_PROBLEM_SETUP",err,error,*999)
1448 IF(
ASSOCIATED(problem))
THEN 1449 IF(.NOT.
ALLOCATED(problem%SPECIFICATION))
THEN 1450 CALL flagerror(
"Problem specification is not allocated.",err,error,*999)
1451 ELSE IF(
SIZE(problem%SPECIFICATION,1)<3)
THEN 1452 CALL flagerror(
"Problem specification must have three entries for a Hamilton-Jacobi problem.",err,error,*999)
1454 SELECT CASE(problem%SPECIFICATION(3))
1456 CALL hj_equation_problem_standard_setup(problem,problem_setup,err,error,*999)
1458 CALL flagerror(
"Not implemented.",err,error,*999)
1461 &
" is not valid for a Hamilton-Jacobi equation type of a classical field problem class." 1462 CALL flagerror(local_error,err,error,*999)
1465 CALL flagerror(
"Problem is not associated.",err,error,*999)
1468 exits(
"HJ_EQUATION_PROBLEM_SETUP")
1470 999 errorsexits(
"HJ_EQUATION_PROBLEM_SETUP",err,error)
1472 END SUBROUTINE hj_equation_problem_setup
1479 SUBROUTINE hjequation_problemspecificationset(problem,problemSpecification,err,error,*)
1483 INTEGER(INTG),
INTENT(IN) :: problemSpecification(:)
1484 INTEGER(INTG),
INTENT(OUT) :: err
1488 INTEGER(INTG) :: problemSubtype
1490 enters(
"HJEquation_ProblemSpecificationSet",err,error,*999)
1492 IF(
ASSOCIATED(problem))
THEN 1493 IF(
SIZE(problemspecification,1)==3)
THEN 1494 problemsubtype=problemspecification(3)
1495 SELECT CASE(problemsubtype)
1499 CALL flagerror(
"Not implemented.",err,error,*999)
1501 localerror=
"The third problem specification of "//
trim(
numbertovstring(problemsubtype,
"*",err,error))// &
1502 &
" is not valid for a Hamilton-Jacobi type of a classical field problem." 1503 CALL flagerror(localerror,err,error,*999)
1505 IF(
ALLOCATED(problem%specification))
THEN 1506 CALL flagerror(
"Problem specification is already allocated.",err,error,*999)
1508 ALLOCATE(problem%specification(3),stat=err)
1509 IF(err/=0)
CALL flagerror(
"Could not allocate problem specification.",err,error,*999)
1513 CALL flagerror(
"Hamilton-Jacobi problem specification must have three entries.",err,error,*999)
1516 CALL flagerror(
"Problem is not associated.",err,error,*999)
1519 exits(
"HJEquation_ProblemSpecificationSet")
1521 999
errors(
"HJEquation_ProblemSpecificationSet",err,error)
1522 exits(
"HJEquation_ProblemSpecificationSet")
1525 END SUBROUTINE hjequation_problemspecificationset
1532 SUBROUTINE hj_equation_problem_standard_setup(PROBLEM,PROBLEM_SETUP,ERR,ERROR,*)
1537 INTEGER(INTG),
INTENT(OUT) :: ERR
1546 enters(
"HJ_EQUATION_PROBLEM_STANDARD_SETUP",err,error,*999)
1548 NULLIFY(control_loop)
1550 NULLIFY(solver_equations)
1552 IF(
ASSOCIATED(problem))
THEN 1553 IF(.NOT.
ALLOCATED(problem%SPECIFICATION))
THEN 1554 CALL flagerror(
"Problem specification is not allocated.",err,error,*999)
1555 ELSE IF(
SIZE(problem%SPECIFICATION,1)<3)
THEN 1556 CALL flagerror(
"Problem specification must have three entries for a Hamilton-Jacobi problem.",err,error,*999)
1559 SELECT CASE(problem_setup%SETUP_TYPE)
1561 SELECT CASE(problem_setup%ACTION_TYPE)
1567 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
1569 &
" is invalid for a standard Hamilton-Jacobi equation." 1570 CALL flagerror(local_error,err,error,*999)
1573 SELECT CASE(problem_setup%ACTION_TYPE)
1579 control_loop_root=>problem%CONTROL_LOOP
1583 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
1585 &
" is invalid for a standard Hamilton-Jacobi equation." 1586 CALL flagerror(local_error,err,error,*999)
1590 control_loop_root=>problem%CONTROL_LOOP
1592 SELECT CASE(problem_setup%ACTION_TYPE)
1608 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
1610 &
" is invalid for a standard Hamilton-Jacobi equation." 1611 CALL flagerror(local_error,err,error,*999)
1614 SELECT CASE(problem_setup%ACTION_TYPE)
1617 control_loop_root=>problem%CONTROL_LOOP
1629 control_loop_root=>problem%CONTROL_LOOP
1638 local_error=
"The action type of "//
trim(
number_to_vstring(problem_setup%ACTION_TYPE,
"*",err,error))// &
1640 &
" is invalid for a standard Hamilton-Jacobi equation." 1641 CALL flagerror(local_error,err,error,*999)
1644 local_error=
"The setup type of "//
trim(
number_to_vstring(problem_setup%SETUP_TYPE,
"*",err,error))// &
1645 &
" is invalid for a standard Hamilton-Jacobi equation." 1646 CALL flagerror(local_error,err,error,*999)
1649 local_error=
"The problem subtype of "//
trim(
number_to_vstring(problem%SPECIFICATION(3),
"*",err,error))// &
1650 &
" does not equal a standard Hamilton-Jacobi equation subtype." 1651 CALL flagerror(local_error,err,error,*999)
1654 CALL flagerror(
"Problem is not associated.",err,error,*999)
1657 exits(
"HJ_EQUATION_PROBLEM_STANDARD_SETUP")
1659 999 errorsexits(
"HJ_EQUATION_PROBLEM_STANDARD_SETUP",err,error)
1661 END SUBROUTINE hj_equation_problem_standard_setup
1672 SUBROUTINE number_of_input_nodes(INPUT_FILE_NAME,INPUT_FILE_FORMAT,TOTAL_NUMBER_OF_NODES,TOTAL_NUMBER_OF_ELEMENTS,&
1673 &total_number_of_connectivity,err)
1676 INTEGER(INTG),
INTENT(OUT) :: TOTAL_NUMBER_OF_NODES
1677 INTEGER(INTG),
INTENT(OUT) :: TOTAL_NUMBER_OF_ELEMENTS
1678 INTEGER(INTG),
INTENT(OUT) :: TOTAL_NUMBER_OF_CONNECTIVITY
1679 CHARACTER (LEN=300) :: INPUT_FILE_NAME
1680 CHARACTER (LEN=10) :: INPUT_FILE_FORMAT
1681 INTEGER(INTG) :: Err
1687 INTEGER(INTG),
ALLOCATABLE,
DIMENSION(:,:):: CONNECTIVITY_LIST
1688 INTEGER(INTG),
ALLOCATABLE,
DIMENSION(:,:):: ELEMENT_LIST
1689 INTEGER(INTG),
ALLOCATABLE,
DIMENSION(:) :: CONNECTIVITY_NUMBER
1690 INTEGER(INTG) :: I,J,K,N,NUMBER_OF_NODES_PER_ELEMENT,THERE_IS_IN_CONNECTIVITY_LIST
1691 CHARACTER (LEN=300) :: STRING
1697 IF (input_file_format .EQ.
"TABC")
THEN 1699 i =
index(input_file_name,
' ') - 1
1700 string = input_file_name(1:i)//
".tabc" 1701 OPEN (11,file=string)
1704 total_number_of_nodes=-1
1705 DO WHILE (string .ne.
"Connectivity")
1707 total_number_of_nodes=total_number_of_nodes+1
1710 total_number_of_connectivity=0
1711 DO i=1,total_number_of_nodes
1713 total_number_of_connectivity=total_number_of_connectivity+j
1717 total_number_of_elements = total_number_of_connectivity
1721 IF (input_file_format .EQ.
"VTKTET")
THEN 1723 number_of_nodes_per_element = 4
1725 i =
index(input_file_name,
' ') - 1
1726 string = input_file_name(1:i)//
".vtk" 1728 OPEN (11,file=string)
1733 READ(11,*) string,total_number_of_nodes
1736 DO i=1,int((total_number_of_nodes/3.0_dp)+0.5_dp)
1743 READ(11,*) string,total_number_of_elements
1745 ALLOCATE(element_list(total_number_of_elements,20),stat=err)
1746 ALLOCATE(connectivity_list(total_number_of_nodes,50),stat=err)
1747 ALLOCATE(connectivity_number(total_number_of_nodes),stat=err)
1749 DO i=1,total_number_of_elements
1754 DO i=1,total_number_of_nodes
1755 connectivity_number(i)=0
1757 connectivity_list(i,j)=0
1761 total_number_of_connectivity=0
1763 DO i=1,total_number_of_elements
1765 READ(11,*) string,(element_list(i,j),j=1,number_of_nodes_per_element)
1768 DO j=1,number_of_nodes_per_element
1769 element_list(i,j)=element_list(i,j)+1
1772 DO j=1,number_of_nodes_per_element-1
1774 DO k=1+j,number_of_nodes_per_element
1775 there_is_in_connectivity_list = 0
1776 DO n=1,connectivity_number(element_list(i,j))
1778 IF (connectivity_list(element_list(i,j),n) .EQ. element_list(i,k))
THEN 1779 there_is_in_connectivity_list = 1
1784 IF (there_is_in_connectivity_list .EQ. 0)
THEN 1786 connectivity_number(element_list(i,j)) = connectivity_number(element_list(i,j)) + 1
1787 connectivity_list(element_list(i,j),connectivity_number(element_list(i,j))) = element_list(i,k)
1788 connectivity_number(element_list(i,k)) = connectivity_number(element_list(i,k)) + 1
1789 connectivity_list(element_list(i,k),connectivity_number(element_list(i,k))) = element_list(i,j)
1791 total_number_of_connectivity=total_number_of_connectivity+1
1800 total_number_of_connectivity=total_number_of_connectivity*2
1806 IF (input_file_format .EQ.
"VTKTET1NPL")
THEN 1808 number_of_nodes_per_element = 4
1810 i =
index(input_file_name,
' ') - 1
1811 string = input_file_name(1:i)//
".vtk" 1813 OPEN (11,file=string)
1818 READ(11,*) string,total_number_of_nodes,string
1821 DO i=1,total_number_of_nodes
1827 READ(11,*) string,total_number_of_elements
1829 ALLOCATE(element_list(total_number_of_elements,20),stat=err)
1830 ALLOCATE(connectivity_list(total_number_of_nodes,50),stat=err)
1831 ALLOCATE(connectivity_number(total_number_of_nodes),stat=err)
1833 DO i=1,total_number_of_elements
1838 DO i=1,total_number_of_nodes
1839 connectivity_number(i)=0
1841 connectivity_list(i,j)=0
1845 total_number_of_connectivity=0
1847 DO i=1,total_number_of_elements
1849 READ(11,*) string,(element_list(i,j),j=1,number_of_nodes_per_element)
1852 DO j=1,number_of_nodes_per_element
1853 element_list(i,j)=element_list(i,j)+1
1856 DO j=1,number_of_nodes_per_element-1
1858 DO k=1+j,number_of_nodes_per_element
1859 there_is_in_connectivity_list = 0
1860 DO n=1,connectivity_number(element_list(i,j))
1862 IF (connectivity_list(element_list(i,j),n) .EQ. element_list(i,k))
THEN 1863 there_is_in_connectivity_list = 1
1868 IF (there_is_in_connectivity_list .EQ. 0)
THEN 1870 connectivity_number(element_list(i,j)) = connectivity_number(element_list(i,j)) + 1
1871 connectivity_list(element_list(i,j),connectivity_number(element_list(i,j))) = element_list(i,k)
1872 connectivity_number(element_list(i,k)) = connectivity_number(element_list(i,k)) + 1
1873 connectivity_list(element_list(i,k),connectivity_number(element_list(i,k))) = element_list(i,j)
1875 total_number_of_connectivity=total_number_of_connectivity+1
1884 total_number_of_connectivity=total_number_of_connectivity*2
1890 IF (input_file_format .EQ.
"CARP")
THEN 1892 number_of_nodes_per_element = 4
1894 i =
index(input_file_name,
' ') - 1
1895 string = input_file_name(1:i)//
".pts" 1897 OPEN (11,file=string)
1898 READ(11,*) total_number_of_nodes
1902 string = input_file_name(1:i)//
".elem" 1904 OPEN (11,file=string)
1905 READ(11,*) total_number_of_elements
1907 ALLOCATE(element_list(total_number_of_elements,20),stat=err)
1908 ALLOCATE(connectivity_list(total_number_of_nodes,50),stat=err)
1909 ALLOCATE(connectivity_number(total_number_of_nodes),stat=err)
1911 DO i=1,total_number_of_elements
1916 DO i=1,total_number_of_nodes
1917 connectivity_number(i)=0
1919 connectivity_list(i,j)=0
1923 total_number_of_connectivity=0
1925 DO i=1,total_number_of_elements
1927 READ(11,*) string,(element_list(i,j),j=1,number_of_nodes_per_element)
1930 DO j=1,number_of_nodes_per_element
1931 element_list(i,j)=element_list(i,j)+1
1934 DO j=1,number_of_nodes_per_element-1
1936 DO k=1+j,number_of_nodes_per_element
1937 there_is_in_connectivity_list = 0
1938 DO n=1,connectivity_number(element_list(i,j))
1940 IF (connectivity_list(element_list(i,j),n) .EQ. element_list(i,k))
THEN 1941 there_is_in_connectivity_list = 1
1946 IF (there_is_in_connectivity_list .EQ. 0)
THEN 1948 connectivity_number(element_list(i,j)) = connectivity_number(element_list(i,j)) + 1
1949 connectivity_list(element_list(i,j),connectivity_number(element_list(i,j))) = element_list(i,k)
1950 connectivity_number(element_list(i,k)) = connectivity_number(element_list(i,k)) + 1
1951 connectivity_list(element_list(i,k),connectivity_number(element_list(i,k))) = element_list(i,j)
1953 total_number_of_connectivity=total_number_of_connectivity+1
1962 total_number_of_connectivity=total_number_of_connectivity*2
1969 IF (input_file_format .EQ.
"TETGEN")
THEN 1971 number_of_nodes_per_element = 4
1973 i =
index(input_file_name,
' ') - 1
1974 string = input_file_name(1:i)//
".node" 1975 OPEN (11,file=string)
1976 READ(11,*) total_number_of_nodes
1979 string = input_file_name(1:i)//
".ele" 1980 OPEN (11,file=string)
1981 READ(11,*) total_number_of_elements
1983 ALLOCATE(element_list(total_number_of_elements,20),stat=err)
1984 ALLOCATE(connectivity_list(total_number_of_nodes,50),stat=err)
1985 ALLOCATE(connectivity_number(total_number_of_nodes),stat=err)
1987 DO i=1,total_number_of_elements
1992 DO i=1,total_number_of_nodes
1993 connectivity_number(i)=0
1995 connectivity_list(i,j)=0
1999 total_number_of_connectivity=0
2001 DO i=1,total_number_of_elements
2003 READ(11,*) string,(element_list(i,j),j=1,number_of_nodes_per_element)
2005 DO j=1,number_of_nodes_per_element-1
2007 DO k=1+j,number_of_nodes_per_element
2008 there_is_in_connectivity_list = 0
2009 DO n=1,connectivity_number(element_list(i,j))
2011 IF (connectivity_list(element_list(i,j),n) .EQ. element_list(i,k))
THEN 2012 there_is_in_connectivity_list = 1
2017 IF (there_is_in_connectivity_list .EQ. 0)
THEN 2018 connectivity_number(element_list(i,j)) = connectivity_number(element_list(i,j)) + 1
2019 connectivity_list(element_list(i,j),connectivity_number(element_list(i,j))) = element_list(i,k)
2020 connectivity_number(element_list(i,k)) = connectivity_number(element_list(i,k)) + 1
2021 connectivity_list(element_list(i,k),connectivity_number(element_list(i,k))) = element_list(i,j)
2023 total_number_of_connectivity=total_number_of_connectivity+1
2035 total_number_of_connectivity=total_number_of_connectivity*2
2040 END SUBROUTINE number_of_input_nodes
2048 SUBROUTINE pre_process_information(MATERIAL_BEHAVIOUR,INPUT_FILE_NAME,INPUT_FILE_FORMAT,TOTAL_NUMBER_OF_NODES,&
2049 &input_type_for_seed_value,input_type_for_speed_function,speed_function_along_eigen_vector,input_type_for_conductivity,&
2050 &status_mask,node_list,conductivity_tensor,speed_function_table,seed_value,connectivity_number,&
2051 &speed_function_table_on_connectivity,conductivity_tensor_on_connectivity,raw_index,column_index,total_number_of_connectivity,&
2052 &connectivity_list,element_list,total_number_of_elements,number_of_nodes_per_element,err)
2055 REAL(DP),
ALLOCATABLE :: NODE_LIST(:,:)
2056 REAL(DP),
ALLOCATABLE :: SPEED_FUNCTION_TABLE(:,:)
2057 REAL(DP),
ALLOCATABLE :: CONDUCTIVITY_TENSOR(:,:)
2058 REAL(DP),
ALLOCATABLE :: SPEED_FUNCTION_TABLE_ON_CONNECTIVITY(:,:)
2059 REAL(DP),
ALLOCATABLE :: CONDUCTIVITY_TENSOR_ON_CONNECTIVITY(:,:)
2060 INTEGER(INTG),
ALLOCATABLE :: CONNECTIVITY_LIST(:,:)
2061 INTEGER(INTG),
ALLOCATABLE :: ELEMENT_LIST(:,:)
2063 INTEGER(INTG),
ALLOCATABLE,
DIMENSION(:) :: COLUMN_INDEX
2064 INTEGER(INTG),
ALLOCATABLE,
DIMENSION(:) :: RAW_INDEX
2066 REAL(DP),
ALLOCATABLE :: SEED_VALUE(:)
2067 INTEGER(INTG),
ALLOCATABLE :: CONNECTIVITY_NUMBER(:)
2068 CHARACTER (LEN=10),
ALLOCATABLE :: STATUS_MASK(:)
2069 REAL(DP) :: SPEED_FUNCTION_ALONG_EIGEN_VECTOR(3)
2070 INTEGER(INTG),
INTENT(OUT) :: TOTAL_NUMBER_OF_ELEMENTS,TOTAL_NUMBER_OF_CONNECTIVITY
2071 INTEGER(INTG),
INTENT(OUT) :: NUMBER_OF_NODES_PER_ELEMENT
2072 INTEGER(INTG),
INTENT(IN) :: TOTAL_NUMBER_OF_NODES
2073 CHARACTER (LEN=10) :: INPUT_TYPE_FOR_SEED_VALUE
2074 CHARACTER (LEN=10) :: INPUT_TYPE_FOR_SPEED_FUNCTION
2075 CHARACTER (LEN=10) :: INPUT_TYPE_FOR_CONDUCTIVITY
2076 CHARACTER (LEN=300) :: INPUT_FILE_NAME
2077 CHARACTER (LEN=10) :: INPUT_FILE_FORMAT
2078 CHARACTER (LEN=12) :: MATERIAL_BEHAVIOUR
2079 INTEGER(INTG) :: Err
2083 CHARACTER (LEN=300) :: STRING
2084 INTEGER(INTG) :: I,J,K,N,FIRST_NODE_NUMBER
2085 INTEGER(INTG) :: TEXT_LENGTH, THERE_IS_IN_CONNECTIVITY_LIST
2086 REAL(DP) :: A(3),B(3),C(3)
2087 REAL(DP) :: DOT_PRODUCT_VALUE
2090 DO i=1,total_number_of_nodes
2091 connectivity_number(i)=0
2093 node_list(i,j) = 0.0
2094 speed_function_table(i,j) = 0.0
2097 conductivity_tensor(i,j) = 0.0
2101 raw_index(total_number_of_nodes+1)=0
2103 DO i=1,total_number_of_connectivity
2106 speed_function_table_on_connectivity(i,j) = 0.0
2109 conductivity_tensor_on_connectivity(i,j) = 0.0
2114 IF (input_file_format .EQ.
"TABC")
THEN 2116 i =
index(input_file_name,
' ') - 1
2117 string = input_file_name(1:i)//
".tabc" 2118 OPEN (11,file=string)
2122 IF (material_behaviour .EQ.
"ISOTROPIC")
THEN 2125 IF (input_type_for_speed_function .EQ.
"FILE" .AND. input_type_for_seed_value .EQ.
"FILE")
THEN 2126 DO i=1,total_number_of_nodes
2128 READ(11,*) string,(node_list(i,j),j=1,3),speed_function_along_eigen_vector(1),seed_value(i)
2130 speed_function_along_eigen_vector(2)=speed_function_along_eigen_vector(1)
2131 speed_function_along_eigen_vector(3)=speed_function_along_eigen_vector(1)
2133 conductivity_tensor(i,1)=1.0_dp
2134 conductivity_tensor(i,2)=0.0_dp
2135 conductivity_tensor(i,3)=0.0_dp
2136 conductivity_tensor(i,4)=0.0_dp
2137 conductivity_tensor(i,5)=1.0_dp
2138 conductivity_tensor(i,6)=0.0_dp
2139 conductivity_tensor(i,7)=0.0_dp
2140 conductivity_tensor(i,8)=0.0_dp
2141 conductivity_tensor(i,9)=1.0_dp
2147 IF (input_type_for_speed_function .EQ.
"FIXED" .AND. input_type_for_seed_value .EQ.
"FILE")
THEN 2148 DO i=1,total_number_of_nodes
2150 READ(11,*) string,(node_list(i,j),j=1,3),seed_value(i)
2151 conductivity_tensor(i,1)=1.0_dp
2152 conductivity_tensor(i,2)=0.0_dp
2153 conductivity_tensor(i,3)=0.0_dp
2154 conductivity_tensor(i,4)=0.0_dp
2155 conductivity_tensor(i,5)=1.0_dp
2156 conductivity_tensor(i,6)=0.0_dp
2157 conductivity_tensor(i,7)=0.0_dp
2158 conductivity_tensor(i,8)=0.0_dp
2159 conductivity_tensor(i,9)=1.0_dp
2161 speed_function_along_eigen_vector(2)=speed_function_along_eigen_vector(1)
2162 speed_function_along_eigen_vector(3)=speed_function_along_eigen_vector(1)
2168 IF (input_type_for_speed_function .EQ.
"FILE" .AND. input_type_for_seed_value .EQ.
"LIST")
THEN 2169 DO i=1,total_number_of_nodes
2171 READ(11,*) string,(node_list(i,j),j=1,3),speed_function_along_eigen_vector(1)
2172 conductivity_tensor(i,1)=1.0_dp
2173 conductivity_tensor(i,2)=0.0_dp
2174 conductivity_tensor(i,3)=0.0_dp
2175 conductivity_tensor(i,4)=0.0_dp
2176 conductivity_tensor(i,5)=1.0_dp
2177 conductivity_tensor(i,6)=0.0_dp
2178 conductivity_tensor(i,7)=0.0_dp
2179 conductivity_tensor(i,8)=0.0_dp
2180 conductivity_tensor(i,9)=1.0_dp
2182 speed_function_along_eigen_vector(2)=speed_function_along_eigen_vector(1)
2183 speed_function_along_eigen_vector(3)=speed_function_along_eigen_vector(1)
2185 IF (status_mask(i) .NE.
"SEED POINT")
THEN 2186 seed_value(i) = 1000.0_dp
2193 IF (input_type_for_speed_function .EQ.
"FIXED" .AND. input_type_for_seed_value .EQ.
"LIST")
THEN 2194 DO i=1,total_number_of_nodes
2196 READ(11,*) string,(node_list(i,j),j=1,3)
2197 conductivity_tensor(i,1)=1.0_dp
2198 conductivity_tensor(i,2)=0.0_dp
2199 conductivity_tensor(i,3)=0.0_dp
2200 conductivity_tensor(i,4)=0.0_dp
2201 conductivity_tensor(i,5)=1.0_dp
2202 conductivity_tensor(i,6)=0.0_dp
2203 conductivity_tensor(i,7)=0.0_dp
2204 conductivity_tensor(i,8)=0.0_dp
2205 conductivity_tensor(i,9)=1.0_dp
2207 speed_function_along_eigen_vector(2)=speed_function_along_eigen_vector(1)
2208 speed_function_along_eigen_vector(3)=speed_function_along_eigen_vector(1)
2210 IF (status_mask(i) .NE.
"SEED POINT")
THEN 2211 seed_value(i) = 1000.0_dp
2220 IF (material_behaviour .EQ.
"ANISOTROPIC")
THEN 2224 IF (input_type_for_conductivity .EQ.
"TENSOR")
THEN 2227 IF (input_type_for_speed_function .EQ.
"FILE" .AND. input_type_for_seed_value .EQ.
"FILE")
THEN 2228 DO i=1,total_number_of_nodes
2230 READ(11,*) string,(node_list(i,j),j=1,3),(conductivity_tensor(i,j),j=1,9),speed_function_along_eigen_vector(1),&
2231 &speed_function_along_eigen_vector(2),speed_function_along_eigen_vector(3),seed_value(i)
2237 IF (input_type_for_speed_function .EQ.
"FIXED" .AND. input_type_for_seed_value .EQ.
"FILE")
THEN 2238 DO i=1,total_number_of_nodes
2240 READ(11,*) string,(node_list(i,j),j=1,3),(conductivity_tensor(i,j),j=1,9),seed_value(i)
2246 IF (input_type_for_speed_function .EQ.
"FILE" .AND. input_type_for_seed_value .EQ.
"LIST")
THEN 2247 DO i=1,total_number_of_nodes
2249 READ(11,*) string,(node_list(i,j),j=1,3),(conductivity_tensor(i,j),j=1,9),speed_function_along_eigen_vector(1),&
2250 &speed_function_along_eigen_vector(2),speed_function_along_eigen_vector(3)
2252 IF (status_mask(i) .NE.
"SEED POINT")
THEN 2253 seed_value(i) = 1000.0_dp
2260 IF (input_type_for_speed_function .EQ.
"FILE" .AND. input_type_for_seed_value .EQ.
"LIST")
THEN 2261 DO i=1,total_number_of_nodes
2263 READ(11,*) string,(node_list(i,j),j=1,3),(conductivity_tensor(i,j),j=1,9)
2265 IF (status_mask(i) .NE.
"SEED POINT")
THEN 2266 seed_value(i) = 1000.0_dp
2276 IF (input_type_for_conductivity .EQ.
"VECTOR")
THEN 2279 IF (input_type_for_speed_function .EQ.
"FILE" .AND. input_type_for_seed_value .EQ.
"FILE")
THEN 2280 DO i=1,total_number_of_nodes
2282 READ(11,*) string,(node_list(i,j),j=1,3),(conductivity_tensor(i,j),j=1,3),speed_function_along_eigen_vector(1),&
2283 &speed_function_along_eigen_vector(2),speed_function_along_eigen_vector(3),seed_value(i)
2289 IF (input_type_for_speed_function .EQ.
"FIXED" .AND. input_type_for_seed_value .EQ.
"FILE")
THEN 2290 DO i=1,total_number_of_nodes
2292 READ(11,*) string,(node_list(i,j),j=1,3),(conductivity_tensor(i,j),j=1,3),seed_value(i)
2298 IF (input_type_for_speed_function .EQ.
"FILE" .AND. input_type_for_seed_value .EQ.
"LIST")
THEN 2299 DO i=1,total_number_of_nodes
2301 READ(11,*) string,(node_list(i,j),j=1,3),(conductivity_tensor(i,j),j=1,3),speed_function_along_eigen_vector(1),&
2302 &speed_function_along_eigen_vector(2),speed_function_along_eigen_vector(3)
2304 IF (status_mask(i) .NE.
"SEED POINT")
THEN 2305 seed_value(i) = 1000.0_dp
2312 IF (input_type_for_speed_function .EQ.
"FILE" .AND. input_type_for_seed_value .EQ.
"LIST")
THEN 2313 DO i=1,total_number_of_nodes
2315 READ(11,*) string,(node_list(i,j),j=1,3),(conductivity_tensor(i,j),j=1,3)
2317 IF (status_mask(i) .NE.
"SEED POINT")
THEN 2318 seed_value(i) = 1000.0_dp
2324 DO i=1,total_number_of_nodes
2326 a=(/conductivity_tensor(i,1),conductivity_tensor(i,2),conductivity_tensor(i,3)/)
2327 b=(/0.0_dp,0.0_dp,1.0_dp/)
2328 CALL vector_vector_product(a,b,dot_product_value,err)
2330 IF (dot_product_value .LT. 0.8_dp)
THEN 2333 b=(/0.0_dp,1.0_dp,0.0_dp/)
2334 CALL vector_vector_product(a,b,dot_product_value,err)
2335 IF (dot_product_value .LT. 0.8_dp)
THEN 2338 b=(/1.0_dp,0.0_dp,0.0_dp/)
2345 conductivity_tensor(i,4) = c(1)/sqrt(c(1)**2+c(2)**2+c(3)**2)
2346 conductivity_tensor(i,5) = c(2)/sqrt(c(1)**2+c(2)**2+c(3)**2)
2347 conductivity_tensor(i,6) = c(3)/sqrt(c(1)**2+c(2)**2+c(3)**2)
2351 b=(/conductivity_tensor(i,4),conductivity_tensor(i,5),conductivity_tensor(i,6)/)
2356 conductivity_tensor(i,7) = c(1)/sqrt(c(1)**2+c(2)**2+c(3)**2)
2357 conductivity_tensor(i,8) = c(2)/sqrt(c(1)**2+c(2)**2+c(3)**2)
2358 conductivity_tensor(i,9) = c(3)/sqrt(c(1)**2+c(2)**2+c(3)**2)
2372 DO i=1,total_number_of_nodes
2374 READ(11,*) string,connectivity_number(i),(connectivity_list(i,j),j=1,connectivity_number(i))
2377 speed_function_table(i,j)=speed_function_along_eigen_vector(j)
2390 IF (input_file_format .EQ.
"VTKTET")
THEN 2392 number_of_nodes_per_element = 4
2395 text_length =
index(input_file_name,
' ') - 1
2396 string = input_file_name(1:text_length)//
".vtk" 2398 OPEN (11,file=string)
2405 DO i=1,int((total_number_of_nodes/3.0_dp)+0.5_dp)-1
2407 READ(11,*) (node_list(3*(i-1)+1,j),j=1,3),(node_list(3*(i-1)+2,j),j=1,3),(node_list(3*(i-1)+3,j),j=1,3)
2411 i=int((total_number_of_nodes/3.0_dp)+0.5_dp)
2413 IF (3*int((total_number_of_nodes/3.0_dp)+0.5_dp)-total_number_of_nodes .EQ. 0)
THEN 2415 READ(11,*) (node_list(3*(i-1)+1,j),j=1,3),(node_list(3*(i-1)+2,j),j=1,3),(node_list(3*(i-1)+3,j),j=1,3)
2418 IF (3*int((total_number_of_nodes/3.0_dp)+0.5_dp)-total_number_of_nodes .EQ. 1)
THEN 2420 READ(11,*) (node_list(3*(i-1)+1,j),j=1,3),(node_list(3*(i-1)+2,j),j=1,3)
2424 IF (3*int((total_number_of_nodes/3.0_dp)+0.5_dp)-total_number_of_nodes .EQ. 2)
THEN 2426 READ(11,*) (node_list(3*(i-1)+1,j),j=1,3)
2435 DO i=1,total_number_of_elements
2437 READ(11,*) string,(element_list(i,j),j=1,number_of_nodes_per_element)
2440 DO j=1,number_of_nodes_per_element
2441 element_list(i,j)=element_list(i,j)+1
2444 DO j=1,number_of_nodes_per_element-1
2446 DO k=1+j,number_of_nodes_per_element
2447 there_is_in_connectivity_list = 0
2448 DO n=1,connectivity_number(element_list(i,j))
2451 IF (connectivity_list(element_list(i,j),n) .EQ. element_list(i,k))
THEN 2452 there_is_in_connectivity_list = 1
2457 IF (there_is_in_connectivity_list .EQ. 0)
THEN 2459 connectivity_number(element_list(i,j)) = connectivity_number(element_list(i,j)) + 1
2460 connectivity_list(element_list(i,j),connectivity_number(element_list(i,j))) = element_list(i,k)
2461 connectivity_number(element_list(i,k)) = connectivity_number(element_list(i,k)) + 1
2462 connectivity_list(element_list(i,k),connectivity_number(element_list(i,k))) = element_list(i,j)
2476 IF (input_type_for_seed_value .EQ.
"LIST")
THEN 2478 DO i=1,total_number_of_nodes
2480 IF (status_mask(i) .NE.
"SEED POINT")
THEN 2481 seed_value(i) = 1000.0_dp
2489 IF (input_type_for_seed_value .EQ.
"FILE")
THEN 2491 text_length =
index(input_file_name,
' ') - 1
2492 string = input_file_name(1:text_length)//
".estm" 2494 DO i=1,total_number_of_nodes
2498 OPEN (11,file=string)
2503 READ(11,*) j,seed_value(j+1)
2505 status_mask(j+1) =
"SEED POINT" 2511 DO i=1,total_number_of_nodes
2513 IF (status_mask(i) .NE.
"SEED POINT")
THEN 2514 seed_value(i) = 1000.0_dp
2523 IF (material_behaviour .EQ.
"ISOTROPIC")
THEN 2525 DO i=1,total_number_of_nodes
2526 conductivity_tensor(i,1)=1.0_dp
2527 conductivity_tensor(i,2)=0.0_dp
2528 conductivity_tensor(i,3)=0.0_dp
2529 conductivity_tensor(i,4)=0.0_dp
2530 conductivity_tensor(i,5)=1.0_dp
2531 conductivity_tensor(i,6)=0.0_dp
2532 conductivity_tensor(i,7)=0.0_dp
2533 conductivity_tensor(i,8)=0.0_dp
2534 conductivity_tensor(i,9)=1.0_dp
2540 IF (material_behaviour .EQ.
"ANISOTROPIC")
THEN 2542 text_length =
index(input_file_name,
' ') - 1
2543 string = input_file_name(1:text_length)//
".fiber" 2545 OPEN (11,file=string)
2548 IF (input_type_for_conductivity .EQ.
"TENSOR")
THEN 2549 DO i=1,total_number_of_nodes
2550 READ(11,*) string,(conductivity_tensor(i,j),j=1,9)
2554 IF (input_type_for_conductivity .EQ.
"VECTOR")
THEN 2555 IF (string .EQ.
'#') then
2557 DO WHILE (string .NE.
'fiber')
2565 DO i=1,int((total_number_of_nodes/3.0_dp)+0.5_dp)-1
2567 READ(11,*) (conductivity_tensor(3*(i-1)+1,j),j=1,3),(conductivity_tensor(3*(i-1)+2,j),j=1,3), &
2568 & (conductivity_tensor(3*(i-1)+3,j),j=1,3)
2572 i=int((total_number_of_nodes/3.0_dp)+0.5_dp)
2574 IF (3*int((total_number_of_nodes/3.0_dp)+0.5_dp)-total_number_of_nodes .EQ. 0)
THEN 2576 READ(11,*) (conductivity_tensor(3*(i-1)+1,j),j=1,3),(conductivity_tensor(3*(i-1)+2,j),j=1,3), &
2577 & (conductivity_tensor(3*(i-1)+3,j),j=1,3)
2580 IF (3*int((total_number_of_nodes/3.0_dp)+0.5_dp)-total_number_of_nodes .EQ. 1)
THEN 2582 READ(11,*) (conductivity_tensor(3*(i-1)+1,j),j=1,3),(conductivity_tensor(3*(i-1)+2,j),j=1,3)
2585 IF (3*int((total_number_of_nodes/3.0_dp)+0.5_dp)-total_number_of_nodes .EQ. 2)
THEN 2587 READ(11,*) (conductivity_tensor(3*(i-1)+1,j),j=1,3)
2593 DO i=1,total_number_of_nodes
2595 READ(11,*) (conductivity_tensor(i,j),j=1,3)
2600 DO i=1,total_number_of_nodes
2604 a=(/conductivity_tensor(i,1),conductivity_tensor(i,2),conductivity_tensor(i,3)/)
2606 b=(/0.0_dp,0.0_dp,1.0_dp/)
2607 CALL vector_vector_product(a,b,dot_product_value,err)
2609 IF (dot_product_value .LT. 0.8_dp)
THEN 2612 b=(/0.0_dp,1.0_dp,0.0_dp/)
2613 CALL vector_vector_product(a,b,dot_product_value,err)
2614 IF (dot_product_value .LT. 0.8_dp)
THEN 2617 b=(/1.0_dp,0.0_dp,0.0_dp/)
2624 conductivity_tensor(i,4) = c(1)/sqrt(c(1)**2+c(2)**2+c(3)**2)
2625 conductivity_tensor(i,5) = c(2)/sqrt(c(1)**2+c(2)**2+c(3)**2)
2626 conductivity_tensor(i,6) = c(3)/sqrt(c(1)**2+c(2)**2+c(3)**2)
2630 b=(/conductivity_tensor(i,4),conductivity_tensor(i,5),conductivity_tensor(i,6)/)
2635 conductivity_tensor(i,7) = c(1)/sqrt(c(1)**2+c(2)**2+c(3)**2)
2636 conductivity_tensor(i,8) = c(2)/sqrt(c(1)**2+c(2)**2+c(3)**2)
2637 conductivity_tensor(i,9) = c(3)/sqrt(c(1)**2+c(2)**2+c(3)**2)
2652 IF (material_behaviour .EQ.
"ISOTROPIC")
THEN 2655 IF (input_type_for_speed_function .EQ.
"FIXED")
THEN 2657 DO i=1,total_number_of_nodes
2659 speed_function_table(i,j) = speed_function_along_eigen_vector(1)
2666 IF (input_type_for_speed_function .EQ.
"FILE")
THEN 2668 text_length =
index(input_file_name,
' ') - 1
2669 string = input_file_name(1:text_length)//
".cond" 2671 OPEN (11,file=string)
2676 READ(11,*) j,speed_function_table(j,1)
2677 speed_function_table(j,2) = speed_function_table(j,1)
2678 speed_function_table(j,3) = speed_function_table(j,1)
2689 IF (material_behaviour .EQ.
"ANISOTROPIC")
THEN 2692 IF (input_type_for_speed_function .EQ.
"FIXED")
THEN 2694 DO i=1,total_number_of_nodes
2696 speed_function_table(i,j) = 0.0_dp
2700 DO i=1,total_number_of_nodes
2705 speed_function_table(i,1) = speed_function_along_eigen_vector(1)
2706 speed_function_table(i,2) = speed_function_along_eigen_vector(2)
2707 speed_function_table(i,3) = speed_function_along_eigen_vector(3)
2717 IF (input_type_for_speed_function .EQ.
"FILE")
THEN 2719 text_length =
index(input_file_name,
' ') - 1
2721 string = input_file_name(1:text_length)//
".cond" 2723 OPEN (11,file=string)
2728 READ(11,*) j,speed_function_table(j,1),speed_function_table(j,2),speed_function_table(j,3)
2740 IF (input_file_format .EQ.
"VTKTET1NPL")
THEN 2742 number_of_nodes_per_element = 4
2745 text_length =
index(input_file_name,
' ') - 1
2746 string = input_file_name(1:text_length)//
".vtk" 2748 OPEN (11,file=string)
2755 DO i=1,total_number_of_nodes
2757 READ(11,*) (node_list(i,j),j=1,3)
2765 DO n=1,total_number_of_nodes
2766 connectivity_number(n)=0
2769 DO i=1,total_number_of_elements
2771 READ(11,*) string,(element_list(i,j),j=1,number_of_nodes_per_element)
2774 DO j=1,number_of_nodes_per_element
2775 element_list(i,j)=element_list(i,j)+1
2778 DO j=1,number_of_nodes_per_element-1
2780 DO k=1+j,number_of_nodes_per_element
2781 there_is_in_connectivity_list = 0
2782 DO n=1,connectivity_number(element_list(i,j))
2785 IF (connectivity_list(element_list(i,j),n) .EQ. element_list(i,k))
THEN 2786 there_is_in_connectivity_list = 1
2791 IF (there_is_in_connectivity_list .EQ. 0)
THEN 2793 connectivity_number(element_list(i,j)) = connectivity_number(element_list(i,j)) + 1
2794 connectivity_list(element_list(i,j),connectivity_number(element_list(i,j))) = element_list(i,k)
2795 connectivity_number(element_list(i,k)) = connectivity_number(element_list(i,k)) + 1
2796 connectivity_list(element_list(i,k),connectivity_number(element_list(i,k))) = element_list(i,j)
2810 IF (input_type_for_seed_value .EQ.
"LIST")
THEN 2812 DO i=1,total_number_of_nodes
2814 IF (status_mask(i) .NE.
"SEED POINT")
THEN 2815 seed_value(i) = 1000.0_dp
2823 IF (input_type_for_seed_value .EQ.
"FILE")
THEN 2825 text_length =
index(input_file_name,
' ') - 1
2826 string = input_file_name(1:text_length)//
".estm" 2828 OPEN (11,file=string)
2833 READ(11,*) j,seed_value(j+1)
2835 status_mask(j+1) =
"SEED POINT" 2841 DO i=1,total_number_of_nodes
2843 IF (status_mask(i) .NE.
"SEED POINT")
THEN 2844 seed_value(i) = 1000.0_dp
2853 IF (material_behaviour .EQ.
"ISOTROPIC")
THEN 2855 DO i=1,total_number_of_nodes
2856 conductivity_tensor(i,1)=1.0_dp
2857 conductivity_tensor(i,2)=0.0_dp
2858 conductivity_tensor(i,3)=0.0_dp
2859 conductivity_tensor(i,4)=0.0_dp
2860 conductivity_tensor(i,5)=1.0_dp
2861 conductivity_tensor(i,6)=0.0_dp
2862 conductivity_tensor(i,7)=0.0_dp
2863 conductivity_tensor(i,8)=0.0_dp
2864 conductivity_tensor(i,9)=1.0_dp
2870 IF (material_behaviour .EQ.
"ANISOTROPIC")
THEN 2872 text_length =
index(input_file_name,
' ') - 1
2873 string = input_file_name(1:text_length)//
".fiber" 2875 OPEN (11,file=string)
2879 IF (input_type_for_conductivity .EQ.
"TENSOR")
THEN 2880 DO i=1,total_number_of_nodes
2881 READ(11,*) string,(conductivity_tensor(i,j),j=1,9)
2885 IF (input_type_for_conductivity .EQ.
"VECTOR")
THEN 2886 IF (string .EQ.
'#') then
2888 DO WHILE (string .NE.
'fiber')
2896 DO i=1,int((total_number_of_nodes/3.0_dp)+0.5_dp)-1
2898 READ(11,*) (conductivity_tensor(3*(i-1)+1,j),j=1,3),(conductivity_tensor(3*(i-1)+2,j),j=1,3), &
2899 & (conductivity_tensor(3*(i-1)+3,j),j=1,3)
2903 i=int((total_number_of_nodes/3.0_dp)+0.5_dp)
2905 IF (3*int((total_number_of_nodes/3.0_dp)+0.5_dp)-total_number_of_nodes .EQ. 0)
THEN 2907 READ(11,*) (conductivity_tensor(3*(i-1)+1,j),j=1,3),(conductivity_tensor(3*(i-1)+2,j),j=1,3), &
2908 & (conductivity_tensor(3*(i-1)+3,j),j=1,3)
2911 IF (3*int((total_number_of_nodes/3.0_dp)+0.5_dp)-total_number_of_nodes .EQ. 1)
THEN 2913 READ(11,*) (conductivity_tensor(3*(i-1)+1,j),j=1,3),(conductivity_tensor(3*(i-1)+2,j),j=1,3)
2916 IF (3*int((total_number_of_nodes/3.0_dp)+0.5_dp)-total_number_of_nodes .EQ. 2)
THEN 2918 READ(11,*) (conductivity_tensor(3*(i-1)+1,j),j=1,3)
2924 DO i=1,total_number_of_nodes
2926 READ(11,*) (conductivity_tensor(i,j),j=1,3)
2931 DO i=1,total_number_of_nodes
2935 a=(/conductivity_tensor(i,1),conductivity_tensor(i,2),conductivity_tensor(i,3)/)
2936 b=(/0.0_dp,0.0_dp,1.0_dp/)
2937 CALL vector_vector_product(a,b,dot_product_value,err)
2939 IF (dot_product_value .LT. 0.8_dp)
THEN 2942 b=(/0.0_dp,1.0_dp,0.0_dp/)
2943 CALL vector_vector_product(a,b,dot_product_value,err)
2944 IF (dot_product_value .LT. 0.8_dp)
THEN 2947 b=(/1.0_dp,0.0_dp,0.0_dp/)
2954 conductivity_tensor(i,4) = c(1)/sqrt(c(1)**2+c(2)**2+c(3)**2)
2955 conductivity_tensor(i,5) = c(2)/sqrt(c(1)**2+c(2)**2+c(3)**2)
2956 conductivity_tensor(i,6) = c(3)/sqrt(c(1)**2+c(2)**2+c(3)**2)
2960 b=(/conductivity_tensor(i,4),conductivity_tensor(i,5),conductivity_tensor(i,6)/)
2965 conductivity_tensor(i,7) = c(1)/sqrt(c(1)**2+c(2)**2+c(3)**2)
2966 conductivity_tensor(i,8) = c(2)/sqrt(c(1)**2+c(2)**2+c(3)**2)
2967 conductivity_tensor(i,9) = c(3)/sqrt(c(1)**2+c(2)**2+c(3)**2)
2982 IF (material_behaviour .EQ.
"ISOTROPIC")
THEN 2985 IF (input_type_for_speed_function .EQ.
"FIXED")
THEN 2987 DO i=1,total_number_of_nodes
2989 speed_function_table(i,j) = speed_function_along_eigen_vector(1)
2996 IF (input_type_for_speed_function .EQ.
"FILE")
THEN 2998 text_length =
index(input_file_name,
' ') - 1
2999 string = input_file_name(1:text_length)//
".cond" 3001 OPEN (11,file=string)
3006 READ(11,*) j,speed_function_table(j,1)
3007 speed_function_table(j,2) = speed_function_table(j,1)
3008 speed_function_table(j,3) = speed_function_table(j,1)
3019 IF (material_behaviour .EQ.
"ANISOTROPIC")
THEN 3022 IF (input_type_for_speed_function .EQ.
"FIXED")
THEN 3024 DO i=1,total_number_of_nodes
3026 speed_function_table(i,j) = speed_function_along_eigen_vector(j)
3033 IF (input_type_for_speed_function .EQ.
"FILE")
THEN 3035 text_length =
index(input_file_name,
' ') - 1
3037 string = input_file_name(1:text_length)//
".cond" 3039 OPEN (11,file=string)
3044 READ(11,*) j,speed_function_table(j,1),speed_function_table(j,2),&
3045 &speed_function_table(j,3)
3058 IF (input_file_format .EQ.
"CARP")
THEN 3060 number_of_nodes_per_element = 4
3063 text_length =
index(input_file_name,
' ') - 1
3064 string = input_file_name(1:text_length)//
".pts" 3066 OPEN (11,file=string)
3069 DO i=1,total_number_of_nodes
3071 READ(11,*) (node_list(i,j),j=1,3)
3078 text_length =
index(input_file_name,
' ') - 1
3079 string = input_file_name(1:text_length)//
".elem" 3081 OPEN (11,file=string)
3082 READ (11,*) total_number_of_elements
3084 DO n=1,total_number_of_nodes
3085 connectivity_number(n)=0
3088 DO i=1,total_number_of_elements
3090 READ(11,*) string,(element_list(i,j),j=1,number_of_nodes_per_element)
3092 DO j=1,number_of_nodes_per_element
3093 element_list(i,j)=element_list(i,j)+1
3096 DO j=1,number_of_nodes_per_element-1
3098 DO k=1+j,number_of_nodes_per_element
3099 there_is_in_connectivity_list = 0
3100 DO n=1,connectivity_number(element_list(i,j))
3103 IF (connectivity_list(element_list(i,j),n) .EQ. element_list(i,k))
THEN 3104 there_is_in_connectivity_list = 1
3109 IF (there_is_in_connectivity_list .EQ. 0)
THEN 3111 connectivity_number(element_list(i,j)) = connectivity_number(element_list(i,j)) + 1
3112 connectivity_list(element_list(i,j),connectivity_number(element_list(i,j))) = element_list(i,k)
3113 connectivity_number(element_list(i,k)) = connectivity_number(element_list(i,k)) + 1
3114 connectivity_list(element_list(i,k),connectivity_number(element_list(i,k))) = element_list(i,j)
3128 IF (input_type_for_seed_value .EQ.
"LIST")
THEN 3130 DO i=1,total_number_of_nodes
3132 IF (status_mask(i) .NE.
"SEED POINT")
THEN 3133 seed_value(i) = 1000.0_dp
3141 IF (input_type_for_seed_value .EQ.
"FILE")
THEN 3143 text_length =
index(input_file_name,
' ') - 1
3144 string = input_file_name(1:text_length)//
".estm" 3146 OPEN (11,file=string)
3149 DO i=1,total_number_of_nodes
3151 READ(11,*) string,seed_value(i)
3161 IF (material_behaviour .EQ.
"ISOTROPIC")
THEN 3163 DO i=1,total_number_of_nodes
3164 conductivity_tensor(i,1)=1.0_dp
3165 conductivity_tensor(i,2)=0.0_dp
3166 conductivity_tensor(i,3)=0.0_dp
3167 conductivity_tensor(i,4)=0.0_dp
3168 conductivity_tensor(i,5)=1.0_dp
3169 conductivity_tensor(i,6)=0.0_dp
3170 conductivity_tensor(i,7)=0.0_dp
3171 conductivity_tensor(i,8)=0.0_dp
3172 conductivity_tensor(i,9)=1.0_dp
3178 IF (material_behaviour .EQ.
"ANISOTROPIC")
THEN 3180 text_length =
index(input_file_name,
' ') - 1
3181 string = input_file_name(1:text_length)//
".lon" 3183 OPEN (11,file=string)
3186 IF (input_type_for_conductivity .EQ.
"TENSOR")
THEN 3187 DO i=1,total_number_of_nodes
3188 READ(11,*) string,(conductivity_tensor(i,j),j=1,9)
3192 IF (input_type_for_conductivity .EQ.
"VECTOR" .OR. input_type_for_conductivity .EQ.
" ")
THEN 3193 DO i=1,total_number_of_elements
3194 READ(11,*) (conductivity_tensor(element_list(i,1),j),j=1,3)
3196 a=(/conductivity_tensor(element_list(i,1),1),conductivity_tensor(element_list(i,1),2), &
3197 & conductivity_tensor(element_list(i,1),3)/)
3198 b=(/0.0_dp,0.0_dp,1.0_dp/)
3199 CALL vector_vector_product(a,b,dot_product_value,err)
3201 IF (dot_product_value .LT. 0.8_dp)
THEN 3204 b=(/0.0_dp,1.0_dp,0.0_dp/)
3205 CALL vector_vector_product(a,b,dot_product_value,err)
3206 IF (dot_product_value .LT. 0.8_dp)
THEN 3209 b=(/1.0_dp,0.0_dp,0.0_dp/)
3216 conductivity_tensor(element_list(i,1),4) = c(1)/sqrt(c(1)**2+c(2)**2+c(3)**2)
3217 conductivity_tensor(element_list(i,1),5) = c(2)/sqrt(c(1)**2+c(2)**2+c(3)**2)
3218 conductivity_tensor(element_list(i,1),6) = c(3)/sqrt(c(1)**2+c(2)**2+c(3)**2)
3222 b=(/conductivity_tensor(element_list(i,1),4),conductivity_tensor(element_list(i,1),5), &
3223 & conductivity_tensor(element_list(i,1),6)/)
3228 conductivity_tensor(element_list(i,1),7) = c(1)/sqrt(c(1)**2+c(2)**2+c(3)**2)
3229 conductivity_tensor(element_list(i,1),8) = c(2)/sqrt(c(1)**2+c(2)**2+c(3)**2)
3230 conductivity_tensor(element_list(i,1),9) = c(3)/sqrt(c(1)**2+c(2)**2+c(3)**2)
3234 DO j=2,number_of_nodes_per_element
3236 conductivity_tensor(element_list(i,j),k)=conductivity_tensor(element_list(i,1),k)
3251 IF (material_behaviour .EQ.
"ISOTROPIC")
THEN 3254 IF (input_type_for_speed_function .EQ.
"FIXED")
THEN 3256 DO i=1,total_number_of_nodes
3258 speed_function_table(i,j) = speed_function_along_eigen_vector(1)
3265 IF (input_type_for_speed_function .EQ.
"FILE")
THEN 3267 text_length =
index(input_file_name,
' ') - 1
3268 string = input_file_name(1:text_length)//
".cond" 3270 OPEN (11,file=string)
3275 READ(11,*) j,speed_function_table(j,1)
3276 speed_function_table(j,2) = speed_function_table(j,1)
3277 speed_function_table(j,3) = speed_function_table(j,1)
3288 IF (material_behaviour .EQ.
"ANISOTROPIC")
THEN 3291 IF (input_type_for_speed_function .EQ.
"FIXED")
THEN 3293 DO i=1,total_number_of_nodes
3295 speed_function_table(i,j) = speed_function_along_eigen_vector(j)
3302 IF (input_type_for_speed_function .EQ.
"FILE")
THEN 3304 text_length =
index(input_file_name,
' ') - 1
3306 string = input_file_name(1:text_length)//
".cond" 3308 OPEN (11,file=string)
3313 READ(11,*) j,speed_function_table(j,1),speed_function_table(j,2),&
3314 &speed_function_table(j,3)
3327 IF (input_file_format .EQ.
"TETGEN")
THEN 3329 number_of_nodes_per_element = 4
3332 text_length =
index(input_file_name,
' ') - 1
3333 string = input_file_name(1:text_length)//
".node" 3335 OPEN (11,file=string)
3338 READ(11,*) first_node_number,(node_list(1,j),j=1,3)
3340 DO i=2,total_number_of_nodes
3343 READ(11,*) string,(node_list(i,j),j=1,3)
3351 text_length =
index(input_file_name,
' ') - 1
3352 string = input_file_name(1:text_length)//
".ele" 3354 OPEN (11,file=string)
3355 READ (11,*) total_number_of_elements
3357 DO n=1,total_number_of_nodes
3358 connectivity_number(n)=0
3361 DO i=1,total_number_of_elements
3363 READ(11,*) string,(element_list(i,j),j=1,number_of_nodes_per_element)
3365 IF (first_node_number .EQ. 0)
THEN 3366 DO j=1,number_of_nodes_per_element
3367 element_list(i,j)=element_list(i,j)+1
3371 DO j=1,number_of_nodes_per_element-1
3373 DO k=1+j,number_of_nodes_per_element
3374 there_is_in_connectivity_list = 0
3375 DO n=1,connectivity_number(element_list(i,j))
3378 IF (connectivity_list(element_list(i,j),n) .EQ. element_list(i,k))
THEN 3379 there_is_in_connectivity_list = 1
3384 IF (there_is_in_connectivity_list .EQ. 0)
THEN 3386 connectivity_number(element_list(i,j)) = connectivity_number(element_list(i,j)) + 1
3387 connectivity_list(element_list(i,j),connectivity_number(element_list(i,j))) = element_list(i,k)
3388 connectivity_number(element_list(i,k)) = connectivity_number(element_list(i,k)) + 1
3389 connectivity_list(element_list(i,k),connectivity_number(element_list(i,k))) = element_list(i,j)
3403 IF (input_type_for_seed_value .EQ.
"LIST")
THEN 3405 DO i=1,total_number_of_nodes
3407 IF (status_mask(i) .NE.
"SEED POINT")
THEN 3408 seed_value(i) = 1000.0_dp
3416 IF (input_type_for_seed_value .EQ.
"FILE")
THEN 3418 text_length =
index(input_file_name,
' ') - 1
3419 string = input_file_name(1:text_length)//
".estm" 3421 OPEN (11,file=string)
3424 DO i=1,total_number_of_nodes
3426 READ(11,*) string,seed_value(i)
3436 IF (material_behaviour .EQ.
"ISOTROPIC")
THEN 3438 DO i=1,total_number_of_nodes
3439 conductivity_tensor(i,1)=1.0_dp
3440 conductivity_tensor(i,2)=0.0_dp
3441 conductivity_tensor(i,3)=0.0_dp
3442 conductivity_tensor(i,4)=0.0_dp
3443 conductivity_tensor(i,5)=1.0_dp
3444 conductivity_tensor(i,6)=0.0_dp
3445 conductivity_tensor(i,7)=0.0_dp
3446 conductivity_tensor(i,8)=0.0_dp
3447 conductivity_tensor(i,9)=1.0_dp
3453 IF (material_behaviour .EQ.
"ANISOTROPIC")
THEN 3455 text_length =
index(input_file_name,
' ') - 1
3456 string = input_file_name(1:text_length)//
".fiber" 3458 OPEN (11,file=string)
3461 IF (input_type_for_conductivity .EQ.
"TENSOR")
THEN 3462 DO i=1,total_number_of_nodes
3463 READ(11,*) string,(conductivity_tensor(i,j),j=1,9)
3467 IF (input_type_for_conductivity .EQ.
"VECTOR")
THEN 3468 DO i=1,total_number_of_nodes
3469 READ(11,*) string,(conductivity_tensor(i,j),j=1,3)
3471 a=(/conductivity_tensor(i,1),conductivity_tensor(i,2),conductivity_tensor(i,3)/)
3472 b=(/0.0_dp,0.0_dp,1.0_dp/)
3473 CALL vector_vector_product(a,b,dot_product_value,err)
3475 IF (dot_product_value .LT. 0.8_dp)
THEN 3478 b=(/0.0_dp,1.0_dp,0.0_dp/)
3479 CALL vector_vector_product(a,b,dot_product_value,err)
3480 IF (dot_product_value .LT. 0.8_dp)
THEN 3484 b=(/1.0_dp,0.0_dp,0.0_dp/)
3491 conductivity_tensor(i,4) = c(1)/sqrt(c(1)**2+c(2)**2+c(3)**2)
3492 conductivity_tensor(i,5) = c(2)/sqrt(c(1)**2+c(2)**2+c(3)**2)
3493 conductivity_tensor(i,6) = c(3)/sqrt(c(1)**2+c(2)**2+c(3)**2)
3497 b=(/conductivity_tensor(i,4),conductivity_tensor(i,5),conductivity_tensor(i,6)/)
3502 conductivity_tensor(i,7) = c(1)/sqrt(c(1)**2+c(2)**2+c(3)**2)
3503 conductivity_tensor(i,8) = c(2)/sqrt(c(1)**2+c(2)**2+c(3)**2)
3504 conductivity_tensor(i,9) = c(3)/sqrt(c(1)**2+c(2)**2+c(3)**2)
3519 IF (material_behaviour .EQ.
"ISOTROPIC")
THEN 3522 IF (input_type_for_speed_function .EQ.
"FIXED")
THEN 3524 DO i=1,total_number_of_nodes
3526 speed_function_table(i,j) = speed_function_along_eigen_vector(1)
3533 IF (input_type_for_speed_function .EQ.
"FILE")
THEN 3535 text_length =
index(input_file_name,
' ') - 1
3536 string = input_file_name(1:text_length)//
".cond" 3538 OPEN (11,file=string)
3543 READ(11,*) j,speed_function_table(j,1)
3544 speed_function_table(j,2) = speed_function_table(j,1)
3545 speed_function_table(j,3) = speed_function_table(j,1)
3556 IF (material_behaviour .EQ.
"ANISOTROPIC")
THEN 3559 IF (input_type_for_speed_function .EQ.
"FIXED")
THEN 3561 DO i=1,total_number_of_nodes
3563 speed_function_table(i,j) = speed_function_along_eigen_vector(j)
3570 IF (input_type_for_speed_function .EQ.
"FILE")
THEN 3572 text_length =
index(input_file_name,
' ') - 1
3574 string = input_file_name(1:text_length)//
".cond" 3576 OPEN (11,file=string)
3581 READ(11,*) j,speed_function_table(j,1),speed_function_table(j,2),&
3582 &speed_function_table(j,3)
3596 DO i=1,total_number_of_nodes
3598 raw_index(i+1) = raw_index(i) + connectivity_number(i)
3599 DO j = 1,connectivity_number(i)
3600 column_index(raw_index(i)+j) = connectivity_list(i,j)
3605 DO i=1,total_number_of_nodes
3607 DO j = raw_index(i)+1,raw_index(i+1)
3609 speed_function_table_on_connectivity(j,k) = &
3610 & (speed_function_table(i,k)+speed_function_table(column_index(j),k))/2.0_dp
3613 conductivity_tensor_on_connectivity(j,k) = &
3614 & (conductivity_tensor(i,k)+conductivity_tensor(column_index(j),k))/2.0_dp
3622 999 errorsexits(
"GENERATE_STATUS_MASK",err,error)
3625 END SUBROUTINE pre_process_information
3633 SUBROUTINE solve_problem_fmm(TOTAL_NUMBER_OF_NODES,NODE_LIST,CONDUCTIVITY_TENSOR,SPEED_FUNCTION_TABLE,&
3634 &seed_value,connectivity_number,connectivity_list,status_mask)
3637 INTEGER(INTG),
INTENT(IN) :: TOTAL_NUMBER_OF_NODES
3639 REAL(DP),
ALLOCATABLE :: NODE_LIST(:,:)
3640 REAL(DP),
ALLOCATABLE :: SPEED_FUNCTION_TABLE(:,:)
3641 REAL(DP),
ALLOCATABLE :: CONDUCTIVITY_TENSOR(:,:)
3642 INTEGER(INTG),
ALLOCATABLE :: CONNECTIVITY_LIST(:,:)
3644 REAL(DP),
ALLOCATABLE :: SEED_VALUE(:)
3645 INTEGER(INTG),
ALLOCATABLE :: CONNECTIVITY_NUMBER(:)
3646 CHARACTER (LEN=10),
ALLOCATABLE :: STATUS_MASK(:)
3649 INTEGER(INTG) :: I,J
3650 INTEGER(INTG) :: LOOP_NUMBER, CHANGED_STATUS, MIN_TRIAL_NODE, TRIAL_STATUS
3651 REAL(DP),
DIMENSION(3) :: DISTANCE_VECTOR,MV
3652 REAL(DP),
DIMENSION(3,3) :: CONDUCTIVITY_MATRIX,F,FT,MFT,FMFT
3653 REAL(DP) :: MIN_TRIAL_VALUE,VMV,MINIMUM_DATA,TIME_ITER,TIME_NEW,CONDUCTION_RATIO
3654 INTEGER(INTG) :: Err
3659 CALL generate_status_mask(total_number_of_nodes,seed_value,status_mask,err)
3661 min_trial_value = 1000
3662 DO i=1,total_number_of_nodes
3664 IF (status_mask(i) ==
"SEED POINT")
THEN 3666 IF (seed_value(i) .lt. min_trial_value)
THEN 3667 min_trial_value=seed_value(i)
3679 DO WHILE (trial_status .eq. 1)
3682 loop_number = loop_number + 1
3683 print *,
"Running in loop number",loop_number
3686 status_mask(min_trial_node) =
"KNOWN" 3688 DO i=1,connectivity_number(min_trial_node)
3691 DO j=1,connectivity_number(connectivity_list(min_trial_node,i))
3692 IF (status_mask(connectivity_list(connectivity_list(min_trial_node,i),j)) ==
"KNOWN")
THEN 3695 &/node_list(connectivity_list(min_trial_node,i),1)&
3696 &-node_list(connectivity_list(connectivity_list(min_trial_node,i),j),1)&
3697 &,node_list(connectivity_list(min_trial_node,i),2)&
3698 &-node_list(connectivity_list(connectivity_list(min_trial_node,i),j),2)&
3699 &,node_list(connectivity_list(min_trial_node,i),3)&
3700 &-node_list(connectivity_list(connectivity_list(min_trial_node,i),j),3)/)
3705 &speed_function_table(connectivity_list(connectivity_list(min_trial_node,i),j),2)/&
3706 &speed_function_table(connectivity_list(connectivity_list(min_trial_node,i),j),1)
3709 conductivity_matrix=reshape(source=(/1.0_dp,0.0_dp,0.0_dp,&
3710 &0.0_dp,conduction_ratio*conduction_ratio,0.0_dp,&
3711 &0.0_dp,0.0_dp,conduction_ratio*conduction_ratio/), shape = (/3,3/))
3715 f=reshape(source =(/conductivity_tensor(connectivity_list(connectivity_list(min_trial_node,i),j),1),&
3716 &conductivity_tensor(connectivity_list(connectivity_list(min_trial_node,i),j),2),&
3717 &conductivity_tensor(connectivity_list(connectivity_list(min_trial_node,i),j),3),&
3718 &conductivity_tensor(connectivity_list(connectivity_list(min_trial_node,i),j),4),&
3719 &conductivity_tensor(connectivity_list(connectivity_list(min_trial_node,i),j),5),&
3720 &conductivity_tensor(connectivity_list(connectivity_list(min_trial_node,i),j),6),&
3721 &conductivity_tensor(connectivity_list(connectivity_list(min_trial_node,i),j),7),&
3722 &conductivity_tensor(connectivity_list(connectivity_list(min_trial_node,i),j),8),&
3723 &conductivity_tensor(connectivity_list(connectivity_list(min_trial_node,i),j),9)/&
3734 CALL vector_vector_product(distance_vector,mv,vmv,err)
3736 time_iter=seed_value(connectivity_list(connectivity_list(min_trial_node,i),j))+sqrt(abs(vmv))*&
3737 &speed_function_table(connectivity_list(connectivity_list(min_trial_node,i),j),1)
3741 IF (time_iter .lt. time_new)
THEN 3742 time_new = time_iter
3748 IF (time_new .lt. seed_value(connectivity_list(min_trial_node,i)))
THEN 3749 seed_value(connectivity_list(min_trial_node,i)) = time_new
3750 IF (status_mask(connectivity_list(min_trial_node,i)) .EQ.
"KNOWN")
THEN 3751 status_mask(connectivity_list(min_trial_node,i)) =
"CHANGED" 3753 IF (status_mask(connectivity_list(min_trial_node,i)) .EQ.
"UNKNOWN")
THEN 3754 status_mask(connectivity_list(min_trial_node,i)) =
"SEED POINT" 3760 minimum_data = 1000.0_dp
3763 DO i=1,total_number_of_nodes
3765 IF (status_mask(i) .EQ.
"CHANGED")
THEN 3771 IF (changed_status .EQ. 0.AND.status_mask(i) .EQ.
"SEED POINT".AND.seed_value(i).LT.minimum_data)
THEN 3772 minimum_data = seed_value(i)
3782 999 errorsexits(
"SOLVE_PROBLEM_FMM",err,error)
3785 END SUBROUTINE solve_problem_fmm
3792 SUBROUTINE solve_problem_fmm_connectivity(TOTAL_NUMBER_OF_NODES,NODE_LIST,CONDUCTIVITY_TENSOR_ON_CONNECTIVITY,&
3793 &speed_function_table_on_connectivity,raw_index,column_index,total_number_of_connectivity,&
3794 &seed_value,status_mask)
3797 INTEGER(INTG),
INTENT(IN) :: TOTAL_NUMBER_OF_NODES
3798 INTEGER(INTG),
INTENT(IN) :: TOTAL_NUMBER_OF_CONNECTIVITY
3800 REAL(DP),
ALLOCATABLE :: NODE_LIST(:,:)
3801 REAL(DP),
ALLOCATABLE :: SPEED_FUNCTION_TABLE_ON_CONNECTIVITY(:,:)
3802 REAL(DP),
ALLOCATABLE :: CONDUCTIVITY_TENSOR_ON_CONNECTIVITY(:,:)
3803 INTEGER(INTG),
ALLOCATABLE :: COLUMN_INDEX(:)
3804 INTEGER(INTG),
ALLOCATABLE :: RAW_INDEX(:)
3805 REAL(DP),
ALLOCATABLE :: SEED_VALUE(:)
3806 CHARACTER (LEN=10),
ALLOCATABLE :: STATUS_MASK(:)
3809 INTEGER(INTG) :: I,J
3810 INTEGER(INTG) :: LOOP_NUMBER, CHANGED_STATUS, MIN_TRIAL_NODE, TRIAL_STATUS
3811 REAL(DP),
DIMENSION(3) :: DISTANCE_VECTOR,MV
3812 REAL(DP),
DIMENSION(2) :: CONDUCTION_RATIO
3813 REAL(DP),
DIMENSION(3,3) :: CONDUCTIVITY_MATRIX,F,FT,MFT,FMFT
3814 REAL(DP) :: MIN_TRIAL_VALUE,VMV,MINIMUM_DATA,TIME_ITER,TIME_NEW
3815 INTEGER(INTG) :: Err
3820 CALL generate_status_mask(total_number_of_nodes,seed_value,status_mask,err)
3822 min_trial_value = 1000
3823 DO i=1,total_number_of_nodes
3825 IF (status_mask(i) ==
"SEED POINT")
THEN 3827 IF (seed_value(i) .lt. min_trial_value)
THEN 3828 min_trial_value=seed_value(i)
3840 DO WHILE (trial_status .eq. 1)
3843 loop_number = loop_number + 1
3844 print *,
"Running in loop number",loop_number
3847 status_mask(min_trial_node) =
"KNOWN" 3849 DO i=raw_index(min_trial_node)+1,raw_index(min_trial_node+1)
3852 DO j=raw_index(column_index(i))+1,raw_index(column_index(i)+1)
3853 IF (status_mask(column_index(j)) ==
"KNOWN")
THEN 3855 distance_vector=(/node_list(column_index(i),1)-node_list(column_index(j),1)&
3856 &,node_list(column_index(i),2)-node_list(column_index(j),2)&
3857 &,node_list(column_index(i),3)-node_list(column_index(j),3)/)
3859 conduction_ratio(1)= speed_function_table_on_connectivity(j,2)/speed_function_table_on_connectivity(j,1)
3860 conduction_ratio(2)= speed_function_table_on_connectivity(j,3)/speed_function_table_on_connectivity(j,1)
3862 conductivity_matrix=reshape(source=(/1.0_dp,0.0_dp,0.0_dp,&
3863 &0.0_dp,conduction_ratio(1)*conduction_ratio(1),0.0_dp,&
3864 &0.0_dp,0.0_dp,conduction_ratio(2)*conduction_ratio(2)/), shape = (/3,3/))
3868 f=reshape(source =(/conductivity_tensor_on_connectivity(j,1),&
3869 &conductivity_tensor_on_connectivity(j,2),&
3870 &conductivity_tensor_on_connectivity(j,3),&
3871 &conductivity_tensor_on_connectivity(j,4),&
3872 &conductivity_tensor_on_connectivity(j,5),&
3873 &conductivity_tensor_on_connectivity(j,6),&
3874 &conductivity_tensor_on_connectivity(j,7),&
3875 &conductivity_tensor_on_connectivity(j,8),&
3876 &conductivity_tensor_on_connectivity(j,9)/),shape = (/3,3/))
3884 CALL vector_vector_product(distance_vector,mv,vmv,err)
3886 time_iter=seed_value(column_index(j))+sqrt(abs(vmv))*speed_function_table_on_connectivity(j,1)
3888 IF (time_iter .lt. time_new)
THEN 3889 time_new = time_iter
3895 IF (time_new .LT. seed_value(column_index(i)))
THEN 3896 seed_value(column_index(i)) = time_new
3897 IF (status_mask(column_index(i)) .EQ.
"KNOWN")
THEN 3898 status_mask(column_index(i)) =
"CHANGED" 3900 IF (status_mask(column_index(i)) .EQ.
"UNKNOWN")
THEN 3901 status_mask(column_index(i)) =
"SEED POINT" 3907 minimum_data = 1000.0_dp
3910 DO i=1,total_number_of_nodes
3912 IF (status_mask(i) .EQ.
"CHANGED")
THEN 3918 IF (changed_status .EQ. 0 .AND. status_mask(i) .EQ.
"SEED POINT" .AND. seed_value(i) .LT. minimum_data)
THEN 3919 minimum_data = seed_value(i)
3929 999 errorsexits(
"SOLVE_PROBLEM_FMM_CONNECTIVITY",err,error)
3932 END SUBROUTINE solve_problem_fmm_connectivity
3939 SUBROUTINE solve_problem_geodesic_connectivity(TOTAL_NUMBER_OF_NODES,NODE_LIST,CONDUCTIVITY_TENSOR_ON_CONNECTIVITY,&
3940 &speed_function_table_on_connectivity,raw_index,column_index,total_number_of_connectivity,&
3941 &seed_value,status_mask,trace_node)
3944 INTEGER(INTG),
INTENT(IN) :: TOTAL_NUMBER_OF_NODES
3945 INTEGER(INTG),
INTENT(IN) :: TOTAL_NUMBER_OF_CONNECTIVITY
3946 REAL(DP),
ALLOCATABLE :: NODE_LIST(:,:)
3947 REAL(DP),
ALLOCATABLE :: SPEED_FUNCTION_TABLE_ON_CONNECTIVITY(:,:)
3948 REAL(DP),
ALLOCATABLE :: CONDUCTIVITY_TENSOR_ON_CONNECTIVITY(:,:)
3949 INTEGER(INTG),
ALLOCATABLE :: COLUMN_INDEX(:)
3950 INTEGER(INTG),
ALLOCATABLE :: RAW_INDEX(:)
3951 REAL(DP),
ALLOCATABLE :: SEED_VALUE(:)
3952 INTEGER(INTG),
ALLOCATABLE :: TRACE_NODE(:)
3953 CHARACTER (LEN=10),
ALLOCATABLE :: STATUS_MASK(:)
3956 REAL(DP),
ALLOCATABLE :: CONNECTIVITY_WEIGHT(:)
3957 INTEGER(INTG) :: I,J
3958 INTEGER(INTG) :: CHANGED_STATUS,MIN_TRIAL_NODE,TRIAL_STATUS,TRACE_NODE_NUMBER
3959 REAL(DP),
DIMENSION(3) :: DISTANCE_VECTOR,MV
3960 REAL(DP),
DIMENSION(3,3) :: CONDUCTIVITY_MATRIX,F,FT,MFT,FMFT
3961 REAL(DP) :: MIN_TRIAL_VALUE,VMV,MINIMUM_DATA,TIME_ITER,TIME_NEW
3962 REAL(DP),
DIMENSION(2) :: CONDUCTION_RATIO
3963 INTEGER(INTG) :: Err
3968 DO i=1,total_number_of_nodes
3973 ALLOCATE(connectivity_weight(total_number_of_connectivity),stat=err)
3974 DO i=1,total_number_of_nodes
3975 DO j=raw_index(i)+1,raw_index(i+1)
3976 distance_vector=(/node_list(i,1)-node_list(column_index(j),1)&
3977 &,node_list(i,2)-node_list(column_index(j),2)&
3978 &,node_list(i,3)-node_list(column_index(j),3)/)
3980 conduction_ratio(1) = speed_function_table_on_connectivity(j,2)/speed_function_table_on_connectivity(j,1)
3981 conduction_ratio(2) = speed_function_table_on_connectivity(j,3)/speed_function_table_on_connectivity(j,1)
3983 conductivity_matrix=reshape(source=(/1.0_dp,0.0_dp,0.0_dp,&
3984 &0.0_dp,conduction_ratio(1)*conduction_ratio(1),0.0_dp,&
3985 &0.0_dp,0.0_dp,conduction_ratio(2)*conduction_ratio(2)/), shape = (/3,3/))
3987 f=reshape(source =(/conductivity_tensor_on_connectivity(j,1),&
3988 &conductivity_tensor_on_connectivity(j,2),&
3989 &conductivity_tensor_on_connectivity(j,3),&
3990 &conductivity_tensor_on_connectivity(j,4),&
3991 &conductivity_tensor_on_connectivity(j,5),&
3992 &conductivity_tensor_on_connectivity(j,6),&
3993 &conductivity_tensor_on_connectivity(j,7),&
3994 &conductivity_tensor_on_connectivity(j,8),&
3995 &conductivity_tensor_on_connectivity(j,9)/),shape = (/3,3/))
4002 CALL vector_vector_product(distance_vector,mv,vmv,err)
4004 connectivity_weight(j)=sqrt(abs(vmv))*speed_function_table_on_connectivity(j,1)
4008 CALL generate_status_mask(total_number_of_nodes,seed_value,status_mask,err)
4010 min_trial_value = 1000
4011 DO i=1,total_number_of_nodes
4013 IF (status_mask(i) ==
"SEED POINT")
THEN 4015 IF (seed_value(i) .lt. min_trial_value)
THEN 4016 min_trial_value=seed_value(i)
4027 print *,
"Running GEODESIC Solver ...." 4029 DO WHILE (trial_status .eq. 1)
4033 status_mask(min_trial_node) =
"KNOWN" 4035 DO i=raw_index(min_trial_node)+1,raw_index(min_trial_node+1)
4038 DO j=raw_index(column_index(i))+1,raw_index(column_index(i)+1)
4039 IF (status_mask(column_index(j)) ==
"KNOWN")
THEN 4041 time_iter=seed_value(column_index(j))+connectivity_weight(j)
4043 IF (time_iter .lt. time_new)
THEN 4044 time_new = time_iter
4045 trace_node_number=column_index(j)
4051 IF (time_new .LT. seed_value(column_index(i)))
THEN 4052 seed_value(column_index(i)) = time_new
4053 trace_node(column_index(i)) = trace_node_number
4054 IF (status_mask(column_index(i)) .EQ.
"KNOWN")
THEN 4055 status_mask(column_index(i)) =
"CHANGED" 4057 IF (status_mask(column_index(i)) .EQ.
"UNKNOWN")
THEN 4058 status_mask(column_index(i)) =
"SEED POINT" 4064 minimum_data = 1000.0_dp
4067 DO i=1,total_number_of_nodes
4069 IF (status_mask(i) .EQ.
"CHANGED")
THEN 4075 IF (changed_status .EQ. 0 .AND. status_mask(i) .EQ.
"SEED POINT" .AND. seed_value(i) .LT. minimum_data)
THEN 4076 minimum_data = seed_value(i)
4085 999 errorsexits(
"SOLVE_PROBLEM_GEODESIC_CONNECTIVITY",err,error)
4088 END SUBROUTINE solve_problem_geodesic_connectivity
4095 SUBROUTINE solve_problem_geodesic(TOTAL_NUMBER_OF_NODES,NODE_LIST,CONDUCTIVITY_TENSOR,SPEED_FUNCTION_TABLE,&
4096 & seed_value,connectivity_number,connectivity_list,status_mask,trace_node)
4099 INTEGER(INTG),
INTENT(IN) :: TOTAL_NUMBER_OF_NODES
4101 REAL(DP),
ALLOCATABLE :: NODE_LIST(:,:)
4102 REAL(DP),
ALLOCATABLE :: SPEED_FUNCTION_TABLE(:,:)
4103 REAL(DP),
ALLOCATABLE :: CONDUCTIVITY_TENSOR(:,:)
4104 INTEGER(INTG),
ALLOCATABLE :: CONNECTIVITY_LIST(:,:)
4106 REAL(DP),
ALLOCATABLE :: SEED_VALUE(:)
4107 INTEGER(INTG),
ALLOCATABLE :: CONNECTIVITY_NUMBER(:)
4108 INTEGER(INTG),
ALLOCATABLE :: TRACE_NODE(:)
4109 CHARACTER (LEN=10),
ALLOCATABLE :: STATUS_MASK(:)
4112 INTEGER(INTG) :: I,J
4113 INTEGER(INTG) :: LOOP_NUMBER,CHANGED_STATUS,MIN_TRIAL_NODE,TRIAL_STATUS,TRACE_NODE_NUMBER
4114 REAL(DP),
DIMENSION(3) :: DISTANCE_VECTOR,MV
4115 REAL(DP),
DIMENSION(3,3) :: CONDUCTIVITY_MATRIX,F,FT,MFT,FMFT
4116 REAL(DP) :: MIN_TRIAL_VALUE,VMV,MINIMUM_DATA,TIME_ITER,TIME_NEW,CONDUCTION_RATIO
4117 INTEGER(INTG) :: Err
4123 CALL generate_status_mask(total_number_of_nodes,seed_value,status_mask,err)
4125 min_trial_value = 1000
4126 DO i=1,total_number_of_nodes
4128 IF (status_mask(i) ==
"SEED POINT")
THEN 4130 IF (seed_value(i) .lt. min_trial_value)
THEN 4131 min_trial_value=seed_value(i)
4143 DO WHILE (trial_status .eq. 1)
4146 loop_number = loop_number + 1
4147 print *,
"Running in loop number",loop_number
4150 status_mask(min_trial_node) =
"KNOWN" 4152 DO i=1,connectivity_number(min_trial_node)
4155 DO j=1,connectivity_number(connectivity_list(min_trial_node,i))
4156 IF (status_mask(connectivity_list(connectivity_list(min_trial_node,i),j)) ==
"KNOWN")
THEN 4159 &/node_list(connectivity_list(min_trial_node,i),1)&
4160 &-node_list(connectivity_list(connectivity_list(min_trial_node,i),j),1)&
4161 &,node_list(connectivity_list(min_trial_node,i),2)&
4162 &-node_list(connectivity_list(connectivity_list(min_trial_node,i),j),2)&
4163 &,node_list(connectivity_list(min_trial_node,i),3)&
4164 &-node_list(connectivity_list(connectivity_list(min_trial_node,i),j),3)/)
4166 conduction_ratio=speed_function_table(connectivity_list(connectivity_list(min_trial_node,i),j),2)/&
4167 &speed_function_table(connectivity_list(connectivity_list(min_trial_node,i),j),1)
4169 conductivity_matrix=reshape(source=(/1.0_dp,0.0_dp,0.0_dp,&
4170 &0.0_dp,conduction_ratio*conduction_ratio,0.0_dp,&
4171 &0.0_dp,0.0_dp,conduction_ratio*conduction_ratio/), shape = (/3,3/))
4174 f=reshape(source =(/conductivity_tensor(connectivity_list(connectivity_list(min_trial_node,i),j),1),&
4175 &conductivity_tensor(connectivity_list(connectivity_list(min_trial_node,i),j),2),&
4176 &conductivity_tensor(connectivity_list(connectivity_list(min_trial_node,i),j),3),&
4177 &conductivity_tensor(connectivity_list(connectivity_list(min_trial_node,i),j),4),&
4178 &conductivity_tensor(connectivity_list(connectivity_list(min_trial_node,i),j),5),&
4179 &conductivity_tensor(connectivity_list(connectivity_list(min_trial_node,i),j),6),&
4180 &conductivity_tensor(connectivity_list(connectivity_list(min_trial_node,i),j),7),&
4181 &conductivity_tensor(connectivity_list(connectivity_list(min_trial_node,i),j),8),&
4182 &conductivity_tensor(connectivity_list(connectivity_list(min_trial_node,i),j),9)/&
4190 CALL vector_vector_product(distance_vector,mv,vmv,err)
4192 time_iter=seed_value(connectivity_list(connectivity_list(min_trial_node,i),j))+&
4193 &sqrt(abs(vmv))*speed_function_table(connectivity_list(connectivity_list(min_trial_node,i),j),1)
4195 IF (time_iter .lt. time_new)
THEN 4196 time_new = time_iter
4197 trace_node_number=connectivity_list(connectivity_list(min_trial_node,i),j)
4203 IF (time_new .lt. seed_value(connectivity_list(min_trial_node,i)))
THEN 4204 seed_value(connectivity_list(min_trial_node,i)) = time_new
4205 trace_node(connectivity_list(min_trial_node,i))=trace_node_number
4206 IF (status_mask(connectivity_list(min_trial_node,i)) .EQ.
"KNOWN")
THEN 4207 status_mask(connectivity_list(min_trial_node,i)) =
"CHANGED" 4209 IF (status_mask(connectivity_list(min_trial_node,i)) .EQ.
"UNKNOWN")
THEN 4210 status_mask(connectivity_list(min_trial_node,i)) =
"SEED POINT" 4219 DO i=1,total_number_of_nodes
4221 IF (status_mask(i) .EQ.
"CHANGED")
THEN 4227 IF (changed_status .EQ. 0.AND.status_mask(i) .EQ.
"SEED POINT".AND.seed_value(i).LT.minimum_data)
THEN 4228 minimum_data = seed_value(i)
4238 999 errorsexits(
"SOLVE_PROBLEM_GEODESIC",err,error)
4241 END SUBROUTINE solve_problem_geodesic
4249 SUBROUTINE generate_status_mask(TOTAL_NUMBER_OF_NODES,SEED_VALUE,STATUS_MASK,Err)
4252 INTEGER(INTG),
INTENT(IN) :: TOTAL_NUMBER_OF_NODES
4253 REAL(DP),
ALLOCATABLE :: SEED_VALUE(:)
4254 CHARACTER (LEN=10),
ALLOCATABLE :: STATUS_MASK(:)
4257 INTEGER(INTG) :: Err
4265 DO i=1,total_number_of_nodes
4267 IF (seed_value(i) .LT. 100.0_dp)
THEN 4268 status_mask(i) =
"SEED POINT" 4270 status_mask(i) =
"UNKNOWN" 4280 END SUBROUTINE generate_status_mask
4288 SUBROUTINE find_minimax(A,N,MIN_VALUE,MAX_VALUE,Err)
4291 REAL(DP),
ALLOCATABLE :: A(:)
4293 REAL(DP),
INTENT(OUT) :: MIN_VALUE
4294 REAL(DP),
INTENT(OUT) :: MAX_VALUE
4295 INTEGER(INTG),
INTENT(IN) :: N
4296 INTEGER(INTG) :: ERR
4303 IF(
SIZE(a,1).GT.2)
THEN 4307 IF (min_value .GT. a(i))
THEN 4310 IF (max_value .LT. a(i))
THEN 4323 END SUBROUTINE find_minimax
4331 SUBROUTINE vector_vector_product(A,B,C,Err)
4334 REAL(DP),
INTENT(IN) :: A(3)
4335 REAL(DP),
INTENT(IN) :: B(3)
4336 REAL(DP),
INTENT(OUT) :: C
4337 INTEGER(INTG) :: ERR
4343 IF(
SIZE(a,1)==
SIZE(b,1))
THEN 4344 SELECT CASE(
SIZE(a,1))
4348 c=a(1)*b(1)+a(2)*b(2)
4350 c=a(1)*b(1)+a(2)*b(2)+a(3)*b(3)
4363 END SUBROUTINE vector_vector_product
4371 SUBROUTINE post_process_data(MATERIAL_BEHAVIOUR,OUTPUT_FILE_NAME,OUTPUT_FILE_FORMAT,TOTAL_NUMBER_OF_NODES,NODE_LIST,&
4372 &conductivity_tensor,speed_function_table,seed_value,connectivity_number,output_file_field_title,&
4373 &connectivity_list,element_list,total_number_of_elements,number_of_nodes_per_element,err)
4376 REAL(DP),
ALLOCATABLE :: NODE_LIST(:,:)
4377 REAL(DP),
ALLOCATABLE :: SPEED_FUNCTION_TABLE(:,:)
4378 REAL(DP),
ALLOCATABLE :: CONDUCTIVITY_TENSOR(:,:)
4379 INTEGER(INTG),
ALLOCATABLE :: CONNECTIVITY_LIST(:,:)
4380 INTEGER(INTG),
ALLOCATABLE :: ELEMENT_LIST(:,:)
4381 REAL(DP),
ALLOCATABLE :: SEED_VALUE(:)
4382 INTEGER(INTG),
ALLOCATABLE :: CONNECTIVITY_NUMBER(:)
4384 INTEGER(INTG),
INTENT(IN) :: TOTAL_NUMBER_OF_ELEMENTS
4385 INTEGER(INTG),
INTENT(IN) :: NUMBER_OF_NODES_PER_ELEMENT
4386 INTEGER(INTG),
INTENT(IN) :: TOTAL_NUMBER_OF_NODES
4387 CHARACTER (LEN=300) :: OUTPUT_FILE_NAME
4388 CHARACTER (LEN=300) :: OUTPUT_FILE_FIELD_TITLE
4389 CHARACTER (LEN=10) :: OUTPUT_FILE_FORMAT
4390 CHARACTER (LEN=12) :: MATERIAL_BEHAVIOUR
4391 INTEGER(INTG) :: Err
4394 CHARACTER (LEN=300) :: STRING
4395 INTEGER(INTG) :: TEXT_LENGTH
4396 INTEGER(INTG) :: I, J
4406 IF (output_file_format .EQ.
"TABC")
THEN 4409 text_length =
index(output_file_name,
' ') - 1
4410 string = output_file_name(1:text_length)//
".tabc" 4413 OPEN (12,file=string)
4416 WRITE(12,*)
"VARIABLES=""NODE"",""X"",""Y"",""Z"",""U"",""V"",""W"",""Speed function along fibers"", & 4417 & ""Speed function in transverse direction"",""Time""" 4418 WRITE(12,*)
"zone i=",total_number_of_nodes,
" , DATAPACKING=POINT" 4420 DO i=1,total_number_of_nodes
4421 WRITE(12,*) i,node_list(i,1),node_list(i,2),node_list(i,3),conductivity_tensor(i,1),conductivity_tensor(i,2),&
4422 &conductivity_tensor(i,3),speed_function_table(i,1),&
4423 &speed_function_table(i,2),speed_function_table(i,3),&
4427 WRITE(12,*)
"Connectivity" 4428 DO i=1,total_number_of_nodes
4429 WRITE(12,*) i,connectivity_number(i),(connectivity_list(i,j),j=1,connectivity_number(i))
4437 IF (output_file_format .EQ.
"VTKTET")
THEN 4440 text_length =
index(output_file_name,
' ') - 1
4441 string = output_file_name(1:text_length)//
".vtk" 4442 OPEN (12,file=string)
4445 WRITE(12,
'(A)')
"# vtk DataFile Version 3.0" 4446 WRITE(12,
'(A)')
"vtk output" 4447 WRITE(12,
'(A)')
"ASCII" 4448 WRITE(12,
'(A)')
"DATASET UNSTRUCTURED_GRID" 4449 WRITE(12,
'(A,I8,A6)')
"POINTS",total_number_of_nodes,
"float" 4452 DO i=1,total_number_of_nodes
4453 WRITE(12,*) (node_list(i,j),j=1,3)
4457 WRITE(12,
'(A,I8,I8)')
"CELLS",total_number_of_elements,total_number_of_elements*(number_of_nodes_per_element+1)
4458 DO i=1,total_number_of_elements
4459 WRITE(12,*) number_of_nodes_per_element,((element_list(i,j)-1),j=1,number_of_nodes_per_element)
4463 WRITE(12,
'(A,I8)')
"CELL_TYPES",total_number_of_elements
4464 DO i=1,total_number_of_elements
4465 WRITE(12,
'(A)')
"10" 4469 WRITE(12,
'(A,I8)')
"CELL_DATA",total_number_of_elements
4470 WRITE(12,
'(A,I8)')
"POINT_DATA",total_number_of_nodes
4473 WRITE(12,
'(A,A)')
"FIELD number",
" 1" 4474 WRITE(12,
'(A,I3,I8,A6)')output_file_field_title,1,total_number_of_nodes,
"float" 4475 DO i=1,total_number_of_nodes
4476 WRITE(12,
'(F15.10)') seed_value(i)
4480 WRITE(12,
'(A,A,A6)')
"VECTORS ",
"fiber_vector",
"float" 4481 DO i=1,total_number_of_nodes
4482 WRITE(12,
'(3F8.5)') (conductivity_tensor(i,j),j=1,3)
4506 END SUBROUTINE post_process_data
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 equations_set_hj_equation_three_dim_1
u=x**2-2*y**2+z**2
Contains information on the equations mapping i.e., how field variable DOFS are mapped to the rows an...
Contains information about the equations in an equations set.
integer(intg), parameter equations_set_gfem_solution_method
Grid-based Finite Element Method solution method.
integer(intg), parameter global_deriv_s1_s2_s3
Cross derivative in the s1, s2 and s3 direction i.e., d^3u/ds1ds2ds3.
integer(intg), parameter equations_set_generalised_hj_subtype
integer(intg), parameter problem_setup_control_type
Solver setup for a problem.
This module handles all problem wide constants.
integer(intg), parameter, public control_loop_node
The identifier for a each "leaf" node in a control loop.
Returns the transpose of a matrix A in A^T.
integer(intg), parameter no_global_deriv
No global derivative i.e., u.
Converts a number to its equivalent varying string representation.
subroutine, public equations_create_start(EQUATIONS_SET, EQUATIONS, ERR, ERROR,)
Start the creation of equations for the equation set.
Contains information on the mesh decomposition.
subroutine, public equations_matrices_create_start(EQUATIONS, EQUATIONS_MATRICES, ERR, ERROR,)
Starts the creation of the equations matrices and rhs for the the equations.
Contains information on the type of solver to be used.
integer(intg), parameter, public solver_petsc_library
PETSc solver library.
subroutine, public solvers_number_set(SOLVERS, NUMBER_OF_SOLVERS, ERR, ERROR,)
Sets/changes the number of solvers.
This module handles all Hamilton-Jacobi equations routines.
This module handles all equations matrix and rhs routines.
subroutine, public solver_type_set(SOLVER, SOLVE_TYPE, ERR, ERROR,)
Sets/changes the type for a solver.
integer(intg), parameter equations_static
The equations are static and have no time dependence.
Contains information on an equations set.
This module handles all equations routines.
integer(intg), parameter equations_set_setup_source_type
Source setup.
This module contains all string manipulation and transformation routines.
subroutine, public solvers_create_start(CONTROL_LOOP, SOLVERS, ERR, ERROR,)
Start the creation of a solvers for the control loop.
Contains information on the solvers to be used in a control loop.
integer(intg), parameter first_part_deriv
First partial derivative i.e., du/ds.
integer(intg), parameter equations_set_hj_equation_three_dim_2
u=cos(x)*cosh(y)*z
This module contains routines for timing the program.
integer(intg), parameter solver_equations_static
Solver equations are static.
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 contains all mathematics support routines.
subroutine, public solvers_solver_get(SOLVERS, SOLVER_INDEX, SOLVER, ERR, ERROR,)
Returns a pointer to the specified solver in the list of solvers.
integer(intg), parameter problem_hj_equation_type
Contains information for a field defined on a region.
integer(intg), parameter, public equations_matrices_full_matrices
Use fully populated equation matrices.
subroutine, public equations_mapping_rhs_variable_type_set(EQUATIONS_MAPPING, RHS_VARIABLE_TYPE, ERR, ERROR,)
Sets the mapping between a dependent field variable and the equations set rhs vector.
integer(intg), parameter solver_equations_linear
Solver equations are linear.
integer(intg), parameter global_deriv_s2
First global derivative in the s2 direction i.e., du/ds2.
Contains information on a control loop.
This module provides an iso_varying_string module, conformant to the API specified in ISO/IEC 1539-2:...
subroutine, public solver_equations_create_finish(SOLVER_EQUATIONS, ERR, ERROR,)
Finishes the process of creating solver equations.
integer(intg), parameter, public solver_sparse_matrices
Use sparse solver matrices.
integer(intg), parameter global_deriv_s2_s3
Global Cross derivative in the s2 and s3 direction i.e., d^2u/ds2ds3.
subroutine, public solver_equations_create_start(SOLVER, SOLVER_EQUATIONS, ERR, ERROR,)
Starts the process of creating solver equations.
integer(intg), parameter equations_set_hj_equation_two_dim_1
u=x**2+y**2
integer(intg), parameter, public basis_default_quadrature_scheme
Identifier for the default quadrature scheme.
integer(intg), parameter problem_setup_solvers_type
Solver setup for a problem.
integer(intg), parameter equations_set_setup_equations_type
Equations setup.
integer(intg), parameter equations_set_standard_hj_subtype
This module contains all program wide constants.
subroutine, public solver_library_type_set(SOLVER, SOLVER_LIBRARY_TYPE, ERR, ERROR,)
Sets/changes the type of library type to use for the solver.
Calculates the vector cross product of two vectors.
subroutine, public equationsmapping_linearmatricesnumberset(EQUATIONS_MAPPING, NUMBER_OF_LINEAR_EQUATIONS_MATRICES, ERR, ERROR,)
Sets/changes the number of linear equations matrices.
integer(intg), parameter problem_setup_initial_type
Initial setup for a problem.
integer(intg), parameter equations_set_constant_source_poisson_subtype
subroutine, public equationsmapping_linearmatricesvariabletypesset(EQUATIONS_MAPPING, LINEAR_MATRIX_VARIABLE_TYPES, ERR, ERROR,)
Sets the mapping between the dependent field variable types and the linear equations matrices...
subroutine, public solver_equations_linearity_type_set(SOLVER_EQUATIONS, LINEARITY_TYPE, ERR, ERROR,)
Sets/changes the linearity type for solver equations.
integer(intg), parameter equations_set_setup_start_action
Start setup action.
integer(intg), parameter problem_classical_field_class
subroutine, public exits(NAME)
Records the exit out of the named procedure.
recursive subroutine, public control_loop_solvers_get(CONTROL_LOOP, SOLVERS, ERR, ERROR,)
Returns a pointer to the solvers for a control loop.
This module contains all type definitions in order to avoid cyclic module references.
Contains information on the equations matrices and vectors.
integer(intg), parameter, public equations_matrix_fem_structure
Finite element matrix structure.
This module contains all the low-level base routines e.g., all debug, control, and low-level communic...
Contains information of the linear matrices for equations matrices.
subroutine, public equations_matrices_linear_storage_type_set(EQUATIONS_MATRICES, STORAGE_TYPE, ERR, ERROR,)
Sets the storage type (sparsity) of the linear equations matrices.
subroutine, public equationsmatrices_linearstructuretypeset(EQUATIONS_MATRICES, STRUCTURE_TYPE, ERR, ERROR,)
Sets the structure (sparsity) of the linear equations matrices.
subroutine, public equations_mapping_create_finish(EQUATIONS_MAPPING, ERR, ERROR,)
Finishes the process of creating an equations mapping.
Returns the specified control loop as indexed by the control loop identifier from the control loop ro...
subroutine, public equations_set_equations_get(EQUATIONS_SET, EQUATIONS, ERR, ERROR,)
Gets the equations for an equations set.
integer(intg), dimension(4) partial_derivative_first_derivative_map
PARTIAL_DERIVATIVE_FIRST_DERIVATIVE_MAP(nic) gives the partial derivative index for the first derivat...
subroutine, public equations_create_finish(EQUATIONS, ERR, ERROR,)
Finish the creation of equations.
This module handles all domain mappings routines.
integer(intg), parameter problem_setup_finish_action
Finish setup action.
Calculates and returns the matrix-vector-product A*b in the vector c.
This module handles all equations mapping routines.
Contains information about the solver equations for a solver.
integer(intg), parameter, public matrix_compressed_row_storage_type
Matrix compressed row storage type.
integer(intg), parameter equations_set_gfv_solution_method
Grid-based Finite Volume solution method.
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_classical_field_class
integer(intg), parameter equations_set_hj_equation_type
integer(intg), parameter equations_linear
The equations are linear.
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.
This module handles all distributed matrix vector routines.
integer(intg), parameter global_deriv_s1
First global derivative in the s1 direction i.e., du/ds1.
This module handles all boundary conditions routines.
This module handles all solver routines.
subroutine, public equations_mapping_create_start(EQUATIONS, EQUATIONS_MAPPING, ERR, ERROR,)
Finishes the process of creating an equations mapping for a equations set equations.
Contains information about an equations matrix.
Contains information for a particular quadrature scheme.
This module contains all routines dealing with (non-distributed) matrix and vectors types...
integer(intg), parameter problem_generalised_hj_subtype
subroutine, public equations_linearity_type_set(EQUATIONS, LINEARITY_TYPE, ERR, ERROR,)
Sets/changes the linearity type for equations.
subroutine, public control_loop_create_start(PROBLEM, CONTROL_LOOP, ERR, ERROR,)
Start the process of creating a control loop for a problem.
integer(intg), parameter problem_setup_solver_equations_type
Solver equations setup for a problem.
Sets a boundary condition on the specified local DOF.
Contains information for a field variable defined on a field.
integer(intg), parameter equations_set_fd_solution_method
Finite Difference solution method.
integer(intg), parameter, public equations_matrices_sparse_matrices
Use sparse equations matrices.
integer(intg), parameter global_deriv_s3
First global derivative in the s3 direction i.e., du/ds3.
Contains information on the setup information for an equations set.
A pointer to the domain decomposition for this domain.
integer(intg), parameter problem_setup_start_action
Start setup action.
subroutine, public solver_equations_time_dependence_type_set(SOLVER_EQUATIONS, TIME_DEPENDENCE_TYPE, ERR, ERROR,)
Sets/changes the time dependence type for solver equations.
This module handles all control loop routines.
Calculates and returns the matrix-product A*B in the matrix C.
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 problem_standard_hj_subtype
integer(intg), parameter equations_set_hj_equation_two_dim_2
u=sin(x)sin(y)
Contains all information about a basis .
integer(intg), parameter equations_set_fv_solution_method
Finite Volume solution method.
integer(intg), parameter, public matrix_block_storage_type
Matrix block storage type.
integer(intg), parameter equations_set_setup_initial_type
Initial setup.
recursive subroutine, public control_loop_create_finish(CONTROL_LOOP, ERR, ERROR,)
Finish the process of creating a control loop.
integer(intg), parameter global_deriv_s1_s3
Global Cross derivative in the s1 and s3 direction i.e., d^2u/ds1ds3.
integer(intg), parameter equations_set_setup_analytic_type
Analytic setup.
Flags an error condition.
integer(intg), parameter, public solver_linear_type
A linear solver.
Contains information of the RHS vector for equations matrices.
real(dp), parameter zero_tolerance
Contains information for mapping field variables to the linear matrices in the equations set of the m...
This module contains all kind definitions.
integer(intg), parameter equations_set_setup_finish_action
Finish setup action.