182 INTEGER(INTG),
INTENT(OUT) :: ERR
185 INTEGER(INTG) :: MPI_IERROR,SEND_COUNT,STORAGE_TYPE, NUMBER_OF_NON_ZEROS, NUMBER_OF_ROWS,COUNT
186 INTEGER(INTG) :: variable_idx,dof_idx, equ_matrix_idx, dirichlet_idx, row_idx, DUMMY, LAST, DIRICHLET_DOF
187 INTEGER(INTG) :: col_idx,equations_set_idx,parameterSetIdx
188 INTEGER(INTG) :: pressureIdx,neumannIdx
189 INTEGER(INTG),
POINTER :: ROW_INDICES(:), COLUMN_INDICES(:)
204 TYPE(
list_type),
POINTER :: SPARSE_INDICES
206 INTEGER(INTG),
ALLOCATABLE:: COLUMN_ARRAY(:)
208 enters(
"BOUNDARY_CONDITIONS_CREATE_FINISH",err,error,*999)
210 NULLIFY(boundary_conditions_pressure_incremented)
212 IF(
ASSOCIATED(boundary_conditions))
THEN 213 IF(boundary_conditions%BOUNDARY_CONDITIONS_FINISHED)
THEN 214 CALL flagerror(
"Boundary conditions have already been finished.",err,error,*999)
216 IF(
ALLOCATED(boundary_conditions%BOUNDARY_CONDITIONS_VARIABLES))
THEN 220 DO variable_idx=1,boundary_conditions%NUMBER_OF_BOUNDARY_CONDITIONS_VARIABLES
221 boundary_condition_variable=>boundary_conditions%BOUNDARY_CONDITIONS_VARIABLES(variable_idx)%PTR
222 IF(
ASSOCIATED(boundary_condition_variable))
THEN 223 field_variable=>boundary_condition_variable%VARIABLE
224 IF(
ASSOCIATED(field_variable))
THEN 225 variable_domain_mapping=>field_variable%DOMAIN_MAPPING
226 IF(
ASSOCIATED(variable_domain_mapping))
THEN 227 send_count=variable_domain_mapping%NUMBER_OF_GLOBAL
231 CALL mpi_allreduce(mpi_in_place,boundary_condition_variable%DOF_TYPES, &
235 CALL mpi_allreduce(mpi_in_place,boundary_condition_variable%CONDITION_TYPES, &
241 local_error=
"Field variable domain mapping is not associated for variable type "// &
243 CALL flagerror(local_error,err,error,*999)
249 CALL mpi_allreduce(mpi_in_place,boundary_condition_variable%DOF_COUNTS, &
252 CALL mpi_allreduce(mpi_in_place,boundary_condition_variable%NUMBER_OF_DIRICHLET_CONDITIONS, &
261 CALL mpi_allreduce(mpi_in_place,boundary_condition_variable%parameterSetRequired, &
264 DO parametersetidx=1,field_number_of_set_types
265 IF(boundary_condition_variable%parameterSetRequired(parametersetidx))
THEN 266 CALL field_parametersetensurecreated(field_variable%FIELD,field_variable%VARIABLE_TYPE, &
267 & parametersetidx,err,error,*999)
268 CALL field_parameter_set_update_start(field_variable%FIELD,field_variable%VARIABLE_TYPE, &
269 & parametersetidx,err,error,*999)
276 boundary_conditions_pressure_incremented=>boundary_condition_variable%PRESSURE_INCREMENTED_BOUNDARY_CONDITIONS
288 DO dof_idx=1,field_variable%NUMBER_OF_GLOBAL_DOFS
290 boundary_conditions_pressure_incremented%PRESSURE_INCREMENTED_DOF_INDICES(pressureidx)=dof_idx
291 pressureidx=pressureidx+1
294 boundary_condition_variable%neumannBoundaryConditions%setDofs(neumannidx)=dof_idx
295 neumannidx=neumannidx+1
306 IF(boundary_condition_variable%NUMBER_OF_DIRICHLET_CONDITIONS>0)
THEN 308 boundary_conditions_dirichlet=>boundary_condition_variable%DIRICHLET_BOUNDARY_CONDITIONS
309 IF(
ASSOCIATED(boundary_conditions_dirichlet))
THEN 312 DO dof_idx=1,field_variable%NUMBER_OF_GLOBAL_DOFS
314 boundary_conditions_dirichlet%DIRICHLET_DOF_INDICES(dirichlet_idx)=dof_idx
315 dirichlet_idx=dirichlet_idx+1
320 solver_equations=>boundary_conditions%SOLVER_EQUATIONS
321 IF(
ASSOCIATED(solver_equations))
THEN 322 IF(
ASSOCIATED(solver_equations%SOLVER_MAPPING))
THEN 323 DO equations_set_idx=1,solver_equations%SOLVER_MAPPING%NUMBER_OF_EQUATIONS_SETS
324 equations_set=>solver_equations%SOLVER_MAPPING%EQUATIONS_SETS(equations_set_idx)%PTR
325 IF(
ASSOCIATED(equations_set))
THEN 326 equations=>equations_set%EQUATIONS
327 IF(
ASSOCIATED(equations))
THEN 328 equations_matrices=>equations%EQUATIONS_MATRICES
329 IF(
ASSOCIATED(equations_matrices))
THEN 330 linear_matrices=>equations_matrices%LINEAR_MATRICES
331 IF(
ASSOCIATED(linear_matrices))
THEN 333 DO equ_matrix_idx=1,linear_matrices%NUMBER_OF_LINEAR_MATRICES
334 equation_matrix=>linear_matrices%MATRICES(equ_matrix_idx)%PTR
335 CALL distributed_matrix_storage_type_get(equation_matrix%MATRIX,storage_type,err,error,*999)
336 IF(
ASSOCIATED(equation_matrix))
THEN 337 SELECT CASE(storage_type)
338 CASE(distributed_matrix_block_storage_type)
340 CASE(distributed_matrix_diagonal_storage_type)
342 CASE(distributed_matrix_column_major_storage_type)
343 CALL flagerror(
"Not implemented for column major storage.",err,error,*999)
344 CASE(distributed_matrix_row_major_storage_type)
345 CALL flagerror(
"Not implemented for row major storage.",err,error,*999)
346 CASE(distributed_matrix_compressed_row_storage_type)
348 CALL distributed_matrix_storage_locations_get(equation_matrix%MATRIX,row_indices, &
349 & column_indices,err,error,*999)
350 CALL distributed_matrix_number_non_zeros_get(equation_matrix%MATRIX,number_of_non_zeros, &
353 CALL distributed_matrix_linklist_get(equation_matrix%MATRIX,list,err,error,*999)
354 number_of_rows=equations_matrices%TOTAL_NUMBER_OF_ROWS
357 & linear_sparsity_indices(equations_set_idx,equ_matrix_idx)%PTR, &
358 & boundary_condition_variable%NUMBER_OF_DIRICHLET_CONDITIONS,err,error,*999)
360 NULLIFY(sparsity_indices)
361 sparsity_indices=>boundary_conditions_dirichlet%LINEAR_SPARSITY_INDICES( &
362 & equations_set_idx,equ_matrix_idx)%PTR
363 IF(
ASSOCIATED(sparsity_indices))
THEN 365 NULLIFY(sparse_indices)
366 CALL list_create_start(sparse_indices,err,error,*999)
367 CALL list_data_type_set(sparse_indices,list_intg_type,err,error,*999)
368 CALL list_initial_size_set(sparse_indices, &
369 & boundary_condition_variable%NUMBER_OF_DIRICHLET_CONDITIONS*( &
370 & number_of_non_zeros/number_of_rows),err,error,*999)
371 CALL list_create_finish(sparse_indices,err,error,*999)
373 sparsity_indices%SPARSE_COLUMN_INDICES(1)=1
375 DO dirichlet_idx=1,boundary_condition_variable%NUMBER_OF_DIRICHLET_CONDITIONS
376 dirichlet_dof=boundary_conditions_dirichlet%DIRICHLET_DOF_INDICES(dirichlet_idx)
377 CALL linkedlist_to_array(list(dirichlet_dof),column_array,err,error,*999)
378 DO row_idx=1,
size(column_array)
379 CALL list_item_add(sparse_indices,column_array(row_idx),err,error,*999)
383 sparsity_indices%SPARSE_COLUMN_INDICES(dirichlet_idx+1)=count+1
385 CALL list_detach_and_destroy(sparse_indices,dummy,sparsity_indices%SPARSE_ROW_INDICES, &
387 DO col_idx =1,number_of_rows
388 CALL linkedlist_destroy(list(col_idx),err,error,*999)
391 local_error=
"Sparsity indices arrays are not associated for this equations matrix." 392 CALL flagerror(local_error,err,error,*999)
394 CASE(distributed_matrix_compressed_column_storage_type)
395 CALL flagerror(
"Not implemented for compressed column storage.",err,error,*999)
396 CASE(distributed_matrix_row_column_storage_type)
397 CALL flagerror(
"Not implemented for row column storage.",err,error,*999)
399 local_error=
"The storage type of "//trim(number_to_vstring(storage_type,
"*",err,error)) &
401 CALL flagerror(local_error,err,error,*999)
404 CALL flagerror(
"The equation matrix is not associated.",err,error,*999)
409 dynamic_matrices=>equations_matrices%DYNAMIC_MATRICES
410 IF(
ASSOCIATED(dynamic_matrices))
THEN 412 DO equ_matrix_idx=1,dynamic_matrices%NUMBER_OF_DYNAMIC_MATRICES
413 equation_matrix=>dynamic_matrices%MATRICES(equ_matrix_idx)%PTR
414 CALL distributed_matrix_storage_type_get(equation_matrix%MATRIX,storage_type,err,error,*999)
415 IF(
ASSOCIATED(equation_matrix))
THEN 416 SELECT CASE(storage_type)
417 CASE(distributed_matrix_block_storage_type)
419 CASE(distributed_matrix_diagonal_storage_type)
421 CASE(distributed_matrix_column_major_storage_type)
422 CALL flagerror(
"Not implemented for column major storage.",err,error,*999)
423 CASE(distributed_matrix_row_major_storage_type)
424 CALL flagerror(
"Not implemented for row major storage.",err,error,*999)
425 CASE(distributed_matrix_compressed_row_storage_type)
427 CALL distributed_matrix_storage_locations_get(equation_matrix%MATRIX,row_indices, &
428 & column_indices,err,error,*999)
429 CALL distributed_matrix_number_non_zeros_get(equation_matrix%MATRIX,number_of_non_zeros, &
432 CALL distributed_matrix_linklist_get(equation_matrix%MATRIX,list,err,error,*999)
433 number_of_rows=equations_matrices%TOTAL_NUMBER_OF_ROWS
436 & dynamic_sparsity_indices(equations_set_idx,equ_matrix_idx)%PTR, &
437 & boundary_condition_variable%NUMBER_OF_DIRICHLET_CONDITIONS,err,error,*999)
439 NULLIFY(sparsity_indices)
440 sparsity_indices=>boundary_conditions_dirichlet%DYNAMIC_SPARSITY_INDICES( &
441 & equations_set_idx,equ_matrix_idx)%PTR
442 IF(
ASSOCIATED(sparsity_indices))
THEN 444 NULLIFY(sparse_indices)
445 CALL list_create_start(sparse_indices,err,error,*999)
446 CALL list_data_type_set(sparse_indices,list_intg_type,err,error,*999)
447 CALL list_initial_size_set(sparse_indices, &
448 & boundary_condition_variable%NUMBER_OF_DIRICHLET_CONDITIONS*( &
449 & number_of_non_zeros/number_of_rows),err,error,*999)
450 CALL list_create_finish(sparse_indices,err,error,*999)
452 sparsity_indices%SPARSE_COLUMN_INDICES(1)=1
454 DO dirichlet_idx=1,boundary_condition_variable%NUMBER_OF_DIRICHLET_CONDITIONS
456 dirichlet_dof=boundary_conditions_dirichlet%DIRICHLET_DOF_INDICES(dirichlet_idx)
457 CALL linkedlist_to_array(list(dirichlet_dof),column_array,err,error,*999)
459 DO row_idx=1,
size(column_array)
460 CALL list_item_add(sparse_indices,column_array(row_idx),err,error,*999)
464 sparsity_indices%SPARSE_COLUMN_INDICES(dirichlet_idx+1)=count+1
466 CALL list_detach_and_destroy(sparse_indices,dummy,sparsity_indices%SPARSE_ROW_INDICES, &
468 DO col_idx =1,number_of_rows
469 CALL linkedlist_destroy(list(col_idx),err,error,*999)
472 local_error=
"Sparsity indices arrays are not associated for this equations matrix." 473 CALL flagerror(local_error,err,error,*999)
475 CASE(distributed_matrix_compressed_column_storage_type)
476 CALL flagerror(
"Not implemented for compressed column storage.",err,error,*999)
477 CASE(distributed_matrix_row_column_storage_type)
478 CALL flagerror(
"Not implemented for row column storage.",err,error,*999)
480 local_error=
"The storage type of "//trim(number_to_vstring(storage_type,
"*",err,error)) &
482 CALL flagerror(local_error,err,error,*999)
485 CALL flagerror(
"The equation matrix is not associated.",err,error,*999)
490 local_error=
"Equations Matrices is not associated for these Equations." 491 CALL flagerror(local_error,err,error,*999)
494 local_error=
"Equations is not associated for this Equations Set." 495 CALL flagerror(local_error,err,error,*999)
498 local_error=
"Equations Set is not associated for boundary conditions variable "// &
499 & trim(number_to_vstring(variable_idx,
"*",err,error))//
"." 500 CALL flagerror(local_error,err,error,*999)
601 local_error=
"Solver equations solver mapping is not associated." 602 CALL flagerror(local_error,err,error,*999)
605 local_error=
"Solver equations is not associated." 606 CALL flagerror(local_error,err,error,*999)
609 local_error=
"Dirichlet Boundary Conditions type is not associated for boundary condition variable type "// &
610 & trim(number_to_vstring(variable_idx,
"*",err,error))//
"." 611 CALL flagerror(local_error,err,error,*999)
615 DO parametersetidx=1,field_number_of_set_types
616 IF(boundary_condition_variable%parameterSetRequired(parametersetidx))
THEN 617 CALL field_parameter_set_update_finish(field_variable%FIELD,field_variable%VARIABLE_TYPE, &
618 & parametersetidx,err,error,*999)
625 local_error=
"Field variable is not associated for variable index "// &
626 & trim(number_to_vstring(variable_idx,
"*",err,error))//
"." 627 CALL flagerror(local_error,err,error,*999)
630 CALL flagerror(
"Boundary conditions variable is not associated for variable index "// &
631 & trim(number_to_vstring(variable_idx,
"*",err,error))//
".",err,error,*999)
637 boundary_conditions%BOUNDARY_CONDITIONS_FINISHED=.true.
639 CALL flagerror(
"Boundary conditions variables array is not allocated.",err,error,*999)
643 CALL flagerror(
"Boundary conditions is not associated.",err,error,*999)
645 IF(diagnostics1)
THEN 646 CALL write_string(diagnostic_output_type,
"Boundary conditions:",err,error,*999)
647 DO variable_idx=1,boundary_conditions%NUMBER_OF_BOUNDARY_CONDITIONS_VARIABLES
648 boundary_condition_variable=>boundary_conditions%BOUNDARY_CONDITIONS_VARIABLES(variable_idx)%PTR
649 CALL write_string_value(diagnostic_output_type,
" Variable type = ",boundary_condition_variable%VARIABLE_TYPE, &
651 IF(
ASSOCIATED(boundary_condition_variable))
THEN 652 field_variable=>boundary_condition_variable%VARIABLE
653 variable_domain_mapping=>field_variable%DOMAIN_MAPPING
654 CALL write_string_value(diagnostic_output_type,
" Number of global dofs = ",variable_domain_mapping% &
655 & number_of_global,err,error,*999)
656 CALL write_string_vector(diagnostic_output_type,1,1,variable_domain_mapping%NUMBER_OF_GLOBAL,8,8, &
657 & boundary_condition_variable%CONDITION_TYPES,
'(" Global BCs:",8(X,I8))',
'(15X,8(X,I8))', &
660 CALL flagerror(
"Boundary condition variable is not associated",err,error,*999)
665 exits(
"BOUNDARY_CONDITIONS_CREATE_FINISH")
667 999 errorsexits(
"BOUNDARY_CONDITIONS_CREATE_FINISH",err,error)
680 TYPE(solver_equations_type),
POINTER :: SOLVER_EQUATIONS
681 TYPE(boundary_conditions_type),
POINTER :: BOUNDARY_CONDITIONS
682 INTEGER(INTG),
INTENT(OUT) :: ERR
683 TYPE(varying_string),
INTENT(OUT) :: ERROR
685 TYPE(varying_string) :: LOCAL_ERROR
687 enters(
"BOUNDARY_CONDITIONS_CREATE_START",err,error,*999)
689 IF(
ASSOCIATED(solver_equations))
THEN 690 IF(
ASSOCIATED(solver_equations%BOUNDARY_CONDITIONS))
THEN 691 CALL flagerror(
"Boundary conditions are already associated for the solver equations.",err,error,*999)
693 IF(
ASSOCIATED(boundary_conditions))
THEN 694 CALL flagerror(
"Boundary conditions is already associated.",err,error,*999)
696 IF(
ASSOCIATED(solver_equations%SOLVER_MAPPING))
THEN 700 local_error=
"Solver equations solver mapping is not associated." 701 CALL flagerror(local_error,err,error,*999)
704 boundary_conditions=>solver_equations%BOUNDARY_CONDITIONS
708 CALL flagerror(
"Solver equations is not associated.",err,error,*999)
711 exits(
"BOUNDARY_CONDITIONS_CREATE_START")
713 999 errorsexits(
"BOUNDARY_CONDITIONS_CREATE_START",err,error)
726 TYPE(boundary_conditions_type),
POINTER :: BOUNDARY_CONDITIONS
727 INTEGER(INTG),
INTENT(OUT) :: ERR
728 TYPE(varying_string),
INTENT(OUT) :: ERROR
731 enters(
"BOUNDARY_CONDITIONS_DESTROY",err,error,*999)
733 IF(
ASSOCIATED(boundary_conditions))
THEN 736 CALL flagerror(
"Boundary conditions is not associated.",err,error,*999)
739 exits(
"BOUNDARY_CONDITIONS_DESTROY")
741 999 errorsexits(
"BOUNDARY_CONDITIONS_DESTROY",err,error)
754 TYPE(boundary_conditions_type),
POINTER :: BOUNDARY_CONDITIONS
755 INTEGER(INTG),
INTENT(OUT) :: ERR
756 TYPE(varying_string),
INTENT(OUT) :: ERROR
758 INTEGER(INTG) :: variable_idx
760 enters(
"BOUNDARY_CONDITIONS_FINALISE",err,error,*999)
762 IF(
ASSOCIATED(boundary_conditions))
THEN 763 IF(
ALLOCATED(boundary_conditions%BOUNDARY_CONDITIONS_VARIABLES))
THEN 764 DO variable_idx=1,boundary_conditions%NUMBER_OF_BOUNDARY_CONDITIONS_VARIABLES
765 IF(
ASSOCIATED(boundary_conditions%BOUNDARY_CONDITIONS_VARIABLES(variable_idx)%PTR))
THEN 769 CALL flagerror(
"Boundary conditions variable number "//trim(number_to_vstring(variable_idx,
"*",err,error))// &
770 &
" is not associated",err,error,*999)
773 NULLIFY(boundary_conditions%SOLVER_EQUATIONS%SOLVER%SOLVER_EQUATIONS)
776 DEALLOCATE(boundary_conditions%BOUNDARY_CONDITIONS_VARIABLES)
778 DEALLOCATE(boundary_conditions)
781 exits(
"BOUNDARY_CONDITIONS_FINALISE")
783 999 errorsexits(
"BOUNDARY_CONDITIONS_FINALISE",err,error)
795 TYPE(solver_equations_type),
POINTER :: SOLVER_EQUATIONS
796 INTEGER(INTG),
INTENT(OUT) :: ERR
797 TYPE(varying_string),
INTENT(OUT) :: ERROR
799 INTEGER(INTG) :: DUMMY_ERR,variable_idx,variable_type,equations_set_idx,interface_condition_idx
800 TYPE(equations_type),
POINTER :: EQUATIONS
801 TYPE(equations_set_type),
POINTER :: EQUATIONS_SET
802 TYPE(equations_mapping_type),
POINTER :: EQUATIONS_MAPPING
803 TYPE(equations_mapping_dynamic_type),
POINTER :: DYNAMIC_MAPPING
804 TYPE(equations_mapping_linear_type),
POINTER :: LINEAR_MAPPING
805 TYPE(equations_mapping_nonlinear_type),
POINTER :: NONLINEAR_MAPPING
806 TYPE(equations_mapping_rhs_type),
POINTER :: RHS_MAPPING
807 TYPE(interface_condition_type),
POINTER :: INTERFACE_CONDITION
808 TYPE(interface_equations_type),
POINTER :: INTERFACE_EQUATIONS
809 TYPE(interface_mapping_type),
POINTER :: INTERFACE_MAPPING
810 TYPE(interface_mapping_rhs_type),
POINTER :: INTERFACE_RHS_MAPPING
811 TYPE(varying_string) :: DUMMY_ERROR,LOCAL_ERROR
813 enters(
"BOUNDARY_CONDITIONS_INITIALISE",err,error,*998)
815 IF(
ASSOCIATED(solver_equations))
THEN 816 IF(
ASSOCIATED(solver_equations%BOUNDARY_CONDITIONS))
THEN 817 CALL flagerror(
"Boundary conditions is already associated for these solver equations.",err,error,*998)
819 IF(
ASSOCIATED(solver_equations%SOLVER_MAPPING))
THEN 820 ALLOCATE(solver_equations%BOUNDARY_CONDITIONS,stat=err)
821 IF(err/=0)
CALL flagerror(
"Could not allocate boundary conditions.",err,error,*999)
822 solver_equations%BOUNDARY_CONDITIONS%BOUNDARY_CONDITIONS_FINISHED=.false.
823 solver_equations%BOUNDARY_CONDITIONS%NUMBER_OF_BOUNDARY_CONDITIONS_VARIABLES=0
824 solver_equations%BOUNDARY_CONDITIONS%SOLVER_EQUATIONS=>solver_equations
826 DO equations_set_idx=1,solver_equations%SOLVER_MAPPING%NUMBER_OF_EQUATIONS_SETS
827 equations_set=>solver_equations%SOLVER_MAPPING%EQUATIONS_SETS(equations_set_idx)%PTR
828 IF(
ASSOCIATED(equations_set))
THEN 829 equations=>equations_set%EQUATIONS
830 IF(
ASSOCIATED(equations))
THEN 831 IF(equations%EQUATIONS_FINISHED)
THEN 832 equations_mapping=>equations%EQUATIONS_MAPPING
833 IF(
ASSOCIATED(equations_mapping))
THEN 834 IF(equations_mapping%EQUATIONS_MAPPING_FINISHED)
THEN 835 equations_set%BOUNDARY_CONDITIONS=>solver_equations%BOUNDARY_CONDITIONS
836 SELECT CASE(equations%TIME_DEPENDENCE)
837 CASE(equations_static,equations_quasistatic)
838 SELECT CASE(equations%LINEARITY)
839 CASE(equations_linear,equations_nonlinear_bcs)
840 linear_mapping=>equations_mapping%LINEAR_MAPPING
841 IF(
ASSOCIATED(linear_mapping))
THEN 842 DO variable_idx=1,linear_mapping%NUMBER_OF_LINEAR_MATRIX_VARIABLES
843 variable_type=linear_mapping%LINEAR_MATRIX_VARIABLE_TYPES(variable_idx)
844 IF(linear_mapping%VAR_TO_EQUATIONS_MATRICES_MAPS(variable_type)%NUMBER_OF_EQUATIONS_MATRICES>0)
THEN 846 & linear_mapping%VAR_TO_EQUATIONS_MATRICES_MAPS(variable_type)%VARIABLE,err,error,*999)
850 CALL flagerror(
"Equations mapping linear mapping is not associated.",err,error,*999)
852 rhs_mapping=>equations_mapping%RHS_MAPPING
853 IF(
ASSOCIATED(rhs_mapping))
THEN 855 & rhs_mapping%RHS_VARIABLE,err,error,*999)
857 CASE(equations_nonlinear)
858 nonlinear_mapping=>equations_mapping%NONLINEAR_MAPPING
859 IF(
ASSOCIATED(nonlinear_mapping))
THEN 860 DO variable_idx=1,nonlinear_mapping%NUMBER_OF_RESIDUAL_VARIABLES
862 & nonlinear_mapping%RESIDUAL_VARIABLES(variable_idx)%PTR,err,error,*999)
865 CALL flagerror(
"Equations mapping nonlinear mapping is not associated.",err,error,*999)
867 rhs_mapping=>equations_mapping%RHS_MAPPING
868 IF(
ASSOCIATED(rhs_mapping))
THEN 870 & rhs_mapping%RHS_VARIABLE,err,error,*999)
872 CALL flagerror(
"Equations mapping RHS mapping is not associated.",err,error,*999)
875 local_error=
"The equations linearity type of "//trim(number_to_vstring(equations%LINEARITY,
"*", &
876 & err,error))//
" is invalid." 877 CALL flagerror(local_error,err,error,*999)
879 CASE(equations_first_order_dynamic,equations_second_order_dynamic)
880 SELECT CASE(equations%LINEARITY)
881 CASE(equations_linear,equations_nonlinear_bcs)
882 dynamic_mapping=>equations_mapping%DYNAMIC_MAPPING
883 IF(
ASSOCIATED(dynamic_mapping))
THEN 885 & dynamic_mapping%DYNAMIC_VARIABLE,err,error,*999)
887 CALL flagerror(
"Equations mapping dynamic mapping is not associated.",err,error,*999)
889 rhs_mapping=>equations_mapping%RHS_MAPPING
890 IF(
ASSOCIATED(rhs_mapping))
THEN 892 & rhs_mapping%RHS_VARIABLE,err,error,*999)
894 CALL flagerror(
"Equations mapping RHS mapping is not associated.",err,error,*999)
896 CASE(equations_nonlinear)
897 dynamic_mapping=>equations_mapping%DYNAMIC_MAPPING
898 IF(
ASSOCIATED(dynamic_mapping))
THEN 900 & dynamic_mapping%DYNAMIC_VARIABLE,err,error,*999)
902 CALL flagerror(
"Equations mapping dynamic mapping is not associated.",err,error,*999)
904 rhs_mapping=>equations_mapping%RHS_MAPPING
905 IF(
ASSOCIATED(rhs_mapping))
THEN 907 & rhs_mapping%RHS_VARIABLE,err,error,*999)
909 CALL flagerror(
"Equations mapping RHS mapping is not associated.",err,error,*999)
912 local_error=
"The equations linearity type of "//trim(number_to_vstring(equations%LINEARITY,
"*", &
913 & err,error))//
" is invalid." 914 CALL flagerror(local_error,err,error,*999)
917 local_error=
"The equations time dependence type of "// &
918 & trim(number_to_vstring(equations%TIME_DEPENDENCE,
"*",err,error))//
" is invalid." 919 CALL flagerror(local_error,err,error,*999)
922 CALL flagerror(
"Equations mapping has not been finished.",err,error,*998)
925 CALL flagerror(
"Equations equations mapping is not associated.",err,error,*998)
928 CALL flagerror(
"Equations has not been finished.",err,error,*998)
931 CALL flagerror(
"Equations set equations is not associated.",err,error,*998)
934 CALL flagerror(
"Equations set is not associated.",err,error,*998)
937 DO interface_condition_idx=1,solver_equations%SOLVER_MAPPING%NUMBER_OF_INTERFACE_CONDITIONS
938 interface_condition=>solver_equations%SOLVER_MAPPING%INTERFACE_CONDITIONS(interface_condition_idx)%PTR
939 IF(
ASSOCIATED(interface_condition))
THEN 940 interface_equations=>interface_condition%INTERFACE_EQUATIONS
941 IF(
ASSOCIATED(interface_equations))
THEN 942 IF(interface_equations%INTERFACE_EQUATIONS_FINISHED)
THEN 943 interface_mapping=>interface_equations%INTERFACE_MAPPING
944 IF(
ASSOCIATED(interface_mapping))
THEN 945 IF(interface_mapping%INTERFACE_MAPPING_FINISHED)
THEN 946 interface_condition%BOUNDARY_CONDITIONS=>solver_equations%BOUNDARY_CONDITIONS
948 SELECT CASE(interface_equations%TIME_DEPENDENCE)
949 CASE(interface_condition_static,interface_condition_quasistatic)
950 SELECT CASE(interface_equations%LINEARITY)
951 CASE(interface_condition_linear)
952 interface_mapping=>interface_equations%INTERFACE_MAPPING
953 IF(
ASSOCIATED(interface_mapping))
THEN 954 variable_type=interface_mapping%LAGRANGE_VARIABLE_TYPE
955 IF(interface_mapping%NUMBER_OF_INTERFACE_MATRICES>0)
THEN 957 & interface_mapping%LAGRANGE_VARIABLE,err,error,*999)
960 CALL flagerror(
"Interface mapping mapping is not associated.",err,error,*999)
962 interface_rhs_mapping=>interface_mapping%RHS_MAPPING
963 IF(
ASSOCIATED(interface_rhs_mapping))
THEN 965 & interface_rhs_mapping%RHS_VARIABLE,err,error,*999)
968 local_error=
"The equations linearity type of "//trim(number_to_vstring(equations%LINEARITY,
"*", &
969 & err,error))//
" is invalid." 970 CALL flagerror(local_error,err,error,*999)
973 local_error=
"The equations time dependence type of "// &
974 & trim(number_to_vstring(equations%TIME_DEPENDENCE,
"*",err,error))//
" is invalid." 975 CALL flagerror(local_error,err,error,*999)
978 CALL flagerror(
"Interface mapping has not been finished.",err,error,*998)
981 CALL flagerror(
"Interface mapping is not associated.",err,error,*998)
984 CALL flagerror(
"Interface equations has not been finished.",err,error,*998)
987 CALL flagerror(
"Interface equations is not associated.",err,error,*998)
990 CALL flagerror(
"Interface condition not associated.",err,error,*998)
994 CALL flagerror(
"Solver equations solver mapping is not associated.",err,error,*998)
998 CALL flagerror(
"Solver equations is not associated",err,error,*998)
1001 exits(
"BOUNDARY_CONDITIONS_INITIALISE")
1004 998 errorsexits(
"BOUNDARY_CONDITIONS_INITIALISE",err,error)
1017 TYPE(boundary_conditions_type),
POINTER :: BOUNDARY_CONDITIONS
1018 TYPE(field_type),
POINTER :: FIELD
1019 INTEGER(INTG),
INTENT(IN) :: VARIABLE_TYPE
1020 INTEGER(INTG),
INTENT(IN) :: COMPONENT_NUMBER
1021 INTEGER(INTG),
INTENT(IN) :: CONDITION
1022 REAL(DP),
INTENT(IN) ::
VALUE 1023 INTEGER(INTG),
INTENT(OUT) :: ERR
1024 TYPE(varying_string),
INTENT(OUT) :: ERROR
1026 INTEGER(INTG) :: local_ny,global_ny
1027 TYPE(boundary_conditions_variable_type),
POINTER :: BOUNDARY_CONDITIONS_VARIABLE
1028 TYPE(field_variable_type),
POINTER :: DEPENDENT_FIELD_VARIABLE
1029 TYPE(varying_string) :: LOCAL_ERROR
1031 enters(
"BOUNDARY_CONDITIONS_ADD_CONSTANT",err,error,*999)
1033 NULLIFY(boundary_conditions_variable)
1034 NULLIFY(dependent_field_variable)
1037 IF(
ASSOCIATED(boundary_conditions))
THEN 1038 IF(boundary_conditions%BOUNDARY_CONDITIONS_FINISHED)
THEN 1039 CALL flagerror(
"Boundary conditions have been finished.",err,error,*999)
1041 IF(
ASSOCIATED(field))
THEN 1042 CALL field_component_dof_get_constant(field,variable_type,component_number,local_ny,global_ny, &
1044 CALL field_variable_get(field,variable_type,dependent_field_variable,err,error,*999)
1047 IF(
ASSOCIATED(boundary_conditions_variable))
THEN 1050 & local_ny,condition,
VALUE,err,error,*999)
1052 local_error=
"The boundary conditions for variable type "//trim(number_to_vstring(variable_type,
"*",err,error))// &
1053 &
" has not been created." 1054 CALL flagerror(local_error,err,error,*999)
1057 CALL flagerror(
"The dependent field is not associated.",err,error,*999)
1061 CALL flagerror(
"Boundary conditions is not associated.",err,error,*999)
1064 exits(
"BOUNDARY_CONDITION_ADD_CONSTANT")
1066 999 errorsexits(
"BOUNDARY_CONDITION_ADD_CONSTANT",err,error)
1078 TYPE(boundary_conditions_type),
POINTER :: BOUNDARY_CONDITIONS
1079 TYPE(field_type),
POINTER :: FIELD
1080 INTEGER(INTG),
INTENT(IN) :: VARIABLE_TYPE
1081 INTEGER(INTG),
INTENT(IN) :: COMPONENT_NUMBER
1082 INTEGER(INTG),
INTENT(IN) :: CONDITION
1083 REAL(DP),
INTENT(IN) ::
VALUE 1084 INTEGER(INTG),
INTENT(OUT) :: ERR
1085 TYPE(varying_string),
INTENT(OUT) :: ERROR
1087 INTEGER(INTG) :: local_ny,global_ny
1088 TYPE(boundary_conditions_variable_type),
POINTER :: BOUNDARY_CONDITIONS_VARIABLE
1089 TYPE(field_variable_type),
POINTER :: FIELD_VARIABLE
1090 TYPE(varying_string) :: LOCAL_ERROR
1092 enters(
"BOUNDARY_CONDITIONS_SET_CONSTANT",err,error,*999)
1095 IF(
ASSOCIATED(boundary_conditions))
THEN 1096 IF(boundary_conditions%BOUNDARY_CONDITIONS_FINISHED)
THEN 1097 CALL flagerror(
"Boundary conditions have been finished.",err,error,*999)
1099 IF(
ASSOCIATED(field))
THEN 1100 CALL field_component_dof_get_constant(field,variable_type,component_number,local_ny,global_ny, &
1102 CALL field_variable_get(field,variable_type,field_variable,err,error,*999)
1104 IF(
ASSOCIATED(boundary_conditions_variable))
THEN 1107 & local_ny,condition,
VALUE,err,error,*999)
1109 local_error=
"The boundary conditions for variable type "//trim(number_to_vstring(variable_type,
"*",err,error))// &
1110 &
" has not been created." 1111 CALL flagerror(local_error,err,error,*999)
1114 CALL flagerror(
"The dependent field is not associated.",err,error,*999)
1118 CALL flagerror(
"Boundary conditions is not associated.",err,error,*999)
1121 exits(
"BOUNDARY_CONDITION_SET_CONSTANT")
1123 999 errorsexits(
"BOUNDARY_CONDITION_SET_CONSTANT",err,error)
1135 TYPE(boundary_conditions_type),
POINTER :: BOUNDARY_CONDITIONS
1136 TYPE(field_type),
POINTER :: FIELD
1137 INTEGER(INTG),
INTENT(IN) :: VARIABLE_TYPE
1138 INTEGER(INTG),
INTENT(IN) :: DOF_INDEX
1139 INTEGER(INTG),
INTENT(IN) :: CONDITION
1140 REAL(DP),
INTENT(IN) ::
VALUE 1141 INTEGER(INTG),
INTENT(OUT) :: ERR
1142 TYPE(varying_string),
INTENT(OUT) :: ERROR
1145 enters(
"BOUNDARY_CONDITIONS_ADD_LOCAL_DOF1",err,error,*999)
1150 exits(
"BOUNDARY_CONDITIONS_ADD_LOCAL_DOF1")
1152 999 errorsexits(
"BOUNDARY_CONDITIONS_ADD_LOCAL_DOF1",err,error)
1164 TYPE(boundary_conditions_type),
POINTER :: BOUNDARY_CONDITIONS
1165 TYPE(field_type),
POINTER :: FIELD
1166 INTEGER(INTG),
INTENT(IN) :: VARIABLE_TYPE
1167 INTEGER(INTG),
INTENT(IN) :: DOF_INDICES(:)
1168 INTEGER(INTG),
INTENT(IN) :: CONDITIONS(:)
1169 REAL(DP),
INTENT(IN) :: VALUES(:)
1170 INTEGER(INTG),
INTENT(OUT) :: ERR
1171 TYPE(varying_string),
INTENT(OUT) :: ERROR
1173 INTEGER(INTG) :: i,global_ny,local_ny
1174 REAL(DP) :: INITIAL_VALUE
1175 TYPE(boundary_conditions_variable_type),
POINTER :: BOUNDARY_CONDITIONS_VARIABLE
1176 TYPE(domain_mapping_type),
POINTER :: DOMAIN_MAPPING
1177 TYPE(field_variable_type),
POINTER :: DEPENDENT_VARIABLE
1178 TYPE(varying_string) :: LOCAL_ERROR
1180 enters(
"BOUNDARY_CONDITIONS_ADD_LOCAL_DOFS",err,error,*999)
1181 NULLIFY(dependent_variable)
1183 IF(
ASSOCIATED(boundary_conditions))
THEN 1184 IF(boundary_conditions%BOUNDARY_CONDITIONS_FINISHED)
THEN 1185 CALL flagerror(
"Boundary conditions have been finished.",err,error,*999)
1187 IF(
ASSOCIATED(field))
THEN 1188 NULLIFY(dependent_variable)
1189 CALL field_variable_get(field,variable_type,dependent_variable,err,error,*999)
1190 IF(
ASSOCIATED(dependent_variable))
THEN 1191 domain_mapping=>dependent_variable%DOMAIN_MAPPING
1192 IF(
ASSOCIATED(domain_mapping))
THEN 1195 IF(
ASSOCIATED(boundary_conditions_variable))
THEN 1196 IF(
SIZE(dof_indices,1)==
SIZE(conditions,1))
THEN 1197 IF(
SIZE(dof_indices,1)==
SIZE(values,1))
THEN 1198 DO i=1,
SIZE(dof_indices,1)
1199 local_ny=dof_indices(i)
1200 IF(local_ny>=1.AND.local_ny<=domain_mapping%NUMBER_OF_LOCAL)
THEN 1201 global_ny=domain_mapping%LOCAL_TO_GLOBAL_MAP(local_ny)
1206 SELECT CASE(conditions(i))
1210 CALL field_parameter_set_add_local_dof(field,variable_type,field_values_set_type, &
1211 & local_ny,values(i),err,error,*999)
1213 CALL field_parameter_set_add_local_dof(field,variable_type,field_values_set_type, &
1214 & local_ny,values(i),err,error,*999)
1216 CALL field_parameter_set_add_local_dof(field,variable_type,field_values_set_type, &
1217 & local_ny,values(i),err,error,*999)
1219 CALL field_parameter_set_add_local_dof(field,variable_type,field_values_set_type, &
1220 & local_ny,values(i),err,error,*999)
1222 CALL field_parameter_set_add_local_dof(field,variable_type,field_values_set_type, &
1223 & local_ny,values(i),err,error,*999)
1225 CALL field_parameter_set_add_local_dof(field,variable_type,field_values_set_type, &
1226 & local_ny,values(i),err,error,*999)
1228 CALL field_parameter_set_add_local_dof(field,variable_type,field_values_set_type,local_ny,values(i), &
1230 CALL field_parameter_set_add_local_dof(field,variable_type,field_boundary_conditions_set_type, &
1231 & local_ny,values(i),err,error,*999)
1235 CALL field_parameter_set_get_local_dof(field,variable_type,field_values_set_type, &
1236 & local_ny,initial_value,err,error,*999)
1237 CALL field_parameter_set_update_local_dof(field,variable_type,field_boundary_conditions_set_type, &
1238 & local_ny,initial_value+values(i),err,error,*999)
1240 CALL field_parameter_set_add_local_dof(field,variable_type,field_pressure_values_set_type, &
1241 & local_ny,values(i),err,error,*999)
1245 CALL field_parameter_set_add_local_dof(field,variable_type,field_pressure_values_set_type, &
1246 & local_ny,values(i),err,error,*999)
1250 CALL field_parameter_set_add_local_dof(field,variable_type,field_impermeable_flag_values_set_type, &
1251 & local_ny,values(i),err,error,*999)
1255 CALL field_parameter_set_add_local_dof(field,variable_type,field_boundary_conditions_set_type, &
1256 & local_ny,values(i),err,error,*999)
1258 CALL field_parameter_set_add_local_dof(field,variable_type,field_boundary_conditions_set_type, &
1259 & local_ny,values(i),err,error,*999)
1263 CALL field_parameter_set_add_local_dof(field,variable_type,field_values_set_type, &
1264 & local_ny,values(i),err,error,*999)
1267 CALL field_parameter_set_add_local_dof(field,variable_type,field_values_set_type, &
1268 & local_ny,values(i),err,error,*999)
1270 local_error=
"The specified boundary condition type for dof index "// &
1271 & trim(number_to_vstring(i,
"*",err,error))//
" of "// &
1272 & trim(number_to_vstring(conditions(i),
"*",err,error))//
" is invalid." 1273 CALL flagerror(local_error,err,error,*999)
1276 local_error=
"The local dof of "//&
1277 & trim(number_to_vstring(local_ny,
"*",err,error))//
" at dof index "// &
1278 & trim(number_to_vstring(i,
"*",err,error))// &
1279 &
" is invalid. The dof should be between 1 and "// &
1280 & trim(number_to_vstring(domain_mapping%NUMBER_OF_LOCAL,
"*",err,error))//
"." 1281 CALL flagerror(local_error,err,error,*999)
1285 local_error=
"The size of the dof indices array ("// &
1286 & trim(number_to_vstring(
SIZE(dof_indices,1),
"*",err,error))// &
1287 &
") does not match the size of the values array ("// &
1288 & trim(number_to_vstring(
SIZE(values,1),
"*",err,error))//
")." 1289 CALL flagerror(local_error,err,error,*999)
1292 local_error=
"The size of the dof indices array ("// &
1293 & trim(number_to_vstring(
SIZE(dof_indices,1),
"*",err,error))// &
1294 &
") does not match the size of the fixed conditions array ("// &
1295 & trim(number_to_vstring(
SIZE(conditions,1),
"*",err,error))//
")." 1296 CALL flagerror(local_error,err,error,*999)
1299 CALL flagerror(
"Boundary conditions variable is not associated.",err,error,*999)
1302 CALL flagerror(
"The dependent field variable domain mapping is not associated.",err,error,*999)
1305 CALL flagerror(
"The dependent field variable is not associated.",err,error,*999)
1308 CALL flagerror(
"The dependent field is not associated..",err,error,*999)
1312 CALL flagerror(
"Boundary conditions is not associated.",err,error,*999)
1315 exits(
"BOUNDARY_CONDITIONS_ADD_LOCAL_DOFS")
1317 999 errorsexits(
"BOUNDARY_CONDITIONS_ADD_LOCAL_DOFS",err,error)
1329 TYPE(boundary_conditions_type),
POINTER :: BOUNDARY_CONDITIONS
1330 TYPE(field_type),
POINTER :: FIELD
1331 INTEGER(INTG),
INTENT(IN) :: VARIABLE_TYPE
1332 INTEGER(INTG),
INTENT(IN) :: DOF_INDEX
1333 INTEGER(INTG),
INTENT(IN) :: CONDITION
1334 REAL(DP),
INTENT(IN) ::
VALUE 1335 INTEGER(INTG),
INTENT(OUT) :: ERR
1336 TYPE(varying_string),
INTENT(OUT) :: ERROR
1339 enters(
"BOUNDARY_CONDITIONS_SET_LOCAL_DOF1",err,error,*999)
1343 exits(
"BOUNDARY_CONDITIONS_SET_LOCAL_DOF1")
1345 999 errorsexits(
"BOUNDARY_CONDITIONS_SET_LOCAL_DOF1",err,error)
1357 TYPE(boundary_conditions_type),
POINTER :: BOUNDARY_CONDITIONS
1358 TYPE(field_type),
POINTER :: FIELD
1359 INTEGER(INTG),
INTENT(IN) :: VARIABLE_TYPE
1360 INTEGER(INTG),
INTENT(IN) :: DOF_INDICES(:)
1361 INTEGER(INTG),
INTENT(IN) :: CONDITIONS(:)
1362 REAL(DP),
INTENT(IN) :: VALUES(:)
1363 INTEGER(INTG),
INTENT(OUT) :: ERR
1364 TYPE(varying_string),
INTENT(OUT) :: ERROR
1366 INTEGER(INTG) :: i,global_ny,local_ny
1367 TYPE(boundary_conditions_variable_type),
POINTER :: BOUNDARY_CONDITIONS_VARIABLE
1368 TYPE(domain_mapping_type),
POINTER :: DOMAIN_MAPPING
1369 TYPE(field_variable_type),
POINTER :: DEPENDENT_VARIABLE
1370 TYPE(varying_string) :: LOCAL_ERROR
1372 enters(
"BOUNDARY_CONDITIONS_SET_LOCAL_DOFS",err,error,*999)
1374 IF(
ASSOCIATED(boundary_conditions))
THEN 1375 IF(boundary_conditions%BOUNDARY_CONDITIONS_FINISHED)
THEN 1376 CALL flagerror(
"Boundary conditions have been finished.",err,error,*999)
1378 IF(
ASSOCIATED(field))
THEN 1379 NULLIFY(dependent_variable)
1380 CALL field_variable_get(field,variable_type,dependent_variable,err,error,*999)
1381 IF(
ASSOCIATED(dependent_variable))
THEN 1382 domain_mapping=>dependent_variable%DOMAIN_MAPPING
1383 IF(
ASSOCIATED(domain_mapping))
THEN 1386 IF(
ASSOCIATED(boundary_conditions_variable))
THEN 1387 IF(
SIZE(dof_indices,1)==
SIZE(conditions,1))
THEN 1388 IF(
SIZE(dof_indices,1)==
SIZE(values,1))
THEN 1389 DO i=1,
SIZE(dof_indices,1)
1390 local_ny=dof_indices(i)
1391 IF(local_ny>=1.AND.local_ny<=domain_mapping%NUMBER_OF_LOCAL)
THEN 1392 global_ny=domain_mapping%LOCAL_TO_GLOBAL_MAP(local_ny)
1398 SELECT CASE(conditions(i))
1402 CALL field_parameter_set_update_local_dof(field,variable_type,field_values_set_type, &
1403 & local_ny,values(i),err,error,*999)
1405 CALL field_parameter_set_update_local_dof(field,variable_type,field_values_set_type, &
1406 & local_ny,values(i),err,error,*999)
1408 CALL field_parameter_set_update_local_dof(field,variable_type,field_values_set_type, &
1409 & local_ny,values(i),err,error,*999)
1411 CALL field_parameter_set_update_local_dof(field,variable_type,field_values_set_type, &
1412 & local_ny,values(i),err,error,*999)
1414 CALL field_parameter_set_update_local_dof(field,variable_type,field_values_set_type, &
1415 & local_ny,values(i),err,error,*999)
1417 CALL field_parameter_set_update_local_dof(field,variable_type,field_values_set_type, &
1418 & local_ny,values(i),err,error,*999)
1420 CALL field_parameter_set_update_local_dof(field,variable_type,field_values_set_type,local_ny,values(i), &
1422 CALL field_parameter_set_update_local_dof(field,variable_type,field_boundary_conditions_set_type, &
1423 & local_ny,values(i),err,error,*999)
1425 CALL field_parameter_set_update_local_dof(field,variable_type,field_boundary_conditions_set_type, &
1426 & local_ny,values(i),err,error,*999)
1428 CALL field_parameter_set_update_local_dof(field,variable_type,field_pressure_values_set_type, &
1429 & local_ny,values(i),err,error,*999)
1431 CALL field_parameter_set_update_local_dof(field,variable_type,field_pressure_values_set_type, &
1432 & local_ny,values(i),err,error,*999)
1436 CALL field_parameter_set_update_local_dof(field,variable_type,field_boundary_conditions_set_type, &
1437 & local_ny,values(i),err,error,*999)
1439 CALL field_parameter_set_update_local_dof(field,variable_type,field_boundary_conditions_set_type, &
1440 & local_ny,values(i),err,error,*999)
1442 CALL field_parameter_set_update_local_dof(field,variable_type,field_values_set_type, &
1443 & local_ny,values(i),err,error,*999)
1445 CALL field_parameter_set_update_local_dof(field,variable_type,field_impermeable_flag_values_set_type, &
1446 & local_ny,values(i),err,error,*999)
1449 CALL field_parameter_set_update_local_dof(field,variable_type,field_values_set_type, &
1450 & local_ny,values(i),err,error,*999)
1452 local_error=
"The specified boundary condition type for dof index "// &
1453 & trim(number_to_vstring(i,
"*",err,error))//
" of "// &
1454 & trim(number_to_vstring(conditions(i),
"*",err,error))//
" is invalid." 1455 CALL flagerror(local_error,err,error,*999)
1458 local_error=
"The local dof of "//&
1459 & trim(number_to_vstring(local_ny,
"*",err,error))//
" at dof index "// &
1460 & trim(number_to_vstring(i,
"*",err,error))// &
1461 &
" is invalid. The dof should be between 1 and "// &
1462 & trim(number_to_vstring(domain_mapping%NUMBER_OF_LOCAL,
"*",err,error))//
"." 1463 CALL flagerror(local_error,err,error,*999)
1467 local_error=
"The size of the dof indices array ("// &
1468 & trim(number_to_vstring(
SIZE(dof_indices,1),
"*",err,error))// &
1469 &
") does not match the size of the values array ("// &
1470 & trim(number_to_vstring(
SIZE(values,1),
"*",err,error))//
")." 1471 CALL flagerror(local_error,err,error,*999)
1474 local_error=
"The size of the dof indices array ("// &
1475 & trim(number_to_vstring(
SIZE(dof_indices,1),
"*",err,error))// &
1476 &
") does not match the size of the fixed conditions array ("// &
1477 & trim(number_to_vstring(
SIZE(conditions,1),
"*",err,error))//
")." 1478 CALL flagerror(local_error,err,error,*999)
1481 CALL flagerror(
"Boundary conditions variable is not associated.",err,error,*999)
1484 CALL flagerror(
"The dependent field variable domain mapping is not associated.",err,error,*999)
1487 CALL flagerror(
"The dependent field variable is not associated.",err,error,*999)
1490 CALL flagerror(
"The dependent field is not associated.",err,error,*999)
1494 CALL flagerror(
"Boundary conditions is not associated.",err,error,*999)
1497 exits(
"BOUNDARY_CONDITIONS_SET_LOCAL_DOFS")
1499 999 errorsexits(
"BOUNDARY_CONDITIONS_SET_LOCAL_DOFS",err,error)
1512 TYPE(boundary_conditions_variable_type),
POINTER :: boundaryConditionsVariable
1513 INTEGER(INTG),
INTENT(IN) :: globalDof
1514 INTEGER(INTG),
INTENT(IN) :: condition
1515 INTEGER(INTG),
INTENT(OUT) :: err
1516 TYPE(varying_string),
INTENT(OUT) :: error
1518 INTEGER(INTG) :: dofType, previousCondition, previousDof
1520 enters(
"BoundaryConditions_SetConditionType",err,error,*999)
1526 SELECT CASE(condition)
1545 CALL field_parametersetensurecreated(boundaryconditionsvariable%VARIABLE%FIELD,boundaryconditionsvariable%VARIABLE_TYPE, &
1546 & field_boundary_conditions_set_type,err,error,*999)
1547 boundaryconditionsvariable%parameterSetRequired(field_boundary_conditions_set_type)=.true.
1550 CALL field_parametersetensurecreated(boundaryconditionsvariable%VARIABLE%FIELD,boundaryconditionsvariable%VARIABLE_TYPE, &
1551 & field_boundary_conditions_set_type,err,error,*999)
1552 boundaryconditionsvariable%parameterSetRequired(field_boundary_conditions_set_type)=.true.
1557 CALL field_parametersetensurecreated(boundaryconditionsvariable%VARIABLE%FIELD,boundaryconditionsvariable%VARIABLE_TYPE, &
1558 & field_pressure_values_set_type,err,error,*999)
1559 boundaryconditionsvariable%parameterSetRequired(field_pressure_values_set_type)=.true.
1562 CALL field_parametersetensurecreated(boundaryconditionsvariable%VARIABLE%FIELD,boundaryconditionsvariable%VARIABLE_TYPE, &
1563 & field_pressure_values_set_type,err,error,*999)
1564 boundaryconditionsvariable%parameterSetRequired(field_pressure_values_set_type)=.true.
1565 CALL field_parametersetensurecreated(boundaryconditionsvariable%VARIABLE%FIELD,boundaryconditionsvariable%VARIABLE_TYPE, &
1566 & field_previous_pressure_set_type,err,error,*999)
1567 boundaryconditionsvariable%parameterSetRequired(field_previous_pressure_set_type)=.true.
1572 CALL field_parametersetensurecreated(boundaryconditionsvariable%VARIABLE%FIELD,boundaryconditionsvariable%VARIABLE_TYPE, &
1573 & field_impermeable_flag_values_set_type,err,error,*999)
1574 boundaryconditionsvariable%parameterSetRequired(field_impermeable_flag_values_set_type)=.true.
1577 CALL field_parametersetensurecreated(boundaryconditionsvariable%VARIABLE%FIELD,boundaryconditionsvariable%VARIABLE_TYPE, &
1578 & field_boundary_conditions_set_type,err,error,*999)
1579 CALL field_parametersetensurecreated(boundaryconditionsvariable%VARIABLE%FIELD,boundaryconditionsvariable%VARIABLE_TYPE, &
1580 & field_integrated_neumann_set_type,err,error,*999)
1581 boundaryconditionsvariable%parameterSetRequired(field_boundary_conditions_set_type)=.true.
1582 boundaryconditionsvariable%parameterSetRequired(field_integrated_neumann_set_type)=.true.
1589 CALL flagerror(
"The specified boundary condition type for dof number "// &
1590 & trim(number_to_vstring(globaldof,
"*",err,error))//
" of "// &
1591 & trim(number_to_vstring(condition,
"*",err,error))//
" is invalid.", &
1597 previouscondition=boundaryconditionsvariable%CONDITION_TYPES(globaldof)
1598 IF(previouscondition/=condition)
THEN 1601 boundaryconditionsvariable%DOF_COUNTS(previouscondition)= &
1602 & boundaryconditionsvariable%DOF_COUNTS(previouscondition)-1
1605 boundaryconditionsvariable%DOF_COUNTS(condition)= &
1606 & boundaryconditionsvariable%DOF_COUNTS(condition)+1
1610 previousdof=boundaryconditionsvariable%DOF_TYPES(globaldof)
1612 boundaryconditionsvariable%NUMBER_OF_DIRICHLET_CONDITIONS= &
1613 & boundaryconditionsvariable%NUMBER_OF_DIRICHLET_CONDITIONS+1
1615 boundaryconditionsvariable%NUMBER_OF_DIRICHLET_CONDITIONS= &
1616 & boundaryconditionsvariable%NUMBER_OF_DIRICHLET_CONDITIONS-1
1620 boundaryconditionsvariable%CONDITION_TYPES(globaldof)=condition
1621 boundaryconditionsvariable%DOF_TYPES(globaldof)=doftype
1622 IF(diagnostics1)
THEN 1623 CALL write_string(diagnostic_output_type,
"Boundary Condition Being Set",err,error,*999)
1624 CALL write_string_value(diagnostic_output_type,
"global dof = ", globaldof,err,error,*999)
1625 CALL write_string_value(diagnostic_output_type,
"Variable Type = ", &
1626 & boundaryconditionsvariable%VARIABLE_TYPE,err,error,*999)
1627 CALL write_string_value(diagnostic_output_type,
"New Condition = ", &
1628 & condition,err,error,*999)
1629 CALL write_string_value(diagnostic_output_type,
"dof type = ", &
1630 & doftype,err,error,*999)
1632 exits(
"BoundaryConditions_SetConditionType")
1634 999 errorsexits(
"BoundaryConditions_SetConditionType",err,error)
1644 & condition,
VALUE,err,error,*)
1647 TYPE(boundary_conditions_type),
POINTER :: BOUNDARY_CONDITIONS
1648 TYPE(field_type),
POINTER :: FIELD
1649 INTEGER(INTG),
INTENT(IN) :: VARIABLE_TYPE
1650 INTEGER(INTG),
INTENT(IN) :: USER_ELEMENT_NUMBER
1651 INTEGER(INTG),
INTENT(IN) :: COMPONENT_NUMBER
1652 INTEGER(INTG),
INTENT(IN) :: CONDITION
1653 REAL(DP),
INTENT(IN) ::
VALUE 1654 INTEGER(INTG),
INTENT(OUT) :: ERR
1655 TYPE(varying_string),
INTENT(OUT) :: ERROR
1657 INTEGER(INTG) :: local_ny,global_ny
1658 TYPE(boundary_conditions_variable_type),
POINTER :: BOUNDARY_CONDITIONS_VARIABLE
1659 TYPE(field_variable_type),
POINTER :: FIELD_VARIABLE
1660 TYPE(varying_string) :: LOCAL_ERROR
1662 enters(
"BOUNDARY_CONDITIONS_ADD_ELEMENT",err,error,*999)
1665 IF(
ASSOCIATED(boundary_conditions))
THEN 1666 IF(boundary_conditions%BOUNDARY_CONDITIONS_FINISHED)
THEN 1667 CALL flagerror(
"Boundary conditions have been finished.",err,error,*999)
1669 IF(
ASSOCIATED(field))
THEN 1670 CALL field_component_dof_get_user_element(field,variable_type,user_element_number,component_number, &
1671 & local_ny,global_ny,err,error,*999)
1672 NULLIFY(field_variable)
1673 NULLIFY(boundary_conditions_variable)
1674 CALL field_variable_get(field,variable_type,field_variable,err,error,*999)
1675 IF(
ASSOCIATED(field_variable))
THEN 1677 IF(
ASSOCIATED(boundary_conditions_variable))
THEN 1680 & local_ny,condition,
VALUE,err,error,*999)
1682 local_error=
"The boundary conditions for variable type "//trim(number_to_vstring(variable_type,
"*",err,error))// &
1683 &
" has not been created." 1684 CALL flagerror(local_error,err,error,*999)
1687 CALL flagerror(
"The dependent field variable is not associated.",err,error,*999)
1690 CALL flagerror(
"The dependent field is not associated.",err,error,*999)
1694 CALL flagerror(
"Boundary conditions is not associated.",err,error,*999)
1697 exits(
"BOUNDARY_CONDITION_ADD_ELEMENT")
1699 999 errorsexits(
"BOUNDARY_CONDITION_ADD_ELEMENT",err,error)
1711 INTEGER(INTG),
INTENT(IN) :: condition
1712 TYPE(field_type),
POINTER :: field
1713 INTEGER(INTG),
INTENT(IN) :: variableType
1714 INTEGER(INTG),
INTENT(IN) :: componentNumber
1715 INTEGER(INTG),
INTENT(OUT) :: err
1716 TYPE(varying_string),
INTENT(OUT) :: error
1718 INTEGER(INTG) :: interpolationType
1719 LOGICAL :: validCondition
1721 enters(
"BoundaryConditions_CheckInterpolationType",err,error,*999)
1723 CALL field_component_interpolation_get(field,variabletype,componentnumber,interpolationtype,err,error,*999)
1725 validcondition=.true.
1726 SELECT CASE(condition)
1733 IF(interpolationtype/=field_node_based_interpolation)
THEN 1734 validcondition=.false.
1740 IF(interpolationtype/=field_node_based_interpolation)
THEN 1741 validcondition=.false.
1745 IF(interpolationtype/=field_node_based_interpolation)
THEN 1746 validcondition=.false.
1749 IF(interpolationtype/=field_node_based_interpolation)
THEN 1750 validcondition=.false.
1753 IF(interpolationtype/=field_node_based_interpolation)
THEN 1754 validcondition=.false.
1760 IF(interpolationtype/=field_node_based_interpolation)
THEN 1761 validcondition=.false.
1765 IF(interpolationtype/=field_node_based_interpolation)
THEN 1766 validcondition=.false.
1769 CALL flagerror(
"The specified boundary condition type of "// &
1770 & trim(number_to_vstring(condition,
"*",err,error))//
" is invalid.", &
1773 IF(.NOT.validcondition)
THEN 1774 CALL flagerror(
"The specified boundary condition type of "// &
1775 & trim(number_to_vstring(condition,
"*",err,error))//
" is not valid for the field component "// &
1776 &
"interpolation type of "//trim(number_to_vstring(interpolationtype,
"*",err,error))//
".", &
1780 exits(
"BoundaryConditions_CheckInterpolationType")
1782 999 errorsexits(
"BoundaryConditions_CheckInterpolationType",err,error)
1794 TYPE(boundary_conditions_variable_type),
POINTER :: boundaryConditionsVariable
1795 INTEGER(INTG),
INTENT(OUT) :: err
1796 type(varying_string),
intent(out) :: error
1798 INTEGER(INTG) :: boundaryConditionType,equationsSetIdx,specificationSize
1799 TYPE(solver_equations_type),
POINTER :: solverEquations
1800 TYPE(solver_mapping_type),
POINTER :: solverMapping
1801 TYPE(equations_set_type),
POINTER :: equationsSet
1802 LOGICAL :: validEquationsSetFound
1804 enters(
"BoundaryConditions_CheckEquations",err,error,*999)
1807 solverequations=>boundaryconditionsvariable%BOUNDARY_CONDITIONS%SOLVER_EQUATIONS
1808 IF(.NOT.
ASSOCIATED(solverequations))
THEN 1809 CALL flagerror(
"Boundary conditions solver equations are not associated.",err,error,*999)
1811 solvermapping=>solverequations%SOLVER_MAPPING
1812 IF(.NOT.
ASSOCIATED(solvermapping))
THEN 1813 CALL flagerror(
"Solver equations solver mapping is not associated.",err,error,*999)
1818 IF(boundaryconditionsvariable%DOF_COUNTS(boundaryconditiontype)>0)
THEN 1819 validequationssetfound=.false.
1820 DO equationssetidx=1,solvermapping%NUMBER_OF_EQUATIONS_SETS
1821 equationsset=>solvermapping%EQUATIONS_SETS(equationssetidx)%PTR
1822 IF(.NOT.
ASSOCIATED(equationsset))
THEN 1823 CALL flagerror(
"Solver equations equations set is not associated.",err,error,*999)
1825 IF(.NOT.
ALLOCATED(equationsset%specification))
THEN 1826 CALL flagerror(
"Equations set specification is not allocated.",err,error,*999)
1828 specificationsize=
SIZE(equationsset%specification,1)
1830 SELECT CASE(boundaryconditiontype)
1833 validequationssetfound=.true.
1835 validequationssetfound=.true.
1837 validequationssetfound=.true.
1840 IF(specificationsize>=2)
THEN 1841 IF(equationsset%specification(1)==equations_set_fluid_mechanics_class.AND. &
1842 & (equationsset%specification(2)==equations_set_stokes_equation_type.OR. &
1843 & equationsset%specification(2)==equations_set_characteristic_equation_type.OR. &
1844 & equationsset%specification(2)==equations_set_navier_stokes_equation_type))
THEN 1845 validequationssetfound=.true.
1850 IF(specificationsize>=2)
THEN 1851 IF(equationsset%specification(1)==equations_set_fluid_mechanics_class.AND. &
1852 & (equationsset%specification(2)==equations_set_stokes_equation_type.OR. &
1853 & equationsset%specification(2)==equations_set_navier_stokes_equation_type.OR. &
1854 & equationsset%specification(2)==equations_set_darcy_equation_type))
THEN 1855 validequationssetfound=.true.
1856 ELSE IF(specificationsize==3)
THEN 1857 IF(equationsset%specification(1)==equations_set_classical_field_class.AND. &
1858 & equationsset%specification(2)==equations_set_laplace_equation_type.AND. &
1859 & equationsset%specification(3)==equations_set_moving_mesh_laplace_subtype)
THEN 1860 validequationssetfound=.true.
1865 validequationssetfound=.true.
1868 IF(specificationsize>=2)
THEN 1869 IF(equationsset%specification(1)==equations_set_elasticity_class.AND. &
1870 & equationsset%specification(2)==equations_set_finite_elasticity_type)
THEN 1871 validequationssetfound=.true.
1872 ELSE IF(equationsset%specification(1)==equations_set_fluid_mechanics_class .AND. &
1873 & equationsset%specification(2)==equations_set_navier_stokes_equation_type)
THEN 1874 validequationssetfound=.true.
1879 validequationssetfound=.false.
1881 IF(specificationsize>=3)
THEN 1882 IF(equationsset%specification(1)==equations_set_elasticity_class.AND. &
1883 & equationsset%specification(2)==equations_set_finite_elasticity_type.AND. &
1884 & (equationsset%specification(3)==equations_set_incompressible_finite_elasticity_darcy_subtype.OR. &
1885 & equationsset%specification(3)==equations_set_elasticity_darcy_inria_model_subtype.OR. &
1886 & equationsset%specification(3)==equations_set_incompressible_elasticity_driven_darcy_subtype))
THEN 1887 validequationssetfound=.true.
1891 validequationssetfound=.true.
1893 validequationssetfound=.true.
1895 IF(equationsset%specification(1)==equations_set_fluid_mechanics_class.AND. &
1896 & (equationsset%specification(2)==equations_set_stokes_equation_type.OR. &
1897 & equationsset%specification(2)==equations_set_navier_stokes_equation_type))
THEN 1898 validequationssetfound=.true.
1901 IF(equationsset%specification(1)==equations_set_fluid_mechanics_class.AND. &
1902 & (equationsset%specification(2)==equations_set_characteristic_equation_type.OR. &
1903 & equationsset%specification(2)==equations_set_navier_stokes_equation_type))
THEN 1904 validequationssetfound=.true.
1907 CALL flagerror(
"The specified boundary condition type of "// &
1908 & trim(number_to_vstring(boundaryconditiontype,
"*",err,error))// &
1909 &
" is invalid.",err,error,*999)
1913 IF(.NOT.validequationssetfound)
THEN 1914 CALL flagerror(
"The specified boundary condition type of "// &
1915 & trim(number_to_vstring(boundaryconditiontype,
"*",err,error))// &
1916 &
" is invalid for the equations sets in the solver equations.",err,error,*999)
1921 exits(
"BoundaryConditions_CheckEquations")
1923 999 errorsexits(
"BoundaryConditions_CheckEquations",err,error)
1933 & condition,
VALUE,err,error,*)
1936 TYPE(boundary_conditions_type),
POINTER :: BOUNDARY_CONDITIONS
1937 TYPE(field_type),
POINTER :: FIELD
1938 INTEGER(INTG),
INTENT(IN) :: VARIABLE_TYPE
1939 INTEGER(INTG),
INTENT(IN) :: USER_ELEMENT_NUMBER
1940 INTEGER(INTG),
INTENT(IN) :: COMPONENT_NUMBER
1941 INTEGER(INTG),
INTENT(IN) :: CONDITION
1942 REAL(DP),
INTENT(IN) ::
VALUE 1943 INTEGER(INTG),
INTENT(OUT) :: ERR
1944 TYPE(varying_string),
INTENT(OUT) :: ERROR
1946 INTEGER(INTG) :: local_ny,global_ny
1947 TYPE(boundary_conditions_variable_type),
POINTER :: BOUNDARY_CONDITIONS_VARIABLE
1948 TYPE(field_variable_type),
POINTER :: FIELD_VARIABLE
1949 TYPE(varying_string) :: LOCAL_ERROR
1951 enters(
"BOUNDARY_CONDITIONS_SET_ELEMENT",err,error,*999)
1954 IF(
ASSOCIATED(boundary_conditions))
THEN 1955 IF(boundary_conditions%BOUNDARY_CONDITIONS_FINISHED)
THEN 1956 CALL flagerror(
"Boundary conditions have been finished.",err,error,*999)
1958 IF(
ASSOCIATED(field))
THEN 1959 CALL field_component_dof_get_user_element(field,variable_type,user_element_number,component_number, &
1960 & local_ny,global_ny,err,error,*999)
1961 NULLIFY(field_variable)
1962 NULLIFY(boundary_conditions_variable)
1963 CALL field_variable_get(field,variable_type,field_variable,err,error,*999)
1964 IF(
ASSOCIATED(field_variable))
THEN 1966 IF(
ASSOCIATED(boundary_conditions_variable))
THEN 1969 & local_ny,condition,
VALUE,err,error,*999)
1971 local_error=
"The boundary conditions for variable type "//trim(number_to_vstring(variable_type,
"*",err,error))// &
1972 &
" has not been created." 1973 CALL flagerror(local_error,err,error,*999)
1976 CALL flagerror(
"The dependent field variable is not associated.",err,error,*999)
1979 CALL flagerror(
"The dependent field is not associated.",err,error,*999)
1983 CALL flagerror(
"Boundary conditions is not associated.",err,error,*999)
1986 exits(
"BOUNDARY_CONDITION_SET_ELEMENT")
1988 999 errorsexits(
"BOUNDARY_CONDITION_SET_ELEMENT",err,error)
1998 & user_node_number,component_number,condition,
VALUE,err,error,*)
2001 TYPE(boundary_conditions_type),
POINTER :: BOUNDARY_CONDITIONS
2002 TYPE(field_type),
POINTER :: FIELD
2003 INTEGER(INTG),
INTENT(IN) :: VARIABLE_TYPE
2004 INTEGER(INTG),
INTENT(IN) :: VERSION_NUMBER
2005 INTEGER(INTG),
INTENT(IN) :: DERIVATIVE_NUMBER
2006 INTEGER(INTG),
INTENT(IN) :: USER_NODE_NUMBER
2007 INTEGER(INTG),
INTENT(IN) :: COMPONENT_NUMBER
2008 INTEGER(INTG),
INTENT(IN) :: CONDITION
2009 REAL(DP),
INTENT(IN) ::
VALUE 2010 INTEGER(INTG),
INTENT(OUT) :: ERR
2011 TYPE(varying_string),
INTENT(OUT) :: ERROR
2013 INTEGER(INTG) :: local_ny,global_ny
2014 TYPE(boundary_conditions_variable_type),
POINTER :: BOUNDARY_CONDITIONS_VARIABLE
2015 TYPE(field_variable_type),
POINTER :: FIELD_VARIABLE
2016 TYPE(varying_string) :: LOCAL_ERROR
2018 enters(
"BOUNDARY_CONDITIONS_ADD_NODE",err,error,*999)
2020 NULLIFY(field_variable)
2021 NULLIFY(boundary_conditions_variable)
2023 IF(
ASSOCIATED(boundary_conditions))
THEN 2024 IF(boundary_conditions%BOUNDARY_CONDITIONS_FINISHED)
THEN 2025 CALL flagerror(
"Boundary conditions have been finished.",err,error,*999)
2027 IF(
ASSOCIATED(field))
THEN 2028 CALL field_component_dof_get_user_node(field,variable_type,version_number,derivative_number, &
2029 & user_node_number,component_number,local_ny,global_ny,err,error,*999)
2030 CALL field_variable_get(field,variable_type,field_variable,err,error,*999)
2031 IF(
ASSOCIATED(field_variable))
THEN 2033 IF(
ASSOCIATED(boundary_conditions_variable))
THEN 2036 & local_ny,condition,
VALUE,err,error,*999)
2038 local_error=
"The boundary conditions for variable type "//trim(number_to_vstring(variable_type,
"*",err,error))// &
2039 &
" has not been created." 2040 CALL flagerror(local_error,err,error,*999)
2043 CALL flagerror(
"The dependent field variable is not associated",err,error,*999)
2046 CALL flagerror(
"The dependent field is not associated.",err,error,*999)
2050 CALL flagerror(
"Boundary conditions is not associated.",err,error,*999)
2053 exits(
"BOUNDARY_CONDITIONS_ADD_NODE")
2055 999 errorsexits(
"BOUNDARY_CONDITIONS_ADD_NODE",err,error)
2067 TYPE(boundary_conditions_variable_type),
POINTER :: boundaryConditionsVariable
2068 INTEGER(INTG),
INTENT(OUT) :: err
2069 TYPE(varying_string),
INTENT(OUT) :: error
2071 TYPE(boundaryconditionsneumanntype),
POINTER :: boundaryConditionsNeumann
2072 INTEGER(INTG) :: numberOfValues,numberOfLocalDofs
2073 INTEGER(INTG) :: dummyErr
2074 TYPE(varying_string) :: dummyError
2076 enters(
"BoundaryConditions_NeumannInitialise",err,error,*998)
2078 IF(
ASSOCIATED(boundaryconditionsvariable))
THEN 2081 ALLOCATE(boundaryconditionsvariable%neumannBoundaryConditions,stat=err)
2082 IF(err/=0)
CALL flagerror(
"Could not allocate Neumann Boundary Conditions",err,error,*998)
2083 boundaryconditionsneumann=>boundaryconditionsvariable%neumannBoundaryConditions
2084 IF(
ASSOCIATED(boundaryconditionsneumann))
THEN 2085 NULLIFY(boundaryconditionsneumann%integrationMatrix)
2086 NULLIFY(boundaryconditionsneumann%pointValues)
2087 NULLIFY(boundaryconditionsneumann%pointDofMapping)
2089 numberoflocaldofs=boundaryconditionsvariable%VARIABLE%NUMBER_OF_DOFS
2090 ALLOCATE(boundaryconditionsneumann%setDofs(numberofvalues),stat=err)
2091 IF(err/=0)
CALL flagerror(
"Could not allocate Neumann set DOFs.",err,error,*999)
2092 boundaryconditionsneumann%setDofs=0
2094 CALL flagerror(
"The boundary condition Neumann is not associated",err,error,*998)
2097 CALL flagerror(
"Boundary conditions variable is not associated.",err,error,*998)
2100 exits(
"BoundaryConditions_NeumannInitialise")
2103 998 errorsexits(
"BoundaryConditions_NeumannInitialise",err,error)
2117 TYPE(boundary_conditions_variable_type),
POINTER :: boundaryConditionsVariable
2118 INTEGER(INTG),
INTENT(OUT) :: err
2119 TYPE(varying_string),
INTENT(OUT) :: error
2121 TYPE(boundaryconditionsneumanntype),
POINTER :: boundaryConditionsNeumann
2122 TYPE(field_variable_type),
POINTER :: rhsVariable
2123 TYPE(domain_mapping_type),
POINTER :: rowMapping, pointDofMapping
2124 TYPE(domain_topology_type),
POINTER :: topology
2125 TYPE(domain_line_type),
POINTER :: line
2126 TYPE(domain_face_type),
POINTER :: face
2127 TYPE(list_type),
POINTER :: columnIndicesList, rowColumnIndicesList
2128 INTEGER(INTG) :: myComputationalNodeNumber
2129 INTEGER(INTG) :: numberOfPointDofs, numberNonZeros, numberRowEntries, neumannConditionNumber, localNeumannConditionIdx
2130 INTEGER(INTG) :: neumannIdx, globalDof, localDof, localDofNyy, domainIdx, numberOfDomains, domainNumber, componentNumber
2131 INTEGER(INTG) :: nodeIdx, derivIdx, nodeNumber, versionNumber, derivativeNumber, columnNodeNumber, lineIdx, faceIdx, columnDof
2132 INTEGER(INTG),
ALLOCATABLE :: rowIndices(:), columnIndices(:), localDofNumbers(:)
2133 REAL(DP) :: pointValue
2134 INTEGER(INTG) :: dummyErr
2135 TYPE(varying_string) :: dummyError
2137 enters(
"BoundaryConditions_NeumannMatricesInitialise",err,error,*999)
2139 IF(
ASSOCIATED(boundaryconditionsvariable))
THEN 2140 rhsvariable=>boundaryconditionsvariable%variable
2141 IF(.NOT.
ASSOCIATED(rhsvariable)) &
2142 &
CALL flagerror(
"RHS boundary conditions variable field variable is not associated.",err,error,*999)
2145 boundaryconditionsneumann=>boundaryconditionsvariable%neumannBoundaryConditions
2146 IF(
ASSOCIATED(boundaryconditionsneumann))
THEN 2148 rowmapping=>rhsvariable%DOMAIN_MAPPING
2149 IF(.NOT.
ASSOCIATED(rowmapping)) &
2150 &
CALL flagerror(
"RHS field variable mapping is not associated.",err,error,*998)
2153 ALLOCATE(pointdofmapping,stat=err)
2154 IF(err/=0)
CALL flagerror(
"Could not allocate Neumann DOF domain mapping.",err,error,*999)
2155 CALL domain_mappings_mapping_initialise(pointdofmapping,rowmapping%NUMBER_OF_DOMAINS,err,error,*999)
2156 boundaryconditionsneumann%pointDofMapping=>pointdofmapping
2158 pointdofmapping%NUMBER_OF_GLOBAL=numberofpointdofs
2159 ALLOCATE(pointdofmapping%GLOBAL_TO_LOCAL_MAP(numberofpointdofs),stat=err)
2160 IF(err/=0)
CALL flagerror(
"Could not allocate Neumann point DOF global to local mapping.",err,error,*999)
2161 ALLOCATE(localdofnumbers(0:rowmapping%NUMBER_OF_DOMAINS-1),stat=err)
2162 IF(err/=0)
CALL flagerror(
"Could not allocate local Neumann DOF numbers.",err,error,*999)
2165 IF(diagnostics2)
THEN 2166 CALL write_string(diagnostic_output_type,
"Local numbering",err,error,*999)
2168 DO neumannidx=1,numberofpointdofs
2169 globaldof=boundaryconditionsneumann%setDofs(neumannidx)
2171 numberofdomains=rhsvariable%DOMAIN_MAPPING%GLOBAL_TO_LOCAL_MAP(globaldof)%NUMBER_OF_DOMAINS
2172 pointdofmapping%GLOBAL_TO_LOCAL_MAP(neumannidx)%NUMBER_OF_DOMAINS=numberofdomains
2173 ALLOCATE(pointdofmapping%GLOBAL_TO_LOCAL_MAP(neumannidx)%LOCAL_NUMBER(numberofdomains),stat=err)
2174 IF(err/=0)
CALL flagerror(
"Could not allocate Neumann DOF global to local map local number.",err,error,*999)
2175 ALLOCATE(pointdofmapping%GLOBAL_TO_LOCAL_MAP(neumannidx)%DOMAIN_NUMBER(numberofdomains),stat=err)
2176 IF(err/=0)
CALL flagerror(
"Could not allocate Neumann DOF global to local map domain number.",err,error,*999)
2177 ALLOCATE(pointdofmapping%GLOBAL_TO_LOCAL_MAP(neumannidx)%LOCAL_TYPE(numberofdomains),stat=err)
2178 IF(err/=0)
CALL flagerror(
"Could not allocate Neumann DOF global to local map local type.",err,error,*999)
2179 IF(diagnostics2)
THEN 2180 CALL write_string_value(diagnostic_output_type,
" Neumann point DOF index = ",neumannidx,err,error,*999)
2182 DO domainidx=1,numberofdomains
2183 domainnumber=rhsvariable%DOMAIN_MAPPING%GLOBAL_TO_LOCAL_MAP(globaldof)%DOMAIN_NUMBER(domainidx)
2184 pointdofmapping%GLOBAL_TO_LOCAL_MAP(neumannidx)%DOMAIN_NUMBER(domainidx)=domainnumber
2185 pointdofmapping%GLOBAL_TO_LOCAL_MAP(neumannidx)%LOCAL_TYPE(domainidx)= &
2186 & rhsvariable%DOMAIN_MAPPING%GLOBAL_TO_LOCAL_MAP(globaldof)%LOCAL_TYPE(domainidx)
2187 IF(pointdofmapping%GLOBAL_TO_LOCAL_MAP(neumannidx)%LOCAL_TYPE(domainidx)==domain_local_internal.OR. &
2188 & pointdofmapping%GLOBAL_TO_LOCAL_MAP(neumannidx)%LOCAL_TYPE(domainidx)==domain_local_boundary)
THEN 2189 localdofnumbers(domainnumber)=localdofnumbers(domainnumber)+1
2190 pointdofmapping%GLOBAL_TO_LOCAL_MAP(neumannidx)%LOCAL_NUMBER(domainidx)=localdofnumbers(domainnumber)
2191 IF(diagnostics2)
THEN 2192 CALL write_string_value(diagnostic_output_type,
" Global rhs var DOF = ",globaldof,err,error,*999)
2193 CALL write_string_value(diagnostic_output_type,
" Domain number = ",domainnumber,err,error,*999)
2194 CALL write_string_value(diagnostic_output_type,
" Local type = ", &
2195 & pointdofmapping%GLOBAL_TO_LOCAL_MAP(neumannidx)%LOCAL_TYPE(domainidx),err,error,*999)
2196 CALL write_string_value(diagnostic_output_type,
" Local number = ",localdofnumbers(domainnumber),err,error,*999)
2202 IF(diagnostics2)
THEN 2203 CALL write_string(diagnostic_output_type,
"Ghost numbering",err,error,*999)
2205 DO neumannidx=1,numberofpointdofs
2206 globaldof=boundaryconditionsneumann%setDofs(neumannidx)
2207 numberofdomains=rhsvariable%DOMAIN_MAPPING%GLOBAL_TO_LOCAL_MAP(globaldof)%NUMBER_OF_DOMAINS
2208 IF(diagnostics2)
THEN 2209 CALL write_string_value(diagnostic_output_type,
" Neumann point DOF index = ",neumannidx,err,error,*999)
2211 DO domainidx=1,numberofdomains
2212 IF(pointdofmapping%GLOBAL_TO_LOCAL_MAP(neumannidx)%LOCAL_TYPE(domainidx)==domain_local_ghost)
THEN 2213 domainnumber=rhsvariable%DOMAIN_MAPPING%GLOBAL_TO_LOCAL_MAP(globaldof)%DOMAIN_NUMBER(domainidx)
2214 localdofnumbers(domainnumber)=localdofnumbers(domainnumber)+1
2215 pointdofmapping%GLOBAL_TO_LOCAL_MAP(neumannidx)%LOCAL_NUMBER(domainidx)=localdofnumbers(domainnumber)
2216 IF(diagnostics2)
THEN 2217 CALL write_string_value(diagnostic_output_type,
" Global rhs var DOF = ",globaldof,err,error,*999)
2218 CALL write_string_value(diagnostic_output_type,
" Domain number = ",domainnumber,err,error,*999)
2219 CALL write_string_value(diagnostic_output_type,
" Local number = ",localdofnumbers(domainnumber),err,error,*999)
2225 CALL domain_mappings_local_from_global_calculate(pointdofmapping,err,error,*999)
2227 CALL distributed_matrix_create_start(rowmapping,pointdofmapping,boundaryconditionsneumann%integrationMatrix,err,error,*999)
2228 SELECT CASE(boundaryconditionsvariable%BOUNDARY_CONDITIONS%neumannMatrixSparsity)
2235 ALLOCATE(rowindices(rowmapping%TOTAL_NUMBER_OF_LOCAL+1),stat=err)
2236 IF(err/=0)
CALL flagerror(
"Could not allocate Neumann integration matrix column indices.",err,error,*999)
2238 NULLIFY(columnindiceslist)
2239 CALL list_create_start(columnindiceslist,err,error,*999)
2240 CALL list_data_type_set(columnindiceslist,list_intg_type,err,error,*999)
2241 CALL list_create_finish(columnindiceslist,err,error,*999)
2243 NULLIFY(rowcolumnindiceslist)
2244 CALL list_create_start(rowcolumnindiceslist,err,error,*999)
2245 CALL list_data_type_set(rowcolumnindiceslist,list_intg_type,err,error,*999)
2246 CALL list_mutable_set(rowcolumnindiceslist,.true.,err,error,*999)
2247 CALL list_create_finish(rowcolumnindiceslist,err,error,*999)
2250 DO localdof=1,rhsvariable%DOMAIN_MAPPING%TOTAL_NUMBER_OF_LOCAL
2251 localdofnyy=rhsvariable%DOF_TO_PARAM_MAP%DOF_TYPE(2,localdof)
2252 componentnumber=rhsvariable%DOF_TO_PARAM_MAP%NODE_DOF2PARAM_MAP(4,localdofnyy)
2254 topology=>rhsvariable%COMPONENTS(componentnumber)%DOMAIN%TOPOLOGY
2255 IF(.NOT.
ASSOCIATED(topology))
THEN 2256 CALL flagerror(
"Field component topology is not associated.",err,error,*999)
2259 SELECT CASE(rhsvariable%COMPONENTS(componentnumber)%INTERPOLATION_TYPE)
2260 CASE(field_node_based_interpolation)
2261 nodenumber=rhsvariable%DOF_TO_PARAM_MAP%NODE_DOF2PARAM_MAP(3,localdofnyy)
2262 IF(.NOT.
ASSOCIATED(topology%NODES%NODES))
THEN 2263 CALL flagerror(
"Topology nodes are not associated.",err,error,*999)
2265 IF(topology%NODES%NODES(nodenumber)%BOUNDARY_NODE)
THEN 2266 SELECT CASE(rhsvariable%COMPONENTS(componentnumber)%DOMAIN%NUMBER_OF_DIMENSIONS)
2270 globaldof=rhsvariable%DOMAIN_MAPPING%LOCAL_TO_GLOBAL_MAP(localdof)
2274 neumannconditionnumber=0
2275 DO neumannidx=1,numberofpointdofs
2276 IF(boundaryconditionsneumann%setDofs(neumannidx)==globaldof)
THEN 2277 neumannconditionnumber=neumannidx
2280 IF(neumannconditionnumber==0)
THEN 2281 CALL flagerror(
"Could not find matching Neuamann condition number for global DOF "// &
2282 & trim(number_to_vstring(globaldof,
"*",err,error))//
" with Neumann condition set.",err,error,*999)
2284 CALL list_item_add(rowcolumnindiceslist,neumannconditionnumber,err,error,*999)
2289 DO lineidx=1,topology%NODES%NODES(nodenumber)%NUMBER_OF_NODE_LINES
2290 IF(.NOT.
ALLOCATED(topology%LINES%LINES))
THEN 2291 CALL flagerror(
"Topology lines have not been calculated.",err,error,*999)
2293 line=>topology%LINES%LINES(topology%NODES%NODES(nodenumber)%NODE_LINES(lineidx))
2294 IF(.NOT.line%BOUNDARY_LINE) cycle
2295 DO nodeidx=1,line%BASIS%NUMBER_OF_NODES
2296 columnnodenumber=line%NODES_IN_LINE(nodeidx)
2297 DO derividx=1,line%BASIS%NUMBER_OF_DERIVATIVES(nodeidx)
2298 derivativenumber=line%DERIVATIVES_IN_LINE(1,derividx,nodeidx)
2299 versionnumber=line%DERIVATIVES_IN_LINE(2,derividx,nodeidx)
2300 columndof=rhsvariable%COMPONENTS(componentnumber)%PARAM_TO_DOF_MAP%NODE_PARAM2DOF_MAP% &
2301 & nodes(columnnodenumber)%DERIVATIVES(derivativenumber)%VERSIONS(versionnumber)
2302 globaldof=rhsvariable%DOMAIN_MAPPING%LOCAL_TO_GLOBAL_MAP(columndof)
2304 & boundaryconditionsvariable%CONDITION_TYPES(globaldof)== &
2306 neumannconditionnumber=0
2307 DO neumannidx=1,numberofpointdofs
2308 IF(boundaryconditionsneumann%setDofs(neumannidx)==globaldof)
THEN 2309 neumannconditionnumber=neumannidx
2312 IF(neumannconditionnumber==0)
THEN 2313 CALL flagerror(
"Could not find matching Neuamann condition number for global DOF "// &
2314 & trim(number_to_vstring(globaldof,
"*",err,error))//
" with Neumann condition set.",err,error,*999)
2316 CALL list_item_add(rowcolumnindiceslist,neumannconditionnumber,err,error,*999)
2324 DO faceidx=1,topology%NODES%NODES(nodenumber)%NUMBER_OF_NODE_FACES
2325 IF(.NOT.
ALLOCATED(topology%faces%faces))
THEN 2326 CALL flagerror(
"Topology faces have not been calculated.",err,error,*999)
2328 face=>topology%FACES%FACES(topology%NODES%NODES(nodenumber)%NODE_FACES(faceidx))
2329 IF(.NOT.face%BOUNDARY_FACE) cycle
2330 DO nodeidx=1,face%BASIS%NUMBER_OF_NODES
2331 columnnodenumber=face%NODES_IN_FACE(nodeidx)
2332 DO derividx=1,face%BASIS%NUMBER_OF_DERIVATIVES(nodeidx)
2333 derivativenumber=face%DERIVATIVES_IN_FACE(1,derividx,nodeidx)
2334 versionnumber=face%DERIVATIVES_IN_FACE(2,derividx,nodeidx)
2335 columndof=rhsvariable%COMPONENTS(componentnumber)%PARAM_TO_DOF_MAP%NODE_PARAM2DOF_MAP% &
2336 & nodes(columnnodenumber)%DERIVATIVES(derivativenumber)%VERSIONS(versionnumber)
2337 globaldof=rhsvariable%DOMAIN_MAPPING%LOCAL_TO_GLOBAL_MAP(columndof)
2339 & boundaryconditionsvariable%CONDITION_TYPES(globaldof)== &
2341 neumannconditionnumber=0
2342 DO neumannidx=1,numberofpointdofs
2343 IF(boundaryconditionsneumann%setDofs(neumannidx)==globaldof)
THEN 2344 neumannconditionnumber=neumannidx
2347 IF(neumannconditionnumber==0)
THEN 2348 CALL flagerror(
"Could not find matching Neuamann condition number for global DOF "// &
2349 & trim(number_to_vstring(globaldof,
"*",err,error))//
" with Neumann condition set.",err,error,*999)
2351 CALL list_item_add(rowcolumnindiceslist,neumannconditionnumber,err,error,*999)
2358 CALL flagerror(
"The dimension is invalid for point Neumann conditions",err,error,*999)
2361 CASE(field_element_based_interpolation)
2362 CALL flagerror(
"Not implemented.",err,error,*999)
2363 CASE(field_constant_interpolation)
2364 CALL flagerror(
"Not implemented.",err,error,*999)
2365 CASE(field_grid_point_based_interpolation)
2366 CALL flagerror(
"Not implemented.",err,error,*999)
2367 CASE(field_gauss_point_based_interpolation)
2368 CALL flagerror(
"Not implemented.",err,error,*999)
2370 CALL flagerror(
"The interpolation type of "// &
2371 & trim(number_to_vstring(rhsvariable%COMPONENTS(componentnumber) &
2372 & %INTERPOLATION_TYPE,
"*",err,error))//
" is invalid for component number "// &
2373 & trim(number_to_vstring(componentnumber,
"*",err,error))//
".", &
2378 CALL list_remove_duplicates(rowcolumnindiceslist,err,error,*999)
2380 CALL list_appendlist(columnindiceslist,rowcolumnindiceslist,err,error,*999)
2381 CALL list_number_of_items_get(rowcolumnindiceslist,numberrowentries,err,error,*999)
2382 rowindices(localdof+1)=rowindices(localdof)+numberrowentries
2383 CALL list_clearitems(rowcolumnindiceslist,err,error,*999)
2386 CALL list_destroy(rowcolumnindiceslist,err,error,*999)
2387 CALL list_detach_and_destroy(columnindiceslist,numbernonzeros,columnindices,err,error,*999)
2388 IF(diagnostics1)
THEN 2389 CALL write_string(diagnostic_output_type,
"Neumann integration matrix sparsity",err,error,*999)
2390 CALL write_string_value(diagnostic_output_type,
"Number non-zeros = ", numbernonzeros,err,error,*999)
2391 CALL write_string_value(diagnostic_output_type,
"Number columns = ",numberofpointdofs,err,error,*999)
2392 CALL write_string_value(diagnostic_output_type,
"Number rows = ", &
2393 & rhsvariable%DOMAIN_MAPPING%TOTAL_NUMBER_OF_LOCAL,err,error,*999)
2394 CALL write_string_vector(diagnostic_output_type,1,1,numberofpointdofs+1,6,6, &
2395 & rowindices,
'(" Row indices: ",6(X,I6))',
'(6X,6(X,I6))',err,error,*999)
2396 CALL write_string_vector(diagnostic_output_type,1,1,numbernonzeros,6,6, &
2397 & columnindices,
'(" Column indices: ",6(X,I6))',
'(6X,6(X,I6))',err,error,*999)
2400 CALL distributed_matrix_storage_type_set(boundaryconditionsneumann%integrationMatrix, &
2401 & distributed_matrix_compressed_row_storage_type,err,error,*999)
2402 CALL distributed_matrix_number_non_zeros_set(boundaryconditionsneumann%integrationMatrix,numbernonzeros,err,error,*999)
2403 CALL distributed_matrix_storage_locations_set(boundaryconditionsneumann%integrationMatrix, &
2404 & rowindices,columnindices(1:numbernonzeros),err,error,*999)
2406 DEALLOCATE(localdofnumbers)
2407 DEALLOCATE(rowindices)
2408 DEALLOCATE(columnindices)
2410 CALL distributed_matrix_storage_type_set(boundaryconditionsneumann%integrationMatrix, &
2411 & distributed_matrix_block_storage_type,err,error,*999)
2413 CALL flagerror(
"The Neumann matrix sparsity type of "// &
2414 & trim(number_to_vstring(boundaryconditionsvariable%BOUNDARY_CONDITIONS%neumannMatrixSparsity,
"*",err,error))// &
2415 &
" is invalid.",err,error,*999)
2418 CALL distributed_matrix_create_finish(boundaryconditionsneumann%integrationMatrix,err,error,*999)
2421 CALL distributed_vector_create_start(pointdofmapping,boundaryconditionsneumann%pointValues,err,error,*999)
2422 CALL distributed_vector_create_finish(boundaryconditionsneumann%pointValues,err,error,*999)
2423 mycomputationalnodenumber=computational_node_number_get(err,error)
2425 DO neumannidx=1,numberofpointdofs
2426 globaldof=boundaryconditionsneumann%setDofs(neumannidx)
2427 IF(rhsvariable%DOMAIN_MAPPING%GLOBAL_TO_LOCAL_MAP(globaldof)%DOMAIN_NUMBER(1)==mycomputationalnodenumber)
THEN 2428 localdof=rhsvariable%DOMAIN_MAPPING%GLOBAL_TO_LOCAL_MAP(globaldof)%LOCAL_NUMBER(1)
2430 localneumannconditionidx=boundaryconditionsneumann%pointDofMapping%GLOBAL_TO_LOCAL_MAP(neumannidx)%LOCAL_NUMBER(1)
2431 CALL field_parameter_set_get_local_dof(rhsvariable%FIELD,rhsvariable%VARIABLE_TYPE, &
2432 & field_boundary_conditions_set_type,localdof,pointvalue,err,error,*999)
2433 CALL distributed_vector_values_set(boundaryconditionsneumann%pointValues, &
2434 & localneumannconditionidx,pointvalue,err,error,*999)
2437 CALL distributed_vector_update_start(boundaryconditionsneumann%pointValues,err,error,*999)
2438 CALL distributed_vector_update_finish(boundaryconditionsneumann%pointValues,err,error,*999)
2441 CALL flagerror(
"The boundary condition Neumann is not associated",err,error,*998)
2444 CALL flagerror(
"Boundary conditions variable is not associated.",err,error,*998)
2447 exits(
"BoundaryConditions_NeumannMatricesInitialise")
2449 999
IF(
ALLOCATED(rowindices))
THEN 2450 DEALLOCATE(rowindices)
2452 IF(
ALLOCATED(columnindices))
THEN 2453 DEALLOCATE(columnindices)
2455 IF(
ALLOCATED(localdofnumbers))
THEN 2456 DEALLOCATE(localdofnumbers)
2459 998 errors(
"BoundaryConditions_NeumannMatricesInitialise",err,error)
2460 exits(
"BoundaryConditions_NeumannMatricesInitialise")
2473 TYPE(boundary_conditions_variable_type),
POINTER :: boundaryConditionsVariable
2474 INTEGER(INTG),
INTENT(OUT) :: err
2475 TYPE(varying_string),
INTENT(OUT) :: error
2477 TYPE(boundaryconditionsneumanntype),
POINTER :: boundaryConditionsNeumann
2479 enters(
"BoundaryConditions_NeumannFinalise",err,error,*999)
2481 IF(
ASSOCIATED(boundaryconditionsvariable))
THEN 2482 boundaryconditionsneumann=>boundaryconditionsvariable%neumannBoundaryConditions
2483 IF(
ASSOCIATED(boundaryconditionsneumann))
THEN 2484 IF(
ALLOCATED(boundaryconditionsneumann%setDofs)) &
2485 &
DEALLOCATE(boundaryconditionsneumann%setDofs)
2487 DEALLOCATE(boundaryconditionsneumann)
2488 NULLIFY(boundaryconditionsvariable%neumannBoundaryConditions)
2491 CALL flagerror(
"Boundary conditions variable is not associated.",err,error,*999)
2494 exits(
"BoundaryConditions_NeumannFinalise")
2496 999 errorsexits(
"BoundaryConditions_NeumannFinalise",err,error)
2508 TYPE(boundary_conditions_variable_type),
POINTER :: boundaryConditionsVariable
2509 INTEGER(INTG),
INTENT(OUT) :: err
2510 TYPE(varying_string),
INTENT(OUT) :: error
2512 TYPE(boundaryconditionsneumanntype),
POINTER :: boundaryConditionsNeumann
2514 enters(
"BoundaryConditions_NeumannMatricesFinalise",err,error,*999)
2516 IF(
ASSOCIATED(boundaryconditionsvariable))
THEN 2517 boundaryconditionsneumann=>boundaryconditionsvariable%neumannBoundaryConditions
2518 IF(
ASSOCIATED(boundaryconditionsneumann))
THEN 2519 IF(
ASSOCIATED(boundaryconditionsneumann%integrationMatrix)) &
2520 &
CALL distributed_matrix_destroy(boundaryconditionsneumann%integrationMatrix,err,error,*999)
2521 IF(
ASSOCIATED(boundaryconditionsneumann%pointValues)) &
2522 &
CALL distributed_vector_destroy(boundaryconditionsneumann%pointValues,err,error,*999)
2523 CALL domain_mappings_mapping_finalise(boundaryconditionsneumann%pointDofMapping,err,error,*999)
2526 CALL flagerror(
"Boundary conditions variable is not associated.",err,error,*999)
2529 exits(
"BoundaryConditions_NeumannMatricesFinalise")
2531 999 errorsexits(
"BoundaryConditions_NeumannMatricesFinalise",err,error)
2544 TYPE(boundary_conditions_variable_type),
POINTER,
INTENT(IN) :: rhsBoundaryConditions
2545 INTEGER(INTG),
INTENT(OUT) :: err
2546 TYPE(varying_string),
INTENT(OUT) :: error
2549 INTEGER(INTG) :: componentNumber,globalDof,localDof,neumannDofIdx,myComputationalNodeNumber
2550 INTEGER(INTG) :: numberOfNeumann,neumannLocalDof,neumannDofNyy
2551 INTEGER(INTG) :: neumannGlobalDof,neumannNodeNumber,neumannLocalNodeNumber,neumannLocalDerivNumber
2552 INTEGER(INTG) :: faceIdx,lineIdx,nodeIdx,derivIdx,gaussIdx
2553 INTEGER(INTG) :: faceNumber,lineNumber
2554 INTEGER(INTG) :: ms,os,nodeNumber,derivativeNumber,versionNumber
2555 LOGICAL :: dependentGeometry
2556 REAL(DP) :: integratedValue,phim,phio
2557 TYPE(boundaryconditionsneumanntype),
POINTER :: neumannConditions
2558 TYPE(basis_type),
POINTER :: basis
2559 TYPE(field_type),
POINTER :: geometricField
2560 TYPE(field_variable_type),
POINTER :: rhsVariable
2561 TYPE(field_interpolated_point_metrics_ptr_type),
POINTER :: interpolatedPointMetrics(:)
2562 TYPE(field_interpolated_point_ptr_type),
POINTER :: interpolatedPoints(:)
2563 TYPE(field_interpolation_parameters_ptr_type),
POINTER :: interpolationParameters(:), scalingParameters(:)
2564 TYPE(distributed_vector_type),
POINTER :: integratedValues
2565 TYPE(domain_topology_type),
POINTER :: topology
2566 TYPE(domain_faces_type),
POINTER :: faces
2567 TYPE(domain_lines_type),
POINTER :: lines
2568 TYPE(domain_face_type),
POINTER :: face
2569 TYPE(domain_line_type),
POINTER :: line
2570 TYPE(decomposition_type),
POINTER :: decomposition
2571 TYPE(quadrature_scheme_type),
POINTER :: quadratureScheme
2573 enters(
"BoundaryConditions_NeumannIntegrate",err,error,*999)
2575 NULLIFY(scalingparameters)
2576 NULLIFY(interpolationparameters)
2577 NULLIFY(interpolatedpoints)
2578 NULLIFY(interpolatedpointmetrics)
2579 NULLIFY(integratedvalues)
2581 neumannconditions=>rhsboundaryconditions%neumannBoundaryConditions
2583 IF(
ASSOCIATED(neumannconditions))
THEN 2584 rhsvariable=>rhsboundaryconditions%VARIABLE
2585 IF(.NOT.
ASSOCIATED(rhsvariable))
THEN 2586 CALL flagerror(
"Field variable for RHS boundary conditions is not associated.",err,error,*999)
2589 CALL field_geometricgeneralfieldget(rhsvariable%field,geometricfield,dependentgeometry,err,error,*999)
2591 CALL distributed_matrix_all_values_set(neumannconditions%integrationMatrix,0.0_dp,err,error,*999)
2595 mycomputationalnodenumber=computational_node_number_get(err,error)
2599 CALL field_interpolation_parameters_initialise(geometricfield,interpolationparameters,err,error,*999)
2600 CALL field_interpolation_parameters_initialise(rhsvariable%field,scalingparameters,err,error,*999)
2601 CALL field_interpolated_points_initialise(interpolationparameters,interpolatedpoints,err,error,*999)
2602 CALL field_interpolatedpointsmetricsinitialise(interpolatedpoints,interpolatedpointmetrics,err,error,*999)
2606 DO neumanndofidx=1,numberofneumann
2607 neumannglobaldof=neumannconditions%setDofs(neumanndofidx)
2608 IF(rhsvariable%DOMAIN_MAPPING%GLOBAL_TO_LOCAL_MAP(neumannglobaldof)%DOMAIN_NUMBER(1)==mycomputationalnodenumber)
THEN 2609 neumannlocaldof=rhsvariable%DOMAIN_MAPPING%GLOBAL_TO_LOCAL_MAP(neumannglobaldof)%LOCAL_NUMBER(1)
2611 neumanndofnyy=rhsvariable%DOF_TO_PARAM_MAP%DOF_TYPE(2,neumannlocaldof)
2612 componentnumber=rhsvariable%DOF_TO_PARAM_MAP%NODE_DOF2PARAM_MAP(4,neumanndofnyy)
2613 topology=>rhsvariable%COMPONENTS(componentnumber)%DOMAIN%TOPOLOGY
2614 IF(.NOT.
ASSOCIATED(topology))
THEN 2615 CALL flagerror(
"Field component topology is not associated.",err,error,*999)
2617 decomposition=>rhsvariable%COMPONENTS(componentnumber)%DOMAIN%DECOMPOSITION
2618 IF(.NOT.
ASSOCIATED(decomposition))
THEN 2619 CALL flagerror(
"Field component decomposition is not associated.",err,error,*999)
2621 SELECT CASE(rhsvariable%COMPONENTS(componentnumber)%INTERPOLATION_TYPE)
2622 CASE(field_node_based_interpolation)
2623 neumannnodenumber=rhsvariable%DOF_TO_PARAM_MAP%NODE_DOF2PARAM_MAP(3,neumanndofnyy)
2624 SELECT CASE(rhsvariable%COMPONENTS(componentnumber)%DOMAIN%NUMBER_OF_DIMENSIONS)
2626 CALL distributed_matrix_values_set(neumannconditions%integrationMatrix,neumannlocaldof,neumanndofidx, &
2627 & 1.0_dp,err,error,*999)
2629 IF(.NOT.decomposition%CALCULATE_LINES)
THEN 2630 CALL flagerror(
"Decomposition does not have lines calculated.",err,error,*999)
2632 lines=>topology%LINES
2633 IF(.NOT.
ASSOCIATED(lines))
THEN 2634 CALL flagerror(
"Mesh topology lines is not associated.",err,error,*999)
2636 linesloop:
DO lineidx=1,topology%NODES%NODES(neumannnodenumber)%NUMBER_OF_NODE_LINES
2637 linenumber=topology%NODES%NODES(neumannnodenumber)%NODE_LINES(lineidx)
2638 line=>topology%lines%lines(linenumber)
2639 IF(.NOT.line%BOUNDARY_LINE) &
2642 IF(.NOT.
ASSOCIATED(basis))
THEN 2643 CALL flagerror(
"Line basis is not associated.",err,error,*999)
2645 neumannlocalnodenumber=0
2646 neumannlocalderivnumber=0
2649 DO nodeidx=1,line%BASIS%NUMBER_OF_NODES
2650 nodenumber=line%NODES_IN_LINE(nodeidx)
2651 DO derividx=1,line%BASIS%NUMBER_OF_DERIVATIVES(nodeidx)
2652 derivativenumber=line%DERIVATIVES_IN_LINE(1,derividx,nodeidx)
2653 versionnumber=line%DERIVATIVES_IN_LINE(2,derividx,nodeidx)
2654 localdof=rhsvariable%COMPONENTS(componentnumber)%PARAM_TO_DOF_MAP%NODE_PARAM2DOF_MAP% &
2655 & nodes(nodenumber)%DERIVATIVES(derivativenumber)%VERSIONS(versionnumber)
2656 globaldof=rhsvariable%DOMAIN_MAPPING%LOCAL_TO_GLOBAL_MAP(localdof)
2657 IF(globaldof==neumannglobaldof)
THEN 2658 neumannlocalnodenumber=nodeidx
2659 neumannlocalderivnumber=derividx
2665 IF(neumannlocalnodenumber==0)
THEN 2666 CALL flagerror(
"Could not find local Neumann node and derivative numbers in line.",err,error,*999)
2670 quadraturescheme=>basis%QUADRATURE%QUADRATURE_SCHEME_MAP(basis_default_quadrature_scheme)%PTR
2671 IF(.NOT.
ASSOCIATED(quadraturescheme))
THEN 2672 CALL flagerror(
"Line basis default quadrature scheme is not associated.",err,error,*999)
2674 CALL field_interpolation_parameters_line_get(field_values_set_type,linenumber, &
2675 & interpolationparameters(field_u_variable_type)%ptr,err,error,*999,field_geometric_components_type)
2676 IF(rhsvariable%FIELD%SCALINGS%SCALING_TYPE/=field_no_scaling)
THEN 2677 CALL field_interpolationparametersscalefactorslineget(linenumber, &
2678 & scalingparameters(field_u_variable_type)%ptr,err,error,*999)
2681 DO nodeidx=1,line%BASIS%NUMBER_OF_NODES
2682 nodenumber=line%NODES_IN_LINE(nodeidx)
2683 DO derividx=1,line%BASIS%NUMBER_OF_DERIVATIVES(nodeidx)
2684 derivativenumber=line%DERIVATIVES_IN_LINE(1,derividx,nodeidx)
2685 versionnumber=line%DERIVATIVES_IN_LINE(2,derividx,nodeidx)
2686 localdof=rhsvariable%COMPONENTS(componentnumber)%PARAM_TO_DOF_MAP%NODE_PARAM2DOF_MAP% &
2687 & nodes(nodenumber)%DERIVATIVES(derivativenumber)%VERSIONS(versionnumber)
2689 ms=basis%ELEMENT_PARAMETER_INDEX(derividx,nodeidx)
2690 os=basis%ELEMENT_PARAMETER_INDEX(neumannlocalderivnumber,neumannlocalnodenumber)
2692 integratedvalue=0.0_dp
2694 DO gaussidx=1,quadraturescheme%NUMBER_OF_GAUSS
2695 CALL field_interpolate_gauss(first_part_deriv,basis_default_quadrature_scheme,gaussidx, &
2696 & interpolatedpoints(field_u_variable_type)%ptr,err,error,*999,field_geometric_components_type)
2697 CALL field_interpolated_point_metrics_calculate(coordinate_jacobian_line_type, &
2698 & interpolatedpointmetrics(field_u_variable_type)%ptr,err,error,*999)
2701 phim=quadraturescheme%GAUSS_BASIS_FNS(ms,no_part_deriv,gaussidx)
2702 phio=quadraturescheme%GAUSS_BASIS_FNS(os,no_part_deriv,gaussidx)
2705 integratedvalue=integratedvalue+phim*phio* &
2706 & quadraturescheme%GAUSS_WEIGHTS(gaussidx)* &
2707 & interpolatedpointmetrics(field_u_variable_type)%ptr%jacobian
2711 IF(rhsvariable%FIELD%SCALINGS%SCALING_TYPE/=field_no_scaling)
THEN 2712 integratedvalue=integratedvalue* &
2713 & scalingparameters(field_u_variable_type)%ptr%SCALE_FACTORS(ms,componentnumber)* &
2714 & scalingparameters(field_u_variable_type)%ptr%SCALE_FACTORS(os,componentnumber)
2718 CALL distributed_matrix_values_add(neumannconditions%integrationMatrix,localdof,neumanndofidx, &
2719 & integratedvalue,err,error,*999)
2724 IF(.NOT.decomposition%CALCULATE_FACES)
THEN 2725 CALL flagerror(
"Decomposition does not have faces calculated.",err,error,*999)
2727 faces=>topology%FACES
2728 IF(.NOT.
ASSOCIATED(faces))
THEN 2729 CALL flagerror(
"Mesh topology faces is not associated.",err,error,*999)
2731 facesloop:
DO faceidx=1,topology%NODES%NODES(neumannnodenumber)%NUMBER_OF_NODE_FACES
2732 facenumber=topology%NODES%NODES(neumannnodenumber)%NODE_FACES(faceidx)
2733 face=>topology%FACES%FACES(facenumber)
2734 IF(.NOT.face%BOUNDARY_FACE) &
2737 IF(.NOT.
ASSOCIATED(basis))
THEN 2738 CALL flagerror(
"Line face is not associated.",err,error,*999)
2740 neumannlocalnodenumber=0
2741 neumannlocalderivnumber=0
2744 DO nodeidx=1,basis%NUMBER_OF_NODES
2745 nodenumber=face%NODES_IN_FACE(nodeidx)
2746 DO derividx=1,basis%NUMBER_OF_DERIVATIVES(nodeidx)
2747 derivativenumber=face%DERIVATIVES_IN_FACE(1,derividx,nodeidx)
2748 versionnumber=face%DERIVATIVES_IN_FACE(2,derividx,nodeidx)
2749 localdof=rhsvariable%COMPONENTS(componentnumber)%PARAM_TO_DOF_MAP%NODE_PARAM2DOF_MAP% &
2750 & nodes(nodenumber)%DERIVATIVES(derivativenumber)%VERSIONS(versionnumber)
2751 globaldof=rhsvariable%DOMAIN_MAPPING%LOCAL_TO_GLOBAL_MAP(localdof)
2752 IF(globaldof==neumannglobaldof)
THEN 2753 neumannlocalnodenumber=nodeidx
2754 neumannlocalderivnumber=derividx
2760 IF(neumannlocalnodenumber==0)
THEN 2761 CALL flagerror(
"Could not find local Neumann node and derivative numbers in line.",err,error,*999)
2765 quadraturescheme=>basis%QUADRATURE%QUADRATURE_SCHEME_MAP(basis_default_quadrature_scheme)%PTR
2766 IF(.NOT.
ASSOCIATED(quadraturescheme))
THEN 2767 CALL flagerror(
"Face basis default quadrature scheme is not associated.",err,error,*999)
2769 CALL field_interpolation_parameters_face_get(field_values_set_type,facenumber, &
2770 & interpolationparameters(field_u_variable_type)%ptr,err,error,*999,field_geometric_components_type)
2771 IF(rhsvariable%FIELD%SCALINGS%SCALING_TYPE/=field_no_scaling)
THEN 2772 CALL field_interpolationparametersscalefactorsfaceget(facenumber, &
2773 & scalingparameters(field_u_variable_type)%ptr,err,error,*999)
2776 DO nodeidx=1,basis%NUMBER_OF_NODES
2777 nodenumber=face%NODES_IN_FACE(nodeidx)
2778 DO derividx=1,basis%NUMBER_OF_DERIVATIVES(nodeidx)
2779 derivativenumber=face%DERIVATIVES_IN_FACE(1,derividx,nodeidx)
2780 versionnumber=face%DERIVATIVES_IN_FACE(2,derividx,nodeidx)
2781 localdof=rhsvariable%COMPONENTS(componentnumber)%PARAM_TO_DOF_MAP%NODE_PARAM2DOF_MAP% &
2782 & nodes(nodenumber)%DERIVATIVES(derivativenumber)%VERSIONS(versionnumber)
2784 ms=basis%ELEMENT_PARAMETER_INDEX(derividx,nodeidx)
2785 os=basis%ELEMENT_PARAMETER_INDEX(neumannlocalderivnumber,neumannlocalnodenumber)
2787 integratedvalue=0.0_dp
2789 DO gaussidx=1,quadraturescheme%NUMBER_OF_GAUSS
2790 CALL field_interpolate_gauss(first_part_deriv,basis_default_quadrature_scheme,gaussidx, &
2791 & interpolatedpoints(field_u_variable_type)%ptr,err,error,*999,field_geometric_components_type)
2792 CALL field_interpolated_point_metrics_calculate(coordinate_jacobian_area_type, &
2793 & interpolatedpointmetrics(field_u_variable_type)%ptr,err,error,*999)
2796 phim=quadraturescheme%GAUSS_BASIS_FNS(ms,no_part_deriv,gaussidx)
2797 phio=quadraturescheme%GAUSS_BASIS_FNS(os,no_part_deriv,gaussidx)
2800 integratedvalue=integratedvalue+phim*phio* &
2801 & quadraturescheme%GAUSS_WEIGHTS(gaussidx)* &
2802 & interpolatedpointmetrics(field_u_variable_type)%ptr%jacobian
2806 IF(rhsvariable%FIELD%SCALINGS%SCALING_TYPE/=field_no_scaling)
THEN 2807 integratedvalue=integratedvalue* &
2808 & scalingparameters(field_u_variable_type)%ptr%SCALE_FACTORS(ms,componentnumber)* &
2809 & scalingparameters(field_u_variable_type)%ptr%SCALE_FACTORS(os,componentnumber)
2813 CALL distributed_matrix_values_add(neumannconditions%integrationMatrix,localdof,neumanndofidx, &
2814 & integratedvalue,err,error,*999)
2819 CALL flagerror(
"The dimension is invalid for point Neumann conditions",err,error,*999)
2821 CASE(field_element_based_interpolation)
2822 CALL flagerror(
"Not implemented.",err,error,*999)
2823 CASE(field_constant_interpolation)
2824 CALL flagerror(
"Not implemented.",err,error,*999)
2825 CASE(field_grid_point_based_interpolation)
2826 CALL flagerror(
"Not implemented.",err,error,*999)
2827 CASE(field_gauss_point_based_interpolation)
2828 CALL flagerror(
"Not implemented.",err,error,*999)
2830 CALL flagerror(
"The interpolation type of "// &
2831 & trim(number_to_vstring(rhsvariable%COMPONENTS(componentnumber) &
2832 & %INTERPOLATION_TYPE,
"*",err,error))//
" is invalid for component number "// &
2833 & trim(number_to_vstring(componentnumber,
"*",err,error))//
".", &
2839 CALL distributed_matrix_update_start(neumannconditions%integrationMatrix,err,error,*999)
2840 CALL distributed_matrix_update_finish(neumannconditions%integrationMatrix,err,error,*999)
2842 CALL field_parameter_set_vector_get(rhsvariable%field,rhsvariable%variable_type,field_integrated_neumann_set_type, &
2843 & integratedvalues,err,error,*999)
2844 CALL distributed_vector_all_values_set(integratedvalues,0.0_dp,err,error,*999)
2846 CALL distributed_matrix_by_vector_add(distributed_matrix_vector_no_ghosts_type,1.0_dp, &
2847 & neumannconditions%integrationMatrix,neumannconditions%pointValues,integratedvalues, &
2850 CALL field_parameter_set_update_start(rhsvariable%FIELD,rhsvariable%VARIABLE_TYPE,field_integrated_neumann_set_type, &
2852 IF(diagnostics1)
THEN 2853 IF(dependentgeometry)
THEN 2854 CALL write_string(diagnostic_output_type,
" Using dependent field geometry",err,error,*999)
2856 CALL write_string(diagnostic_output_type,
" Using undeformed geometry",err,error,*999)
2858 CALL write_string_vector(diagnostic_output_type,1,1,numberofneumann,6,6,neumannconditions%setDofs, &
2859 &
'(" setDofs:",6(X,I8))',
'(10X,6(X,I8))',err,error,*999)
2860 CALL write_string(diagnostic_output_type,
" Neumann point values",err,error,*999)
2861 CALL distributed_vector_output(diagnostic_output_type,neumannconditions%pointValues,err,error,*999)
2862 CALL write_string(diagnostic_output_type,
" Neumann integration matrix",err,error,*999)
2863 CALL distributed_matrix_output(diagnostic_output_type,neumannconditions%integrationMatrix,err,error,*999)
2864 CALL write_string(diagnostic_output_type,
" Integrated values",err,error,*999)
2865 CALL distributed_vector_output(diagnostic_output_type,integratedvalues,err,error,*999)
2867 CALL field_parameter_set_update_finish(rhsvariable%FIELD,rhsvariable%VARIABLE_TYPE,field_integrated_neumann_set_type, &
2872 exits(
"BoundaryConditions_NeumannIntegrate")
2874 999 errorsexits(
"BoundaryConditions_NeumannIntegrate",err,error)
2886 INTEGER(INTG),
INTENT(IN) :: sparsityType
2887 INTEGER(INTG),
INTENT(OUT) :: err
2888 TYPE(varying_string),
INTENT(OUT) :: error
2890 TYPE(boundary_conditions_type),
POINTER :: boundaryConditions
2892 enters(
"BoundaryConditions_NeumannSparsityTypeSet",err,error,*999)
2894 IF(
ASSOCIATED(boundaryconditions))
THEN 2895 SELECT CASE(sparsitytype)
2901 CALL flagerror(
"The specified Neumann integration matrix sparsity type of "// &
2902 & trim(number_to_vstring(sparsitytype,
"*",err,error))//
" is invalid.",err,error,*999)
2905 CALL flagerror(
"Boundary conditions are not associated.",err,error,*999)
2908 exits(
"BoundaryConditions_NeumannSparsityTypeSet")
2910 999 errorsexits(
"BoundaryConditions_NeumannSparsityTypeSet",err,error)
2921 & user_node_number,component_number,condition,
VALUE,err,error,*)
2924 TYPE(boundary_conditions_type),
POINTER :: BOUNDARY_CONDITIONS
2925 TYPE(field_type),
POINTER :: FIELD
2926 INTEGER(INTG),
INTENT(IN) :: VARIABLE_TYPE
2927 INTEGER(INTG),
INTENT(IN) :: VERSION_NUMBER
2928 INTEGER(INTG),
INTENT(IN) :: DERIVATIVE_NUMBER
2929 INTEGER(INTG),
INTENT(IN) :: USER_NODE_NUMBER
2930 INTEGER(INTG),
INTENT(IN) :: COMPONENT_NUMBER
2931 INTEGER(INTG),
INTENT(IN) :: CONDITION
2932 REAL(DP),
INTENT(IN) ::
VALUE 2933 INTEGER(INTG),
INTENT(OUT) :: ERR
2934 TYPE(varying_string),
INTENT(OUT) :: ERROR
2936 INTEGER(INTG) :: local_ny,global_ny
2937 TYPE(boundary_conditions_variable_type),
POINTER :: BOUNDARY_CONDITIONS_VARIABLE
2938 TYPE(field_variable_type),
POINTER :: FIELD_VARIABLE
2939 TYPE(varying_string) :: LOCAL_ERROR
2941 enters(
"BOUNDARY_CONDITIONS_SET_NODE",err,error,*999)
2943 NULLIFY(boundary_conditions_variable)
2944 NULLIFY(field_variable)
2946 IF(
ASSOCIATED(boundary_conditions))
THEN 2947 IF(boundary_conditions%BOUNDARY_CONDITIONS_FINISHED)
THEN 2948 CALL flagerror(
"Boundary conditions have been finished.",err,error,*999)
2950 IF(
ASSOCIATED(field))
THEN 2951 CALL field_component_dof_get_user_node(field,variable_type,version_number,derivative_number, &
2952 & user_node_number,component_number,local_ny,global_ny,err,error,*999)
2953 CALL field_variable_get(field,variable_type,field_variable,err,error,*999)
2954 IF(
ASSOCIATED(field_variable))
THEN 2957 IF(
ASSOCIATED(boundary_conditions_variable))
THEN 2960 & local_ny,condition,
VALUE,err,error,*999)
2962 local_error=
"The boundary conditions for variable type "//trim(number_to_vstring(variable_type,
"*",err,error))// &
2963 &
" has not been created." 2964 CALL flagerror(local_error,err,error,*999)
2967 CALL flagerror(
"The dependent field variable is not associated",err,error,*999)
2970 CALL flagerror(
"The dependent field is not associated",err,error,*999)
2974 CALL flagerror(
"Boundary conditions is not associated.",err,error,*999)
2977 exits(
"BOUNDARY_CONDITIONS_SET_NODE")
2979 999 errorsexits(
"BOUNDARY_CONDITIONS_SET_NODE",err,error)
2991 TYPE(boundary_conditions_type),
POINTER,
INTENT(IN) :: boundaryConditions
2992 TYPE(field_variable_type),
POINTER,
INTENT(IN) :: fieldVariable
2993 INTEGER(INTG),
INTENT(IN) :: globalDofs(:)
2994 REAL(DP),
INTENT(IN) :: coefficient
2995 INTEGER(INTG),
INTENT(OUT) :: err
2996 TYPE(varying_string),
INTENT(OUT) :: error
2998 INTEGER(INTG) :: numberOfDofs,dofIdx,dofIdx2
3000 enters(
"BoundaryConditions_ConstrainDofsEqual",err,error,*999)
3002 numberofdofs=
SIZE(globaldofs,1)
3003 IF(numberofdofs<2)
THEN 3004 CALL flagerror(
"Cannot constrain zero or 1 DOF to be equal.",err,error,*999)
3008 DO dofidx=1,numberofdofs
3009 DO dofidx2=dofidx+1,numberofdofs
3010 IF(globaldofs(dofidx)==globaldofs(dofidx2))
THEN 3011 CALL flagerror(
"DOF number "//trim(numbertovstring(globaldofs(dofidx),
"*",err,error))// &
3012 &
" is duplicated in the DOFs constrained to be equal.",err,error,*999)
3020 DO dofidx=2,numberofdofs
3022 & boundaryconditions,fieldvariable,globaldofs(dofidx),[globaldofs(1)],[coefficient],err,error,*999)
3025 exits(
"BoundaryConditions_ConstrainDofsEqual")
3027 999 errorsexits(
"BoundaryConditions_ConstrainDofsEqual",err,error)
3037 & boundaryconditions,field,fieldvariabletype,versionnumber,derivativenumber,component,nodes,coefficient,err,error,*)
3040 TYPE(boundary_conditions_type),
POINTER,
INTENT(IN) :: boundaryConditions
3041 TYPE(field_type),
POINTER,
INTENT(IN) :: field
3042 INTEGER(INTG),
INTENT(IN) :: fieldVariableType
3043 INTEGER(INTG),
INTENT(IN) :: versionNumber
3044 INTEGER(INTG),
INTENT(IN) :: derivativeNumber
3045 INTEGER(INTG),
INTENT(IN) :: component
3046 INTEGER(INTG),
INTENT(IN) :: nodes(:)
3047 REAL(DP),
INTENT(IN) :: coefficient
3048 INTEGER(INTG),
INTENT(OUT) :: err
3049 TYPE(varying_string),
INTENT(OUT) :: error
3051 TYPE(field_variable_type),
POINTER :: fieldVariable
3052 INTEGER(INTG) :: numberOfNodes, nodeIdx, dof
3053 INTEGER(INTG),
ALLOCATABLE :: globalDofs(:)
3055 enters(
"BoundaryConditions_ConstrainNodeDofsEqual",err,error,*998)
3057 NULLIFY(fieldvariable)
3059 IF(.NOT.
ASSOCIATED(boundaryconditions))
THEN 3060 CALL flagerror(
"Boundary conditions are not associated.",err,error,*998)
3063 numberofnodes=
SIZE(nodes,1)
3064 ALLOCATE(globaldofs(numberofnodes),stat=err)
3065 IF(err/=0)
CALL flagerror(
"Could not allocate equal global DOFs array.",err,error,*998)
3067 DO nodeidx=1,numberofnodes
3068 CALL field_component_dof_get_user_node(field,fieldvariabletype,versionnumber,derivativenumber,nodes(nodeidx), &
3069 & component,dof,globaldofs(nodeidx),err,error,*999)
3072 CALL field_variable_get(field,fieldvariabletype,fieldvariable,err,error,*999)
3077 DEALLOCATE(globaldofs)
3079 exits(
"BoundaryConditions_ConstrainNodeDofsEqual")
3081 999
IF(
ALLOCATED(globaldofs))
DEALLOCATE(globaldofs)
3082 998 errorsexits(
"BoundaryConditions_ConstrainNodeDofsEqual",err,error)
3094 TYPE(boundary_conditions_type),
POINTER,
INTENT(IN) :: boundaryConditions
3095 TYPE(field_variable_type),
POINTER,
INTENT(IN) :: fieldVariable
3096 INTEGER(INTG),
INTENT(IN) :: globalDof
3097 INTEGER(INTG),
INTENT(IN) :: dofs(:)
3098 REAL(DP),
INTENT(IN) :: coefficients(:)
3099 INTEGER(INTG),
INTENT(OUT) :: err
3100 TYPE(varying_string),
INTENT(OUT) :: error
3102 INTEGER(INTG) :: numberOfDofs,dofIdx,dofIdx2
3103 TYPE(boundaryconditionsdofconstraintptrtype),
ALLOCATABLE :: newConstraints(:)
3104 TYPE(boundary_conditions_variable_type),
POINTER :: boundaryConditionsVariable
3105 TYPE(boundaryconditionsdofconstraintstype),
POINTER :: dofConstraints
3106 TYPE(boundaryconditionsdofconstrainttype),
POINTER :: dofConstraint
3108 NULLIFY(dofconstraint)
3109 NULLIFY(dofconstraints)
3111 enters(
"BoundaryConditions_DofConstraintSet",err,error,*998)
3114 IF(.NOT.
ASSOCIATED(boundaryconditions))
THEN 3115 CALL flagerror(
"Boundary conditions are not associated.",err,error,*998)
3117 IF(boundaryconditions%boundary_conditions_finished)
THEN 3118 CALL flagerror(
"The boundary conditions have already been finished.",err,error,*998)
3120 IF(.NOT.
ASSOCIATED(fieldvariable))
THEN 3121 CALL flagerror(
"Field variable is not associated.",err,error,*998)
3124 IF(.NOT.
ASSOCIATED(boundaryconditionsvariable))
THEN 3125 CALL flagerror(
"Boundary conditions variable is not associated.",err,error,*998)
3127 dofconstraints=>boundaryconditionsvariable%dofConstraints
3128 IF(.NOT.
ASSOCIATED(dofconstraints))
THEN 3129 CALL flagerror(
"Boundary conditions DOF constraints are not associated.",err,error,*998)
3132 numberofdofs=
SIZE(dofs,1)
3133 IF(numberofdofs==0)
THEN 3134 CALL flagerror(
"Empty DOFs list.",err,error,*998)
3135 ELSE IF(numberofdofs/=
SIZE(coefficients,1))
THEN 3136 CALL flagerror(
"Length of coefficients does not match length of DOFs array.",err,error,*998)
3137 ELSE IF(numberofdofs>1)
THEN 3138 CALL flagerror(
"Support for constraining an equations DOF to be depended on multiple "// &
3139 &
"other DOFs is not yet implemented.",err,error,*998)
3143 DO dofidx=1,numberofdofs
3144 DO dofidx2=dofidx+1,numberofdofs
3145 IF(dofs(dofidx)==dofs(dofidx2))
THEN 3146 CALL flagerror(
"DOF number "//trim(numbertovstring(dofs(dofidx),
"*",err,error))// &
3147 &
" is duplicated in the DOF constraint.",err,error,*998)
3153 DO dofidx=1,numberofdofs
3155 CALL flagerror(
"DOF number "//trim(numbertovstring(dofs(dofidx),
"*",err,error))// &
3156 &
" is not free in the boundary conditions.",err,error,*998)
3161 ALLOCATE(newconstraints(dofconstraints%numberOfConstraints+1),stat=err)
3162 IF(err/=0)
CALL flagerror(
"Could not allocate new DOF constraints array.",err,error,*998)
3163 IF(dofconstraints%numberOfConstraints>0)
THEN 3164 newconstraints(1:dofconstraints%numberOfConstraints)= &
3165 & dofconstraints%constraints(1:dofconstraints%numberOfConstraints)
3169 ALLOCATE(dofconstraint,stat=err)
3170 IF(err/=0)
CALL flagerror(
"Could not allocate new DOF constraint.",err,error,*999)
3171 ALLOCATE(dofconstraint%dofs(numberofdofs),stat=err)
3172 IF(err/=0)
CALL flagerror(
"Could not allocate constraint DOFs array.",err,error,*999)
3173 ALLOCATE(dofconstraint%coefficients(numberofdofs),stat=err)
3174 IF(err/=0)
CALL flagerror(
"Could not allocate constraint coefficients array.",err,error,*999)
3175 dofconstraint%globalDof=globaldof
3176 dofconstraint%numberOfDofs=numberofdofs
3177 dofconstraint%dofs(1:numberofdofs)=dofs(1:numberofdofs)
3178 dofconstraint%coefficients(1:numberofdofs)=coefficients(1:numberofdofs)
3181 newconstraints(dofconstraints%numberOfConstraints+1)%ptr=>dofconstraint
3183 CALL move_alloc(newconstraints,dofconstraints%constraints)
3184 dofconstraints%numberOfConstraints=dofconstraints%numberOfConstraints+1
3190 exits(
"BoundaryConditions_DofConstraintSet")
3192 999
IF(
ASSOCIATED(dofconstraint))
THEN 3193 IF(
ALLOCATED(dofconstraint%dofs))
DEALLOCATE(dofconstraint%dofs)
3194 IF(
ALLOCATED(dofconstraint%coefficients))
DEALLOCATE(dofconstraint%coefficients)
3195 DEALLOCATE(dofconstraint)
3197 IF(
ALLOCATED(newconstraints))
DEALLOCATE(newconstraints)
3198 998 errorsexits(
"BoundaryConditions_DofConstraintSet",err,error)
3210 TYPE(boundary_conditions_variable_type),
POINTER :: boundaryConditionsVariable
3211 INTEGER(INTG),
INTENT(OUT) :: err
3212 TYPE(varying_string),
INTENT(OUT) :: error
3214 INTEGER(INTG) :: constraintIdx,dofIdx,thisDofDomain,otherDofDomain
3215 INTEGER(INTG) :: globalDof,globalDof2,localDof,localDof2
3216 INTEGER(INTG) :: numberOfCoupledDofs
3217 INTEGER(INTG),
ALLOCATABLE :: newCoupledGlobalDofs(:),newCoupledLocalDofs(:)
3218 REAL(DP),
ALLOCATABLE :: newCoefficients(:)
3219 TYPE(boundaryconditionsdofconstraintstype),
POINTER :: dofConstraints
3220 TYPE(boundaryconditionsdofconstrainttype),
POINTER :: dofConstraint
3221 TYPE(boundaryconditionscoupleddofstype),
POINTER :: dofCoupling
3222 TYPE(domain_mapping_type),
POINTER :: variableDomainMapping
3223 TYPE(field_variable_type),
POINTER :: fieldVariable
3225 enters(
"BoundaryConditions_DofConstraintsCreateFinish",err,error,*998)
3227 NULLIFY(dofcoupling)
3235 IF(
ASSOCIATED(boundaryconditionsvariable))
THEN 3236 fieldvariable=>boundaryconditionsvariable%variable
3237 IF(
ASSOCIATED(fieldvariable))
THEN 3238 IF(
ASSOCIATED(boundaryconditionsvariable%dofConstraints))
THEN 3239 dofconstraints=>boundaryconditionsvariable%dofConstraints
3241 CALL flagerror(
"Boundary conditions DOF constraints are not associated.",err,error,*998)
3244 variabledomainmapping=>fieldvariable%domain_mapping
3245 IF(.NOT.
ASSOCIATED(variabledomainmapping))
THEN 3246 CALL flagerror(
"Field variable domain mapping is not associated for variable type "// &
3247 & trim(numbertovstring(fieldvariable%variable_type,
"*",err,error))//
".",err,error,*998)
3251 IF(dofconstraints%numberOfConstraints>0)
THEN 3252 ALLOCATE(dofconstraints%dofCouplings(fieldvariable%number_of_global_dofs),stat=err)
3253 IF(err/=0)
CALL flagerror( &
3254 &
"Could not allocate dof constraints dof couplings array.",err,error,*998)
3255 dofconstraints%numberOfDofs=fieldvariable%number_of_global_dofs
3256 DO dofidx=1,fieldvariable%number_of_global_dofs
3257 NULLIFY(dofconstraints%dofCouplings(dofidx)%ptr)
3262 DO constraintidx=1,dofconstraints%numberOfConstraints
3263 dofconstraint=>dofconstraints%constraints(constraintidx)%ptr
3264 IF(.NOT.
ASSOCIATED(dofconstraint))
THEN 3265 CALL flagerror(
"DOF constraint number "// &
3266 & trim(numbertovstring(constraintidx,
"*",err,error))// &
3267 &
" is not associated.",err,error,*999)
3270 globaldof=dofconstraint%globalDof
3271 localdof=variabledomainmapping%global_to_local_map(globaldof)%local_number(1)
3272 thisdofdomain=variabledomainmapping%global_to_local_map(globaldof)%domain_number(1)
3278 CALL flagerror(
"Global DOF number "//trim(numbertovstring(globaldof,
"*",err,error))// &
3279 &
" is part of a linear constraint but the DOF type has been changed"// &
3280 &
" by applying a boundary condition.",err,error,*999)
3283 DO dofidx=1,dofconstraint%numberOfDofs
3284 globaldof2=dofconstraint%dofs(dofidx)
3285 localdof2=variabledomainmapping%global_to_local_map(globaldof2)%local_number(1)
3288 CALL flagerror(
"A Dirichlet boundary condition has been set on DOF number "// &
3289 & trim(numbertovstring(globaldof2,
"*",err,error))// &
3290 &
" which is part of a linear constraint.",err,error,*999)
3295 IF(variabledomainmapping%number_of_domains>1)
THEN 3296 otherdofdomain=variabledomainmapping%global_to_local_map(globaldof2)%domain_number(1)
3297 IF(thisdofdomain/=otherdofdomain)
THEN 3298 CALL flagerror(
"An equal DOF constraint is split over multiple domains, "// &
3299 &
"support for this has not yet been implemented.",err,error,*999)
3306 IF(
ASSOCIATED(dofconstraints%dofCouplings(globaldof2)%ptr))
THEN 3307 numberofcoupleddofs=dofconstraints%dofCouplings(globaldof2)%ptr%numberOfDofs
3308 ALLOCATE(newcoupledglobaldofs(numberofcoupleddofs+1),stat=err)
3309 IF(err/=0)
CALL flagerror(
"Could not allocate new DOF coupling global DOFs.",err,error,*999)
3310 ALLOCATE(newcoupledlocaldofs(numberofcoupleddofs+1),stat=err)
3311 IF(err/=0)
CALL flagerror(
"Could not allocate new DOF coupling local DOFs.",err,error,*999)
3312 ALLOCATE(newcoefficients(numberofcoupleddofs+1),stat=err)
3313 IF(err/=0)
CALL flagerror(
"Could not allocate new DOF coupling values.",err,error,*999)
3314 newcoupledglobaldofs(1:numberofcoupleddofs)=dofcoupling%globalDofs(1:numberofcoupleddofs)
3315 newcoupledlocaldofs(1:numberofcoupleddofs)=dofcoupling%localDofs(1:numberofcoupleddofs)
3316 newcoefficients(1:numberofcoupleddofs)=dofcoupling%coefficients(1:numberofcoupleddofs)
3319 ALLOCATE(dofconstraints%dofCouplings(globaldof2)%ptr,stat=err)
3320 IF(err/=0)
CALL flagerror(
"Could not allocate new DOF coupling type.",err,error,*999)
3321 ALLOCATE(newcoupledglobaldofs(2),stat=err)
3322 IF(err/=0)
CALL flagerror(
"Could not allocate new DOF coupling global DOFs.",err,error,*999)
3323 ALLOCATE(newcoupledlocaldofs(2),stat=err)
3324 IF(err/=0)
CALL flagerror(
"Could not allocate new DOF coupling local DOFs.",err,error,*999)
3325 ALLOCATE(newcoefficients(2),stat=err)
3326 IF(err/=0)
CALL flagerror(
"Could not allocate new DOF coupling values.",err,error,*999)
3327 newcoupledglobaldofs(1)=globaldof2
3328 newcoupledlocaldofs(1)=localdof2
3329 newcoefficients(1)=1.0_dp
3330 numberofcoupleddofs=1
3332 dofcoupling=>dofconstraints%dofCouplings(globaldof2)%ptr
3333 newcoupledglobaldofs(numberofcoupleddofs+1)=globaldof
3334 newcoupledlocaldofs(numberofcoupleddofs+1)=localdof
3335 newcoefficients(numberofcoupleddofs+1)=dofconstraint%coefficients(dofidx)
3336 CALL move_alloc(newcoupledglobaldofs,dofcoupling%globalDofs)
3337 CALL move_alloc(newcoupledlocaldofs,dofcoupling%localDofs)
3338 CALL move_alloc(newcoefficients,dofcoupling%coefficients)
3339 dofcoupling%numberOfDofs=numberofcoupleddofs+1
3343 CALL flagerror(
"Field variable is not associated for this boundary conditions variable",err,error,*999)
3346 CALL flagerror(
"Boundary conditions variable is not associated.",err,error,*999)
3349 exits(
"BoundaryConditions_DofConstraintsCreateFinish")
3351 999
IF(
ALLOCATED(newcoupledglobaldofs))
DEALLOCATE(newcoupledglobaldofs)
3352 IF(
ALLOCATED(newcoupledlocaldofs))
DEALLOCATE(newcoupledlocaldofs)
3353 IF(
ALLOCATED(newcoefficients))
DEALLOCATE(newcoefficients)
3355 998 errors(
"BoundaryConditions_DofConstraintsCreateFinish",err,error)
3356 exits(
"BoundaryConditions_DofConstraintsCreateFinish")
3369 TYPE(boundaryconditionsdofconstraintstype),
POINTER :: dofConstraints
3370 INTEGER(INTG),
INTENT(OUT) :: err
3371 TYPE(varying_string),
INTENT(OUT) :: error
3373 INTEGER(INTG) :: constraintIdx,dofIdx
3375 enters(
"BoundaryConditions_DofConstraintsFinalise",err,error,*999)
3377 IF(
ASSOCIATED(dofconstraints))
THEN 3378 IF(
ALLOCATED(dofconstraints%constraints))
THEN 3379 DO constraintidx=1,dofconstraints%numberOfConstraints
3380 IF(
ASSOCIATED(dofconstraints%constraints(constraintidx)%ptr))
THEN 3381 IF(
ALLOCATED(dofconstraints%constraints(constraintidx)%ptr%dofs))
THEN 3382 DEALLOCATE(dofconstraints%constraints(constraintidx)%ptr%dofs)
3384 IF(
ALLOCATED(dofconstraints%constraints(constraintidx)%ptr%coefficients))
THEN 3385 DEALLOCATE(dofconstraints%constraints(constraintidx)%ptr%coefficients)
3387 DEALLOCATE(dofconstraints%constraints(constraintidx)%ptr)
3390 DEALLOCATE(dofconstraints%constraints)
3392 IF(
ALLOCATED(dofconstraints%dofCouplings))
THEN 3393 DO dofidx=1,dofconstraints%numberOfDofs
3394 IF(
ASSOCIATED(dofconstraints%dofCouplings(dofidx)%ptr))
THEN 3395 IF(
ALLOCATED(dofconstraints%dofCouplings(dofidx)%ptr%globalDofs))
THEN 3396 DEALLOCATE(dofconstraints%dofCouplings(dofidx)%ptr%globalDofs)
3398 IF(
ALLOCATED(dofconstraints%dofCouplings(dofidx)%ptr%localDofs))
THEN 3399 DEALLOCATE(dofconstraints%dofCouplings(dofidx)%ptr%localDofs)
3401 IF(
ALLOCATED(dofconstraints%dofCouplings(dofidx)%ptr%coefficients))
THEN 3402 DEALLOCATE(dofconstraints%dofCouplings(dofidx)%ptr%coefficients)
3406 DEALLOCATE(dofconstraints%dofCouplings)
3409 CALL flagerror(
"dofConstraints pointer is not associated.",err,error,*999)
3412 exits(
"BoundaryConditions_DofConstraintsFinalise")
3414 999 errorsexits(
"BoundaryConditions_DofConstraintsFinalise",err,error)
3427 TYPE(boundaryconditionsdofconstraintstype),
POINTER :: dofConstraints
3428 INTEGER(INTG),
INTENT(OUT) :: err
3429 TYPE(varying_string),
INTENT(OUT) :: error
3431 enters(
"BoundaryConditions_DofConstraintsInitialise",err,error,*999)
3433 IF(
ASSOCIATED(dofconstraints))
THEN 3434 dofconstraints%numberOfConstraints=0
3435 dofconstraints%numberOfDofs=0
3437 CALL flagerror(
"dofConstraints pointer is not associated.",err,error,*999)
3440 exits(
"BoundaryConditions_DofConstraintsInitialise")
3442 999 errorsexits(
"BoundaryConditions_DofConstraintsInitialise",err,error)
3455 TYPE(boundary_conditions_variable_type),
POINTER :: BOUNDARY_CONDITIONS_VARIABLE
3456 INTEGER(INTG),
INTENT(OUT) :: ERR
3457 TYPE(varying_string),
INTENT(OUT) :: ERROR
3459 TYPE(boundary_conditions_dirichlet_type),
POINTER :: BOUNDARY_CONDITIONS_DIRICHLET
3461 enters(
"BOUNDARY_CONDITIONS_VARIABLE_FINALISE",err,error,*999)
3463 IF(
ASSOCIATED(boundary_conditions_variable))
THEN 3464 IF(
ALLOCATED(boundary_conditions_variable%CONDITION_TYPES)) &
3465 &
DEALLOCATE(boundary_conditions_variable%CONDITION_TYPES)
3466 IF(
ALLOCATED(boundary_conditions_variable%DOF_TYPES)) &
3467 &
DEALLOCATE(boundary_conditions_variable%DOF_TYPES)
3468 IF(
ASSOCIATED(boundary_conditions_variable%DIRICHLET_BOUNDARY_CONDITIONS))
THEN 3469 boundary_conditions_dirichlet=>boundary_conditions_variable%DIRICHLET_BOUNDARY_CONDITIONS
3471 & linear_sparsity_indices,err,error,*999)
3473 & dynamic_sparsity_indices,err,error,*999)
3474 IF(
ALLOCATED(boundary_conditions_dirichlet%DIRICHLET_DOF_INDICES))
THEN 3475 DEALLOCATE(boundary_conditions_dirichlet%DIRICHLET_DOF_INDICES)
3477 DEALLOCATE(boundary_conditions_dirichlet)
3480 IF(
ASSOCIATED(boundary_conditions_variable%PRESSURE_INCREMENTED_BOUNDARY_CONDITIONS)) &
3481 &
DEALLOCATE(boundary_conditions_variable%PRESSURE_INCREMENTED_BOUNDARY_CONDITIONS)
3482 IF(
ASSOCIATED(boundary_conditions_variable%dofConstraints))
THEN 3484 DEALLOCATE(boundary_conditions_variable%dofConstraints)
3486 DEALLOCATE(boundary_conditions_variable)
3489 exits(
"BOUNDARY_CONDITIONS_VARIABLE_FINALISE")
3491 999 errorsexits(
"BOUNDARY_CONDITIONS_VARIABLE_FINALISE",err,error)
3503 TYPE(boundary_conditions_sparsity_indices_ptr_type),
ALLOCATABLE :: SPARSITY_INDICES_ARRAY(:,:)
3504 INTEGER(INTG),
INTENT(OUT) :: ERR
3505 TYPE(varying_string),
INTENT(OUT) :: ERROR
3507 INTEGER(INTG) :: equ_set_idx, equ_matrix_idx
3508 TYPE(boundary_conditions_sparsity_indices_type),
POINTER :: SPARSITY_INDICES
3510 enters(
"BoundaryConditions_SparsityIndicesArrayFinalise",err,error,*999)
3512 IF (
ALLOCATED(sparsity_indices_array))
THEN 3513 DO equ_set_idx=1,
SIZE(sparsity_indices_array,1)
3514 DO equ_matrix_idx=1,
SIZE(sparsity_indices_array,2)
3515 sparsity_indices=>sparsity_indices_array(equ_set_idx,equ_matrix_idx)%PTR
3516 IF(
ASSOCIATED(sparsity_indices))
THEN 3517 IF(
ALLOCATED(sparsity_indices%SPARSE_ROW_INDICES))
THEN 3518 DEALLOCATE(sparsity_indices%SPARSE_ROW_INDICES)
3520 IF(
ALLOCATED(sparsity_indices%SPARSE_COLUMN_INDICES))
THEN 3521 DEALLOCATE(sparsity_indices%SPARSE_COLUMN_INDICES)
3523 DEALLOCATE(sparsity_indices)
3527 DEALLOCATE(sparsity_indices_array)
3530 exits(
"BoundaryConditions_SparsityIndicesArrayFinalise")
3532 999 errors(
"BoundaryConditions_SparsityIndicesArrayFinalise",err,error)
3533 exits(
"BoundaryConditions_SparsityIndicesArrayFinalise")
3546 TYPE(boundary_conditions_type),
POINTER :: BOUNDARY_CONDITIONS
3547 TYPE(field_variable_type),
POINTER :: FIELD_VARIABLE
3548 INTEGER(INTG),
INTENT(OUT) :: ERR
3549 TYPE(varying_string),
INTENT(OUT) :: ERROR
3551 INTEGER(INTG) :: DUMMY_ERR,variable_idx
3552 TYPE(domain_mapping_type),
POINTER :: VARIABLE_DOMAIN_MAPPING
3553 TYPE(varying_string) :: DUMMY_ERROR
3554 TYPE(boundary_conditions_variable_ptr_type),
ALLOCATABLE :: NEW_BOUNDARY_CONDITIONS_VARIABLES(:)
3555 TYPE(boundary_conditions_variable_type),
POINTER :: BOUNDARY_CONDITIONS_VARIABLE
3557 enters(
"BOUNDARY_CONDITIONS_VARIABLE_INITIALISE",err,error,*998)
3559 IF(
ASSOCIATED(boundary_conditions))
THEN 3560 IF(
ASSOCIATED(field_variable))
THEN 3561 variable_domain_mapping=>field_variable%DOMAIN_MAPPING
3562 IF(
ASSOCIATED(variable_domain_mapping))
THEN 3563 NULLIFY(boundary_conditions_variable)
3567 IF(.NOT.
ASSOCIATED(boundary_conditions_variable))
THEN 3568 ALLOCATE(new_boundary_conditions_variables(boundary_conditions%NUMBER_OF_BOUNDARY_CONDITIONS_VARIABLES+1),stat=err)
3569 IF(err/=0)
CALL flagerror(
"Could not allocate new boundary conditions variables array.",err,error,*998)
3570 IF(
ALLOCATED(boundary_conditions%BOUNDARY_CONDITIONS_VARIABLES))
THEN 3571 DO variable_idx=1,boundary_conditions%NUMBER_OF_BOUNDARY_CONDITIONS_VARIABLES
3572 new_boundary_conditions_variables(variable_idx)%PTR=> &
3573 & boundary_conditions%BOUNDARY_CONDITIONS_VARIABLES(variable_idx)%PTR
3577 ALLOCATE(new_boundary_conditions_variables(boundary_conditions%NUMBER_OF_BOUNDARY_CONDITIONS_VARIABLES+1)%PTR,stat=err)
3578 IF(err/=0)
CALL flagerror(
"Could not allocate boundary condition variable.",err,error,*998)
3579 boundary_conditions_variable=>new_boundary_conditions_variables( &
3580 & boundary_conditions%NUMBER_OF_BOUNDARY_CONDITIONS_VARIABLES+1)%PTR
3581 boundary_conditions_variable%BOUNDARY_CONDITIONS=>boundary_conditions
3582 boundary_conditions_variable%VARIABLE_TYPE=field_variable%VARIABLE_TYPE
3583 boundary_conditions_variable%VARIABLE=>field_variable
3584 ALLOCATE(boundary_conditions_variable%CONDITION_TYPES(variable_domain_mapping%NUMBER_OF_GLOBAL),stat=err)
3585 IF(err/=0)
CALL flagerror(
"Could not allocate global boundary condition types.",err,error,*999)
3586 ALLOCATE(boundary_conditions_variable%DOF_TYPES(variable_domain_mapping%NUMBER_OF_GLOBAL),stat=err)
3587 IF(err/=0)
CALL flagerror(
"Could not allocate global boundary condition dof types.",err,error,*999)
3591 IF(err/=0)
CALL flagerror(
"Could not allocate boundary condition DOF counts array.",err,error,*999)
3592 boundary_conditions_variable%DOF_COUNTS=0
3593 NULLIFY(boundary_conditions_variable%DIRICHLET_BOUNDARY_CONDITIONS)
3594 boundary_conditions_variable%NUMBER_OF_DIRICHLET_CONDITIONS=0
3595 NULLIFY(boundary_conditions_variable%neumannBoundaryConditions)
3596 NULLIFY(boundary_conditions_variable%PRESSURE_INCREMENTED_BOUNDARY_CONDITIONS)
3597 ALLOCATE(boundary_conditions_variable%parameterSetRequired(field_number_of_set_types),stat=err)
3598 IF(err/=0)
CALL flagerror(
"Could not allocate boundary condition parameter set required array.",err,error,*999)
3599 boundary_conditions_variable%parameterSetRequired=.false.
3600 boundary_conditions_variable%parameterSetRequired(field_values_set_type)=.true.
3602 CALL move_alloc(new_boundary_conditions_variables,boundary_conditions%BOUNDARY_CONDITIONS_VARIABLES)
3603 boundary_conditions%NUMBER_OF_BOUNDARY_CONDITIONS_VARIABLES= &
3604 & boundary_conditions%NUMBER_OF_BOUNDARY_CONDITIONS_VARIABLES+1
3606 ALLOCATE(boundary_conditions_variable%DofConstraints,stat=err)
3607 IF(err/=0)
CALL flagerror(
"Could not allocate boundary conditions dof constraints.",err,error,*999)
3612 CALL flagerror(
"Field variable domain mapping is not associated.",err,error,*998)
3615 CALL flagerror(
"Field variable is not associated.",err,error,*998)
3618 CALL flagerror(
"Boundary conditions is not associated.",err,error,*998)
3621 exits(
"BOUNDARY_CONDITIONS_VARIABLE_INITIALISE")
3624 DEALLOCATE(new_boundary_conditions_variables)
3625 998 errorsexits(
"BOUNDARY_CONDITIONS_VARIABLE_INITIALISE",err,error)
3637 TYPE(boundary_conditions_type),
POINTER :: BOUNDARY_CONDITIONS
3638 TYPE(field_variable_type),
POINTER :: FIELD_VARIABLE
3639 TYPE(boundary_conditions_variable_type),
POINTER,
INTENT(OUT) :: BOUNDARY_CONDITIONS_VARIABLE
3640 INTEGER(INTG),
INTENT(OUT) :: ERR
3641 TYPE(varying_string),
INTENT(OUT) :: ERROR
3643 INTEGER(INTG) :: variable_idx
3644 TYPE(field_variable_type),
POINTER :: VARIABLE
3645 LOGICAL :: VARIABLE_FOUND
3647 enters(
"BOUNDARY_CONDITIONS_VARIABLE_GET",err,error,*999)
3649 NULLIFY(boundary_conditions_variable)
3651 IF(
ASSOCIATED(boundary_conditions))
THEN 3652 IF(
ASSOCIATED(field_variable))
THEN 3653 IF(
ALLOCATED(boundary_conditions%BOUNDARY_CONDITIONS_VARIABLES))
THEN 3654 variable_found=.false.
3656 DO WHILE(variable_idx<=boundary_conditions%NUMBER_OF_BOUNDARY_CONDITIONS_VARIABLES.AND..NOT.variable_found)
3657 variable=>boundary_conditions%BOUNDARY_CONDITIONS_VARIABLES(variable_idx)%PTR%VARIABLE
3658 IF(
ASSOCIATED(variable))
THEN 3659 IF(variable%VARIABLE_TYPE==field_variable%VARIABLE_TYPE.AND. &
3660 & variable%FIELD%USER_NUMBER==field_variable%FIELD%USER_NUMBER)
THEN 3661 IF(
ASSOCIATED(variable%FIELD%REGION))
THEN 3662 IF(variable%FIELD%REGION%USER_NUMBER==field_variable%FIELD%REGION%USER_NUMBER)
THEN 3663 variable_found=.true.
3664 boundary_conditions_variable=>boundary_conditions%BOUNDARY_CONDITIONS_VARIABLES(variable_idx)%PTR
3666 ELSEIF(
ASSOCIATED(variable%FIELD%INTERFACE))
THEN 3667 IF(variable%FIELD%INTERFACE%USER_NUMBER==field_variable%FIELD%INTERFACE%USER_NUMBER)
THEN 3668 variable_found=.true.
3669 boundary_conditions_variable=>boundary_conditions%BOUNDARY_CONDITIONS_VARIABLES(variable_idx)%PTR
3673 variable_idx=variable_idx+1
3678 CALL flagerror(
"Field variable is not associated.",err,error,*999)
3681 CALL flagerror(
"Boundary conditions is not associated.",err,error,*999)
3684 exits(
"BOUNDARY_CONDITIONS_VARIABLE_GET")
3686 999 errorsexits(
"BOUNDARY_CONDITIONS_VARIABLE_GET",err,error)
3698 TYPE(boundary_conditions_variable_type),
POINTER :: BOUNDARY_CONDITIONS_VARIABLE
3699 INTEGER(INTG),
INTENT(OUT) :: ERR
3700 TYPE(varying_string),
INTENT(OUT) :: ERROR
3702 INTEGER(INTG) :: NUMBER_OF_DIRICHLET_CONDITIONS,NUMBER_OF_LINEAR_MATRICES,NUMBER_OF_DYNAMIC_MATRICES,matrix_idx, &
3703 & MAX_NUMBER_LINEAR_MATRICES,MAX_NUMBER_DYNAMIC_MATRICES,equations_set_idx
3704 TYPE(solver_equations_type),
POINTER :: SOLVER_EQUATIONS
3705 TYPE(boundary_conditions_dirichlet_type),
POINTER :: BOUNDARY_CONDITIONS_DIRICHLET
3706 TYPE(equations_set_type),
POINTER :: EQUATIONS_SET
3707 TYPE(equations_type),
POINTER :: EQUATIONS
3708 TYPE(equations_mapping_type),
POINTER :: EQUATIONS_MAPPING
3709 TYPE(equations_mapping_linear_type),
POINTER :: LINEAR_MAPPING
3710 TYPE(equations_mapping_dynamic_type),
POINTER :: DYNAMIC_MAPPING
3712 enters(
"BOUNDARY_CONDITIONS_DIRICHLET_INITIALISE",err,error,*999)
3714 IF(
ASSOCIATED(boundary_conditions_variable))
THEN 3715 IF(
ASSOCIATED(boundary_conditions_variable%DIRICHLET_BOUNDARY_CONDITIONS))
THEN 3716 CALL flagerror(
"Dirichlet boundary conditions are already associated for this boundary conditions variable." &
3719 ALLOCATE(boundary_conditions_variable%DIRICHLET_BOUNDARY_CONDITIONS,stat=err)
3720 IF(err/=0)
CALL flagerror(
"Could not allocate Dirichlet Boundary Conditions",err,error,*999)
3721 boundary_conditions_dirichlet=>boundary_conditions_variable%DIRICHLET_BOUNDARY_CONDITIONS
3722 number_of_dirichlet_conditions=boundary_conditions_variable%NUMBER_OF_DIRICHLET_CONDITIONS
3723 ALLOCATE(boundary_conditions_dirichlet%DIRICHLET_DOF_INDICES(number_of_dirichlet_conditions),stat=err)
3724 IF(err/=0)
CALL flagerror(
"Could not allocate Dirichlet DOF indices array",err,error,*999)
3726 solver_equations=>boundary_conditions_variable%BOUNDARY_CONDITIONS%SOLVER_EQUATIONS
3727 IF(
ASSOCIATED(solver_equations))
THEN 3728 max_number_linear_matrices=0
3729 max_number_dynamic_matrices=0
3730 DO equations_set_idx=1,solver_equations%SOLVER_MAPPING%NUMBER_OF_EQUATIONS_SETS
3731 equations_set=>solver_equations%SOLVER_MAPPING%EQUATIONS_SETS(equations_set_idx)%PTR
3732 IF(
ASSOCIATED(equations_set))
THEN 3733 equations=>equations_set%EQUATIONS
3734 IF(
ASSOCIATED(equations))
THEN 3735 equations_mapping=>equations%EQUATIONS_MAPPING
3736 IF(
ASSOCIATED(equations_mapping))
THEN 3737 linear_mapping=>equations_mapping%LINEAR_MAPPING
3738 dynamic_mapping=>equations_mapping%DYNAMIC_MAPPING
3739 IF(
ASSOCIATED(linear_mapping))
THEN 3740 number_of_linear_matrices=linear_mapping%NUMBER_OF_LINEAR_EQUATIONS_MATRICES
3741 IF(number_of_linear_matrices>max_number_linear_matrices) &
3742 & max_number_linear_matrices=number_of_linear_matrices
3744 IF(
ASSOCIATED(dynamic_mapping))
THEN 3745 number_of_dynamic_matrices=dynamic_mapping%NUMBER_OF_DYNAMIC_EQUATIONS_MATRICES
3746 IF(number_of_dynamic_matrices>max_number_dynamic_matrices) &
3747 & max_number_dynamic_matrices=number_of_dynamic_matrices
3750 CALL flagerror(
"Equations mapping is not associated.",err,error,*999)
3753 CALL flagerror(
"Equations is not associated.",err,error,*999)
3756 CALL flagerror(
"Equations set is not associated.",err,error,*999)
3759 ALLOCATE(boundary_conditions_dirichlet%LINEAR_SPARSITY_INDICES(solver_equations%SOLVER_MAPPING%NUMBER_OF_EQUATIONS_SETS, &
3760 & max_number_linear_matrices),stat=err)
3761 IF(err/=0)
CALL flagerror(
"Could not allocate Dirichlet linear sparsity indices array",err,error,*999)
3762 ALLOCATE(boundary_conditions_dirichlet%DYNAMIC_SPARSITY_INDICES(solver_equations%SOLVER_MAPPING%NUMBER_OF_EQUATIONS_SETS,&
3763 & max_number_dynamic_matrices),stat=err)
3764 IF(err/=0)
CALL flagerror(
"Could not allocate Dirichlet dynamic sparsity indices array",err,error,*999)
3765 DO equations_set_idx=1,solver_equations%SOLVER_MAPPING%NUMBER_OF_EQUATIONS_SETS
3766 DO matrix_idx=1,max_number_linear_matrices
3767 NULLIFY(boundary_conditions_dirichlet%LINEAR_SPARSITY_INDICES(equations_set_idx,matrix_idx)%PTR)
3769 DO matrix_idx=1,max_number_dynamic_matrices
3770 NULLIFY(boundary_conditions_dirichlet%DYNAMIC_SPARSITY_INDICES(equations_set_idx,matrix_idx)%PTR)
3774 CALL flagerror(
"Solver equations is not associated.",err,error,*999)
3778 CALL flagerror(
"Boundary conditions variable is not associated.",err,error,*999)
3781 exits(
"BOUNDARY_CONDITIONS_DIRICHLET_INITIALISE")
3784 999 errorsexits(
"BOUNDARY_CONDITIONS_DIRICHLET_INITIALISE",err,error)
3797 TYPE(boundary_conditions_sparsity_indices_type),
POINTER :: SPARSITY_INDICES
3798 INTEGER(INTG),
INTENT(IN) :: NUMBER_OF_DIRICHLET
3799 INTEGER(INTG),
INTENT(OUT) :: ERR
3800 TYPE(varying_string),
INTENT(OUT) :: ERROR
3803 enters(
"BoundaryConditions_SparsityIndicesInitialise",err,error,*999)
3805 IF(
ASSOCIATED(sparsity_indices))
THEN 3806 CALL flagerror(
"Sparsity Indices are already associated.",err,error,*999)
3808 ALLOCATE(sparsity_indices,stat=err)
3809 IF(err/=0)
CALL flagerror(
"Could not allocate sparsity indicies.",err,error,*999)
3810 ALLOCATE(sparsity_indices%SPARSE_COLUMN_INDICES(number_of_dirichlet+1),stat=err)
3811 IF(err/=0)
CALL flagerror(
"Could not allocate sparsity column indices array",err,error,*999)
3814 exits(
"BoundaryConditions_SparsityIndicesInitialise")
3817 999 errors(
"BoundaryConditions_SparsityIndicesInitialise",err,error)
3818 exits(
"BoundaryConditions_SparsityIndicesInitialise")
3830 TYPE(boundary_conditions_variable_type),
POINTER :: BOUNDARY_CONDITIONS_VARIABLE
3831 INTEGER(INTG),
INTENT(OUT) :: ERR
3832 TYPE(varying_string),
INTENT(OUT) :: ERROR
3834 TYPE(boundary_conditions_pressure_incremented_type),
POINTER :: BOUNDARY_CONDITIONS_PRESSURE_INCREMENTED
3835 INTEGER(INTG) :: NUMBER_OF_PRESSURE_INCREMENTED_CONDITIONS
3837 enters(
"BOUNDARY_CONDITIONS_PRESSURE_INCREMENTED_INITIALISE",err,error,*999)
3839 IF(
ASSOCIATED(boundary_conditions_variable))
THEN 3840 IF(
ASSOCIATED(boundary_conditions_variable%PRESSURE_INCREMENTED_BOUNDARY_CONDITIONS))
THEN 3841 CALL flagerror(
"Pressure incremented boundary conditions are already associated for this boundary conditions variable." &
3844 ALLOCATE(boundary_conditions_variable%PRESSURE_INCREMENTED_BOUNDARY_CONDITIONS,stat=err)
3845 IF(err/=0)
CALL flagerror(
"Could not allocate Pressure incremented Boundary Conditions",err,error,*999)
3846 boundary_conditions_pressure_incremented=>boundary_conditions_variable%PRESSURE_INCREMENTED_BOUNDARY_CONDITIONS
3848 ALLOCATE(boundary_conditions_pressure_incremented%PRESSURE_INCREMENTED_DOF_INDICES &
3849 & (number_of_pressure_incremented_conditions),stat=err)
3850 IF(err/=0)
CALL flagerror(
"Could not allocate Pressure incremented DOF indices array",err,error,*999)
3853 CALL flagerror(
"Boundary conditions variable is not associated.",err,error,*999)
3856 exits(
"BOUNDARY_CONDITIONS_DIRICHLET_INITIALISE")
3859 999 errorsexits(
"BOUNDARY_CONDITIONS_DIRICHLET_INITIALISE",err,error)
subroutine boundaryconditions_constraindofsequal(boundaryConditions, fieldVariable, globalDofs, coefficient, err, error,)
Constrain multiple equations dependent field DOFs to be a single solver DOF in the solver equations...
subroutine, public boundary_conditions_add_node(BOUNDARY_CONDITIONS, FIELD, VARIABLE_TYPE, VERSION_NUMBER, DERIVATIVE_NUMBER, USER_NODE_NUMBER, COMPONENT_NUMBER, CONDITION, VALUE, ERR, ERROR,)
Adds to the value of the specified constant and sets this as a boundary condition on the specified us...
This module contains all basis function routines.
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.
integer(intg), parameter, public boundary_condition_moved_wall
The dof is fixed as a boundary condition.
This module contains all coordinate transformation and support routines.
Contains information about the equations in an equations set.
integer(intg), parameter, public boundary_condition_moved_wall_incremented
The dof is fixed as a boundary condition, to be used with load increment loop.
Converts a number to its equivalent varying string representation.
subroutine boundary_conditions_set_local_dofs(BOUNDARY_CONDITIONS, FIELD, VARIABLE_TYPE, DOF_INDICES, CONDITIONS, VALUES, ERR, ERROR,)
Sets a boundary condition on the specified DOFs.
integer(intg), parameter, public boundary_condition_dof_free
The dof is free.
subroutine boundaryconditions_checkinterpolationtype(condition, field, variableType, componentNumber, err, error,)
Checks that the specified boundary condition is appropriate for the field variable interpolation type...
subroutine boundaryconditions_dofconstraintscreatefinish(boundaryConditionsVariable, err, error,)
Finish the creation of the dof constraints for a boundary conditions variable.
subroutine boundary_conditions_finalise(BOUNDARY_CONDITIONS, ERR, ERROR,)
Finalise the boundary conditions and deallocate all memory.
subroutine boundary_conditions_set_local_dof1(BOUNDARY_CONDITIONS, FIELD, VARIABLE_TYPE, DOF_INDEX, CONDITION, VALUE, ERR, ERROR,)
Sets a boundary condition on the specified DOF.
subroutine, public boundary_conditions_set_element(BOUNDARY_CONDITIONS, FIELD, VARIABLE_TYPE, USER_ELEMENT_NUMBER, COMPONENT_NUMBER, CONDITION, VALUE, ERR, ERROR,)
Sets a boundary condition on the specified user element.
integer(intg), parameter boundary_condition_linear_constraint
The dof is constrained to be a linear combination of other DOFs.
integer(intg), parameter, public boundary_condition_neumann_integrated
The dof is set to a Neumann integrated boundary condition.
subroutine boundaryconditions_dofconstraintsinitialise(dofConstraints, err, error,)
Initialise the DOF constraints structure.
subroutine boundary_conditions_variable_initialise(BOUNDARY_CONDITIONS, FIELD_VARIABLE, ERR, ERROR,)
Initialise the boundary conditions variable for a variable type if that variable has not already been...
integer(intg), parameter, public boundary_condition_dirichlet
The dof is set to a Dirichlet boundary condition.
Contains information on an equations set.
integer(intg), parameter, public boundary_condition_correction_mass_increase
The dof is fixed as a boundary condition, to be used with load increment loop.
This module contains all string manipulation and transformation routines.
Contains information on dofs associated with pressure incremented conditions.
integer(intg), parameter, public boundary_condition_neumann_point_incremented
A Neumann point boundary condition that is incremented inside a load increment control loop...
integer(intg), parameter, public boundary_condition_pressure_incremented
The dof is a surface pressure boundary condition, to be used with load increment loop.
subroutine, public boundary_conditions_set_constant(BOUNDARY_CONDITIONS, FIELD, VARIABLE_TYPE, COMPONENT_NUMBER, CONDITION, VALUE, ERR, ERROR,)
Sets a boundary condition on the specified constant.
This module contains routines for timing the program.
subroutine, public boundary_conditions_destroy(BOUNDARY_CONDITIONS, ERR, ERROR,)
Destroys boundary conditions.
subroutine boundaryconditions_neumanninitialise(boundaryConditionsVariable, err, error,)
Initialise the Neumann boundary conditions information.
subroutine boundary_conditions_pressure_incremented_initialise(BOUNDARY_CONDITIONS_VARIABLE, ERR, ERROR,)
Initialises the pressure incremented boundary condition.
subroutine boundaryconditions_sparsityindicesinitialise(SPARSITY_INDICES, NUMBER_OF_DIRICHLET, ERR, ERROR,)
Initialise Sparsity Indices type.
subroutine boundaryconditions_checkequations(boundaryConditionsVariable, err, error,)
Checks that the applied boundary conditions are supported by the equations sets in the solver equatio...
This module provides an iso_varying_string module, conformant to the API specified in ISO/IEC 1539-2:...
Only for integer data type for now.
subroutine, public boundaryconditions_neumannintegrate(rhsBoundaryConditions, err, error,)
Calculates integrated Neumann condition values from point values for a boundary conditions variable a...
subroutine boundaryconditions_neumannmatricesfinalise(boundaryConditionsVariable, err, error,)
integer(intg), parameter, public boundary_condition_fixed_stree
The dof is fixed and set to values specified based on the transmission line theory at the dof...
This module contains all program wide constants.
integer(intg), parameter, public boundary_condition_fixed_inlet
The dof is fixed as a boundary condition.
integer(intg), parameter max_boundary_condition_number
integer(intg), parameter, public boundary_condition_fixed_nonreflecting
The dof is fixed and set to a non-reflecting type for 1D wave propagation problems.
subroutine, public boundary_conditions_add_element(BOUNDARY_CONDITIONS, FIELD, VARIABLE_TYPE, USER_ELEMENT_NUMBER, COMPONENT_NUMBER, CONDITION, VALUE, ERR, ERROR,)
Adds to the value of the specified constant and sets this as a boundary condition on the specified us...
integer(intg), parameter, public boundary_condition_free
The dof is free.
Contains information on the boundary conditions for a dependent field variable.
integer(intg), parameter, public boundary_condition_neumann_point
The dof is set to a Neumann point boundary condition.
This module contains all type definitions in order to avoid cyclic module references.
integer(intg), parameter, public boundary_condition_fixed_outlet
The dof is fixed as a boundary condition.
Contains information on the equations matrices and vectors.
Adds to the value of the specified local DOF and sets this as a boundary condition on the specified l...
integer(intg), parameter, public boundary_condition_fixed_wall
The dof is fixed as a boundary condition.
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.
Contains information on dofs with associated dirichlet conditions and corresponding non-zero elements...
subroutine, public boundary_conditions_create_finish(BOUNDARY_CONDITIONS, ERR, ERROR,)
Finish the creation of boundary conditions.
subroutine, public boundary_conditions_set_node(BOUNDARY_CONDITIONS, FIELD, VARIABLE_TYPE, VERSION_NUMBER, DERIVATIVE_NUMBER, USER_NODE_NUMBER, COMPONENT_NUMBER, CONDITION, VALUE, ERR, ERROR,)
Sets a boundary condition on the specified user node.
subroutine boundary_conditions_initialise(SOLVER_EQUATIONS, ERR, ERROR,)
Initialises the boundary conditions for an equations set.
integer(intg), parameter, public boundary_condition_neumann_integrated_only
A Neumann integrated boundary condition, and no point values will be integrated over a face or line t...
Contains information on a list.
subroutine, public boundaryconditions_neumannsparsitytypeset(boundaryConditions, sparsityType, err, error,)
Sets/changes the sparsity type for the Neumann integration matrices.
This module contains all computational environment variables.
This module contains CMISS MPI routines.
integer(intg), parameter, public boundary_condition_impermeable_wall
The dof is set such that (via penalty formulation): velocity * normal = 0.
This module handles all domain mappings routines.
integer(intg), parameter, public boundary_condition_fixed_cellml
The dof is fixed and set to values specified based on the coupled CellML solution at the dof...
Contains information about the solver equations for a solver.
subroutine boundaryconditions_dofconstraintset(boundaryConditions, fieldVariable, globalDof, dofs, coefficients, err, error,)
Constrain a DOF to be a linear combination of other DOFs.
type(computational_environment_type), target, public computational_environment
The computational environment the program is running in.
subroutine boundaryconditions_dofconstraintsfinalise(dofConstraints, err, error,)
Finalise the DOF constraints structure.
subroutine boundary_conditions_dirichlet_initialise(BOUNDARY_CONDITIONS_VARIABLE, ERR, ERROR,)
Initialise dirichlet boundary conditions for a boundary conditions.
subroutine boundaryconditions_neumannmatricesinitialise(boundaryConditionsVariable, err, error,)
Initialise the Neumann boundary conditions matrices and vectors. This must be done after we know whic...
integer(intg), parameter, public boundary_condition_dof_mixed
The dof is set as a mixed boundary condition.
subroutine boundary_conditions_variable_finalise(BOUNDARY_CONDITIONS_VARIABLE, ERR, ERROR,)
Finalise the boundary conditions variable and deallocate all memory.
This module handles all distributed matrix vector routines.
This module defines all constants shared across interface condition routines.
integer(intg), parameter, public boundary_condition_sparse_matrices
The matrices are stored as sparse matrices.
This module handles all boundary conditions routines.
Contains information about an equations matrix.
subroutine, public boundaryconditions_constrainnodedofsequal(boundaryConditions, field, fieldVariableType, versionNumber, derivativeNumber, component, nodes, coefficient, err, error,)
Constrain multiple nodal equations dependent field DOFs to be a single solver DOF in the solver equat...
integer(intg), parameter, public boundary_condition_free_wall
The dof is fixed as a boundary condition.
integer(intg), parameter, public boundary_condition_full_matrices
The matrices are stored as full matrices.
Sets a boundary condition on the specified local DOF.
Contains information for a field variable defined on a field.
subroutine boundaryconditions_neumannfinalise(boundaryConditionsVariable, err, error,)
subroutine, public boundary_conditions_add_constant(BOUNDARY_CONDITIONS, FIELD, VARIABLE_TYPE, COMPONENT_NUMBER, CONDITION, VALUE, ERR, ERROR,)
Adds to the value of the specified constant and sets this as a boundary condition on the specified co...
integer(intg), parameter, public boundary_condition_dof_constrained
The dof is constrained to be a linear combination of other DOFs.
Contains information on the domain mappings (i.e., local and global numberings).
integer(intg), parameter, public boundary_condition_fixed_fitted
The dof is fixed as a boundary condition to be updated from fitting data.
integer(intg), parameter, public boundary_condition_fixed
The dof is fixed as a boundary condition.
subroutine boundary_conditions_add_local_dofs(BOUNDARY_CONDITIONS, FIELD, VARIABLE_TYPE, DOF_INDICES, CONDITIONS, VALUES, ERR, ERROR,)
Adds to the value of the specified DOF and sets this as a boundary condition on the specified DOFs...
This module defines all constants shared across equations set routines.
subroutine boundaryconditions_setconditiontype(boundaryConditionsVariable, globalDof, condition, err, error,)
Checks the boundary condition type and sets the boundary condition type and dof type for the boundary...
subroutine boundary_conditions_add_local_dof1(BOUNDARY_CONDITIONS, FIELD, VARIABLE_TYPE, DOF_INDEX, CONDITION, VALUE, ERR, ERROR,)
Adds to the value of the specified DOF and sets this as a boundary condition on the specified DOF...
integer(intg), parameter, public boundary_condition_fixed_incremented
The dof is a fixed boundary condition, to be used with load increment loop.
Implements lists of base types.
subroutine, public boundary_conditions_variable_get(BOUNDARY_CONDITIONS, FIELD_VARIABLE, BOUNDARY_CONDITIONS_VARIABLE, ERR, ERROR,)
Find the boundary conditions variable for a given field variable.
Contains information on indices of non-zero elements with associated dirichlet conditions Indices sto...
integer(intg), parameter, public boundary_condition_cauchy
The dof is set to a Cauchy boundary condition.
integer(intg), parameter, public boundary_condition_pressure
The dof is a surface pressure boundary condition.
Flags an error condition.
subroutine boundaryconditions_sparsityindicesarrayfinalise(SPARSITY_INDICES_ARRAY, ERR, ERROR,)
Finalise an array of sparcity indices and deallocate all memory.
integer(intg), parameter, public boundary_condition_dof_fixed
The dof is fixed as a boundary condition.
subroutine, public boundary_conditions_create_start(SOLVER_EQUATIONS, BOUNDARY_CONDITIONS, ERR, ERROR,)
Start the creation of boundary conditions for the equation set.
This module contains all kind definitions.
integer(intg), parameter, public boundary_condition_robin
The dof is set to a Robin boundary condition.
Contains information of the dynamic matrices for equations matrices.
subroutine, public mpi_error_check(ROUTINE, MPI_ERR_CODE, ERR, ERROR,)
Checks to see if an MPI error has occured during an MPI call and flags a CMISS error it if it has...