123 INTEGER(INTG),
INTENT(OUT) :: ERR
126 INTEGER(INTG) :: column_idx,COLUMN_LIST_ITEM(5),COLUMN_RANK,dof_idx,dof_type,equation_type, &
127 & equations_column,equations_idx,equations_idx2,equations_matrix,equations_matrix_idx,equations_row_number, &
128 & equations_set_idx,EQUATIONS_VARIABLE_LIST_ITEM(3),global_column,global_dof,global_dof_idx,GLOBAL_DOFS_OFFSET, &
129 & global_row,global_row_idx,interface_column,interface_col_number,interface_condition_idx,interface_condition_idx2, &
130 & INTERFACE_EQUATIONS_LIST_ITEM(2),interface_idx,interface_matrix_idx,interface_row,interface_row_number,jacobian_column, &
131 & local_column,local_dof,LOCAL_DOFS_OFFSET,local_row,matrices_type,matrix_number,matrix_type,matrix_type_idx, &
132 & matrix_variable_idx,myrank,NUMBER_OF_COLUMNS,NUMBER_OF_DYNAMIC_EQUATIONS_MATRICES,NUMBER_OF_EQUATIONS_COLUMNS, &
133 & NUMBER_OF_EQUATIONS_SETS,NUMBER_OF_EQUATIONS_VARIABLES,NUMBER_OF_INTERFACES,NUMBER_OF_INTERFACE_COLUMNS, &
134 & NUMBER_OF_INTERFACE_ROWS,NUMBER_OF_INTERFACE_VARIABLES,NUMBER_OF_GLOBAL_SOLVER_DOFS,NUMBER_OF_GLOBAL_SOLVER_ROWS, &
135 & NUMBER_OF_LINEAR_EQUATIONS_MATRICES,NUMBER_OF_LOCAL_SOLVER_DOFS,NUMBER_OF_LOCAL_SOLVER_ROWS,NUMBER_OF_RANK_COLS, &
136 & NUMBER_OF_RANK_ROWS,NUMBER_OF_VARIABLES,rank,rank_idx,row_idx,ROW_LIST_ITEM(4),ROW_RANK,solver_global_dof, &
137 & solver_matrix_idx,solver_variable_idx,TOTAL_NUMBER_OF_LOCAL_SOLVER_DOFS,variable_idx, &
138 & VARIABLE_LIST_ITEM(3),variable_position_idx,variable_type, &
139 & numberRowEquationsRows,numberColEquationsCols,rowEquationsRowIdx,colEquationsColIdx, &
140 & globalDofCouplingNumber,equationsRow,eqnLocalDof
141 INTEGER(INTG) :: temp_offset, solver_variable_idx_temp
142 INTEGER(INTG),
ALLOCATABLE :: EQUATIONS_SET_VARIABLES(:,:),EQUATIONS_VARIABLES(:,:),INTERFACE_EQUATIONS_LIST(:,:), &
143 & INTERFACE_VARIABLES(:,:),RANK_GLOBAL_ROWS_LIST(:,:),RANK_GLOBAL_COLS_LIST(:,:),solver_local_dof(:)
144 INTEGER(INTG),
ALLOCATABLE :: NUMBER_OF_VARIABLE_GLOBAL_SOLVER_DOFS(:),NUMBER_OF_VARIABLE_LOCAL_SOLVER_DOFS(:), &
145 & TOTAL_NUMBER_OF_VARIABLE_LOCAL_SOLVER_DOFS(:),SUB_MATRIX_INFORMATION(:,:,:),SUB_MATRIX_LIST(:,:,:),VARIABLE_TYPES(:)
146 REAL(DP) :: couplingCoefficient
147 LOGICAL :: FOUND,INCLUDE_COLUMN,INCLUDE_ROW,CONSTRAINED_DOF
148 LOGICAL,
ALLOCATABLE :: VARIABLE_PROCESSED(:),VARIABLE_RANK_PROCESSED(:,:)
151 TYPE(
domain_mapping_type),
POINTER :: COL_DOMAIN_MAPPING,COL_DOFS_MAPPING,ROW_DOMAIN_MAPPING,ROW_DOFS_MAPPING
161 TYPE(
field_type),
POINTER :: DEPENDENT_FIELD,LAGRANGE_FIELD
170 TYPE(
list_type),
POINTER :: EQUATIONS_SET_VARIABLE_LIST
171 TYPE(
list_ptr_type),
ALLOCATABLE :: INTERFACE_EQUATIONS_LISTS(:),RANK_GLOBAL_ROWS_LISTS(:,:), &
172 & RANK_GLOBAL_COLS_LISTS(:,:,:,:),VARIABLES_LIST(:)
181 enters(
"SOLVER_MAPPING_CALCULATE",err,error,*999)
183 IF(
ASSOCIATED(solver_mapping))
THEN 184 IF(
ASSOCIATED(solver_mapping%CREATE_VALUES_CACHE))
THEN 185 solver_equations=>solver_mapping%SOLVER_EQUATIONS
186 IF(
ASSOCIATED(solver_equations))
THEN 187 boundary_conditions=>solver_equations%BOUNDARY_CONDITIONS
188 IF(.NOT.
ASSOCIATED(boundary_conditions))
THEN 189 CALL flagerror(
"The solver equations boundary conditions are not associated.",err,error,*999)
199 ALLOCATE(solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(solver_mapping%NUMBER_OF_EQUATIONS_SETS),stat=err)
200 IF(err/=0)
CALL flagerror(
"Could not allocate solver mapping equations set to solver map.",err,error,*999)
202 ALLOCATE(solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(solver_mapping%NUMBER_OF_INTERFACE_CONDITIONS),stat=err)
203 IF(err/=0)
CALL flagerror(
"Could not allocate solver mapping interface condition to solver map.",err,error,*999)
207 ALLOCATE(interface_equations_lists(solver_mapping%NUMBER_OF_INTERFACE_CONDITIONS),stat=err)
208 IF(err/=0)
CALL flagerror(
"Could not allocate equations set list.",err,error,*999)
209 DO interface_condition_idx=1,solver_mapping%NUMBER_OF_INTERFACE_CONDITIONS
210 interface_condition=>solver_mapping%INTERFACE_CONDITIONS(interface_condition_idx)%PTR
211 IF(
ASSOCIATED(interface_condition))
THEN 212 interface_equations=>interface_condition%INTERFACE_EQUATIONS
213 IF(
ASSOCIATED(interface_equations))
THEN 215 & interface_condition_idx),err,error,*999)
216 solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)%INTERFACE_CONDITION_INDEX= &
217 & interface_condition_idx
218 solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)%SOLVER_MAPPING=>solver_mapping
219 solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)%INTERFACE_EQUATIONS=>interface_equations
220 NULLIFY(interface_equations_lists(interface_condition_idx)%PTR)
221 CALL list_create_start(interface_equations_lists(interface_condition_idx)%PTR,err,error,*999)
224 CALL list_create_finish(interface_equations_lists(interface_condition_idx)%PTR,err,error,*999)
226 CALL flagerror(
"Interface condition interface equations is not associated.",err,error,*999)
229 CALL flagerror(
"Interface condition is not associated.",err,error,*999)
235 DO equations_set_idx=1,solver_mapping%NUMBER_OF_EQUATIONS_SETS
236 equations_set=>solver_mapping%EQUATIONS_SETS(equations_set_idx)%PTR
237 IF(
ASSOCIATED(equations_set))
THEN 238 equations=>equations_set%EQUATIONS
239 IF(
ASSOCIATED(equations))
THEN 241 & equations_set_idx),err,error,*999)
242 solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_SET_INDEX=equations_set_idx
243 solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%SOLVER_MAPPING=>solver_mapping
244 solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS=>equations
247 & number_of_interfaces,interface_equations_list,err,error,*999)
248 ALLOCATE(solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)% &
249 & equations_to_solver_matrix_maps_interface(number_of_interfaces),stat=err)
250 IF(err/=0)
CALL flagerror(
"Could not allocate equations to solver maps interface.",err,error,*999)
251 solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%NUMBER_OF_INTERFACE_CONDITIONS=number_of_interfaces
252 DO interface_idx=1,number_of_interfaces
254 & equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_INTERFACE(interface_idx),err,error,*999)
255 interface_condition_idx=interface_equations_list(1,interface_idx)
256 interface_matrix_idx=interface_equations_list(2,interface_idx)
257 interface_condition=>solver_mapping%INTERFACE_CONDITIONS(interface_condition_idx)%PTR
258 IF(
ASSOCIATED(interface_condition))
THEN 259 solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_INTERFACE( &
260 & interface_idx)%INTERFACE_CONDITION_INDEX=interface_condition_idx
261 solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_INTERFACE( &
262 & interface_idx)%INTERFACE_CONDITION=>interface_condition
263 solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_INTERFACE( &
264 & interface_idx)%INTERFACE_MATRIX_NUMBER=interface_matrix_idx
265 interface_equations_list_item(1)=equations_set_idx
266 interface_equations_list_item(2)=interface_matrix_idx
267 CALL list_item_add(interface_equations_lists(interface_condition_idx)%PTR,interface_equations_list_item, &
270 CALL flagerror(
"Interface condition is not associated.",err,error,*999)
273 IF(
ALLOCATED(interface_equations_list))
DEALLOCATE(interface_equations_list)
275 CALL flagerror(
"Equations set equations is not associated.",err,error,*999)
278 CALL flagerror(
"Equations set is not associated.",err,error,*999)
281 DO interface_condition_idx=1,solver_mapping%NUMBER_OF_INTERFACE_CONDITIONS
282 CALL list_detach_and_destroy(interface_equations_lists(interface_condition_idx)%PTR,number_of_equations_sets, &
283 interface_equations_list,err,error,*999)
284 ALLOCATE(solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
285 & interface_to_solver_matrix_maps_equations(number_of_equations_sets),stat=err)
286 IF(err/=0)
CALL flagerror(
"Could not allocate interface to solver maps equations.",err,error,*999)
287 solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)%NUMBER_OF_EQUATIONS_SETS= &
288 & number_of_equations_sets
289 DO equations_idx=1,number_of_equations_sets
291 & interface_condition_idx)%INTERFACE_TO_SOLVER_MATRIX_MAPS_EQUATIONS(equations_idx),err,error,*999)
292 equations_set_idx=interface_equations_list(1,equations_idx)
293 interface_matrix_idx=interface_equations_list(2,equations_idx)
294 equations_set=>solver_mapping%EQUATIONS_SETS(equations_set_idx)%PTR
295 IF(
ASSOCIATED(equations_set))
THEN 296 solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
297 & interface_to_solver_matrix_maps_equations(equations_idx)%EQUATIONS_SET_INDEX=equations_set_idx
298 solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
299 & interface_to_solver_matrix_maps_equations(equations_idx)%EQUATIONS_SET=>equations_set
300 solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
301 & interface_to_solver_matrix_maps_equations(equations_idx)%INTERFACE_MATRIX_INDEX=interface_matrix_idx
303 CALL flagerror(
"Equations set is not associated.",err,error,*999)
306 IF(
ALLOCATED(interface_equations_list))
DEALLOCATE(interface_equations_list)
317 number_of_global_solver_rows=0
318 number_of_local_solver_rows=0
323 ALLOCATE(rank_global_rows_lists(solver_mapping%NUMBER_OF_EQUATIONS_SETS+solver_mapping% &
325 IF(err/=0)
CALL flagerror(
"Could not allocate rank global rows lists.",err,error,*999)
329 DO equations_set_idx=1,solver_mapping%NUMBER_OF_EQUATIONS_SETS
330 equations_idx=equations_idx+1
331 equations_set=>solver_mapping%EQUATIONS_SETS(equations_set_idx)%PTR
332 IF(
ASSOCIATED(equations_set))
THEN 333 equations=>equations_set%EQUATIONS
334 IF(
ASSOCIATED(equations))
THEN 335 equations_mapping=>equations%EQUATIONS_MAPPING
336 IF(
ASSOCIATED(equations_mapping))
THEN 337 NULLIFY(rank_global_rows_lists(equations_idx,rank)%PTR)
338 CALL list_create_start(rank_global_rows_lists(equations_idx,rank)%PTR,err,error,*999)
345 CALL list_create_finish(rank_global_rows_lists(equations_idx,rank)%PTR,err,error,*999)
347 CALL flagerror(
"Equations equations mapping is not associated",err,error,*999)
350 CALL flagerror(
"Equations set equations is not associated.",err,error,*999)
353 CALL flagerror(
"Equations set is not associated.",err,error,*999)
356 DO interface_condition_idx=1,solver_mapping%NUMBER_OF_INTERFACE_CONDITIONS
357 equations_idx=equations_idx+1
358 interface_condition=>solver_mapping%INTERFACE_CONDITIONS(interface_condition_idx)%PTR
359 IF(
ASSOCIATED(interface_condition))
THEN 360 SELECT CASE(interface_condition%METHOD)
362 interface_equations=>interface_condition%INTERFACE_EQUATIONS
363 IF(
ASSOCIATED(interface_equations))
THEN 364 interface_mapping=>interface_equations%INTERFACE_MAPPING
365 IF(
ASSOCIATED(interface_mapping))
THEN 366 NULLIFY(rank_global_rows_lists(equations_idx,rank)%PTR)
367 CALL list_create_start(rank_global_rows_lists(equations_idx,rank)%PTR,err,error,*999)
371 &
intg),err,error,*999)
374 CALL list_create_finish(rank_global_rows_lists(equations_idx,rank)%PTR,err,error,*999)
376 CALL flagerror(
"Interface equations interface mapping is not associated.",err,error,*999)
379 CALL flagerror(
"Interface condition interface equations is not associated.",err,error,*999)
382 CALL flagerror(
"Not implemented.",err,error,*999)
384 CALL flagerror(
"Not implemented.",err,error,*999)
386 local_error=
"The interface condition method of "// &
389 CALL flagerror(local_error,err,error,*999)
392 CALL flagerror(
"Interface condition is not associated.",err,error,*999)
400 DO equations_set_idx=1,solver_mapping%NUMBER_OF_EQUATIONS_SETS
401 equations_idx=equations_idx+1
402 equations_set=>solver_mapping%EQUATIONS_SETS(equations_set_idx)%PTR
403 IF(
ASSOCIATED(equations_set))
THEN 404 equations=>equations_set%EQUATIONS
405 IF(
ASSOCIATED(equations))
THEN 406 equations_mapping=>equations%EQUATIONS_MAPPING
407 IF(
ASSOCIATED(equations_mapping))
THEN 408 dynamic_mapping=>equations_mapping%DYNAMIC_MAPPING
409 linear_mapping=>equations_mapping%LINEAR_MAPPING
410 nonlinear_mapping=>equations_mapping%NONLINEAR_MAPPING
411 rhs_mapping=>equations_mapping%RHS_MAPPING
412 source_mapping=>equations_mapping%SOURCE_MAPPING
413 row_dofs_mapping=>equations_mapping%ROW_DOFS_MAPPING
414 IF(
ASSOCIATED(row_dofs_mapping))
THEN 415 dependent_field=>equations_set%DEPENDENT%DEPENDENT_FIELD
416 IF(
ASSOCIATED(dependent_field))
THEN 418 DO global_row=1,equations_mapping%NUMBER_OF_GLOBAL_ROWS
421 DO rank_idx=1,row_dofs_mapping%GLOBAL_TO_LOCAL_MAP(global_row)%NUMBER_OF_DOMAINS
422 IF(row_dofs_mapping%GLOBAL_TO_LOCAL_MAP(global_row)%LOCAL_TYPE(rank_idx)/=
domain_local_ghost)
THEN 423 row_rank=row_dofs_mapping%GLOBAL_TO_LOCAL_MAP(global_row)%DOMAIN_NUMBER(rank_idx)
424 local_row=row_dofs_mapping%GLOBAL_TO_LOCAL_MAP(global_row)%LOCAL_NUMBER(rank_idx)
430 constrained_dof=.false.
431 globaldofcouplingnumber=0
432 IF(
ASSOCIATED(dynamic_mapping))
THEN 433 dependent_variable=>dynamic_mapping%DYNAMIC_VARIABLE
435 & boundary_conditions_variable,err,error,*999)
436 IF(
ASSOCIATED(boundary_conditions_variable))
THEN 439 global_dof=global_row
440 include_row=include_row.AND.(boundary_conditions_variable%DOF_TYPES(global_dof)== &
442 constrained_dof=constrained_dof.OR.(boundary_conditions_variable%DOF_TYPES(global_dof)== &
444 IF(
ASSOCIATED(boundary_conditions_variable%dofConstraints))
THEN 445 dofconstraints=>boundary_conditions_variable%dofConstraints
446 IF(dofconstraints%numberOfConstraints>0)
THEN 447 IF(
ALLOCATED(dofconstraints%dofCouplings))
THEN 448 IF(
ASSOCIATED(dofconstraints%dofCouplings(global_dof)%ptr))
THEN 453 & dofconstraints%dofCouplings(global_dof)%ptr, &
454 & globaldofcouplingnumber,err,error,*999)
457 CALL flagerror(
"DOF constraints DOF couplings are not allocated.",err,error,*999)
462 CALL flagerror(
"Boundary condition variable is not associated.",err,error,*999)
465 IF(
ASSOCIATED(nonlinear_mapping))
THEN 468 dependent_variable=>nonlinear_mapping%JACOBIAN_TO_VAR_MAP(1)%VARIABLE
470 & boundary_conditions_variable,err,error,*999)
471 IF(
ASSOCIATED(boundary_conditions_variable))
THEN 472 global_dof=global_row
473 include_row=include_row.AND.(boundary_conditions_variable%DOF_TYPES(global_dof)== &
475 constrained_dof=constrained_dof.OR.(boundary_conditions_variable%DOF_TYPES(global_dof)== &
477 IF(
ASSOCIATED(boundary_conditions_variable%dofConstraints))
THEN 478 dofconstraints=>boundary_conditions_variable%dofConstraints
479 IF(dofconstraints%numberOfConstraints>0)
THEN 480 IF(
ALLOCATED(dofconstraints%dofCouplings))
THEN 481 IF(
ASSOCIATED(dofconstraints%dofCouplings(global_dof)%ptr))
THEN 483 & dofconstraints%dofCouplings(global_dof)%ptr, &
484 & globaldofcouplingnumber,err,error,*999)
487 CALL flagerror(
"DOF constraints DOF couplings are not allocated.",err,error,*999)
492 CALL flagerror(
"Boundary condition variable is not associated.",err,error,*999)
495 IF(
ASSOCIATED(linear_mapping))
THEN 498 DO equations_matrix_idx=1,linear_mapping%NUMBER_OF_LINEAR_MATRIX_VARIABLES
499 dependent_variable=>linear_mapping%EQUATIONS_MATRIX_TO_VAR_MAPS(equations_matrix_idx)% &
502 & boundary_conditions_variable,err,error,*999)
503 IF(
ASSOCIATED(boundary_conditions_variable))
THEN 506 global_dof=global_row
507 include_row=include_row.AND.(boundary_conditions_variable%DOF_TYPES(global_dof)== &
509 constrained_dof=constrained_dof.OR.(boundary_conditions_variable%DOF_TYPES(global_dof)== &
511 IF(
ASSOCIATED(boundary_conditions_variable%dofConstraints))
THEN 512 dofconstraints=>boundary_conditions_variable%dofConstraints
513 IF(dofconstraints%numberOfConstraints>0)
THEN 514 IF(
ALLOCATED(dofconstraints%dofCouplings))
THEN 515 IF(
ASSOCIATED(dofconstraints%dofCouplings(global_dof)%ptr))
THEN 517 & dofconstraints%dofCouplings(global_dof)%ptr, &
518 & globaldofcouplingnumber,err,error,*999)
521 CALL flagerror(
"DOF constraints DOF couplings are not allocated.",err,error,*999)
526 CALL flagerror(
"Boundary condition variable is not associated.",err,error,*999)
530 row_list_item(1)=global_row
531 row_list_item(2)=local_row
532 row_list_item(4)=globaldofcouplingnumber
535 number_of_global_solver_rows=number_of_global_solver_rows+1
537 IF(row_rank==myrank) number_of_local_solver_rows=number_of_local_solver_rows+1
538 ELSE IF(constrained_dof)
THEN 543 CALL list_item_add(rank_global_rows_lists(equations_idx,row_rank)%PTR,row_list_item,err,error,*999)
545 CALL flagerror(
"Global row is not owned by a domain.",err,error,*999)
549 CALL flagerror(
"Equations set dependent field is not associated.",err,error,*999)
552 CALL flagerror(
"Equations set row degree of freedom mappings is not associated.",err,error,*999)
555 CALL flagerror(
"Equations equations mapping is not associated",err,error,*999)
558 CALL flagerror(
"Equations set equations is not associated.",err,error,*999)
561 CALL flagerror(
"Equations set is not associated.",err,error,*999)
565 DO interface_condition_idx=1,solver_mapping%NUMBER_OF_INTERFACE_CONDITIONS
566 equations_idx=equations_idx+1
567 interface_condition=>solver_mapping%INTERFACE_CONDITIONS(interface_condition_idx)%PTR
568 IF(
ASSOCIATED(interface_condition))
THEN 569 SELECT CASE(interface_condition%METHOD)
571 interface_equations=>interface_condition%INTERFACE_EQUATIONS
572 IF(
ASSOCIATED(interface_equations))
THEN 573 interface_mapping=>interface_equations%INTERFACE_MAPPING
574 IF(
ASSOCIATED(interface_mapping))
THEN 575 col_dofs_mapping=>interface_mapping%COLUMN_DOFS_MAPPING
576 IF(
ASSOCIATED(col_dofs_mapping))
THEN 577 lagrange_field=>interface_condition%LAGRANGE%LAGRANGE_FIELD
578 IF(
ASSOCIATED(lagrange_field))
THEN 579 boundary_conditions=>solver_equations%BOUNDARY_CONDITIONS
580 IF(
ASSOCIATED(boundary_conditions))
THEN 583 lagrange_variable=>lagrange_field%VARIABLE_TYPE_MAP(variable_type)%PTR
585 & boundary_conditions_variable,err,error,*999)
586 IF(
ASSOCIATED(boundary_conditions_variable))
THEN 588 DO global_column=1,interface_mapping%NUMBER_OF_GLOBAL_COLUMNS
591 DO rank_idx=1,col_dofs_mapping%GLOBAL_TO_LOCAL_MAP(global_column)%NUMBER_OF_DOMAINS
592 IF(col_dofs_mapping%GLOBAL_TO_LOCAL_MAP(global_column)% &
594 column_rank=col_dofs_mapping%GLOBAL_TO_LOCAL_MAP(global_column)%DOMAIN_NUMBER(rank_idx)
595 local_column=col_dofs_mapping%GLOBAL_TO_LOCAL_MAP(global_column)%LOCAL_NUMBER(rank_idx)
599 IF(column_rank>=0)
THEN 600 include_column=.true.
603 global_dof=global_column
604 include_column=include_column.AND.(boundary_conditions_variable%DOF_TYPES(global_dof)== &
606 row_list_item(1)=global_column
607 row_list_item(2)=local_column
608 IF(include_column)
THEN 610 number_of_global_solver_rows=number_of_global_solver_rows+1
612 IF(column_rank==myrank) number_of_local_solver_rows=number_of_local_solver_rows+1
616 CALL list_item_add(rank_global_rows_lists(equations_idx,column_rank)%PTR,row_list_item, &
619 CALL flagerror(
"Global row is not owned by a domain.",err,error,*999)
623 CALL flagerror(
"Boundary condition variable is not associated.",err,error,*999)
626 CALL flagerror(
"Equations set boundary conditions is not associated.",err,error,*999)
629 CALL flagerror(
"Interface equations Lagrange field is not associated.",err,error,*999)
632 CALL flagerror(
"Interface condition column degree of freedom mappings is not associated.",err,error,*999)
635 CALL flagerror(
"Interface equations interface mapping is not associated.",err,error,*999)
638 CALL flagerror(
"Interface condition interface equations is not associated.",err,error,*999)
641 CALL flagerror(
"Not implemented.",err,error,*999)
643 CALL flagerror(
"Not implemented.",err,error,*999)
645 local_error=
"The interface condition method of "// &
647 CALL flagerror(local_error,err,error,*999)
650 CALL flagerror(
"Interface condition is not associated.",err,error,*999)
655 IF(number_of_local_solver_rows==0) &
656 &
CALL flagerror(
"Invalid problem setup. The number of local solver rows is zero.",err,error,*999)
657 IF(number_of_global_solver_rows==0) &
658 &
CALL flagerror(
"Invalid problem setup. The number of global solver rows is zero.",err,error,*999)
669 ALLOCATE(solver_mapping%SOLVER_ROW_TO_EQUATIONS_ROWS_MAP(number_of_local_solver_rows),stat=err)
670 IF(err/=0)
CALL flagerror(
"Could not allocate solver mapping solver row to equation rows map.",err,error,*999)
672 solver_mapping%NUMBER_OF_ROWS=number_of_local_solver_rows
673 solver_mapping%NUMBER_OF_GLOBAL_ROWS=number_of_global_solver_rows
675 ALLOCATE(solver_mapping%ROW_DOFS_MAPPING,stat=err)
676 IF(err/=0)
CALL flagerror(
"Could not allocate solver mapping row dofs mapping.",err,error,*999)
679 & number_computational_nodes,err,error,*999)
680 row_domain_mapping=>solver_mapping%ROW_DOFS_MAPPING
681 ALLOCATE(row_domain_mapping%GLOBAL_TO_LOCAL_MAP(number_of_global_solver_rows),stat=err)
682 IF(err/=0)
CALL flagerror(
"Could not allocate row dofs mapping global to local map.",err,error,*999)
683 row_domain_mapping%NUMBER_OF_GLOBAL=number_of_global_solver_rows
686 DO equations_set_idx=1,solver_mapping%NUMBER_OF_EQUATIONS_SETS
689 equations_set=>solver_mapping%EQUATIONS_SETS(equations_set_idx)%PTR
690 equations=>equations_set%EQUATIONS
691 equations_mapping=>equations%EQUATIONS_MAPPING
694 ALLOCATE(solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_SM( &
695 & solver_mapping%NUMBER_OF_SOLVER_MATRICES),stat=err)
696 IF(err/=0)
CALL flagerror(
"Could not allocate equations set to solver map equations to solver matrix maps sm.", &
698 DO solver_matrix_idx=1,solver_mapping%NUMBER_OF_SOLVER_MATRICES
700 & equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_SM(solver_matrix_idx),err,error,*999)
704 ALLOCATE(solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_ROW_TO_SOLVER_ROWS_MAPS( &
705 & equations_mapping%TOTAL_NUMBER_OF_ROWS),stat=err)
706 IF(err/=0)
CALL flagerror(
"Could not allocate equations set to solver map equations row to solver rows maps.", &
708 DO equations_row_number=1,equations_mapping%TOTAL_NUMBER_OF_ROWS
711 & equations_set_idx)%EQUATIONS_ROW_TO_SOLVER_ROWS_MAPS(equations_row_number),err,error,*999)
717 DO interface_condition_idx=1,solver_mapping%NUMBER_OF_INTERFACE_CONDITIONS
720 interface_condition=>solver_mapping%INTERFACE_CONDITIONS(interface_condition_idx)%PTR
721 interface_equations=>interface_condition%INTERFACE_EQUATIONS
722 interface_mapping=>interface_equations%INTERFACE_MAPPING
725 ALLOCATE(solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)%INTERFACE_TO_SOLVER_MATRIX_MAPS_SM( &
726 & solver_mapping%NUMBER_OF_SOLVER_MATRICES),stat=err)
727 IF(err/=0)
CALL flagerror(
"Could not allocate interface to solver map interface to solver matrix maps sm.", &
729 DO solver_matrix_idx=1,solver_mapping%NUMBER_OF_SOLVER_MATRICES
731 & interface_condition_idx)%INTERFACE_TO_SOLVER_MATRIX_MAPS_SM(solver_matrix_idx),err,error,*999)
735 ALLOCATE(solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
736 & interface_to_solver_matrix_maps_im(interface_mapping%NUMBER_OF_INTERFACE_MATRICES),stat=err)
738 &
CALL flagerror(
"Could not allocate interface to solver map equations to solver matrix maps im.", &
740 DO interface_matrix_idx=1,interface_mapping%NUMBER_OF_INTERFACE_MATRICES
742 & interface_condition_idx)%INTERFACE_TO_SOLVER_MATRIX_MAPS_IM(interface_matrix_idx),err,error,*999)
745 ALLOCATE(solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
746 & interface_to_solver_matrix_maps_im(interface_matrix_idx)%INTERFACE_ROW_TO_SOLVER_ROWS_MAP( &
747 & interface_mapping%INTERFACE_MATRIX_ROWS_TO_VAR_MAPS(interface_matrix_idx)%TOTAL_NUMBER_OF_ROWS),stat=err)
748 IF(err/=0)
CALL flagerror(
"Could not allocate interface condition to solver map interface row to solver row map.", &
750 DO interface_row_number=1,interface_mapping%INTERFACE_MATRIX_ROWS_TO_VAR_MAPS(interface_matrix_idx) &
751 & %TOTAL_NUMBER_OF_ROWS
753 & interface_condition_idx)%INTERFACE_TO_SOLVER_MATRIX_MAPS_IM(interface_matrix_idx)% &
754 & interface_row_to_solver_rows_map(interface_row_number),err,error,*999)
760 ALLOCATE(solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
761 & interface_column_to_solver_rows_maps(interface_mapping%TOTAL_NUMBER_OF_COLUMNS),stat=err)
763 &
CALL flagerror(
"Could not allocate interface condition to solver map interface column to solver row map.", &
765 DO interface_col_number=1,interface_mapping%TOTAL_NUMBER_OF_COLUMNS
768 & interface_condition_idx)%INTERFACE_COLUMN_TO_SOLVER_ROWS_MAPS(interface_col_number),err,error,*999)
777 number_of_global_solver_rows=0
779 ALLOCATE(dummydofcoupling%globalDofs(1),stat=err)
780 IF(err/=0)
CALL flagerror(
"Could not allocate dummy DOF coupling DOFs.",err,error,*999)
781 ALLOCATE(dummydofcoupling%localDofs(1),stat=err)
782 IF(err/=0)
CALL flagerror(
"Could not allocate dummy DOF coupling local Dofs.",err,error,*999)
783 ALLOCATE(dummydofcoupling%coefficients(1),stat=err)
784 IF(err/=0)
CALL flagerror(
"Could not allocate dummy DOF coupling values.",err,error,*999)
785 dummydofcoupling%numberOfDofs=1
788 number_of_local_solver_rows=0
792 DO equations_set_idx=1,solver_mapping%NUMBER_OF_EQUATIONS_SETS
793 equations_idx=equations_idx+1
796 CALL list_sort(rank_global_rows_lists(equations_idx,rank)%PTR,err,error,*999)
798 & rank_global_rows_list,err,error,*999)
801 equations_set=>solver_mapping%EQUATIONS_SETS(equations_set_idx)%PTR
802 equations=>equations_set%EQUATIONS
803 equations_mapping=>equations%EQUATIONS_MAPPING
804 dynamic_mapping=>equations_mapping%DYNAMIC_MAPPING
805 linear_mapping=>equations_mapping%LINEAR_MAPPING
806 nonlinear_mapping=>equations_mapping%NONLINEAR_MAPPING
809 DO global_row_idx=1,number_of_rank_rows
810 global_row=rank_global_rows_list(1,global_row_idx)
811 local_row=rank_global_rows_list(2,global_row_idx)
812 include_row=rank_global_rows_list(3,global_row_idx)==1
813 constrained_dof=rank_global_rows_list(3,global_row_idx)==2
814 globaldofcouplingnumber=rank_global_rows_list(4,global_row_idx)
815 IF(globaldofcouplingnumber>0)
THEN 816 rowequationrows=>rowcouplings%dofCouplings(globaldofcouplingnumber)%ptr
817 IF(
ASSOCIATED(rowequationrows))
THEN 818 numberrowequationsrows=rowequationrows%numberOfDofs
820 CALL flagerror(
"Dof coupling is not associated for global dof coupling number "// &
824 numberrowequationsrows=1
825 dummydofcoupling%globalDofs(1)=global_row
826 dummydofcoupling%localDofs(1)=local_row
827 dummydofcoupling%coefficients(1)=1.0_dp
828 rowequationrows=>dummydofcoupling
832 number_of_global_solver_rows=number_of_global_solver_rows+1
833 number_of_local_solver_rows=number_of_local_solver_rows+1
838 & number_of_global_solver_rows),err,error,*999)
840 ALLOCATE(row_domain_mapping%GLOBAL_TO_LOCAL_MAP(number_of_global_solver_rows)%LOCAL_NUMBER(1),stat=err)
841 IF(err/=0)
CALL flagerror(
"Could not allocate row global to local map local number.",err,error,*999)
842 ALLOCATE(row_domain_mapping%GLOBAL_TO_LOCAL_MAP(number_of_global_solver_rows)%DOMAIN_NUMBER(1),stat=err)
843 IF(err/=0)
CALL flagerror(
"Could not allocate row global to local map domain number.",err,error,*999)
844 ALLOCATE(row_domain_mapping%GLOBAL_TO_LOCAL_MAP(number_of_global_solver_rows)%LOCAL_TYPE(1),stat=err)
845 IF(err/=0)
CALL flagerror(
"Could not allocate row global to local map local type.",err,error,*999)
847 row_domain_mapping%GLOBAL_TO_LOCAL_MAP(number_of_global_solver_rows)%NUMBER_OF_DOMAINS=1
848 row_domain_mapping%GLOBAL_TO_LOCAL_MAP(number_of_global_solver_rows)%LOCAL_NUMBER(1)= &
849 & number_of_local_solver_rows
850 row_domain_mapping%GLOBAL_TO_LOCAL_MAP(number_of_global_solver_rows)%DOMAIN_NUMBER(1)=rank
851 row_domain_mapping%GLOBAL_TO_LOCAL_MAP(number_of_global_solver_rows)%LOCAL_TYPE(1)=
domain_local_internal 852 IF(rank==myrank)
THEN 859 & number_of_local_solver_rows),err,error,*999)
861 ALLOCATE(solver_mapping%SOLVER_ROW_TO_EQUATIONS_ROWS_MAP(number_of_local_solver_rows)% &
862 & equations_index(numberrowequationsrows),stat=err)
863 IF(err/=0)
CALL flagerror(
"Could not allocate solver row to equations rows equations index.",err,error,*999)
864 ALLOCATE(solver_mapping%SOLVER_ROW_TO_EQUATIONS_ROWS_MAP(number_of_local_solver_rows)% &
865 & rowcol_number(numberrowequationsrows),stat=err)
867 &
CALL flagerror(
"Could not allocate solver row to equations rows row/col number.",err,error,*999)
868 ALLOCATE(solver_mapping%SOLVER_ROW_TO_EQUATIONS_ROWS_MAP(number_of_local_solver_rows)% &
869 & coupling_coefficients(numberrowequationsrows),stat=err)
870 IF(err/=0)
CALL flagerror(
"Could not allocate solver row to equations rows coupling coefficients.", &
873 solver_mapping%SOLVER_ROW_TO_EQUATIONS_ROWS_MAP(number_of_local_solver_rows)% &
874 & number_of_equations_set_rows=numberrowequationsrows
875 DO rowequationsrowidx=1,numberrowequationsrows
876 solver_mapping%SOLVER_ROW_TO_EQUATIONS_ROWS_MAP(number_of_local_solver_rows)% &
877 & equations_index(rowequationsrowidx)=equations_set_idx
878 solver_mapping%SOLVER_ROW_TO_EQUATIONS_ROWS_MAP(number_of_local_solver_rows)% &
879 & rowcol_number(rowequationsrowidx)=rowequationrows%localDofs(rowequationsrowidx)
880 solver_mapping%SOLVER_ROW_TO_EQUATIONS_ROWS_MAP(number_of_local_solver_rows)% &
881 & coupling_coefficients(rowequationsrowidx)=rowequationrows%coefficients(rowequationsrowidx)
884 DO rowequationsrowidx=1,numberrowequationsrows
885 equationsrow=rowequationrows%localDofs(rowequationsrowidx)
887 IF(
ALLOCATED(solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)% &
888 & equations_row_to_solver_rows_maps(equationsrow)%SOLVER_ROWS))
THEN 889 CALL flagerror(
"Equations row to solver row map is already allocated, "// &
890 &
"mapping an equations row to multiple solver rows is not yet implemented.",err,error,*999)
892 ALLOCATE(solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_ROW_TO_SOLVER_ROWS_MAPS( &
893 & equationsrow)%SOLVER_ROWS(1),stat=err)
894 IF(err/=0)
CALL flagerror(
"Could not allocate equations row to solver rows maps solver rows.", &
896 ALLOCATE(solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_ROW_TO_SOLVER_ROWS_MAPS( &
897 & equationsrow)%COUPLING_COEFFICIENTS(1),stat=err)
898 IF(err/=0)
CALL flagerror(
"Could not allocate equations row to solver rows maps solver rows.", &
901 solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_ROW_TO_SOLVER_ROWS_MAPS( &
902 & equationsrow)%NUMBER_OF_SOLVER_ROWS=1
903 solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_ROW_TO_SOLVER_ROWS_MAPS( &
904 & equationsrow)%SOLVER_ROWS(1)=number_of_local_solver_rows
905 solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_ROW_TO_SOLVER_ROWS_MAPS( &
906 & equationsrow)%COUPLING_COEFFICIENTS(1)=rowequationrows%coefficients(rowequationsrowidx)
908 DO interface_condition_idx=1,solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)% &
909 & number_of_interface_conditions
910 interface_condition_idx2=solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)% &
911 & equations_to_solver_matrix_maps_interface(interface_condition_idx)%INTERFACE_CONDITION_INDEX
912 interface_matrix_idx=solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)% &
913 & equations_to_solver_matrix_maps_interface(interface_condition_idx)%INTERFACE_MATRIX_NUMBER
915 solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx2)% &
916 & interface_to_solver_matrix_maps_im(interface_matrix_idx)%INTERFACE_ROW_TO_SOLVER_ROWS_MAP( &
917 & equationsrow)%NUMBER_OF_SOLVER_ROWS=1
918 solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx2)% &
919 & interface_to_solver_matrix_maps_im(interface_matrix_idx)%INTERFACE_ROW_TO_SOLVER_ROWS_MAP( &
920 & equationsrow)%SOLVER_ROW=number_of_local_solver_rows
921 solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx2)% &
922 & interface_to_solver_matrix_maps_im(interface_matrix_idx)%INTERFACE_ROW_TO_SOLVER_ROWS_MAP( &
923 & equationsrow)%COUPLING_COEFFICIENT=rowequationrows%coefficients(rowequationsrowidx)
928 ELSE IF(constrained_dof)
THEN 933 IF(rank==myrank)
THEN 935 solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_ROW_TO_SOLVER_ROWS_MAPS( &
936 & local_row)%NUMBER_OF_SOLVER_ROWS=0
938 DO interface_condition_idx=1,solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)% &
939 & number_of_interface_conditions
940 interface_condition_idx2=solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)% &
941 & equations_to_solver_matrix_maps_interface(interface_condition_idx)%INTERFACE_CONDITION_INDEX
942 interface_matrix_idx=solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)% &
943 & equations_to_solver_matrix_maps_interface(interface_condition_idx)%INTERFACE_MATRIX_NUMBER
945 solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx2)% &
946 & interface_to_solver_matrix_maps_im(interface_matrix_idx)%INTERFACE_ROW_TO_SOLVER_ROWS_MAP( &
947 & local_row)%NUMBER_OF_SOLVER_ROWS=0
952 IF(
ALLOCATED(rank_global_rows_list))
DEALLOCATE(rank_global_rows_list)
956 DO interface_condition_idx=1,solver_mapping%NUMBER_OF_INTERFACE_CONDITIONS
957 equations_idx=equations_idx+1
960 CALL list_sort(rank_global_rows_lists(equations_idx,rank)%PTR,err,error,*999)
962 & rank_global_rows_list,err,error,*999)
965 interface_condition=>solver_mapping%INTERFACE_CONDITIONS(interface_condition_idx)%PTR
966 interface_equations=>interface_condition%INTERFACE_EQUATIONS
967 interface_mapping=>interface_equations%INTERFACE_MAPPING
970 DO global_row_idx=1,number_of_rank_rows
971 global_column=rank_global_rows_list(1,global_row_idx)
972 local_column=rank_global_rows_list(2,global_row_idx)
973 include_column=rank_global_rows_list(3,global_row_idx)==1
974 constrained_dof=rank_global_rows_list(3,global_row_idx)==2
975 IF(include_column)
THEN 976 number_of_global_solver_rows=number_of_global_solver_rows+1
977 number_of_local_solver_rows=number_of_local_solver_rows+1
982 & number_of_global_solver_rows),err,error,*999)
984 ALLOCATE(row_domain_mapping%GLOBAL_TO_LOCAL_MAP(number_of_global_solver_rows)%LOCAL_NUMBER(1),stat=err)
985 IF(err/=0)
CALL flagerror(
"Could not allocate row global to local map local number.",err,error,*999)
986 ALLOCATE(row_domain_mapping%GLOBAL_TO_LOCAL_MAP(number_of_global_solver_rows)%DOMAIN_NUMBER(1),stat=err)
987 IF(err/=0)
CALL flagerror(
"Could not allocate row global to local map domain number.",err,error,*999)
988 ALLOCATE(row_domain_mapping%GLOBAL_TO_LOCAL_MAP(number_of_global_solver_rows)%LOCAL_TYPE(1),stat=err)
989 IF(err/=0)
CALL flagerror(
"Could not allocate row global to local map local type.",err,error,*999)
991 row_domain_mapping%GLOBAL_TO_LOCAL_MAP(number_of_global_solver_rows)%NUMBER_OF_DOMAINS=1
992 row_domain_mapping%GLOBAL_TO_LOCAL_MAP(number_of_global_solver_rows)%LOCAL_NUMBER(1)= &
993 & number_of_local_solver_rows
994 row_domain_mapping%GLOBAL_TO_LOCAL_MAP(number_of_global_solver_rows)%DOMAIN_NUMBER(1)=rank
995 row_domain_mapping%GLOBAL_TO_LOCAL_MAP(number_of_global_solver_rows)%LOCAL_TYPE(1)=
domain_local_internal 997 IF(rank==myrank)
THEN 1005 & number_of_local_solver_rows),err,error,*999)
1006 ALLOCATE(solver_mapping%SOLVER_ROW_TO_EQUATIONS_ROWS_MAP(number_of_local_solver_rows)% &
1007 & rowcol_number(1),stat=err)
1009 &
CALL flagerror(
"Could not allocate solver row to equations rows row/col number.",err,error,*999)
1010 ALLOCATE(solver_mapping%SOLVER_ROW_TO_EQUATIONS_ROWS_MAP(number_of_local_solver_rows)% &
1011 & coupling_coefficients(1),stat=err)
1012 IF(err/=0)
CALL flagerror(
"Could not allocate solver row to equations rows coupling coefficients.", &
1016 solver_mapping%SOLVER_ROW_TO_EQUATIONS_ROWS_MAP(number_of_local_solver_rows)%INTERFACE_CONDITION_INDEX= &
1017 & interface_condition_idx
1018 solver_mapping%SOLVER_ROW_TO_EQUATIONS_ROWS_MAP(number_of_local_solver_rows)%ROWCOL_NUMBER(1)= &
1020 solver_mapping%SOLVER_ROW_TO_EQUATIONS_ROWS_MAP(number_of_local_solver_rows)%COUPLING_COEFFICIENTS(1)= &
1023 solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
1024 & interface_column_to_solver_rows_maps(local_column)%NUMBER_OF_SOLVER_ROWS=1
1025 solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
1026 & interface_column_to_solver_rows_maps(local_column)%SOLVER_ROW=number_of_local_solver_rows
1027 solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
1028 & interface_column_to_solver_rows_maps(local_column)%COUPLING_COEFFICIENT=1.0_dp
1029 SELECT CASE(interface_condition%METHOD)
1033 interface_matrix_idx=interface_mapping%NUMBER_OF_INTERFACE_MATRICES
1035 solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
1036 & interface_to_solver_matrix_maps_im(interface_matrix_idx)%INTERFACE_ROW_TO_SOLVER_ROWS_MAP( &
1037 & local_column)%NUMBER_OF_SOLVER_ROWS=1
1038 solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
1039 & interface_to_solver_matrix_maps_im(interface_matrix_idx)%INTERFACE_ROW_TO_SOLVER_ROWS_MAP( &
1040 & local_column)%SOLVER_ROW=number_of_local_solver_rows
1041 solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
1042 & interface_to_solver_matrix_maps_im(interface_matrix_idx)%INTERFACE_ROW_TO_SOLVER_ROWS_MAP( &
1043 & local_column)%COUPLING_COEFFICIENT=1.0_dp
1046 ELSE IF(constrained_dof)
THEN 1047 CALL flagerror(
"Constrained DOFs have not been implemented for Lagrange variables.",err,error,*999)
1050 IF(rank==myrank)
THEN 1052 solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
1053 & interface_column_to_solver_rows_maps(local_column)%NUMBER_OF_SOLVER_ROWS=0
1054 SELECT CASE(interface_condition%METHOD)
1058 interface_matrix_idx=interface_mapping%NUMBER_OF_INTERFACE_MATRICES
1060 solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
1061 & interface_to_solver_matrix_maps_im(interface_matrix_idx)%INTERFACE_ROW_TO_SOLVER_ROWS_MAP( &
1062 & local_column)%NUMBER_OF_SOLVER_ROWS=0
1067 IF(
ALLOCATED(rank_global_rows_list))
DEALLOCATE(rank_global_rows_list)
1080 ALLOCATE(solver_mapping%SOLVER_COL_TO_EQUATIONS_COLS_MAP(solver_mapping%NUMBER_OF_SOLVER_MATRICES),stat=err)
1081 IF(err/=0)
CALL flagerror(
"Could not allocate solver mapping solver column to equations column maps.",err,error,*999)
1082 ALLOCATE(solver_mapping%VARIABLES_LIST(solver_mapping%NUMBER_OF_SOLVER_MATRICES),stat=err)
1083 IF(err/=0)
CALL flagerror(
"Could not allocate solver mapping variables list.",err,error,*999)
1087 DO solver_matrix_idx=1,solver_mapping%NUMBER_OF_SOLVER_MATRICES
1095 CALL list_detach_and_destroy(solver_mapping%CREATE_VALUES_CACHE%EQUATIONS_VARIABLE_LIST(solver_matrix_idx)%PTR, &
1096 & number_of_equations_variables,equations_variables,err,error,*999)
1097 CALL list_detach_and_destroy(solver_mapping%CREATE_VALUES_CACHE%INTERFACE_VARIABLE_LIST(solver_matrix_idx)%PTR, &
1098 & number_of_interface_variables,interface_variables,err,error,*999)
1099 ALLOCATE(solver_mapping%VARIABLES_LIST(solver_matrix_idx)%VARIABLES(number_of_equations_variables+ &
1100 & number_of_interface_variables),stat=err)
1101 IF(err/=0)
CALL flagerror(
"Could not allocate variables list variables.",err,error,*999)
1102 solver_mapping%VARIABLES_LIST(solver_matrix_idx)%NUMBER_OF_VARIABLES=number_of_equations_variables+ &
1103 & number_of_interface_variables
1104 ALLOCATE(variables_list(number_of_equations_variables+number_of_interface_variables),stat=err)
1105 IF(err/=0)
CALL flagerror(
"Could not allocate variables list.",err,error,*999)
1106 ALLOCATE(variable_processed(number_of_equations_variables+number_of_interface_variables),stat=err)
1107 IF(err/=0)
CALL flagerror(
"Could not allocate variable processed.",err,error,*999)
1108 variable_processed=.false.
1109 solver_variable_idx=0
1110 DO variable_idx=1,number_of_equations_variables
1111 solver_variable_idx=solver_variable_idx+1
1113 & variables(solver_variable_idx),err,error,*999)
1114 equations_set_idx=equations_variables(1,variable_idx)
1115 equations_set=>solver_mapping%EQUATIONS_SETS(equations_set_idx)%PTR
1116 IF(
ASSOCIATED(equations_set))
THEN 1117 dependent_field=>equations_set%DEPENDENT%DEPENDENT_FIELD
1118 IF(
ASSOCIATED(dependent_field))
THEN 1119 variable_type=equations_variables(2,variable_idx)
1120 variable=>dependent_field%VARIABLE_TYPE_MAP(variable_type)%PTR
1121 IF(
ASSOCIATED(variable))
THEN 1122 solver_mapping%VARIABLES_LIST(solver_matrix_idx)%VARIABLES(solver_variable_idx)%VARIABLE=> &
1124 solver_mapping%VARIABLES_LIST(solver_matrix_idx)%VARIABLES(solver_variable_idx)%VARIABLE_TYPE= &
1126 NULLIFY(variables_list(solver_variable_idx)%PTR)
1133 CALL flagerror(
"Dependent field variable is not associated.",err,error,*999)
1136 CALL flagerror(
"Equations set dependent field is not associated.",err,error,*999)
1139 CALL flagerror(
"Equations set is not associated.",err,error,*999)
1142 IF(
ALLOCATED(equations_variables))
DEALLOCATE(equations_variables)
1143 DO variable_idx=1,number_of_interface_variables
1144 solver_variable_idx=solver_variable_idx+1
1146 & variables(solver_variable_idx),err,error,*999)
1147 interface_condition_idx=interface_variables(1,variable_idx)
1148 interface_condition=>solver_mapping%INTERFACE_CONDITIONS(interface_condition_idx)%PTR
1149 IF(
ASSOCIATED(interface_condition))
THEN 1150 IF(
ASSOCIATED(interface_condition%LAGRANGE))
THEN 1151 lagrange_field=>interface_condition%LAGRANGE%LAGRANGE_FIELD
1152 IF(
ASSOCIATED(lagrange_field))
THEN 1153 variable_type=interface_variables(2,variable_idx)
1154 variable=>lagrange_field%VARIABLE_TYPE_MAP(variable_type)%PTR
1155 IF(
ASSOCIATED(variable))
THEN 1156 solver_mapping%VARIABLES_LIST(solver_matrix_idx)%VARIABLES(solver_variable_idx)%VARIABLE=> &
1158 solver_mapping%VARIABLES_LIST(solver_matrix_idx)%VARIABLES(solver_variable_idx)%VARIABLE_TYPE= &
1160 NULLIFY(variables_list(solver_variable_idx)%PTR)
1167 CALL flagerror(
"Lagrange field variable is not associated.",err,error,*999)
1170 CALL flagerror(
"Interface condition Lagrange field is not associated.",err,error,*999)
1173 CALL flagerror(
"Interface condition Lagrange is not associated.",err,error,*999)
1176 CALL flagerror(
"Interface condition is not associated.",err,error,*999)
1179 IF(
ALLOCATED(interface_variables))
DEALLOCATE(interface_variables)
1183 & solver_col_to_equations_cols_map(solver_matrix_idx),err,error,*999)
1184 solver_mapping%SOLVER_COL_TO_EQUATIONS_COLS_MAP(solver_matrix_idx)%SOLVER_MATRIX_NUMBER=solver_matrix_idx
1185 solver_mapping%SOLVER_COL_TO_EQUATIONS_COLS_MAP(solver_matrix_idx)%SOLVER_MAPPING=>solver_mapping
1187 ALLOCATE(solver_mapping%SOLVER_COL_TO_EQUATIONS_COLS_MAP(solver_matrix_idx)%SOLVER_COL_TO_EQUATIONS_SET_MAPS( &
1188 & solver_mapping%NUMBER_OF_EQUATIONS_SETS),stat=err)
1189 IF(err/=0)
CALL flagerror(
"Could not allocate solver col to equations map solver col to equation set maps.", &
1192 ALLOCATE(solver_mapping%SOLVER_COL_TO_EQUATIONS_COLS_MAP(solver_matrix_idx)%SOLVER_COL_TO_INTERFACE_MAPS( &
1193 & solver_mapping%NUMBER_OF_INTERFACE_CONDITIONS),stat=err)
1194 IF(err/=0)
CALL flagerror(
"Could not allocate solver col to equations map solver col to interface maps.", &
1199 ALLOCATE(rank_global_cols_lists(2,solver_mapping%NUMBER_OF_EQUATIONS_SETS+solver_mapping% &
1200 & number_of_interface_conditions,solver_mapping%VARIABLES_LIST(solver_matrix_idx)%NUMBER_OF_VARIABLES, &
1202 IF(err/=0)
CALL flagerror(
"Could not allocate rank global columns lists.",err,error,*999)
1204 DO solver_variable_idx=1,solver_mapping%VARIABLES_LIST(solver_matrix_idx)%NUMBER_OF_VARIABLES
1205 DO equations_idx=1,solver_mapping%NUMBER_OF_EQUATIONS_SETS+solver_mapping%NUMBER_OF_INTERFACE_CONDITIONS
1207 NULLIFY(rank_global_cols_lists(dof_type,equations_idx,solver_variable_idx,rank)%PTR)
1208 CALL list_create_start(rank_global_cols_lists(dof_type,equations_idx,solver_variable_idx,rank)%PTR, &
1210 CALL list_data_type_set(rank_global_cols_lists(dof_type,equations_idx,solver_variable_idx,rank)%PTR, &
1213 CALL list_initial_size_set(rank_global_cols_lists(dof_type,equations_idx,solver_variable_idx,rank)%PTR, &
1214 & solver_mapping%VARIABLES_LIST(solver_matrix_idx)%VARIABLES(solver_variable_idx)%VARIABLE% &
1215 & total_number_of_dofs,err,error,*999)
1218 CALL list_key_dimension_set(rank_global_cols_lists(dof_type,equations_idx,solver_variable_idx,rank)%PTR,1, &
1220 CALL list_create_finish(rank_global_cols_lists(dof_type,equations_idx,solver_variable_idx,rank)%PTR, &
1233 ALLOCATE(sub_matrix_information(3,solver_mapping%NUMBER_OF_EQUATIONS_SETS+ &
1234 & solver_mapping%NUMBER_OF_INTERFACE_CONDITIONS,solver_mapping%VARIABLES_LIST(solver_matrix_idx)% &
1235 & number_of_variables),stat=err)
1236 IF(err/=0)
CALL flagerror(
"Could not allocate sub matrix information.",err,error,*999)
1237 sub_matrix_information=0
1239 ALLOCATE(sub_matrix_list(0:3,solver_mapping%NUMBER_OF_EQUATIONS_SETS+ &
1240 & solver_mapping%NUMBER_OF_INTERFACE_CONDITIONS,solver_mapping%VARIABLES_LIST(solver_matrix_idx)% &
1241 & number_of_variables),stat=err)
1242 IF(err/=0)
CALL flagerror(
"Could not allocate sub matrix list.",err,error,*999)
1250 ALLOCATE(number_of_variable_global_solver_dofs(solver_mapping%VARIABLES_LIST(solver_matrix_idx)%NUMBER_OF_VARIABLES), &
1252 IF(err/=0)
CALL flagerror(
"Could not allocate number of global solver dofs.",err,error,*999)
1253 ALLOCATE(number_of_variable_local_solver_dofs(solver_mapping%VARIABLES_LIST(solver_matrix_idx)%NUMBER_OF_VARIABLES), &
1255 IF(err/=0)
CALL flagerror(
"Could not allocate number of local solver dofs.",err,error,*999)
1256 ALLOCATE(total_number_of_variable_local_solver_dofs(solver_mapping%VARIABLES_LIST(solver_matrix_idx)% &
1257 & number_of_variables),stat=err)
1258 IF(err/=0)
CALL flagerror(
"Could not allocate total number of local solver dofs.",err,error,*999)
1260 number_of_variable_global_solver_dofs=0
1261 number_of_variable_local_solver_dofs=0
1262 total_number_of_variable_local_solver_dofs=0
1266 DO equations_set_idx=1,solver_mapping%NUMBER_OF_EQUATIONS_SETS
1267 equations_idx=equations_idx+1
1269 equations_set=>solver_mapping%EQUATIONS_SETS(equations_set_idx)%PTR
1270 equations=>equations_set%EQUATIONS
1271 equations_mapping=>equations%EQUATIONS_MAPPING
1272 dynamic_mapping=>equations_mapping%DYNAMIC_MAPPING
1273 linear_mapping=>equations_mapping%LINEAR_MAPPING
1274 nonlinear_mapping=>equations_mapping%NONLINEAR_MAPPING
1275 dependent_field=>equations_set%DEPENDENT%DEPENDENT_FIELD
1276 NULLIFY(equations_set_variable_list)
1282 IF(
ASSOCIATED(dynamic_mapping))
THEN 1283 equations_variable_list_item(1)=solver_mapping%CREATE_VALUES_CACHE%DYNAMIC_VARIABLE_TYPE(equations_set_idx)
1285 equations_variable_list_item(3)=0
1286 CALL list_item_add(equations_set_variable_list,equations_variable_list_item,err,error,*999)
1288 IF(
ASSOCIATED(linear_mapping))
THEN 1289 DO variable_idx=1,solver_mapping%CREATE_VALUES_CACHE%MATRIX_VARIABLE_TYPES(0,equations_set_idx,solver_matrix_idx)
1290 equations_variable_list_item(1)=solver_mapping%CREATE_VALUES_CACHE%MATRIX_VARIABLE_TYPES( &
1291 & variable_idx,equations_set_idx,solver_matrix_idx)
1293 equations_variable_list_item(3)=variable_idx
1294 CALL list_item_add(equations_set_variable_list,equations_variable_list_item,err,error,*999)
1297 IF(
ASSOCIATED(nonlinear_mapping))
THEN 1298 DO variable_idx=1,solver_mapping%CREATE_VALUES_CACHE%RESIDUAL_VARIABLE_TYPES(0,equations_set_idx)
1299 equations_variable_list_item(1)=solver_mapping%CREATE_VALUES_CACHE%RESIDUAL_VARIABLE_TYPES( &
1300 & variable_idx,equations_set_idx)
1302 equations_variable_list_item(3)=variable_idx
1303 CALL list_item_add(equations_set_variable_list,equations_variable_list_item,err,error,*999)
1307 CALL list_detach_and_destroy(equations_set_variable_list,number_of_variables,equations_set_variables,err,error,*999)
1310 & equations_set_to_solver_map(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_SM(solver_matrix_idx), &
1312 solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_SM( &
1313 & solver_matrix_idx)%SOLVER_MATRIX_NUMBER=solver_matrix_idx
1315 ALLOCATE(solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_SM( &
1316 & solver_matrix_idx)%VARIABLE_TYPES(number_of_variables),stat=err)
1318 &
CALL flagerror(
"Could not allocate equations to solver matrix maps sm variable types.",err,error,*999)
1319 ALLOCATE(solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_SM( &
1320 & solver_matrix_idx)%VARIABLES(number_of_variables),stat=err)
1321 IF(err/=0)
CALL flagerror(
"Could not allocate equations to solver matrix maps sm variables.",err,error,*999)
1322 ALLOCATE(solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_SM( &
1323 & solver_matrix_idx)%VARIABLE_TO_SOLVER_COL_MAPS(number_of_variables),stat=err)
1325 &
CALL flagerror(
"Could not allocate equations to solver matrix maps sm variables to solver col maps.", &
1328 solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_SM( &
1329 & solver_matrix_idx)%NUMBER_OF_VARIABLES=number_of_variables
1330 number_of_dynamic_equations_matrices=0
1331 number_of_linear_equations_matrices=0
1333 DO variable_idx=1,number_of_variables
1334 variable_type=equations_set_variables(1,variable_idx)
1335 matrices_type=equations_set_variables(2,variable_idx)
1336 matrix_variable_idx=equations_set_variables(3,variable_idx)
1337 dependent_variable=>dependent_field%VARIABLE_TYPE_MAP(variable_type)%PTR
1338 IF(
ASSOCIATED(dependent_variable))
THEN 1341 DO variable_position_idx=1,solver_mapping%VARIABLES_LIST(solver_matrix_idx)%NUMBER_OF_VARIABLES
1342 IF(
ASSOCIATED(dependent_variable,solver_mapping%VARIABLES_LIST(solver_matrix_idx)%VARIABLES( &
1343 & variable_position_idx)%VARIABLE))
THEN 1350 variable_list_item(1)=equations_set_idx
1351 variable_list_item(2)=variable_type
1353 CALL list_item_add(variables_list(variable_position_idx)%PTR,variable_list_item,err,error,*999)
1354 col_dofs_mapping=>dependent_variable%DOMAIN_MAPPING
1355 IF(
ASSOCIATED(col_dofs_mapping))
THEN 1358 IF(
ASSOCIATED(boundary_conditions_variable))
THEN 1359 solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_SM( &
1360 & solver_matrix_idx)%VARIABLE_TYPES(variable_idx)=variable_type
1361 solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_SM( &
1362 & solver_matrix_idx)%VARIABLES(variable_idx)%PTR=>dependent_variable
1364 ALLOCATE(solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)% &
1365 & equations_to_solver_matrix_maps_sm(solver_matrix_idx)%VARIABLE_TO_SOLVER_COL_MAPS(variable_idx)% &
1366 & column_numbers(dependent_variable%TOTAL_NUMBER_OF_DOFS),stat=err)
1367 IF(err/=0)
CALL flagerror(
"Could not allocate variables to solver column maps column numbers.", &
1369 ALLOCATE(solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)% &
1370 & equations_to_solver_matrix_maps_sm(solver_matrix_idx)%VARIABLE_TO_SOLVER_COL_MAPS(variable_idx)% &
1371 & coupling_coefficients(dependent_variable%TOTAL_NUMBER_OF_DOFS),stat=err)
1372 IF(err/=0)
CALL flagerror(
"Could not allocate variables to solver column maps coupling coefficients.", &
1374 ALLOCATE(solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)% &
1375 & equations_to_solver_matrix_maps_sm(solver_matrix_idx)%VARIABLE_TO_SOLVER_COL_MAPS(variable_idx)% &
1376 & additive_constants(dependent_variable%TOTAL_NUMBER_OF_DOFS),stat=err)
1377 IF(err/=0)
CALL flagerror(
"Could not allocate variables to solver column maps additive constants.", &
1382 sub_matrix_information(2,equations_idx,variable_position_idx)=equations_set_idx
1384 IF(
ASSOCIATED(dynamic_mapping))
THEN 1385 number_of_dynamic_equations_matrices=number_of_dynamic_equations_matrices+ &
1386 & dynamic_mapping%VAR_TO_EQUATIONS_MATRICES_MAPS(variable_type)%NUMBER_OF_EQUATIONS_MATRICES
1387 IF(dynamic_mapping%VAR_TO_EQUATIONS_MATRICES_MAPS(variable_type)%NUMBER_OF_EQUATIONS_MATRICES>0)
THEN 1388 sub_matrix_list(0,equations_idx,variable_position_idx)= &
1389 sub_matrix_list(0,equations_idx,variable_position_idx)+1
1390 sub_matrix_list(sub_matrix_list(0,equations_idx,variable_position_idx), &
1394 IF(
ASSOCIATED(linear_mapping))
THEN 1395 number_of_linear_equations_matrices=number_of_linear_equations_matrices+ &
1396 & linear_mapping%VAR_TO_EQUATIONS_MATRICES_MAPS(variable_type)%NUMBER_OF_EQUATIONS_MATRICES
1397 IF(linear_mapping%VAR_TO_EQUATIONS_MATRICES_MAPS(variable_type)%NUMBER_OF_EQUATIONS_MATRICES>0)
THEN 1398 sub_matrix_list(0,equations_idx,variable_position_idx)= &
1399 sub_matrix_list(0,equations_idx,variable_position_idx)+1
1400 sub_matrix_list(sub_matrix_list(0,equations_idx,variable_position_idx), &
1404 IF(
ASSOCIATED(nonlinear_mapping))
THEN 1405 DO equations_matrix_idx=1,nonlinear_mapping%NUMBER_OF_RESIDUAL_VARIABLES
1406 IF(nonlinear_mapping%VAR_TO_JACOBIAN_MAP(equations_matrix_idx)%VARIABLE_TYPE==variable_type)
THEN 1407 sub_matrix_list(0,equations_idx,variable_position_idx)= &
1408 sub_matrix_list(0,equations_idx,variable_position_idx)+1
1409 sub_matrix_list(sub_matrix_list(0,equations_idx,variable_position_idx), &
1415 DO global_dof=1,dependent_variable%NUMBER_OF_GLOBAL_DOFS
1416 DO rank_idx=1,col_dofs_mapping%GLOBAL_TO_LOCAL_MAP(global_dof)%NUMBER_OF_DOMAINS
1417 local_dof=col_dofs_mapping%GLOBAL_TO_LOCAL_MAP(global_dof)%LOCAL_NUMBER(rank_idx)
1418 dof_type=col_dofs_mapping%GLOBAL_TO_LOCAL_MAP(global_dof)%LOCAL_TYPE(rank_idx)
1419 column_rank=col_dofs_mapping%GLOBAL_TO_LOCAL_MAP(global_dof)%DOMAIN_NUMBER(rank_idx)
1422 globaldofcouplingnumber=0
1423 IF(
ASSOCIATED(boundary_conditions_variable%dofConstraints))
THEN 1424 dofconstraints=>boundary_conditions_variable%dofConstraints
1425 IF(dofconstraints%numberOfConstraints>0)
THEN 1426 IF(
ALLOCATED(dofconstraints%dofCouplings))
THEN 1427 IF(
ASSOCIATED(dofconstraints%dofCouplings(global_dof)%ptr))
THEN 1429 & dofconstraints%dofCouplings(global_dof)%ptr, &
1430 & globaldofcouplingnumber,err,error,*999)
1433 CALL flagerror(
"DOF constraints DOF couplings are not allocated.",err,error,*999)
1437 column_list_item(1)=global_dof
1438 column_list_item(2)=local_dof
1439 column_list_item(5)=globaldofcouplingnumber
1442 IF(include_column)
THEN 1443 column_list_item(3)=1
1444 IF(.NOT.variable_processed(variable_position_idx))
THEN 1445 number_of_variable_global_solver_dofs(variable_position_idx)= &
1446 & number_of_variable_global_solver_dofs(variable_position_idx)+1
1447 IF(column_rank==myrank)
THEN 1448 number_of_variable_local_solver_dofs(variable_position_idx)= &
1449 & number_of_variable_local_solver_dofs(variable_position_idx)+1
1450 total_number_of_variable_local_solver_dofs(variable_position_idx)= &
1451 & total_number_of_variable_local_solver_dofs(variable_position_idx)+1
1454 ELSE IF(constrained_dof)
THEN 1455 column_list_item(3)=2
1457 column_list_item(3)=0
1459 column_list_item(4)=variable_idx
1460 CALL list_item_add(rank_global_cols_lists(1,equations_idx,variable_position_idx,column_rank)%PTR, &
1461 & column_list_item,err,error,*999)
1464 IF(include_column)
THEN 1465 column_list_item(3)=1
1466 IF(.NOT.variable_processed(variable_position_idx))
THEN 1467 IF(column_rank==myrank) total_number_of_variable_local_solver_dofs(variable_position_idx)= &
1468 & total_number_of_variable_local_solver_dofs(variable_position_idx)+1
1470 ELSE IF(constrained_dof)
THEN 1471 column_list_item(3)=2
1473 column_list_item(3)=0
1475 column_list_item(4)=variable_idx
1476 CALL list_item_add(rank_global_cols_lists(2,equations_idx,variable_position_idx,column_rank)%PTR, &
1477 & column_list_item,err,error,*999)
1482 CALL flagerror(
"Boundary condition variable not associated.",err,error,*999)
1485 CALL flagerror(
"Equations matrix columns degree of freedom mapping is not associated.",err,error,*999)
1487 variable_processed(variable_position_idx)=.true.
1489 CALL flagerror(
"Dependent variable does not exist in the list of solver variables.",err,error,*999)
1492 CALL flagerror(
"Dependent variable is not associated.",err,error,*999)
1495 IF(
ALLOCATED(equations_set_variables))
DEALLOCATE(equations_set_variables)
1498 DO interface_condition_idx=1,solver_mapping%NUMBER_OF_INTERFACE_CONDITIONS
1499 equations_idx=equations_idx+1
1501 interface_condition=>solver_mapping%INTERFACE_CONDITIONS(interface_condition_idx)%PTR
1502 SELECT CASE(interface_condition%METHOD)
1504 interface_equations=>interface_condition%INTERFACE_EQUATIONS
1505 interface_mapping=>interface_equations%INTERFACE_MAPPING
1506 interface_dependent=>interface_condition%DEPENDENT
1509 & interface_condition_idx)%INTERFACE_TO_SOLVER_MATRIX_MAPS_SM(solver_matrix_idx), &
1511 solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)%INTERFACE_TO_SOLVER_MATRIX_MAPS_SM( &
1512 & solver_matrix_idx)%SOLVER_MATRIX_NUMBER=solver_matrix_idx
1514 ALLOCATE(solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
1515 & interface_to_solver_matrix_maps_sm(solver_matrix_idx)%DEPENDENT_VARIABLE_TYPES( &
1516 & interface_mapping%NUMBER_OF_INTERFACE_MATRICES),stat=err)
1518 &
CALL flagerror(
"Could not allocate interface to solver matrix maps sm dependent variable types.", &
1520 ALLOCATE(solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
1521 & interface_to_solver_matrix_maps_sm(solver_matrix_idx)%DEPENDENT_VARIABLES(interface_mapping% &
1522 & number_of_interface_matrices),stat=err)
1523 IF(err/=0)
CALL flagerror(
"Could not allocate equations to solver matrix maps sm variables.",err,error,*999)
1524 ALLOCATE(solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
1525 & interface_to_solver_matrix_maps_sm(solver_matrix_idx)%DEPENDENT_VARIABLE_TO_SOLVER_COL_MAPS( &
1526 & interface_mapping%NUMBER_OF_INTERFACE_MATRICES),stat=err)
1527 IF(err/=0)
CALL flagerror(
"Could not allocate interface to solver matrix maps sm dependent variables "// &
1528 &
"to solver col maps.",err,error,*999)
1530 lagrange_field=>interface_condition%LAGRANGE%LAGRANGE_FIELD
1533 lagrange_variable=>lagrange_field%VARIABLE_TYPE_MAP(variable_type)%PTR
1534 IF(
ASSOCIATED(lagrange_variable))
THEN 1537 DO variable_position_idx=1,solver_mapping%VARIABLES_LIST(solver_matrix_idx)%NUMBER_OF_VARIABLES
1538 IF(
ASSOCIATED(lagrange_variable,solver_mapping%VARIABLES_LIST(solver_matrix_idx)%VARIABLES( &
1539 & variable_position_idx)%VARIABLE))
THEN 1546 variable_list_item(1)=interface_condition_idx
1547 variable_list_item(2)=variable_type
1549 CALL list_item_add(variables_list(variable_position_idx)%PTR,variable_list_item,err,error,*999)
1550 col_dofs_mapping=>lagrange_variable%DOMAIN_MAPPING
1551 IF(
ASSOCIATED(col_dofs_mapping))
THEN 1554 IF(
ASSOCIATED(boundary_conditions_variable))
THEN 1555 solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
1556 & interface_to_solver_matrix_maps_sm(solver_matrix_idx)%LAGRANGE_VARIABLE_TYPE=variable_type
1557 solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
1558 & interface_to_solver_matrix_maps_sm(solver_matrix_idx)%LAGRANGE_VARIABLE=>lagrange_variable
1560 ALLOCATE(solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
1561 & interface_to_solver_matrix_maps_sm(solver_matrix_idx)%LAGRANGE_VARIABLE_TO_SOLVER_COL_MAP% &
1562 & column_numbers(lagrange_variable%TOTAL_NUMBER_OF_DOFS),stat=err)
1563 IF(err/=0)
CALL flagerror(
"Could not allocate variables to solver column maps column numbers.", &
1565 ALLOCATE(solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
1566 & interface_to_solver_matrix_maps_sm(solver_matrix_idx)%LAGRANGE_VARIABLE_TO_SOLVER_COL_MAP% &
1567 & coupling_coefficients(lagrange_variable%TOTAL_NUMBER_OF_DOFS),stat=err)
1568 IF(err/=0)
CALL flagerror(
"Could not allocate variables to solver column maps coupling coefficients.", &
1570 ALLOCATE(solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
1571 & interface_to_solver_matrix_maps_sm(solver_matrix_idx)%LAGRANGE_VARIABLE_TO_SOLVER_COL_MAP% &
1572 & additive_constants(lagrange_variable%TOTAL_NUMBER_OF_DOFS),stat=err)
1573 IF(err/=0)
CALL flagerror(
"Could not allocate variables to solver column maps additive constants.", &
1575 DO equations_idx2=1,solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
1576 & number_of_equations_sets
1577 equations_set_idx=solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
1578 & interface_to_solver_matrix_maps_equations(equations_idx2)%EQUATIONS_SET_INDEX
1579 interface_matrix_idx=solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
1580 & interface_to_solver_matrix_maps_equations(equations_idx2)%INTERFACE_MATRIX_INDEX
1582 sub_matrix_information(1,equations_set_idx,variable_position_idx)= &
1584 sub_matrix_information(2,equations_set_idx,variable_position_idx)=interface_condition_idx
1585 sub_matrix_information(3,equations_set_idx,variable_position_idx)=interface_matrix_idx
1587 DO global_dof=1,lagrange_variable%NUMBER_OF_GLOBAL_DOFS
1588 DO rank_idx=1,col_dofs_mapping%GLOBAL_TO_LOCAL_MAP(global_dof)%NUMBER_OF_DOMAINS
1589 local_dof=col_dofs_mapping%GLOBAL_TO_LOCAL_MAP(global_dof)%LOCAL_NUMBER(rank_idx)
1590 dof_type=col_dofs_mapping%GLOBAL_TO_LOCAL_MAP(global_dof)%LOCAL_TYPE(rank_idx)
1591 column_rank=col_dofs_mapping%GLOBAL_TO_LOCAL_MAP(global_dof)%DOMAIN_NUMBER(rank_idx)
1593 column_list_item(1)=global_dof
1594 column_list_item(2)=local_dof
1597 IF(include_column)
THEN 1598 column_list_item(3)=1
1599 IF(.NOT.variable_processed(variable_position_idx))
THEN 1600 number_of_variable_global_solver_dofs(variable_position_idx)= &
1601 & number_of_variable_global_solver_dofs(variable_position_idx)+1
1602 IF(column_rank==myrank)
THEN 1603 number_of_variable_local_solver_dofs(variable_position_idx)= &
1604 & number_of_variable_local_solver_dofs(variable_position_idx)+1
1605 total_number_of_variable_local_solver_dofs(variable_position_idx)= &
1606 & total_number_of_variable_local_solver_dofs(variable_position_idx)+1
1610 column_list_item(3)=0
1612 column_list_item(4)=variable_idx
1613 CALL list_item_add(rank_global_cols_lists(1,equations_set_idx,variable_position_idx, &
1614 & column_rank)%PTR,column_list_item,err,error,*999)
1617 IF(include_column)
THEN 1618 column_list_item(3)=1
1619 IF(.NOT.variable_processed(variable_position_idx))
THEN 1620 IF(column_rank==myrank) total_number_of_variable_local_solver_dofs(variable_position_idx)= &
1621 & total_number_of_variable_local_solver_dofs(variable_position_idx)+1
1624 column_list_item(3)=0
1626 column_list_item(4)=variable_idx
1627 CALL list_item_add(rank_global_cols_lists(2,equations_set_idx,variable_position_idx, &
1628 & column_rank)%PTR,column_list_item,err,error,*999)
1632 variable_processed(variable_position_idx)=.true.
1635 CALL flagerror(
"Boundary condition variable not associated.",err,error,*999)
1638 CALL flagerror(
"Columns degree of freedom mapping is not associated.",err,error,*999)
1641 CALL flagerror(
"Lagrange variable does not exist in the list of solver variables.",err,error,*999)
1644 CALL flagerror(
"Lagrange variable is not associated.",err,error,*999)
1647 solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)%INTERFACE_TO_SOLVER_MATRIX_MAPS_SM( &
1648 & solver_matrix_idx)%NUMBER_OF_DEPENDENT_VARIABLES=interface_mapping%NUMBER_OF_INTERFACE_MATRICES
1649 DO interface_matrix_idx=1,interface_mapping%NUMBER_OF_INTERFACE_MATRICES
1650 dependent_variable=>interface_mapping%INTERFACE_MATRIX_ROWS_TO_VAR_MAPS(interface_matrix_idx)%VARIABLE
1651 IF(
ASSOCIATED(dependent_variable))
THEN 1652 variable_type=dependent_variable%VARIABLE_TYPE
1655 DO variable_position_idx=1,solver_mapping%VARIABLES_LIST(solver_matrix_idx)%NUMBER_OF_VARIABLES
1656 IF(
ASSOCIATED(dependent_variable,solver_mapping%VARIABLES_LIST(solver_matrix_idx)%VARIABLES( &
1657 & variable_position_idx)%VARIABLE))
THEN 1663 equations_set=>interface_dependent%EQUATIONS_SETS(interface_mapping%INTERFACE_MATRIX_ROWS_TO_VAR_MAPS( &
1664 & interface_matrix_idx)%MESH_INDEX)%PTR
1666 IF(
ASSOCIATED(equations_set).OR.
ASSOCIATED(interface_equations))
THEN 1667 col_dofs_mapping=>dependent_variable%DOMAIN_MAPPING
1668 IF(
ASSOCIATED(col_dofs_mapping))
THEN 1670 & boundary_conditions_variable,err,error,*999)
1671 IF(
ASSOCIATED(boundary_conditions_variable))
THEN 1673 solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
1674 & interface_to_solver_matrix_maps_sm(solver_matrix_idx)%DEPENDENT_VARIABLE_TYPES( &
1675 & interface_matrix_idx)=variable_type
1676 solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
1677 & interface_to_solver_matrix_maps_sm(solver_matrix_idx)%DEPENDENT_VARIABLES(interface_matrix_idx)% &
1678 &
ptr=>dependent_variable
1679 ALLOCATE(solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
1680 & interface_to_solver_matrix_maps_sm(solver_matrix_idx)%DEPENDENT_VARIABLE_TO_SOLVER_COL_MAPS( &
1681 & interface_matrix_idx)%COLUMN_NUMBERS(dependent_variable%TOTAL_NUMBER_OF_DOFS),stat=err)
1682 IF(err/=0)
CALL flagerror(
"Could not allocate variables to solver column maps column numbers.", &
1684 ALLOCATE(solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
1685 & interface_to_solver_matrix_maps_sm(solver_matrix_idx)%DEPENDENT_VARIABLE_TO_SOLVER_COL_MAPS( &
1686 & interface_matrix_idx)%COUPLING_COEFFICIENTS(dependent_variable%TOTAL_NUMBER_OF_DOFS),stat=err)
1688 &
CALL flagerror(
"Could not allocate variables to solver column maps coupling coefficients.", &
1690 ALLOCATE(solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
1691 & interface_to_solver_matrix_maps_sm(solver_matrix_idx)%DEPENDENT_VARIABLE_TO_SOLVER_COL_MAPS( &
1692 & interface_matrix_idx)%ADDITIVE_CONSTANTS(dependent_variable%TOTAL_NUMBER_OF_DOFS),stat=err)
1693 IF(err/=0)
CALL flagerror(
"Could not allocate variables to solver column maps additive constants.", &
1696 sub_matrix_information(1,equations_idx,variable_position_idx)= &
1698 sub_matrix_information(2,equations_idx,variable_position_idx)=interface_condition_idx
1699 sub_matrix_information(3,equations_idx,variable_position_idx)=interface_matrix_idx
1701 DO global_dof=1,dependent_variable%NUMBER_OF_GLOBAL_DOFS
1702 DO rank_idx=1,col_dofs_mapping%GLOBAL_TO_LOCAL_MAP(global_dof)%NUMBER_OF_DOMAINS
1703 local_dof=col_dofs_mapping%GLOBAL_TO_LOCAL_MAP(global_dof)%LOCAL_NUMBER(rank_idx)
1704 dof_type=col_dofs_mapping%GLOBAL_TO_LOCAL_MAP(global_dof)%LOCAL_TYPE(rank_idx)
1705 column_rank=col_dofs_mapping%GLOBAL_TO_LOCAL_MAP(global_dof)%DOMAIN_NUMBER(rank_idx)
1707 constrained_dof=boundary_conditions_variable%DOF_TYPES(global_dof)== &
1709 globaldofcouplingnumber=0
1710 IF(
ASSOCIATED(boundary_conditions_variable%dofConstraints))
THEN 1711 dofconstraints=>boundary_conditions_variable%dofConstraints
1712 IF(dofconstraints%numberOfConstraints>0)
THEN 1713 IF(
ALLOCATED(dofconstraints%dofCouplings))
THEN 1714 IF(
ASSOCIATED(dofconstraints%dofCouplings(global_dof)%ptr))
THEN 1716 & dofconstraints%dofCouplings(global_dof)%ptr, &
1717 & globaldofcouplingnumber,err,error,*999)
1720 CALL flagerror(
"DOF constraints DOF couplings are not allocated.",err,error,*999)
1724 column_list_item(1)=global_dof
1725 column_list_item(2)=local_dof
1726 column_list_item(5)=globaldofcouplingnumber
1729 IF(include_column)
THEN 1730 column_list_item(3)=1
1731 IF(.NOT.variable_processed(variable_position_idx))
THEN 1732 number_of_variable_global_solver_dofs(variable_position_idx)= &
1733 & number_of_variable_global_solver_dofs(variable_position_idx)+1
1734 IF(column_rank==myrank)
THEN 1735 number_of_variable_local_solver_dofs(variable_position_idx)= &
1736 & number_of_variable_local_solver_dofs(variable_position_idx)+1
1737 total_number_of_variable_local_solver_dofs(variable_position_idx)= &
1738 & total_number_of_variable_local_solver_dofs(variable_position_idx)+1
1741 ELSE IF(constrained_dof)
THEN 1742 column_list_item(3)=2
1744 column_list_item(3)=0
1746 column_list_item(4)=variable_idx
1747 CALL list_item_add(rank_global_cols_lists(1,equations_idx,variable_position_idx, &
1748 & column_rank)%PTR,column_list_item,err,error,*999)
1751 IF(include_column)
THEN 1752 column_list_item(3)=1
1753 IF(.NOT.variable_processed(variable_position_idx))
THEN 1754 IF(column_rank==myrank) total_number_of_variable_local_solver_dofs(variable_position_idx)= &
1755 & total_number_of_variable_local_solver_dofs(variable_position_idx)+1
1757 ELSE IF(constrained_dof)
THEN 1758 column_list_item(3)=2
1760 column_list_item(3)=0
1762 column_list_item(4)=variable_idx
1763 CALL list_item_add(rank_global_cols_lists(2,equations_idx,variable_position_idx, &
1764 & column_rank)%PTR,column_list_item,err,error,*999)
1769 CALL flagerror(
"Boundary condition variable not associated.",err,error,*999)
1772 CALL flagerror(
"Interface matrix columns degree of freedom mapping is not associated.",err,error,*999)
1775 CALL flagerror(
"Interface dependent equations set is not associated.",err,error,*999)
1777 variable_processed(variable_position_idx)=.true.
1779 CALL flagerror(
"Dependent variable does not exist in the list of solver variables.",err,error,*999)
1782 CALL flagerror(
"Dependent variable is not associated.",err,error,*999)
1786 CALL flagerror(
"Not implemented.",err,error,*999)
1788 CALL flagerror(
"Not implemented.",err,error,*999)
1790 local_error=
"The interface condition method of "// &
1793 CALL flagerror(local_error,err,error,*999)
1797 IF(
ALLOCATED(variable_processed))
DEALLOCATE(variable_processed)
1799 number_of_local_solver_dofs=0
1800 total_number_of_local_solver_dofs=0
1801 number_of_global_solver_dofs=0
1802 DO solver_variable_idx=1,solver_mapping%VARIABLES_LIST(solver_matrix_idx)%NUMBER_OF_VARIABLES
1803 number_of_local_solver_dofs=number_of_local_solver_dofs+number_of_variable_local_solver_dofs(solver_variable_idx)
1804 total_number_of_local_solver_dofs=total_number_of_local_solver_dofs+total_number_of_variable_local_solver_dofs( &
1805 & solver_variable_idx)
1806 number_of_global_solver_dofs=number_of_global_solver_dofs+number_of_variable_global_solver_dofs(solver_variable_idx)
1810 IF(number_of_local_solver_dofs==0)
THEN 1811 local_error=
"Invalid problem setup. The number of local solver DOFs for solver matrix "// &
1813 CALL flagerror(local_error,err,error,*999)
1815 IF(number_of_global_solver_dofs==0)
THEN 1816 local_error=
"Invalid problem setup. The number of global solver DOFs for solver matrix "// &
1818 CALL flagerror(local_error,err,error,*999)
1827 ALLOCATE(solver_mapping%SOLVER_COL_TO_EQUATIONS_COLS_MAP(solver_matrix_idx)%SOLVER_DOF_TO_VARIABLE_MAPS( &
1828 & total_number_of_local_solver_dofs),stat=err)
1829 IF(err/=0)
CALL flagerror(
"Could not allocate solver dof to variable maps.",err,error,*999)
1831 solver_mapping%SOLVER_COL_TO_EQUATIONS_COLS_MAP(solver_matrix_idx)%NUMBER_OF_COLUMNS=number_of_global_solver_dofs
1833 solver_mapping%SOLVER_COL_TO_EQUATIONS_COLS_MAP(solver_matrix_idx)%NUMBER_OF_DOFS=number_of_local_solver_dofs
1834 solver_mapping%SOLVER_COL_TO_EQUATIONS_COLS_MAP(solver_matrix_idx)%TOTAL_NUMBER_OF_DOFS= &
1835 & total_number_of_local_solver_dofs
1836 solver_mapping%SOLVER_COL_TO_EQUATIONS_COLS_MAP(solver_matrix_idx)%NUMBER_OF_GLOBAL_DOFS=number_of_global_solver_dofs
1838 ALLOCATE(solver_mapping%SOLVER_COL_TO_EQUATIONS_COLS_MAP(solver_matrix_idx)%COLUMN_DOFS_MAPPING,stat=err)
1839 IF(err/=0)
CALL flagerror(
"Could not allocate solver col to equations sets map column dofs mapping.",err,error,*999)
1843 col_domain_mapping=>solver_mapping%SOLVER_COL_TO_EQUATIONS_COLS_MAP(solver_matrix_idx)%COLUMN_DOFS_MAPPING
1844 ALLOCATE(col_domain_mapping%GLOBAL_TO_LOCAL_MAP(number_of_global_solver_dofs),stat=err)
1845 IF(err/=0)
CALL flagerror(
"Could not allocate column dofs mapping global to local.",err,error,*999)
1846 col_domain_mapping%NUMBER_OF_GLOBAL=number_of_global_solver_dofs
1847 ALLOCATE(variable_rank_processed(solver_mapping%VARIABLES_LIST(solver_matrix_idx)%NUMBER_OF_VARIABLES, &
1849 IF(err/=0)
CALL flagerror(
"Could not allocate variable rank processed.",err,error,*999)
1850 variable_rank_processed=.false.
1852 number_of_columns=number_of_global_solver_dofs
1855 DO equations_set_idx=1,solver_mapping%NUMBER_OF_EQUATIONS_SETS
1857 equations_set=>solver_mapping%EQUATIONS_SETS(equations_set_idx)%PTR
1858 equations=>equations_set%EQUATIONS
1859 equations_mapping=>equations%EQUATIONS_MAPPING
1860 dynamic_mapping=>equations_mapping%DYNAMIC_MAPPING
1861 linear_mapping=>equations_mapping%LINEAR_MAPPING
1862 nonlinear_mapping=>equations_mapping%NONLINEAR_MAPPING
1864 IF(
ASSOCIATED(dynamic_mapping))
THEN 1866 ALLOCATE(solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_EM( &
1867 & dynamic_mapping%NUMBER_OF_DYNAMIC_EQUATIONS_MATRICES),stat=err)
1869 &
CALL flagerror(
"Could not allocate equations set to solver map equations to solver matrix maps em.", &
1871 DO equations_matrix_idx=1,dynamic_mapping%NUMBER_OF_DYNAMIC_EQUATIONS_MATRICES
1873 & equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_EM(equations_matrix_idx),err,error,*999)
1875 IF(
ASSOCIATED(nonlinear_mapping))
THEN 1877 ALLOCATE(solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_JM( &
1878 & nonlinear_mapping%NUMBER_OF_RESIDUAL_VARIABLES),stat=err)
1880 &
CALL flagerror(
"Could not allocate equations set to solver map equations to solver matrix maps jm.", &
1882 DO equations_matrix_idx=1,nonlinear_mapping%NUMBER_OF_RESIDUAL_VARIABLES
1883 NULLIFY(solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_JM( &
1884 & equations_matrix_idx)%PTR)
1888 IF(
ASSOCIATED(linear_mapping))
THEN 1890 ALLOCATE(solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_EM( &
1891 & linear_mapping%NUMBER_OF_LINEAR_EQUATIONS_MATRICES),stat=err)
1893 &
CALL flagerror(
"Could not allocate equations set to solver map equations to solver matrix maps em.", &
1895 DO equations_matrix_idx=1,linear_mapping%NUMBER_OF_LINEAR_EQUATIONS_MATRICES
1897 & equations_set_to_solver_map(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_EM( &
1898 & equations_matrix_idx),err,error,*999)
1901 IF(
ASSOCIATED(nonlinear_mapping))
THEN 1903 ALLOCATE(solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_JM( &
1904 & nonlinear_mapping%NUMBER_OF_RESIDUAL_VARIABLES),stat=err)
1906 &
CALL flagerror(
"Could not allocate equations set to solver map equations to solver matrix maps jm.", &
1908 DO equations_matrix_idx=1,nonlinear_mapping%NUMBER_OF_RESIDUAL_VARIABLES
1909 NULLIFY(solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_JM( &
1910 & equations_matrix_idx)%PTR)
1917 & solver_col_to_equations_cols_map(solver_matrix_idx)%SOLVER_COL_TO_EQUATIONS_SET_MAPS( &
1918 & equations_set_idx),err,error,*999)
1920 dependent_field=>equations_set%DEPENDENT%DEPENDENT_FIELD
1921 IF(
ASSOCIATED(dynamic_mapping))
THEN 1922 number_of_variables=1
1924 IF(
ASSOCIATED(nonlinear_mapping))
THEN 1925 number_of_variables=solver_mapping%CREATE_VALUES_CACHE%RESIDUAL_VARIABLE_TYPES(0,equations_set_idx)
1927 number_of_variables=solver_mapping%CREATE_VALUES_CACHE%MATRIX_VARIABLE_TYPES(0,equations_set_idx, &
1928 & solver_matrix_idx)
1933 IF(
ASSOCIATED(dynamic_mapping))
THEN 1934 solver_mapping%SOLVER_COL_TO_EQUATIONS_COLS_MAP(solver_matrix_idx)%SOLVER_COL_TO_EQUATIONS_SET_MAPS( &
1935 & equations_set_idx)%HAVE_DYNAMIC=.true.
1936 ALLOCATE(solver_mapping%SOLVER_COL_TO_EQUATIONS_COLS_MAP(solver_matrix_idx)%SOLVER_COL_TO_EQUATIONS_SET_MAPS( &
1937 & equations_set_idx)%SOLVER_COL_TO_DYNAMIC_EQUATIONS_MAPS(number_of_columns),stat=err)
1938 IF(err/=0)
CALL flagerror(
"Could not allocate solver columns to dynamic equations map.",err,error,*999)
1940 solver_mapping%SOLVER_COL_TO_EQUATIONS_COLS_MAP(solver_matrix_idx)%SOLVER_COL_TO_EQUATIONS_SET_MAPS( &
1941 & equations_set_idx)%HAVE_STATIC=.true.
1942 ALLOCATE(solver_mapping%SOLVER_COL_TO_EQUATIONS_COLS_MAP(solver_matrix_idx)%SOLVER_COL_TO_EQUATIONS_SET_MAPS( &
1943 & equations_set_idx)%SOLVER_COL_TO_STATIC_EQUATIONS_MAPS(number_of_columns),stat=err)
1944 IF(err/=0)
CALL flagerror(
"Could not allocate solver columns to static equations map.",err,error,*999)
1947 solver_mapping%SOLVER_COL_TO_EQUATIONS_COLS_MAP(solver_matrix_idx)%SOLVER_COL_TO_EQUATIONS_SET_MAPS( &
1948 & equations_set_idx)%EQUATIONS=>equations
1951 IF(
ASSOCIATED(dynamic_mapping))
THEN 1952 ALLOCATE(solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_SM( &
1953 & solver_matrix_idx)%DYNAMIC_EQUATIONS_TO_SOLVER_MATRIX_MAPS(number_of_dynamic_equations_matrices),stat=err)
1954 IF(err/=0)
CALL flagerror(
"Could not allocate equations to solver matrix maps sm dynamic equations "// &
1955 &
"to solver matrix maps.",err,error,*999)
1957 solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_SM( &
1958 & solver_matrix_idx)%NUMBER_OF_DYNAMIC_EQUATIONS_MATRICES=number_of_dynamic_equations_matrices
1959 DO equations_matrix_idx=1,number_of_dynamic_equations_matrices
1960 NULLIFY(solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_SM( &
1961 & solver_matrix_idx)%DYNAMIC_EQUATIONS_TO_SOLVER_MATRIX_MAPS(equations_matrix_idx)%PTR)
1962 ALLOCATE(solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_SM( &
1963 & solver_matrix_idx)%DYNAMIC_EQUATIONS_TO_SOLVER_MATRIX_MAPS(equations_matrix_idx)%PTR,stat=err)
1964 IF(err/=0)
CALL flagerror(
"Could not allocate equations to solver matrix maps.",err,error,*999)
1966 & equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_SM(solver_matrix_idx)% &
1967 & dynamic_equations_to_solver_matrix_maps(equations_matrix_idx)%PTR,err,error,*999)
1968 solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_SM( &
1969 & solver_matrix_idx)%DYNAMIC_EQUATIONS_TO_SOLVER_MATRIX_MAPS(equations_matrix_idx)%PTR% &
1971 solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_EM( &
1972 & equations_matrix_idx)%EQUATIONS_MATRIX_NUMBER=equations_matrix_idx
1973 solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_EM( &
1974 & equations_matrix_idx)%NUMBER_OF_SOLVER_MATRICES=solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP( &
1975 & equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_EM(equations_matrix_idx)%NUMBER_OF_SOLVER_MATRICES+1
1978 IF(
ASSOCIATED(nonlinear_mapping))
THEN 1979 solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_SM( &
1980 & solver_matrix_idx)%NUMBER_OF_EQUATIONS_JACOBIANS=nonlinear_mapping%NUMBER_OF_RESIDUAL_VARIABLES
1981 ALLOCATE(solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_SM( &
1982 & solver_matrix_idx)%JACOBIAN_TO_SOLVER_MATRIX_MAPS(nonlinear_mapping%NUMBER_OF_RESIDUAL_VARIABLES),stat=err)
1983 IF(err/=0)
CALL flagerror(
"Could not allocate Jacobian to solver matrix maps.",err,error,*999)
1984 DO equations_matrix_idx=1,nonlinear_mapping%NUMBER_OF_RESIDUAL_VARIABLES
1985 ALLOCATE(solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_SM( &
1986 & solver_matrix_idx)%JACOBIAN_TO_SOLVER_MATRIX_MAPS(equations_matrix_idx)%PTR,stat=err)
1987 IF(err/=0)
CALL flagerror(
"Could not allocate Jacobian to solver matrix map.",err,error,*999)
1989 & equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_SM(solver_matrix_idx)% &
1990 & jacobian_to_solver_matrix_maps(equations_matrix_idx)%PTR,err,error,*999)
1991 solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_JM &
1992 & (equations_matrix_idx)%PTR=>solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)% &
1993 & equations_to_solver_matrix_maps_sm(solver_matrix_idx)%JACOBIAN_TO_SOLVER_MATRIX_MAPS( &
1994 & equations_matrix_idx)%PTR
1998 IF(
ASSOCIATED(linear_mapping))
THEN 1999 ALLOCATE(solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_SM( &
2000 & solver_matrix_idx)%LINEAR_EQUATIONS_TO_SOLVER_MATRIX_MAPS(number_of_linear_equations_matrices),stat=err)
2002 &
CALL flagerror(
"Could not allocate equations to solver matrix maps sm equations to solver matrix maps.", &
2005 solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_SM( &
2006 & solver_matrix_idx)%NUMBER_OF_LINEAR_EQUATIONS_MATRICES=number_of_linear_equations_matrices
2007 DO equations_matrix_idx=1,number_of_linear_equations_matrices
2008 NULLIFY(solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_SM( &
2009 & solver_matrix_idx)%LINEAR_EQUATIONS_TO_SOLVER_MATRIX_MAPS(equations_matrix_idx)%PTR)
2010 ALLOCATE(solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_SM( &
2011 & solver_matrix_idx)%LINEAR_EQUATIONS_TO_SOLVER_MATRIX_MAPS(equations_matrix_idx)%PTR,stat=err)
2012 IF(err/=0)
CALL flagerror(
"Could not allocate equations to solver matrix maps.",err,error,*999)
2014 & equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_SM(solver_matrix_idx)% &
2015 & linear_equations_to_solver_matrix_maps(equations_matrix_idx)%PTR,err,error,*999)
2016 solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_SM( &
2017 & solver_matrix_idx)%LINEAR_EQUATIONS_TO_SOLVER_MATRIX_MAPS(equations_matrix_idx)%PTR% &
2019 solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_EM( &
2020 & equations_matrix_idx)%EQUATIONS_MATRIX_NUMBER=equations_matrix_idx
2021 solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_EM( &
2022 & equations_matrix_idx)%NUMBER_OF_SOLVER_MATRICES=solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP( &
2023 & equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_EM(equations_matrix_idx)%NUMBER_OF_SOLVER_MATRICES+1
2026 ALLOCATE(solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_SM( &
2027 & solver_matrix_idx)%LINEAR_EQUATIONS_TO_SOLVER_MATRIX_MAPS(0),stat=err)
2029 &
CALL flagerror(
"Could not allocate equations to solver matrix maps sm equations to solver matrix maps.", &
2032 solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_SM( &
2033 & solver_matrix_idx)%NUMBER_OF_LINEAR_EQUATIONS_MATRICES=0
2036 IF(
ASSOCIATED(nonlinear_mapping))
THEN 2037 solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_SM( &
2038 & solver_matrix_idx)%NUMBER_OF_EQUATIONS_JACOBIANS=nonlinear_mapping%NUMBER_OF_RESIDUAL_VARIABLES
2039 ALLOCATE(solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_SM( &
2040 & solver_matrix_idx)%JACOBIAN_TO_SOLVER_MATRIX_MAPS(nonlinear_mapping%NUMBER_OF_RESIDUAL_VARIABLES),stat=err)
2041 IF(err/=0)
CALL flagerror(
"Could not allocate Jacobian to solver matrix maps.",err,error,*999)
2042 DO equations_matrix_idx=1,nonlinear_mapping%NUMBER_OF_RESIDUAL_VARIABLES
2043 ALLOCATE(solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_SM( &
2044 & solver_matrix_idx)%JACOBIAN_TO_SOLVER_MATRIX_MAPS(equations_matrix_idx)%PTR,stat=err)
2045 IF(err/=0)
CALL flagerror(
"Could not allocate Jacobian to solver matrix map.",err,error,*999)
2047 & equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_SM(solver_matrix_idx)% &
2048 & jacobian_to_solver_matrix_maps(equations_matrix_idx)%PTR,err,error,*999)
2049 solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_JM &
2050 & (equations_matrix_idx)%PTR=>solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)% &
2051 & equations_to_solver_matrix_maps_sm(solver_matrix_idx)%JACOBIAN_TO_SOLVER_MATRIX_MAPS( &
2052 & equations_matrix_idx)%PTR
2056 DO variable_idx=1,number_of_variables
2057 IF(
ASSOCIATED(dynamic_mapping))
THEN 2058 variable_type=solver_mapping%CREATE_VALUES_CACHE%DYNAMIC_VARIABLE_TYPE(equations_set_idx)
2059 number_of_dynamic_equations_matrices=dynamic_mapping%VAR_TO_EQUATIONS_MATRICES_MAPS(variable_type)% &
2060 & number_of_equations_matrices
2062 IF(
ASSOCIATED(nonlinear_mapping))
THEN 2063 variable_type=solver_mapping%CREATE_VALUES_CACHE%RESIDUAL_VARIABLE_TYPES(variable_idx,equations_set_idx)
2065 variable_type=solver_mapping%CREATE_VALUES_CACHE%MATRIX_VARIABLE_TYPES(variable_idx,equations_set_idx, &
2066 & solver_matrix_idx)
2067 number_of_linear_equations_matrices=linear_mapping%VAR_TO_EQUATIONS_MATRICES_MAPS(variable_type)% &
2068 & number_of_equations_matrices
2072 dependent_variable=>dependent_field%VARIABLE_TYPE_MAP(variable_type)%PTR
2073 col_dofs_mapping=>dependent_variable%DOMAIN_MAPPING
2074 IF(
ASSOCIATED(dynamic_mapping))
THEN 2076 DO equations_matrix_idx=1,number_of_dynamic_equations_matrices
2077 matrix_number=dynamic_mapping%VAR_TO_EQUATIONS_MATRICES_MAPS(variable_type)% &
2078 & equations_matrix_numbers(equations_matrix_idx)
2079 solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_SM( &
2080 & solver_matrix_idx)%DYNAMIC_EQUATIONS_TO_SOLVER_MATRIX_MAPS(equations_matrix_idx)%PTR% &
2081 & solver_matrix_number=solver_matrix_idx
2082 solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_SM( &
2083 & solver_matrix_idx)%DYNAMIC_EQUATIONS_TO_SOLVER_MATRIX_MAPS(equations_matrix_idx)%PTR% &
2084 & equations_matrix_number=matrix_number
2085 solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_SM( &
2086 & solver_matrix_idx)%DYNAMIC_EQUATIONS_TO_SOLVER_MATRIX_MAPS(equations_matrix_idx)%PTR% &
2087 & equations_matrix=>dynamic_mapping%EQUATIONS_MATRIX_TO_VAR_MAPS(matrix_number)%EQUATIONS_MATRIX
2088 number_of_equations_columns=dynamic_mapping%EQUATIONS_MATRIX_TO_VAR_MAPS(matrix_number)%NUMBER_OF_COLUMNS
2089 ALLOCATE(solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)% &
2090 & equations_to_solver_matrix_maps_sm(solver_matrix_idx)%DYNAMIC_EQUATIONS_TO_SOLVER_MATRIX_MAPS( &
2091 & equations_matrix_idx)%PTR%EQUATIONS_COL_TO_SOLVER_COLS_MAP(number_of_equations_columns),stat=err)
2092 IF(err/=0)
CALL flagerror(
"Could not allocate dynamic equations column to solver columns map.", &
2097 IF(
ASSOCIATED(linear_mapping))
THEN 2098 DO equations_matrix_idx=1,number_of_linear_equations_matrices
2099 matrix_number=linear_mapping%VAR_TO_EQUATIONS_MATRICES_MAPS(variable_type)% &
2100 & equations_matrix_numbers(equations_matrix_idx)
2101 solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_SM( &
2102 & solver_matrix_idx)%LINEAR_EQUATIONS_TO_SOLVER_MATRIX_MAPS(equations_matrix_idx)%PTR% &
2103 & solver_matrix_number=solver_matrix_idx
2104 solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_SM( &
2105 & solver_matrix_idx)%LINEAR_EQUATIONS_TO_SOLVER_MATRIX_MAPS(equations_matrix_idx)%PTR% &
2106 & equations_matrix_number=matrix_number
2107 solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_SM( &
2108 & solver_matrix_idx)%LINEAR_EQUATIONS_TO_SOLVER_MATRIX_MAPS(equations_matrix_idx)%PTR% &
2109 & equations_matrix=>linear_mapping%EQUATIONS_MATRIX_TO_VAR_MAPS(matrix_number)%EQUATIONS_MATRIX
2110 number_of_equations_columns=linear_mapping%EQUATIONS_MATRIX_TO_VAR_MAPS(matrix_number)%NUMBER_OF_COLUMNS
2111 ALLOCATE(solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)% &
2112 & equations_to_solver_matrix_maps_sm(solver_matrix_idx)%LINEAR_EQUATIONS_TO_SOLVER_MATRIX_MAPS( &
2113 & equations_matrix_idx)%PTR%EQUATIONS_COL_TO_SOLVER_COLS_MAP(number_of_equations_columns),stat=err)
2114 IF(err/=0)
CALL flagerror(
"Could not allocate linear equations column to solver columns map.", &
2120 IF(
ASSOCIATED(nonlinear_mapping))
THEN 2121 DO equations_matrix_idx=1,nonlinear_mapping%NUMBER_OF_RESIDUAL_VARIABLES
2122 solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_SM( &
2123 & solver_matrix_idx)%JACOBIAN_TO_SOLVER_MATRIX_MAPS(equations_matrix_idx)%PTR%SOLVER_MATRIX_NUMBER= &
2125 solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_SM( &
2126 & solver_matrix_idx)%JACOBIAN_TO_SOLVER_MATRIX_MAPS(equations_matrix_idx)%PTR%JACOBIAN_MATRIX=> &
2127 & nonlinear_mapping%JACOBIAN_TO_VAR_MAP(equations_matrix_idx)%JACOBIAN
2128 number_of_equations_columns=nonlinear_mapping%JACOBIAN_TO_VAR_MAP(equations_matrix_idx)%NUMBER_OF_COLUMNS
2129 ALLOCATE(solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_SM( &
2130 & solver_matrix_idx)%JACOBIAN_TO_SOLVER_MATRIX_MAPS(equations_matrix_idx)%PTR% &
2131 & jacobian_col_to_solver_cols_map(number_of_equations_columns),stat=err)
2132 IF(err/=0)
CALL flagerror(
"Could not allocate Jacobian column to solver columns map.",err,error,*999)
2137 DO interface_condition_idx=1,solver_mapping%NUMBER_OF_INTERFACE_CONDITIONS
2139 interface_condition=>solver_mapping%INTERFACE_CONDITIONS(interface_condition_idx)%PTR
2140 interface_equations=>interface_condition%INTERFACE_EQUATIONS
2141 interface_mapping=>interface_equations%INTERFACE_MAPPING
2143 SELECT CASE(interface_condition%METHOD)
2148 & solver_matrix_idx)%SOLVER_COL_TO_INTERFACE_MAPS(interface_condition_idx),err,error,*999)
2151 ALLOCATE(solver_mapping%SOLVER_COL_TO_EQUATIONS_COLS_MAP(solver_matrix_idx)%SOLVER_COL_TO_INTERFACE_MAPS( &
2152 & interface_condition_idx)%SOLVER_COL_TO_INTERFACE_EQUATIONS_MAPS(number_of_columns),stat=err)
2153 IF(err/=0)
CALL flagerror(
"Could not allocate solver columns to interface equations map.",err,error,*999)
2156 ALLOCATE(solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
2157 &interface_to_solver_matrix_maps_sm( &
2158 & solver_matrix_idx)%INTERFACE_EQUATIONS_TO_SOLVER_MATRIX_MAPS(interface_mapping%NUMBER_OF_INTERFACE_MATRICES), &
2160 IF(err/=0)
CALL flagerror(
"Could not allocate interface to solver matrix maps sm interface equations "// &
2161 &
"to solver matrix maps.",err,error,*999)
2164 solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)%INTERFACE_TO_SOLVER_MATRIX_MAPS_SM( &
2165 & solver_matrix_idx)%NUMBER_OF_INTERFACE_MATRICES=interface_mapping%NUMBER_OF_INTERFACE_MATRICES
2166 DO interface_matrix_idx=1,interface_mapping%NUMBER_OF_INTERFACE_MATRICES
2167 NULLIFY(solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
2168 & interface_to_solver_matrix_maps_sm(solver_matrix_idx)%INTERFACE_EQUATIONS_TO_SOLVER_MATRIX_MAPS( &
2169 & interface_matrix_idx)%PTR)
2170 ALLOCATE(solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
2171 & interface_to_solver_matrix_maps_sm(solver_matrix_idx)%INTERFACE_EQUATIONS_TO_SOLVER_MATRIX_MAPS( &
2172 & interface_matrix_idx)%PTR,stat=err)
2173 IF(err/=0)
CALL flagerror(
"Could not allocate interface to solver matrix maps.",err,error,*999)
2175 & interface_condition_to_solver_map(interface_condition_idx)%INTERFACE_TO_SOLVER_MATRIX_MAPS_SM( &
2176 & solver_matrix_idx)%INTERFACE_EQUATIONS_TO_SOLVER_MATRIX_MAPS(interface_matrix_idx)%PTR,err,error,*999)
2177 solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)%INTERFACE_TO_SOLVER_MATRIX_MAPS_IM( &
2178 & interface_matrix_idx)%INTERFACE_MATRIX_NUMBER=interface_matrix_idx
2179 solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)%INTERFACE_TO_SOLVER_MATRIX_MAPS_IM( &
2180 & interface_matrix_idx)%NUMBER_OF_SOLVER_MATRICES=1
2182 dependent_variable=>interface_mapping%INTERFACE_MATRIX_ROWS_TO_VAR_MAPS(interface_matrix_idx)%VARIABLE
2183 solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)%INTERFACE_TO_SOLVER_MATRIX_MAPS_SM( &
2184 & solver_matrix_idx)%DEPENDENT_VARIABLES(interface_matrix_idx)%PTR=>dependent_variable
2185 solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)%INTERFACE_TO_SOLVER_MATRIX_MAPS_SM( &
2186 & solver_matrix_idx)%INTERFACE_EQUATIONS_TO_SOLVER_MATRIX_MAPS(interface_matrix_idx)%PTR% &
2187 & solver_matrix_number=solver_matrix_idx
2188 solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)%INTERFACE_TO_SOLVER_MATRIX_MAPS_SM( &
2189 & solver_matrix_idx)%INTERFACE_EQUATIONS_TO_SOLVER_MATRIX_MAPS(interface_matrix_idx)%PTR% &
2190 & interface_matrix_number=interface_matrix_idx
2191 solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)%INTERFACE_TO_SOLVER_MATRIX_MAPS_SM( &
2192 & solver_matrix_idx)%INTERFACE_EQUATIONS_TO_SOLVER_MATRIX_MAPS(interface_matrix_idx)%PTR% &
2193 & interface_matrix=>interface_mapping%INTERFACE_MATRIX_ROWS_TO_VAR_MAPS(interface_matrix_idx)%INTERFACE_MATRIX
2194 number_of_interface_rows=interface_mapping%INTERFACE_MATRIX_ROWS_TO_VAR_MAPS(interface_matrix_idx)%NUMBER_OF_ROWS
2195 ALLOCATE(solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
2196 & interface_to_solver_matrix_maps_sm(solver_matrix_idx)%INTERFACE_EQUATIONS_TO_SOLVER_MATRIX_MAPS( &
2197 & interface_matrix_idx)%PTR%INTERFACE_ROW_TO_SOLVER_COLS_MAP(number_of_interface_rows),stat=err)
2198 IF(err/=0)
CALL flagerror(
"Could not allocate interface column to solver columns map.",err,error,*999)
2200 number_of_interface_columns=interface_mapping%NUMBER_OF_COLUMNS
2201 ALLOCATE(solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
2202 & interface_to_solver_matrix_maps_sm(solver_matrix_idx)%INTERFACE_COL_TO_SOLVER_COLS_MAP( &
2203 & number_of_interface_columns),stat=err)
2204 IF(err/=0)
CALL flagerror(
"Could not allocate interface column to solver columns map.",err,error,*999)
2206 CALL flagerror(
"Not implemented.",err,error,*999)
2208 CALL flagerror(
"Not implemented.",err,error,*999)
2210 local_error=
"The interface condition method of "// &
2213 CALL flagerror(local_error,err,error,*999)
2220 ALLOCATE(dof_map(solver_mapping%VARIABLES_LIST(solver_matrix_idx)%NUMBER_OF_VARIABLES),stat=err)
2221 IF(err/=0)
CALL flagerror(
"Could not allocate dof map.",err,error,*999)
2222 DO solver_variable_idx=1,solver_mapping%VARIABLES_LIST(solver_matrix_idx)%NUMBER_OF_VARIABLES
2223 ALLOCATE(dof_map(solver_variable_idx)%PTR(solver_mapping%VARIABLES_LIST(solver_matrix_idx)% &
2224 & variables(solver_variable_idx)%VARIABLE%NUMBER_OF_GLOBAL_DOFS),stat=err)
2225 IF(err/=0)
CALL flagerror(
"Could not allocate dof map global dof map.",err,error,*999)
2226 dof_map(solver_variable_idx)%PTR=0
2230 IF(err/=0)
CALL flagerror(
"Could not allocate solver local dof array.",err,error,*999)
2236 number_of_global_solver_dofs=0
2242 DO solver_variable_idx=1,solver_mapping%VARIABLES_LIST(solver_matrix_idx)%NUMBER_OF_VARIABLES
2244 IF (solver_mapping%NUMBER_OF_INTERFACE_CONDITIONS>0)
THEN 2250 DO solver_variable_idx_temp=1,solver_variable_idx
2251 DO global_dof=1,
SIZE(dof_map(solver_variable_idx_temp)%PTR)
2252 IF (dof_map(solver_variable_idx_temp)%PTR(global_dof)>0)
THEN 2253 temp_offset=temp_offset+1
2257 global_dofs_offset=temp_offset
2258 local_dofs_offset=temp_offset
2260 global_dofs_offset=solver_global_dof
2261 local_dofs_offset=solver_local_dof(rank)
2264 variable_type=solver_mapping%VARIABLES_LIST(solver_matrix_idx)%VARIABLES(solver_variable_idx)%VARIABLE_TYPE
2266 DO equations_idx=1,solver_mapping%NUMBER_OF_EQUATIONS_SETS+solver_mapping%NUMBER_OF_INTERFACE_CONDITIONS
2269 CALL list_sort(rank_global_cols_lists(dof_type,equations_idx,solver_variable_idx,rank)%PTR,err,error,*999)
2271 & number_of_rank_cols,rank_global_cols_list,err,error,*999)
2273 IF(number_of_rank_cols>0)
THEN 2275 solver_global_dof=global_dofs_offset
2276 solver_local_dof(rank)=local_dofs_offset
2278 equation_type=sub_matrix_information(1,equations_idx,solver_variable_idx)
2279 SELECT CASE(equation_type)
2282 equations_set_idx=sub_matrix_information(2,equations_idx,solver_variable_idx)
2285 equations_set=>solver_mapping%EQUATIONS_SETS(equations_set_idx)%PTR
2286 equations=>equations_set%EQUATIONS
2287 equations_mapping=>equations%EQUATIONS_MAPPING
2288 dynamic_mapping=>equations_mapping%DYNAMIC_MAPPING
2289 linear_mapping=>equations_mapping%LINEAR_MAPPING
2290 nonlinear_mapping=>equations_mapping%NONLINEAR_MAPPING
2291 dependent_field=>equations_set%DEPENDENT%DEPENDENT_FIELD
2293 number_of_dynamic_equations_matrices=0
2294 number_of_linear_equations_matrices=0
2295 IF(
ASSOCIATED(dynamic_mapping)) number_of_dynamic_equations_matrices=dynamic_mapping% &
2296 & var_to_equations_matrices_maps(variable_type)%NUMBER_OF_EQUATIONS_MATRICES
2297 IF(
ASSOCIATED(linear_mapping)) number_of_linear_equations_matrices=linear_mapping% &
2298 & var_to_equations_matrices_maps(variable_type)%NUMBER_OF_EQUATIONS_MATRICES
2302 dependent_variable=>solver_mapping%VARIABLES_LIST(solver_matrix_idx)%VARIABLES(solver_variable_idx)% &
2304 col_dofs_mapping=>dependent_variable%DOMAIN_MAPPING
2306 DO global_dof_idx=1,number_of_rank_cols
2307 global_dof=rank_global_cols_list(1,global_dof_idx)
2308 local_dof=rank_global_cols_list(2,global_dof_idx)
2310 include_column=rank_global_cols_list(3,global_dof_idx)==1
2311 constrained_dof=rank_global_cols_list(3,global_dof_idx)==2
2312 variable_idx=rank_global_cols_list(4,global_dof_idx)
2313 globaldofcouplingnumber=rank_global_cols_list(5,global_dof_idx)
2314 IF(globaldofcouplingnumber>0)
THEN 2315 colequationcols=>columncouplings%dofCouplings(globaldofcouplingnumber)%ptr
2316 IF(
ASSOCIATED(colequationcols))
THEN 2317 numbercolequationscols=colequationcols%numberOfDofs
2319 CALL flagerror(
"Dof coupling is not associated for global dof coupling number "// &
2323 numbercolequationscols=1
2324 dummydofcoupling%globalDofs(1)=global_dof
2325 dummydofcoupling%localDofs(1)=local_dof
2326 dummydofcoupling%coefficients(1)=1.0_dp
2327 colequationcols=>dummydofcoupling
2330 IF(include_column)
THEN 2333 IF(dof_type==2)
THEN 2334 solver_global_dof=dof_map(solver_variable_idx)%PTR(global_dof)
2336 solver_global_dof=solver_global_dof+1
2337 dof_map(solver_variable_idx)%PTR(global_dof)=solver_global_dof
2340 solver_local_dof(rank)=solver_local_dof(rank)+1
2342 IF(rank==myrank)
THEN 2344 IF(.NOT.variable_rank_processed(solver_variable_idx,rank))
THEN 2348 & solver_global_dof),err,error,*999)
2352 ALLOCATE(col_domain_mapping%GLOBAL_TO_LOCAL_MAP(solver_global_dof)%LOCAL_NUMBER(1),stat=err)
2353 IF(err/=0)
CALL flagerror(
"Could not allocate column domain global to local map local number.", &
2355 ALLOCATE(col_domain_mapping%GLOBAL_TO_LOCAL_MAP(solver_global_dof)%DOMAIN_NUMBER(1),stat=err)
2356 IF(err/=0)
CALL flagerror(
"Could not allocate column domain global to local map domain number.", &
2358 ALLOCATE(col_domain_mapping%GLOBAL_TO_LOCAL_MAP(solver_global_dof)%LOCAL_TYPE(1),stat=err)
2359 IF(err/=0)
CALL flagerror(
"Could not allocate column domain global to local map domain number.", &
2362 col_domain_mapping%GLOBAL_TO_LOCAL_MAP(solver_global_dof)%NUMBER_OF_DOMAINS=1
2363 col_domain_mapping%GLOBAL_TO_LOCAL_MAP(solver_global_dof)%LOCAL_NUMBER(1)= &
2364 & solver_local_dof(rank)
2365 col_domain_mapping%GLOBAL_TO_LOCAL_MAP(solver_global_dof)%DOMAIN_NUMBER(1)=rank
2371 & solver_col_to_equations_cols_map(solver_matrix_idx)%SOLVER_DOF_TO_VARIABLE_MAPS( &
2372 & solver_local_dof(rank)),err,error,*999)
2374 ALLOCATE(solver_mapping%SOLVER_COL_TO_EQUATIONS_COLS_MAP(solver_matrix_idx)% &
2375 & solver_dof_to_variable_maps(solver_local_dof(rank))% &
2376 & equations_types(numbercolequationscols),stat=err)
2377 IF(err/=0)
CALL flagerror(
"Could not allocate solver dof to variable maps equations types.", &
2379 ALLOCATE(solver_mapping%SOLVER_COL_TO_EQUATIONS_COLS_MAP(solver_matrix_idx)% &
2380 & solver_dof_to_variable_maps(solver_local_dof(rank))% &
2381 & equations_indices(numbercolequationscols),stat=err)
2382 IF(err/=0)
CALL flagerror(
"Could not allocate solver dof to variable maps equations indices.", &
2384 ALLOCATE(solver_mapping%SOLVER_COL_TO_EQUATIONS_COLS_MAP(solver_matrix_idx)% &
2385 & solver_dof_to_variable_maps(solver_local_dof(rank))% &
2386 & variable(numbercolequationscols),stat=err)
2387 IF(err/=0)
CALL flagerror(
"Could not allocate solver dof to variable maps variable type.", &
2389 ALLOCATE(solver_mapping%SOLVER_COL_TO_EQUATIONS_COLS_MAP(solver_matrix_idx)% &
2390 & solver_dof_to_variable_maps(solver_local_dof(rank))% &
2391 & variable_dof(numbercolequationscols),stat=err)
2392 IF(err/=0)
CALL flagerror(
"Could not allocate solver dof to variable maps variable dof.", &
2394 ALLOCATE(solver_mapping%SOLVER_COL_TO_EQUATIONS_COLS_MAP(solver_matrix_idx)% &
2395 & solver_dof_to_variable_maps(solver_local_dof(rank))% &
2396 & variable_coefficient(numbercolequationscols),stat=err)
2397 IF(err/=0)
CALL flagerror(
"Could not allocate solver dof to variable maps variable coefficient.", &
2399 ALLOCATE(solver_mapping%SOLVER_COL_TO_EQUATIONS_COLS_MAP(solver_matrix_idx)% &
2400 & solver_dof_to_variable_maps(solver_local_dof(rank))% &
2401 & additive_constant(numbercolequationscols),stat=err)
2402 IF(err/=0)
CALL flagerror(
"Could not allocate solver dof to variable maps additive constant.", &
2404 solver_mapping%SOLVER_COL_TO_EQUATIONS_COLS_MAP(solver_matrix_idx)%SOLVER_DOF_TO_VARIABLE_MAPS( &
2405 & solver_local_dof(rank))%NUMBER_OF_EQUATION_DOFS=numbercolequationscols
2407 DO colequationscolidx=1,numbercolequationscols
2408 solver_mapping%SOLVER_COL_TO_EQUATIONS_COLS_MAP(solver_matrix_idx)%SOLVER_DOF_TO_VARIABLE_MAPS( &
2409 & solver_local_dof(rank))%EQUATIONS_TYPES(colequationscolidx)= &
2411 solver_mapping%SOLVER_COL_TO_EQUATIONS_COLS_MAP(solver_matrix_idx)%SOLVER_DOF_TO_VARIABLE_MAPS( &
2412 & solver_local_dof(rank))%EQUATIONS_INDICES(colequationscolidx)=equations_set_idx
2413 solver_mapping%SOLVER_COL_TO_EQUATIONS_COLS_MAP(solver_matrix_idx)%SOLVER_DOF_TO_VARIABLE_MAPS( &
2414 & solver_local_dof(rank))%VARIABLE(colequationscolidx)%PTR=>dependent_variable
2415 solver_mapping%SOLVER_COL_TO_EQUATIONS_COLS_MAP(solver_matrix_idx)%SOLVER_DOF_TO_VARIABLE_MAPS( &
2416 & solver_local_dof(rank))%VARIABLE_DOF(colequationscolidx)= &
2417 & colequationcols%localDofs(colequationscolidx)
2418 solver_mapping%SOLVER_COL_TO_EQUATIONS_COLS_MAP(solver_matrix_idx)%SOLVER_DOF_TO_VARIABLE_MAPS( &
2419 & solver_local_dof(rank))%VARIABLE_COEFFICIENT(colequationscolidx)= &
2420 & colequationcols%coefficients(colequationscolidx)
2421 solver_mapping%SOLVER_COL_TO_EQUATIONS_COLS_MAP(solver_matrix_idx)%SOLVER_DOF_TO_VARIABLE_MAPS( &
2422 & solver_local_dof(rank))%ADDITIVE_CONSTANT(colequationscolidx)=0.0_dp
2426 DO colequationscolidx=1,numbercolequationscols
2427 eqnlocaldof=colequationcols%localDofs(colequationscolidx)
2428 couplingcoefficient=colequationcols%coefficients(colequationscolidx)
2429 solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_SM( &
2430 & solver_matrix_idx)%VARIABLE_TO_SOLVER_COL_MAPS(variable_idx)%COLUMN_NUMBERS(eqnlocaldof)= &
2432 solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_SM( &
2433 & solver_matrix_idx)%VARIABLE_TO_SOLVER_COL_MAPS(variable_idx)%COUPLING_COEFFICIENTS( &
2434 & eqnlocaldof)=couplingcoefficient
2435 solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_SM( &
2436 & solver_matrix_idx)%VARIABLE_TO_SOLVER_COL_MAPS(variable_idx)%ADDITIVE_CONSTANTS( &
2437 & eqnlocaldof)=0.0_dp
2439 DO matrix_type_idx=1,sub_matrix_list(0,equations_idx,solver_variable_idx)
2440 matrix_type=sub_matrix_list(matrix_type_idx,equations_idx,solver_variable_idx)
2444 DO equations_matrix_idx=1,number_of_dynamic_equations_matrices
2445 matrix_number=dynamic_mapping%VAR_TO_EQUATIONS_MATRICES_MAPS(variable_type)% &
2446 & equations_matrix_numbers(equations_matrix_idx)
2447 equations_column=dynamic_mapping%VAR_TO_EQUATIONS_MATRICES_MAPS(variable_type)% &
2448 & dof_to_columns_maps(equations_matrix_idx)%COLUMN_DOF(eqnlocaldof)
2450 ALLOCATE(solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)% &
2451 & equations_to_solver_matrix_maps_sm(solver_matrix_idx)% &
2452 & dynamic_equations_to_solver_matrix_maps(equations_matrix_idx)%PTR% &
2453 & equations_col_to_solver_cols_map(equations_column)%SOLVER_COLS(1), &
2456 &
CALL flag_error(
"Could not allocate dynamic equations column to solver columns map "// &
2457 &
"solver colums.",err,error,*999)
2458 ALLOCATE(solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)% &
2459 & equations_to_solver_matrix_maps_sm(solver_matrix_idx)% &
2460 & dynamic_equations_to_solver_matrix_maps(equations_matrix_idx)%PTR% &
2461 & equations_col_to_solver_cols_map(equations_column)%COUPLING_COEFFICIENTS(1),stat=err)
2463 &
CALL flagerror(
"Could not allocate dynamic equations column to solver columns map "// &
2464 &
"coupling coefficients.",err,error,*999)
2465 solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)% &
2466 & equations_to_solver_matrix_maps_sm(solver_matrix_idx)% &
2467 & dynamic_equations_to_solver_matrix_maps(equations_matrix_idx)%PTR% &
2468 & equations_col_to_solver_cols_map(equations_column)%NUMBER_OF_SOLVER_COLS=1
2469 solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)% &
2470 & equations_to_solver_matrix_maps_sm(solver_matrix_idx)% &
2471 & dynamic_equations_to_solver_matrix_maps(equations_matrix_idx)%PTR% &
2472 & equations_col_to_solver_cols_map(equations_column)%SOLVER_COLS(1)=solver_global_dof
2473 solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)% &
2474 & equations_to_solver_matrix_maps_sm(solver_matrix_idx)% &
2475 & dynamic_equations_to_solver_matrix_maps(equations_matrix_idx)%PTR% &
2476 & equations_col_to_solver_cols_map(equations_column)%COUPLING_COEFFICIENTS(1)= &
2477 & couplingcoefficient
2480 DO equations_matrix_idx=1,number_of_linear_equations_matrices
2481 matrix_number=linear_mapping%VAR_TO_EQUATIONS_MATRICES_MAPS(variable_type)% &
2482 & equations_matrix_numbers(equations_matrix_idx)
2483 equations_column=linear_mapping%VAR_TO_EQUATIONS_MATRICES_MAPS(variable_type)% &
2484 & dof_to_columns_maps(equations_matrix_idx)%COLUMN_DOF(eqnlocaldof)
2487 ALLOCATE(solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)% &
2488 & equations_to_solver_matrix_maps_sm(solver_matrix_idx)% &
2489 & linear_equations_to_solver_matrix_maps(equations_matrix_idx)%PTR% &
2490 & equations_col_to_solver_cols_map(equations_column)%SOLVER_COLS(1), &
2493 &
CALL flagerror(
"Could not allocate linear equations column to solver columns map "// &
2494 &
"solver colums.",err,error,*999)
2495 ALLOCATE(solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)% &
2496 & equations_to_solver_matrix_maps_sm(solver_matrix_idx)% &
2497 & linear_equations_to_solver_matrix_maps(equations_matrix_idx)%PTR% &
2498 & equations_col_to_solver_cols_map(equations_column)%COUPLING_COEFFICIENTS(1),stat=err)
2500 &
CALL flagerror(
"Could not allocate linear equations column to solver columns map "// &
2501 &
"coupling coefficients.",err,error,*999)
2502 solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)% &
2503 & equations_to_solver_matrix_maps_sm(solver_matrix_idx)% &
2504 & linear_equations_to_solver_matrix_maps(equations_matrix_idx)%PTR% &
2505 & equations_col_to_solver_cols_map(equations_column)%NUMBER_OF_SOLVER_COLS=1
2506 solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)% &
2507 & equations_to_solver_matrix_maps_sm(solver_matrix_idx)% &
2508 & linear_equations_to_solver_matrix_maps(equations_matrix_idx)%PTR% &
2509 & equations_col_to_solver_cols_map(equations_column)%SOLVER_COLS(1)=solver_global_dof
2510 solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)% &
2511 & equations_to_solver_matrix_maps_sm(solver_matrix_idx)% &
2512 & linear_equations_to_solver_matrix_maps(equations_matrix_idx)%PTR% &
2513 & equations_col_to_solver_cols_map(equations_column)%COUPLING_COEFFICIENTS(1)= &
2514 & couplingcoefficient
2517 DO equations_matrix_idx=1,nonlinear_mapping%NUMBER_OF_RESIDUAL_VARIABLES
2518 IF(nonlinear_mapping%VAR_TO_JACOBIAN_MAP(equations_matrix_idx)%VARIABLE_TYPE==variable_type) &
2521 jacobian_column=nonlinear_mapping%VAR_TO_JACOBIAN_MAP(equations_matrix_idx)% &
2522 & dof_to_columns_map(eqnlocaldof)
2525 ALLOCATE(solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)% &
2526 & equations_to_solver_matrix_maps_sm(solver_matrix_idx)%JACOBIAN_TO_SOLVER_MATRIX_MAPS( &
2527 & equations_matrix_idx)%PTR%JACOBIAN_COL_TO_SOLVER_COLS_MAP(jacobian_column)%SOLVER_COLS(1), &
2530 &
CALL flagerror(
"Could not allocate Jacobian column to solver columns map solver colums.", &
2532 ALLOCATE(solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)% &
2533 & equations_to_solver_matrix_maps_sm(solver_matrix_idx)%JACOBIAN_TO_SOLVER_MATRIX_MAPS( &
2534 & equations_matrix_idx)%PTR%JACOBIAN_COL_TO_SOLVER_COLS_MAP(jacobian_column)% &
2535 & coupling_coefficients(1),stat=err)
2537 local_error=
"Could not allocate Jacobian column to solver columns map coupling coefficients." 2538 CALL flagerror(local_error,err,error,*999)
2540 solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)% &
2541 & equations_to_solver_matrix_maps_sm(solver_matrix_idx)%JACOBIAN_TO_SOLVER_MATRIX_MAPS( &
2542 & equations_matrix_idx)%PTR%JACOBIAN_COL_TO_SOLVER_COLS_MAP(jacobian_column)% &
2543 & number_of_solver_cols=1
2544 solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)% &
2545 & equations_to_solver_matrix_maps_sm(solver_matrix_idx)%JACOBIAN_TO_SOLVER_MATRIX_MAPS( &
2546 & equations_matrix_idx)%PTR%JACOBIAN_COL_TO_SOLVER_COLS_MAP(jacobian_column)%SOLVER_COLS(1)= &
2548 solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)% &
2549 & equations_to_solver_matrix_maps_sm(solver_matrix_idx)%JACOBIAN_TO_SOLVER_MATRIX_MAPS( &
2550 & equations_matrix_idx)%PTR%JACOBIAN_COL_TO_SOLVER_COLS_MAP(jacobian_column)% &
2551 & coupling_coefficients(1)=couplingcoefficient
2553 local_error=
"The equations matrix type of "// &
2556 CALL flagerror(local_error,err,error,*999)
2562 IF(.NOT.variable_rank_processed(solver_variable_idx,rank))
THEN 2566 & solver_global_dof),err,error,*999)
2570 ALLOCATE(col_domain_mapping%GLOBAL_TO_LOCAL_MAP(solver_global_dof)%LOCAL_NUMBER(1),stat=err)
2571 IF(err/=0)
CALL flagerror(
"Could not allocate column domain global to local map local number.", &
2573 ALLOCATE(col_domain_mapping%GLOBAL_TO_LOCAL_MAP(solver_global_dof)%DOMAIN_NUMBER(1),stat=err)
2574 IF(err/=0)
CALL flagerror(
"Could not allocate column domain global to local map domain number.", &
2576 ALLOCATE(col_domain_mapping%GLOBAL_TO_LOCAL_MAP(solver_global_dof)%LOCAL_TYPE(1),stat=err)
2577 IF(err/=0)
CALL flagerror(
"Could not allocate column domain global to local map domain number.", &
2580 col_domain_mapping%GLOBAL_TO_LOCAL_MAP(solver_global_dof)%NUMBER_OF_DOMAINS=1
2581 col_domain_mapping%GLOBAL_TO_LOCAL_MAP(solver_global_dof)%LOCAL_NUMBER(1)= &
2582 & solver_local_dof(rank)
2583 col_domain_mapping%GLOBAL_TO_LOCAL_MAP(solver_global_dof)%DOMAIN_NUMBER(1)=rank
2589 ELSE IF(constrained_dof)
THEN 2592 IF(rank==myrank)
THEN 2594 solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_SM( &
2595 & solver_matrix_idx)%VARIABLE_TO_SOLVER_COL_MAPS(variable_idx)%COLUMN_NUMBERS(local_dof)=0
2596 solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_SM( &
2597 & solver_matrix_idx)%VARIABLE_TO_SOLVER_COL_MAPS(variable_idx)%COUPLING_COEFFICIENTS( &
2599 solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_SM( &
2600 & solver_matrix_idx)%VARIABLE_TO_SOLVER_COL_MAPS(variable_idx)%ADDITIVE_CONSTANTS( &
2602 DO matrix_type_idx=1,sub_matrix_list(0,equations_idx,solver_variable_idx)
2603 matrix_type=sub_matrix_list(matrix_type_idx,equations_idx,solver_variable_idx)
2607 DO equations_matrix_idx=1,number_of_dynamic_equations_matrices
2608 matrix_number=dynamic_mapping%VAR_TO_EQUATIONS_MATRICES_MAPS(variable_type)% &
2609 & equations_matrix_numbers(equations_matrix_idx)
2610 equations_column=dynamic_mapping%VAR_TO_EQUATIONS_MATRICES_MAPS(variable_type)% &
2611 & dof_to_columns_maps(equations_matrix_idx)%COLUMN_DOF(local_dof)
2612 solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)% &
2613 & equations_to_solver_matrix_maps_sm(solver_matrix_idx)% &
2614 & dynamic_equations_to_solver_matrix_maps(equations_matrix_idx)%PTR% &
2615 & equations_col_to_solver_cols_map(equations_column)%NUMBER_OF_SOLVER_COLS=0
2619 DO equations_matrix_idx=1,number_of_linear_equations_matrices
2620 matrix_number=linear_mapping%VAR_TO_EQUATIONS_MATRICES_MAPS(variable_type)% &
2621 & equations_matrix_numbers(equations_matrix_idx)
2622 equations_column=linear_mapping%VAR_TO_EQUATIONS_MATRICES_MAPS(variable_type)% &
2623 & dof_to_columns_maps(equations_matrix_idx)%COLUMN_DOF(local_dof)
2624 solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)% &
2625 & equations_to_solver_matrix_maps_sm(solver_matrix_idx)% &
2626 & linear_equations_to_solver_matrix_maps(equations_matrix_idx)%PTR% &
2627 & equations_col_to_solver_cols_map(equations_column)%NUMBER_OF_SOLVER_COLS=0
2630 DO equations_matrix_idx=1,nonlinear_mapping%NUMBER_OF_RESIDUAL_VARIABLES
2631 IF(nonlinear_mapping%VAR_TO_JACOBIAN_MAP(equations_matrix_idx)%VARIABLE_TYPE==variable_type) &
2634 jacobian_column=nonlinear_mapping%VAR_TO_JACOBIAN_MAP(equations_matrix_idx)% &
2635 & dof_to_columns_map(local_dof)
2636 solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)% &
2637 & equations_to_solver_matrix_maps_sm(solver_matrix_idx)%JACOBIAN_TO_SOLVER_MATRIX_MAPS( &
2638 & equations_matrix_idx)%PTR%JACOBIAN_COL_TO_SOLVER_COLS_MAP(jacobian_column)% &
2639 & number_of_solver_cols=0
2641 local_error=
"The equations matrix type of "// &
2643 CALL flagerror(local_error,err,error,*999)
2654 interface_condition_idx=sub_matrix_information(2,equations_idx,solver_variable_idx)
2655 interface_matrix_idx=sub_matrix_information(3,equations_idx,solver_variable_idx)
2658 interface_condition=>solver_mapping%INTERFACE_CONDITIONS(interface_condition_idx)%PTR
2660 SELECT CASE(interface_condition%METHOD)
2662 interface_equations=>interface_condition%INTERFACE_EQUATIONS
2663 interface_mapping=>interface_equations%INTERFACE_MAPPING
2668 lagrange_variable=>solver_mapping%VARIABLES_LIST(solver_matrix_idx)%VARIABLES(solver_variable_idx)% &
2671 DO global_dof_idx=1,number_of_rank_cols
2672 global_dof=rank_global_cols_list(1,global_dof_idx)
2673 local_dof=rank_global_cols_list(2,global_dof_idx)
2675 include_column=rank_global_cols_list(3,global_dof_idx)==1
2676 constrained_dof=rank_global_cols_list(3,global_dof_idx)==2
2677 globaldofcouplingnumber=rank_global_cols_list(5,global_dof_idx)
2679 IF(globaldofcouplingnumber>0)
THEN 2680 colequationcols=>columncouplings%dofCouplings(globaldofcouplingnumber)%ptr
2681 IF(
ASSOCIATED(colequationcols))
THEN 2682 numbercolequationscols=colequationcols%numberOfDofs
2684 CALL flagerror(
"Dof coupling is not associated for global dof coupling number "// &
2688 numbercolequationscols=1
2689 dummydofcoupling%globalDofs(1)=global_dof
2690 dummydofcoupling%localDofs(1)=local_dof
2691 dummydofcoupling%coefficients(1)=1.0_dp
2692 colequationcols=>dummydofcoupling
2695 IF(include_column)
THEN 2698 IF(dof_type==2)
THEN 2700 solver_global_dof=dof_map(solver_variable_idx)%PTR(global_dof)
2702 solver_global_dof=solver_global_dof+1
2703 dof_map(solver_variable_idx)%PTR(global_dof)=solver_global_dof
2706 solver_local_dof(rank)=solver_local_dof(rank)+1
2708 IF(rank==myrank)
THEN 2710 IF(.NOT.variable_rank_processed(solver_variable_idx,rank))
THEN 2714 & solver_global_dof),err,error,*999)
2718 ALLOCATE(col_domain_mapping%GLOBAL_TO_LOCAL_MAP(solver_global_dof)%LOCAL_NUMBER(1),stat=err)
2720 &
CALL flagerror(
"Could not allocate column domain global to local map local number.", &
2722 ALLOCATE(col_domain_mapping%GLOBAL_TO_LOCAL_MAP(solver_global_dof)%DOMAIN_NUMBER(1),stat=err)
2724 &
CALL flagerror(
"Could not allocate column domain global to local map domain number.", &
2726 ALLOCATE(col_domain_mapping%GLOBAL_TO_LOCAL_MAP(solver_global_dof)%LOCAL_TYPE(1),stat=err)
2728 &
CALL flagerror(
"Could not allocate column domain global to local map domain number.", &
2731 col_domain_mapping%GLOBAL_TO_LOCAL_MAP(solver_global_dof)%NUMBER_OF_DOMAINS=1
2732 col_domain_mapping%GLOBAL_TO_LOCAL_MAP(solver_global_dof)%LOCAL_NUMBER(1)= &
2733 & solver_local_dof(rank)
2734 col_domain_mapping%GLOBAL_TO_LOCAL_MAP(solver_global_dof)%DOMAIN_NUMBER(1)=rank
2741 & solver_col_to_equations_cols_map(solver_matrix_idx)%SOLVER_DOF_TO_VARIABLE_MAPS( &
2742 & solver_local_dof(rank)),err,error,*999)
2744 ALLOCATE(solver_mapping%SOLVER_COL_TO_EQUATIONS_COLS_MAP(solver_matrix_idx)% &
2745 & solver_dof_to_variable_maps(solver_local_dof(rank))% &
2746 & equations_types(numbercolequationscols),stat=err)
2747 IF(err/=0)
CALL flagerror(
"Could not allocate solver dof to variable maps equations types.", &
2749 ALLOCATE(solver_mapping%SOLVER_COL_TO_EQUATIONS_COLS_MAP(solver_matrix_idx)% &
2750 & solver_dof_to_variable_maps(solver_local_dof(rank))% &
2751 & equations_indices(numbercolequationscols),stat=err)
2752 IF(err/=0)
CALL flagerror(
"Could not allocate solver dof to variable maps equations indices.", &
2754 ALLOCATE(solver_mapping%SOLVER_COL_TO_EQUATIONS_COLS_MAP(solver_matrix_idx)% &
2755 & solver_dof_to_variable_maps(solver_local_dof(rank))% &
2756 & variable(numbercolequationscols),stat=err)
2757 IF(err/=0)
CALL flagerror(
"Could not allocate solver dof to variable maps variable type.", &
2759 ALLOCATE(solver_mapping%SOLVER_COL_TO_EQUATIONS_COLS_MAP(solver_matrix_idx)% &
2760 & solver_dof_to_variable_maps(solver_local_dof(rank))% &
2761 & variable_dof(numbercolequationscols),stat=err)
2762 IF(err/=0)
CALL flagerror(
"Could not allocate solver dof to variable maps variable dof.", &
2764 ALLOCATE(solver_mapping%SOLVER_COL_TO_EQUATIONS_COLS_MAP(solver_matrix_idx)% &
2765 & solver_dof_to_variable_maps(solver_local_dof(rank))% &
2766 & variable_coefficient(numbercolequationscols),stat=err)
2768 &
CALL flagerror(
"Could not allocate solver dof to variable maps variable coefficient.", &
2770 ALLOCATE(solver_mapping%SOLVER_COL_TO_EQUATIONS_COLS_MAP(solver_matrix_idx)% &
2771 & solver_dof_to_variable_maps(solver_local_dof(rank))% &
2772 & additive_constant(numbercolequationscols),stat=err)
2773 IF(err/=0)
CALL flagerror(
"Could not allocate solver dof to variable maps additive constant.", &
2776 solver_mapping%SOLVER_COL_TO_EQUATIONS_COLS_MAP(solver_matrix_idx)%SOLVER_DOF_TO_VARIABLE_MAPS( &
2777 & solver_local_dof(rank))%NUMBER_OF_EQUATION_DOFS=numbercolequationscols
2778 DO colequationscolidx=1,numbercolequationscols
2779 eqnlocaldof=colequationcols%localDofs(colequationscolidx)
2780 couplingcoefficient=colequationcols%coefficients(colequationscolidx)
2781 solver_mapping%SOLVER_COL_TO_EQUATIONS_COLS_MAP(solver_matrix_idx)%SOLVER_DOF_TO_VARIABLE_MAPS(&
2782 & solver_local_dof(rank))%EQUATIONS_TYPES(colequationscolidx)= &
2784 solver_mapping%SOLVER_COL_TO_EQUATIONS_COLS_MAP(solver_matrix_idx)%SOLVER_DOF_TO_VARIABLE_MAPS(&
2785 & solver_local_dof(rank))%EQUATIONS_INDICES(colequationscolidx)=interface_condition_idx
2786 solver_mapping%SOLVER_COL_TO_EQUATIONS_COLS_MAP(solver_matrix_idx)%SOLVER_DOF_TO_VARIABLE_MAPS(&
2787 & solver_local_dof(rank))%VARIABLE(colequationscolidx)%PTR=>lagrange_variable
2788 solver_mapping%SOLVER_COL_TO_EQUATIONS_COLS_MAP(solver_matrix_idx)%SOLVER_DOF_TO_VARIABLE_MAPS(&
2789 & solver_local_dof(rank))%VARIABLE_DOF(colequationscolidx)=eqnlocaldof
2790 solver_mapping%SOLVER_COL_TO_EQUATIONS_COLS_MAP(solver_matrix_idx)%SOLVER_DOF_TO_VARIABLE_MAPS(&
2791 & solver_local_dof(rank))%VARIABLE_COEFFICIENT(colequationscolidx)=couplingcoefficient
2792 solver_mapping%SOLVER_COL_TO_EQUATIONS_COLS_MAP(solver_matrix_idx)%SOLVER_DOF_TO_VARIABLE_MAPS(&
2793 & solver_local_dof(rank))%ADDITIVE_CONSTANT(1)=0.0_dp
2796 DO colequationscolidx=1,numbercolequationscols
2797 eqnlocaldof=colequationcols%localDofs(colequationscolidx)
2798 couplingcoefficient=colequationcols%coefficients(colequationscolidx)
2800 IF(.NOT.variable_rank_processed(solver_variable_idx,rank))
THEN 2803 solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
2804 & interface_to_solver_matrix_maps_sm(solver_matrix_idx)%LAGRANGE_VARIABLE_TO_SOLVER_COL_MAP% &
2805 & column_numbers(eqnlocaldof)=solver_global_dof
2806 solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
2807 & interface_to_solver_matrix_maps_sm(solver_matrix_idx)%LAGRANGE_VARIABLE_TO_SOLVER_COL_MAP% &
2808 & coupling_coefficients(eqnlocaldof)=couplingcoefficient
2809 solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
2810 & interface_to_solver_matrix_maps_sm(solver_matrix_idx)%LAGRANGE_VARIABLE_TO_SOLVER_COL_MAP% &
2811 & additive_constants(eqnlocaldof)=0.0_dp
2813 interface_column=interface_mapping%LAGRANGE_DOF_TO_COLUMN_MAP(local_dof)
2815 ALLOCATE(solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
2816 & interface_to_solver_matrix_maps_sm(solver_matrix_idx)%INTERFACE_COL_TO_SOLVER_COLS_MAP( &
2817 & interface_column)%SOLVER_COLS(1),stat=err)
2818 IF(err/=0)
CALL flag_error(
"Could not allocate interface column to solver columns map "// &
2819 &
"solver colums.",err,error,*999)
2820 ALLOCATE(solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
2821 & interface_to_solver_matrix_maps_sm(solver_matrix_idx)%INTERFACE_COL_TO_SOLVER_COLS_MAP( &
2822 & interface_column)%COUPLING_COEFFICIENTS(1),stat=err)
2823 IF(err/=0)
CALL flagerror(
"Could not allocate interface column to solver columns map "// &
2824 &
"coupling coefficients.",err,error,*999)
2825 solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
2826 & interface_to_solver_matrix_maps_sm(solver_matrix_idx)%INTERFACE_COL_TO_SOLVER_COLS_MAP( &
2827 & interface_column)%NUMBER_OF_SOLVER_COLS=1
2828 solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
2829 & interface_to_solver_matrix_maps_sm(solver_matrix_idx)%INTERFACE_COL_TO_SOLVER_COLS_MAP( &
2830 & interface_column)%SOLVER_COLS(1)=solver_global_dof
2831 solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
2832 & interface_to_solver_matrix_maps_sm(solver_matrix_idx)%INTERFACE_COL_TO_SOLVER_COLS_MAP( &
2833 & interface_column)%COUPLING_COEFFICIENTS(1)=couplingcoefficient
2837 solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
2838 & interface_to_solver_matrix_maps_sm(solver_matrix_idx)%DEPENDENT_VARIABLE_TO_SOLVER_COL_MAPS( &
2839 & interface_matrix_idx)%COLUMN_NUMBERS(eqnlocaldof)=solver_global_dof
2840 solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
2841 & interface_to_solver_matrix_maps_sm(solver_matrix_idx)%DEPENDENT_VARIABLE_TO_SOLVER_COL_MAPS( &
2842 & interface_matrix_idx)%COUPLING_COEFFICIENTS(eqnlocaldof)=couplingcoefficient
2843 solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
2844 & interface_to_solver_matrix_maps_sm(solver_matrix_idx)%DEPENDENT_VARIABLE_TO_SOLVER_COL_MAPS( &
2845 & interface_matrix_idx)%ADDITIVE_CONSTANTS(eqnlocaldof)=0.0_dp
2847 interface_row=interface_mapping%INTERFACE_MATRIX_ROWS_TO_VAR_MAPS(interface_matrix_idx)% &
2848 & variable_dof_to_row_map(eqnlocaldof)
2850 ALLOCATE(solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
2851 & interface_to_solver_matrix_maps_sm(solver_matrix_idx)% &
2852 & interface_equations_to_solver_matrix_maps(interface_matrix_idx)%PTR% &
2853 & interface_row_to_solver_cols_map(interface_row)%SOLVER_COLS(1),stat=err)
2855 &
CALL flagerror(
"Could not allocate interface equations row to solver columns map "// &
2856 &
"solver colums.",err,error,*999)
2857 ALLOCATE(solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
2858 & interface_to_solver_matrix_maps_sm(solver_matrix_idx)% &
2859 & interface_equations_to_solver_matrix_maps(interface_matrix_idx)%PTR% &
2860 & interface_row_to_solver_cols_map(interface_row)%COUPLING_COEFFICIENTS(1),stat=err)
2862 &
CALL flagerror(
"Could not allocate interface equations row to solver columns map "// &
2863 &
"coupling coefficients.",err,error,*999)
2864 solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
2865 & interface_to_solver_matrix_maps_sm(solver_matrix_idx)% &
2866 & interface_equations_to_solver_matrix_maps(interface_matrix_idx)%PTR% &
2867 & interface_row_to_solver_cols_map(interface_row)%NUMBER_OF_SOLVER_COLS=1
2868 solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
2869 & interface_to_solver_matrix_maps_sm(solver_matrix_idx)% &
2870 & interface_equations_to_solver_matrix_maps(interface_matrix_idx)%PTR% &
2871 & interface_row_to_solver_cols_map(interface_row)%SOLVER_COLS(1)=solver_global_dof
2872 solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
2873 & interface_to_solver_matrix_maps_sm(solver_matrix_idx)% &
2874 & interface_equations_to_solver_matrix_maps(interface_matrix_idx)%PTR% &
2875 & interface_row_to_solver_cols_map(interface_row)%COUPLING_COEFFICIENTS(1)= &
2876 & interface_mapping%INTERFACE_MATRIX_ROWS_TO_VAR_MAPS(interface_matrix_idx)%MATRIX_COEFFICIENT
2880 IF(.NOT.variable_rank_processed(solver_variable_idx,rank))
THEN 2884 & solver_global_dof),err,error,*999)
2888 ALLOCATE(col_domain_mapping%GLOBAL_TO_LOCAL_MAP(solver_global_dof)%LOCAL_NUMBER(1),stat=err)
2890 &
CALL flagerror(
"Could not allocate column domain global to local map local number.", &
2892 ALLOCATE(col_domain_mapping%GLOBAL_TO_LOCAL_MAP(solver_global_dof)%DOMAIN_NUMBER(1),stat=err)
2894 &
CALL flagerror(
"Could not allocate column domain global to local map domain number.", &
2896 ALLOCATE(col_domain_mapping%GLOBAL_TO_LOCAL_MAP(solver_global_dof)%LOCAL_TYPE(1),stat=err)
2898 &
CALL flagerror(
"Could not allocate column domain global to local map domain number.", &
2901 col_domain_mapping%GLOBAL_TO_LOCAL_MAP(solver_global_dof)%NUMBER_OF_DOMAINS=1
2902 col_domain_mapping%GLOBAL_TO_LOCAL_MAP(solver_global_dof)%LOCAL_NUMBER(1)= &
2903 & solver_local_dof(rank)
2904 col_domain_mapping%GLOBAL_TO_LOCAL_MAP(solver_global_dof)%DOMAIN_NUMBER(1)=rank
2909 ELSE IF(constrained_dof)
THEN 2912 IF(rank==myrank)
THEN 2915 solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
2916 & interface_to_solver_matrix_maps_sm(solver_matrix_idx)% &
2917 & lagrange_variable_to_solver_col_map%COLUMN_NUMBERS(local_dof)=0
2918 solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
2919 & interface_to_solver_matrix_maps_sm(solver_matrix_idx)% &
2920 & lagrange_variable_to_solver_col_map%COUPLING_COEFFICIENTS(local_dof)=0.0_dp
2921 solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
2922 & interface_to_solver_matrix_maps_sm(solver_matrix_idx)% &
2923 & lagrange_variable_to_solver_col_map%ADDITIVE_CONSTANTS(local_dof)=0.0_dp
2924 interface_column=interface_mapping%LAGRANGE_DOF_TO_COLUMN_MAP(local_dof)
2925 solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
2926 & interface_to_solver_matrix_maps_sm(solver_matrix_idx)%INTERFACE_COL_TO_SOLVER_COLS_MAP( &
2927 & interface_column)%NUMBER_OF_SOLVER_COLS=0
2930 solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
2931 & interface_to_solver_matrix_maps_sm(solver_matrix_idx)% &
2932 & dependent_variable_to_solver_col_maps(interface_matrix_idx)%COLUMN_NUMBERS(local_dof)=0
2933 solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
2934 & interface_to_solver_matrix_maps_sm(solver_matrix_idx)% &
2935 & dependent_variable_to_solver_col_maps(interface_matrix_idx)% &
2936 & coupling_coefficients(local_dof)=0.0_dp
2937 solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
2938 & interface_to_solver_matrix_maps_sm(solver_matrix_idx)% &
2939 & dependent_variable_to_solver_col_maps(interface_matrix_idx)% &
2940 & additive_constants(local_dof)=0.0_dp
2942 interface_row=interface_mapping%INTERFACE_MATRIX_ROWS_TO_VAR_MAPS(interface_matrix_idx)% &
2943 & variable_dof_to_row_map(local_dof)
2944 solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
2945 & interface_to_solver_matrix_maps_sm(solver_matrix_idx)% &
2946 & interface_equations_to_solver_matrix_maps(interface_matrix_idx)%PTR% &
2947 & interface_row_to_solver_cols_map(interface_row)%NUMBER_OF_SOLVER_COLS=0
2953 CALL flagerror(
"Not implemented.",err,error,*999)
2955 CALL flagerror(
"Not implemented.",err,error,*999)
2957 local_error=
"The interface condition method of "// &
2960 CALL flagerror(local_error,err,error,*999)
2965 CALL flagerror(local_error,err,error,*999)
2967 variable_rank_processed(solver_variable_idx,rank)=.true.
2969 IF(
ALLOCATED(rank_global_cols_list))
DEALLOCATE(rank_global_cols_list)
2977 DO solver_variable_idx=1,solver_mapping%VARIABLES_LIST(solver_matrix_idx)%NUMBER_OF_VARIABLES
2978 DEALLOCATE(dof_map(solver_variable_idx)%PTR)
2982 IF(
ALLOCATED(solver_local_dof))
DEALLOCATE(solver_local_dof)
2986 IF(
ALLOCATED(sub_matrix_information))
DEALLOCATE(sub_matrix_information)
2987 IF(
ALLOCATED(sub_matrix_list))
DEALLOCATE(sub_matrix_list)
2988 IF(
ALLOCATED(variable_rank_processed))
DEALLOCATE(variable_rank_processed)
2989 IF(
ALLOCATED(number_of_variable_global_solver_dofs))
DEALLOCATE(number_of_variable_global_solver_dofs)
2990 IF(
ALLOCATED(number_of_variable_local_solver_dofs))
DEALLOCATE(number_of_variable_local_solver_dofs)
2991 IF(
ALLOCATED(total_number_of_variable_local_solver_dofs))
DEALLOCATE(total_number_of_variable_local_solver_dofs)
2992 DO solver_variable_idx=1,number_of_equations_variables+number_of_interface_variables
2993 CALL list_destroy(variables_list(solver_variable_idx)%PTR,err,error,*999)
2996 IF(
ALLOCATED(dummydofcoupling%globalDofs))
DEALLOCATE(dummydofcoupling%globalDofs)
2997 IF(
ALLOCATED(dummydofcoupling%localDofs))
DEALLOCATE(dummydofcoupling%localDofs)
2998 IF(
ALLOCATED(dummydofcoupling%coefficients))
DEALLOCATE(dummydofcoupling%coefficients)
3005 DO equations_set_idx=1,solver_mapping%NUMBER_OF_EQUATIONS_SETS
3006 equations_set=>solver_mapping%EQUATIONS_SETS(equations_set_idx)%PTR
3007 equations=>equations_set%EQUATIONS
3008 equations_mapping=>equations%EQUATIONS_MAPPING
3009 dynamic_mapping=>equations_mapping%DYNAMIC_MAPPING
3010 linear_mapping=>equations_mapping%LINEAR_MAPPING
3011 IF(
ASSOCIATED(dynamic_mapping))
THEN 3012 DO equations_matrix_idx=1,dynamic_mapping%NUMBER_OF_DYNAMIC_EQUATIONS_MATRICES
3013 ALLOCATE(solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_EM( &
3014 & equations_matrix_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS(solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP( &
3015 & equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_EM(equations_matrix_idx)%NUMBER_OF_SOLVER_MATRICES), &
3017 IF(err/=0)
CALL flagerror(
"Could not allocate equations to solver matrix maps.",err,error,*999)
3018 solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_EM( &
3019 & equations_matrix_idx)%NUMBER_OF_SOLVER_MATRICES=0
3021 DO solver_matrix_idx=1,solver_mapping%NUMBER_OF_SOLVER_MATRICES
3022 DO equations_matrix_idx=1,solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)% &
3023 & equations_to_solver_matrix_maps_sm(solver_matrix_idx)%NUMBER_OF_DYNAMIC_EQUATIONS_MATRICES
3024 IF(solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_SM( &
3025 & solver_matrix_idx)%DYNAMIC_EQUATIONS_TO_SOLVER_MATRIX_MAPS(equations_matrix_idx)%PTR% &
3026 & solver_matrix_number==solver_matrix_idx)
THEN 3027 solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_EM( &
3028 & equations_matrix_idx)%NUMBER_OF_SOLVER_MATRICES=solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP( &
3029 & equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_EM(equations_matrix_idx)%NUMBER_OF_SOLVER_MATRICES+1
3030 solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_EM( &
3031 & equations_matrix_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS(solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP( &
3032 & equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_EM(equations_matrix_idx)%NUMBER_OF_SOLVER_MATRICES)% &
3033 &
ptr=>solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_SM( &
3034 & solver_matrix_idx)%DYNAMIC_EQUATIONS_TO_SOLVER_MATRIX_MAPS(equations_matrix_idx)%PTR
3038 ELSE IF(
ASSOCIATED(linear_mapping))
THEN 3039 DO equations_matrix_idx=1,linear_mapping%NUMBER_OF_LINEAR_EQUATIONS_MATRICES
3040 ALLOCATE(solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_EM( &
3041 & equations_matrix_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS(solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP( &
3042 & equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_EM(equations_matrix_idx)%NUMBER_OF_SOLVER_MATRICES), &
3044 IF(err/=0)
CALL flagerror(
"Could not allocate equations to solver matrix maps.",err,error,*999)
3045 solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_EM( &
3046 & equations_matrix_idx)%NUMBER_OF_SOLVER_MATRICES=0
3048 DO solver_matrix_idx=1,solver_mapping%NUMBER_OF_SOLVER_MATRICES
3049 DO equations_matrix_idx=1,solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)% &
3050 & equations_to_solver_matrix_maps_sm(solver_matrix_idx)%NUMBER_OF_LINEAR_EQUATIONS_MATRICES
3051 IF(solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_SM( &
3052 & solver_matrix_idx)%LINEAR_EQUATIONS_TO_SOLVER_MATRIX_MAPS(equations_matrix_idx)%PTR% &
3053 & solver_matrix_number==solver_matrix_idx)
THEN 3054 solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_EM( &
3055 & equations_matrix_idx)%NUMBER_OF_SOLVER_MATRICES=solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP( &
3056 & equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_EM(equations_matrix_idx)%NUMBER_OF_SOLVER_MATRICES+1
3057 solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_EM( &
3058 & equations_matrix_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS(solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP( &
3059 & equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_EM(equations_matrix_idx)%NUMBER_OF_SOLVER_MATRICES)% &
3060 &
ptr=>solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_SM( &
3061 & solver_matrix_idx)%LINEAR_EQUATIONS_TO_SOLVER_MATRIX_MAPS(equations_matrix_idx)%PTR
3067 DO interface_condition_idx=1,solver_mapping%NUMBER_OF_INTERFACE_CONDITIONS
3068 interface_condition=>solver_mapping%INTERFACE_CONDITIONS(interface_condition_idx)%PTR
3069 SELECT CASE(interface_condition%METHOD)
3071 interface_equations=>interface_condition%INTERFACE_EQUATIONS
3072 interface_mapping=>interface_equations%INTERFACE_MAPPING
3073 DO interface_matrix_idx=1,interface_mapping%NUMBER_OF_INTERFACE_MATRICES
3074 ALLOCATE(solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
3075 & interface_to_solver_matrix_maps_im(interface_matrix_idx)%INTERFACE_TO_SOLVER_MATRIX_MAPS(solver_mapping% &
3076 & interface_condition_to_solver_map(interface_condition_idx)%INTERFACE_TO_SOLVER_MATRIX_MAPS_IM( &
3077 & interface_matrix_idx)%NUMBER_OF_SOLVER_MATRICES),stat=err)
3078 IF(err/=0)
CALL flagerror(
"Could not allocate interface to solver matrix maps.",err,error,*999)
3079 solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)%INTERFACE_TO_SOLVER_MATRIX_MAPS_IM( &
3080 & interface_matrix_idx)%NUMBER_OF_SOLVER_MATRICES=0
3082 DO solver_matrix_idx=1,solver_mapping%NUMBER_OF_SOLVER_MATRICES
3083 DO interface_matrix_idx=1,solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
3084 & interface_to_solver_matrix_maps_sm(solver_matrix_idx)%NUMBER_OF_INTERFACE_MATRICES
3085 IF(solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)%INTERFACE_TO_SOLVER_MATRIX_MAPS_SM( &
3086 & solver_matrix_idx)%INTERFACE_EQUATIONS_TO_SOLVER_MATRIX_MAPS(interface_matrix_idx)%PTR% &
3087 & solver_matrix_number==solver_matrix_idx)
THEN 3088 solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)%INTERFACE_TO_SOLVER_MATRIX_MAPS_IM( &
3089 & interface_matrix_idx)%NUMBER_OF_SOLVER_MATRICES=solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP( &
3090 & interface_condition_idx)%INTERFACE_TO_SOLVER_MATRIX_MAPS_IM(interface_matrix_idx)% &
3091 & number_of_solver_matrices+1
3092 solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)%INTERFACE_TO_SOLVER_MATRIX_MAPS_IM( &
3093 & interface_matrix_idx)%INTERFACE_TO_SOLVER_MATRIX_MAPS(solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP( &
3094 & interface_condition_idx)%INTERFACE_TO_SOLVER_MATRIX_MAPS_IM(interface_matrix_idx)%&
3095 & number_of_solver_matrices)%PTR=>solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
3096 & interface_to_solver_matrix_maps_sm(solver_matrix_idx)%INTERFACE_EQUATIONS_TO_SOLVER_MATRIX_MAPS( &
3097 & interface_matrix_idx)%PTR
3102 CALL flagerror(
"Not implemented.",err,error,*999)
3104 CALL flagerror(
"Not implemented.",err,error,*999)
3106 local_error=
"The interface condition method of "// &
3108 CALL flagerror(local_error,err,error,*999)
3113 CALL flagerror(
"The solver mapping solver equations are not associated.",err,error,*999)
3116 CALL flagerror(
"Solver mapping create values cache is not associated.",err,error,*999)
3119 CALL flagerror(
"Solver mapping is not associated.",err,error,*999)
3125 & number_of_solver_matrices,err,error,*999)
3128 & number_of_equations_sets,err,error,*999)
3129 DO equations_set_idx=1,solver_mapping%NUMBER_OF_EQUATIONS_SETS
3130 equations_set=>solver_mapping%EQUATIONS_SETS(equations_set_idx)%PTR
3139 & number_of_interface_conditions,err,error,*999)
3140 DO interface_condition_idx=1,solver_mapping%NUMBER_OF_INTERFACE_CONDITIONS
3141 interface_condition=>solver_mapping%INTERFACE_CONDITIONS(interface_condition_idx)%PTR
3145 & parent_region%USER_NUMBER,err,error,*999)
3150 DO solver_matrix_idx=1,solver_mapping%NUMBER_OF_SOLVER_MATRICES
3153 & solver_matrix_idx)%NUMBER_OF_VARIABLES,err,error,*999)
3154 DO variable_idx=1,solver_mapping%VARIABLES_LIST(solver_matrix_idx)%NUMBER_OF_VARIABLES
3157 & solver_matrix_idx)%VARIABLES(variable_idx)%VARIABLE_TYPE,err,error,*999)
3159 & solver_matrix_idx)%VARIABLES(variable_idx)%NUMBER_OF_EQUATIONS,err,error,*999)
3161 & variable_idx)%NUMBER_OF_EQUATIONS,5,5,solver_mapping%VARIABLES_LIST(solver_matrix_idx)%VARIABLES( &
3162 & variable_idx)%EQUATION_TYPES,
'(" Equation types :",5(X,I13))',
'(26X,5(X,I13))',err,error,*999)
3164 & variable_idx)%NUMBER_OF_EQUATIONS,5,5,solver_mapping%VARIABLES_LIST(solver_matrix_idx)%VARIABLES( &
3165 & variable_idx)%EQUATION_TYPES,
'(" Equation indices :",5(X,I13))',
'(26X,5(X,I13))',err,error,*999)
3173 DO row_idx=1,solver_mapping%NUMBER_OF_ROWS
3176 & solver_row_to_equations_rows_map(row_idx)%NUMBER_OF_EQUATIONS_SET_ROWS,err,error,*999)
3178 & solver_row_to_equations_rows_map(row_idx)%INTERFACE_CONDITION_INDEX,err,error,*999)
3179 IF(solver_mapping%SOLVER_ROW_TO_EQUATIONS_ROWS_MAP(row_idx)%INTERFACE_CONDITION_INDEX==0)
THEN 3182 & number_of_equations_set_rows,5,5,solver_mapping%SOLVER_ROW_TO_EQUATIONS_ROWS_MAP(row_idx)%EQUATIONS_INDEX, &
3183 &
'(" Equations indices :",5(X,I13))',
'(30X,5(X,I13))',err,error,*999)
3185 & number_of_equations_set_rows,5,5,solver_mapping%SOLVER_ROW_TO_EQUATIONS_ROWS_MAP(row_idx)%ROWCOL_NUMBER, &
3186 &
'(" Equations row numbers :",5(X,I13))',
'(30X,5(X,I13))',err,error,*999)
3188 & number_of_equations_set_rows,5,5,solver_mapping%SOLVER_ROW_TO_EQUATIONS_ROWS_MAP(row_idx)%COUPLING_COEFFICIENTS, &
3189 &
'(" Coupling coefficients :",5(X,E13.6))',
'(30X,5(X,E13.6))',err,error,*999)
3194 & solver_row_to_equations_rows_map(row_idx)%ROWCOL_NUMBER(1),
"(I13)",err,error,*999)
3196 & solver_row_to_equations_rows_map(row_idx)%COUPLING_COEFFICIENTS(1),
"(E13.6)",err,error,*999)
3201 DO solver_matrix_idx=1,solver_mapping%NUMBER_OF_SOLVER_MATRICES
3204 & solver_col_to_equations_cols_map(solver_matrix_idx)%NUMBER_OF_COLUMNS,err,error,*999)
3207 DO equations_set_idx=1,solver_mapping%NUMBER_OF_EQUATIONS_SETS
3209 DO column_idx=1,solver_mapping%SOLVER_COL_TO_EQUATIONS_COLS_MAP(solver_matrix_idx)%NUMBER_OF_COLUMNS
3211 IF(solver_mapping%SOLVER_COL_TO_EQUATIONS_COLS_MAP(solver_matrix_idx)%SOLVER_COL_TO_EQUATIONS_SET_MAPS( &
3212 & equations_set_idx)%HAVE_DYNAMIC)
THEN 3214 & solver_mapping%SOLVER_COL_TO_EQUATIONS_COLS_MAP(solver_matrix_idx)%SOLVER_COL_TO_EQUATIONS_SET_MAPS( &
3215 & equations_set_idx)%SOLVER_COL_TO_DYNAMIC_EQUATIONS_MAPS(column_idx)%NUMBER_OF_DYNAMIC_EQUATIONS_MATRICES, &
3217 IF(solver_mapping%SOLVER_COL_TO_EQUATIONS_COLS_MAP(solver_matrix_idx)%SOLVER_COL_TO_EQUATIONS_SET_MAPS( &
3218 & equations_set_idx)%SOLVER_COL_TO_DYNAMIC_EQUATIONS_MAPS(column_idx)%NUMBER_OF_DYNAMIC_EQUATIONS_MATRICES>0)
THEN 3220 & solver_matrix_idx)%SOLVER_COL_TO_EQUATIONS_SET_MAPS(equations_set_idx)%SOLVER_COL_TO_DYNAMIC_EQUATIONS_MAPS( &
3221 & column_idx)%NUMBER_OF_DYNAMIC_EQUATIONS_MATRICES,5,5,solver_mapping%SOLVER_COL_TO_EQUATIONS_COLS_MAP( &
3222 & solver_matrix_idx)%SOLVER_COL_TO_EQUATIONS_SET_MAPS(equations_set_idx)%SOLVER_COL_TO_DYNAMIC_EQUATIONS_MAPS( &
3223 & column_idx)%EQUATIONS_MATRIX_NUMBERS,
'(" Equation matrices numbers :",5(X,I13))', &
3224 &
'(39X,5(X,I13))',err,error,*999)
3226 & solver_matrix_idx)%SOLVER_COL_TO_EQUATIONS_SET_MAPS(equations_set_idx)%SOLVER_COL_TO_DYNAMIC_EQUATIONS_MAPS( &
3227 & column_idx)%NUMBER_OF_DYNAMIC_EQUATIONS_MATRICES,5,5,solver_mapping%SOLVER_COL_TO_EQUATIONS_COLS_MAP( &
3228 & solver_matrix_idx)%SOLVER_COL_TO_EQUATIONS_SET_MAPS(equations_set_idx)%SOLVER_COL_TO_DYNAMIC_EQUATIONS_MAPS( &
3229 & column_idx)%EQUATIONS_COL_NUMBERS,
'(" Equation column numbers :",5(X,I13))', &
3230 &
'(39X,5(X,I13))',err,error,*999)
3232 & solver_matrix_idx)%SOLVER_COL_TO_EQUATIONS_SET_MAPS(equations_set_idx)%SOLVER_COL_TO_DYNAMIC_EQUATIONS_MAPS( &
3233 & column_idx)%NUMBER_OF_DYNAMIC_EQUATIONS_MATRICES,5,5,solver_mapping%SOLVER_COL_TO_EQUATIONS_COLS_MAP( &
3234 & solver_matrix_idx)%SOLVER_COL_TO_EQUATIONS_SET_MAPS(equations_set_idx)%SOLVER_COL_TO_DYNAMIC_EQUATIONS_MAPS( &
3235 & column_idx)%COUPLING_COEFFICIENTS,
'(" Coupling coefficients :",5(X,E13.6))', &
3236 &
'(39X,5(X,E13.6))',err,error,*999)
3240 & 0_intg,err,error,*999)
3243 IF(solver_mapping%SOLVER_COL_TO_EQUATIONS_COLS_MAP(solver_matrix_idx)%SOLVER_COL_TO_EQUATIONS_SET_MAPS( &
3244 & equations_set_idx)%HAVE_STATIC)
THEN 3246 & solver_mapping%SOLVER_COL_TO_EQUATIONS_COLS_MAP(solver_matrix_idx)%SOLVER_COL_TO_EQUATIONS_SET_MAPS( &
3247 & equations_set_idx)%SOLVER_COL_TO_STATIC_EQUATIONS_MAPS(column_idx)%NUMBER_OF_LINEAR_EQUATIONS_MATRICES, &
3249 IF(solver_mapping%SOLVER_COL_TO_EQUATIONS_COLS_MAP(solver_matrix_idx)%SOLVER_COL_TO_EQUATIONS_SET_MAPS( &
3250 & equations_set_idx)%SOLVER_COL_TO_STATIC_EQUATIONS_MAPS(column_idx)%NUMBER_OF_LINEAR_EQUATIONS_MATRICES>0)
THEN 3271 & solver_mapping%SOLVER_COL_TO_EQUATIONS_COLS_MAP(solver_matrix_idx)%SOLVER_COL_TO_EQUATIONS_SET_MAPS( &
3272 & equations_set_idx)%SOLVER_COL_TO_STATIC_EQUATIONS_MAPS(column_idx)%JACOBIAN_COL_NUMBER,err,error,*999)
3274 & solver_mapping%SOLVER_COL_TO_EQUATIONS_COLS_MAP(solver_matrix_idx)%SOLVER_COL_TO_EQUATIONS_SET_MAPS( &
3275 & equations_set_idx)%SOLVER_COL_TO_STATIC_EQUATIONS_MAPS(column_idx)%JACOBIAN_COUPLING_COEFFICIENT,err,error,*999)
3278 & 0_intg,err,error,*999)
3285 DO solver_matrix_idx=1,solver_mapping%NUMBER_OF_SOLVER_MATRICES
3288 & solver_col_to_equations_cols_map(solver_matrix_idx)%NUMBER_OF_DOFS,err,error,*999)
3290 & solver_col_to_equations_cols_map(solver_matrix_idx)%TOTAL_NUMBER_OF_DOFS,err,error,*999)
3292 & solver_col_to_equations_cols_map(solver_matrix_idx)%NUMBER_OF_GLOBAL_DOFS,err,error,*999)
3293 ALLOCATE(variable_types(solver_mapping%NUMBER_OF_EQUATIONS_SETS+solver_mapping%NUMBER_OF_INTERFACE_CONDITIONS),stat=err)
3294 IF(err/=0)
CALL flagerror(
"Could not allocate variable types.",err,error,*999)
3295 DO dof_idx=1,solver_mapping%SOLVER_COL_TO_EQUATIONS_COLS_MAP(solver_matrix_idx)%TOTAL_NUMBER_OF_DOFS
3298 & solver_col_to_equations_cols_map(solver_matrix_idx)%SOLVER_DOF_TO_VARIABLE_MAPS(dof_idx)% &
3299 & number_of_equation_dofs,err,error,*999)
3300 IF(solver_mapping%SOLVER_COL_TO_EQUATIONS_COLS_MAP(solver_matrix_idx)%SOLVER_DOF_TO_VARIABLE_MAPS(dof_idx)% &
3301 & number_of_equation_dofs>0)
THEN 3303 & solver_matrix_idx)%SOLVER_DOF_TO_VARIABLE_MAPS(dof_idx)%NUMBER_OF_EQUATION_DOFS,5,5,solver_mapping% &
3304 & solver_col_to_equations_cols_map(solver_matrix_idx)%SOLVER_DOF_TO_VARIABLE_MAPS(dof_idx)%EQUATIONS_INDICES, &
3305 &
'(" Equations types :",5(X,I13))',
'(31X,5(X,I13))',err,error,*999)
3307 & solver_matrix_idx)%SOLVER_DOF_TO_VARIABLE_MAPS(dof_idx)%NUMBER_OF_EQUATION_DOFS,5,5,solver_mapping% &
3308 & solver_col_to_equations_cols_map(solver_matrix_idx)%SOLVER_DOF_TO_VARIABLE_MAPS(dof_idx)%EQUATIONS_INDICES, &
3309 &
'(" Equations indices :",5(X,I13))',
'(31X,5(X,I13))',err,error,*999)
3310 DO variable_idx=1,solver_mapping%SOLVER_COL_TO_EQUATIONS_COLS_MAP(solver_matrix_idx)%SOLVER_DOF_TO_VARIABLE_MAPS( &
3311 & dof_idx)%NUMBER_OF_EQUATION_DOFS
3312 variable_types(variable_idx)=solver_mapping%SOLVER_COL_TO_EQUATIONS_COLS_MAP(solver_matrix_idx)% &
3313 & solver_dof_to_variable_maps(dof_idx)%VARIABLE(variable_idx)%PTR%VARIABLE_TYPE
3316 & solver_matrix_idx)%SOLVER_DOF_TO_VARIABLE_MAPS(dof_idx)%NUMBER_OF_EQUATION_DOFS,5,5,variable_types, &
3317 &
'(" Variable types :",5(X,I13))',
'(31X,5(X,I13))',err,error,*999)
3319 & solver_matrix_idx)%SOLVER_DOF_TO_VARIABLE_MAPS(dof_idx)%NUMBER_OF_EQUATION_DOFS,5,5,solver_mapping% &
3320 & solver_col_to_equations_cols_map(solver_matrix_idx)%SOLVER_DOF_TO_VARIABLE_MAPS(dof_idx)%VARIABLE_DOF, &
3321 &
'(" Variable DOFs :",5(X,I13))',
'(31X,5(X,I13))',err,error,*999)
3323 & solver_matrix_idx)%SOLVER_DOF_TO_VARIABLE_MAPS(dof_idx)%NUMBER_OF_EQUATION_DOFS,5,5,solver_mapping% &
3324 & solver_col_to_equations_cols_map(solver_matrix_idx)%SOLVER_DOF_TO_VARIABLE_MAPS(dof_idx)% &
3325 & variable_coefficient, &
3326 &
'(" Variable coefficients :",5(X,E13.6))',
'(31X,5(X,E13.6))',err,error,*999)
3328 & solver_matrix_idx)%SOLVER_DOF_TO_VARIABLE_MAPS(dof_idx)%NUMBER_OF_EQUATION_DOFS,5,5,solver_mapping% &
3329 & solver_col_to_equations_cols_map(solver_matrix_idx)%SOLVER_DOF_TO_VARIABLE_MAPS(dof_idx)% &
3330 & additive_constant, &
3331 &
'(" Additive constants :",5(X,E13.6))',
'(31X,5(X,E13.6))',err,error,*999)
3334 IF(
ALLOCATED(variable_types))
DEALLOCATE(variable_types)
3337 DO equations_set_idx=1,solver_mapping%NUMBER_OF_EQUATIONS_SETS
3338 equations_set=>solver_mapping%EQUATIONS_SETS(equations_set_idx)%PTR
3339 equations=>equations_set%EQUATIONS
3340 equations_mapping=>equations%EQUATIONS_MAPPING
3341 dynamic_mapping=>equations_mapping%DYNAMIC_MAPPING
3342 linear_mapping=>equations_mapping%LINEAR_MAPPING
3343 nonlinear_mapping=>equations_mapping%NONLINEAR_MAPPING
3344 rhs_mapping=>equations_mapping%RHS_MAPPING
3345 source_mapping=>equations_mapping%SOURCE_MAPPING
3349 & total_number_of_rows,err,error,*999)
3350 DO row_idx=1,equations_mapping%TOTAL_NUMBER_OF_ROWS
3353 & equations_set_to_solver_map(equations_set_idx)%EQUATIONS_ROW_TO_SOLVER_ROWS_MAPS(row_idx)%NUMBER_OF_SOLVER_ROWS, &
3355 IF(solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%EQUATIONS_ROW_TO_SOLVER_ROWS_MAPS(row_idx)% &
3356 & number_of_solver_rows>0)
THEN 3358 & equations_row_to_solver_rows_maps(row_idx)%NUMBER_OF_SOLVER_ROWS,5,5,solver_mapping% &
3359 & equations_set_to_solver_map(equations_set_idx)%EQUATIONS_ROW_TO_SOLVER_ROWS_MAPS(row_idx)%SOLVER_ROWS, &
3360 &
'(" Solver row numbers :",5(X,I13))',
'(33X,5(X,I13))',err,error,*999)
3362 & equations_row_to_solver_rows_maps(row_idx)%NUMBER_OF_SOLVER_ROWS,5,5,solver_mapping% &
3363 & equations_set_to_solver_map(equations_set_idx)%EQUATIONS_ROW_TO_SOLVER_ROWS_MAPS(row_idx)%COUPLING_COEFFICIENTS, &
3364 &
'(" Coupling coefficients :",5(X,E13.6))',
'(33X,5(X,E13.6))',err,error,*999)
3368 DO solver_matrix_idx=1,solver_mapping%NUMBER_OF_SOLVER_MATRICES
3373 & equations_set_to_solver_map(equations_set_idx)%NUMBER_OF_INTERFACE_CONDITIONS,err,error,*999)
3374 DO interface_condition_idx=1,solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)%NUMBER_OF_INTERFACE_CONDITIONS
3378 & equations_set_to_solver_map(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_INTERFACE( &
3379 & interface_condition_idx)%INTERFACE_CONDITION_INDEX,err,error,*999)
3381 & equations_set_to_solver_map(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_INTERFACE( &
3382 & interface_condition_idx)%INTERFACE_MATRIX_NUMBER,err,error,*999)
3384 IF(
ASSOCIATED(dynamic_mapping))
THEN 3388 & equations_set_to_solver_map(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_SM(solver_matrix_idx)% &
3389 & number_of_dynamic_equations_matrices,err,error,*999)
3390 DO equations_matrix_idx=1,solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)% &
3391 & equations_to_solver_matrix_maps_sm(solver_matrix_idx)%NUMBER_OF_DYNAMIC_EQUATIONS_MATRICES
3392 equations_to_solver_map=>solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)% &
3393 & equations_to_solver_matrix_maps_sm(solver_matrix_idx)%DYNAMIC_EQUATIONS_TO_SOLVER_MATRIX_MAPS( &
3394 & equations_matrix_idx)%PTR
3397 equations_matrix=equations_to_solver_map%EQUATIONS_MATRIX_NUMBER
3401 & solver_matrix_number,err,error,*999)
3402 DO column_idx=1,dynamic_mapping%EQUATIONS_MATRIX_TO_VAR_MAPS(equations_matrix)%NUMBER_OF_COLUMNS
3406 & equations_to_solver_map%EQUATIONS_COL_TO_SOLVER_COLS_MAP(column_idx)%NUMBER_OF_SOLVER_COLS,err,error,*999)
3407 IF(equations_to_solver_map%EQUATIONS_COL_TO_SOLVER_COLS_MAP(column_idx)%NUMBER_OF_SOLVER_COLS>0)
THEN 3409 & column_idx)%NUMBER_OF_SOLVER_COLS,5,5,equations_to_solver_map%EQUATIONS_COL_TO_SOLVER_COLS_MAP(column_idx)% &
3410 & solver_cols,
'(" Solver columns :",5(X,I13))',
'(42X,5(X,I13))',err,error,*999)
3412 & column_idx)%NUMBER_OF_SOLVER_COLS,5,5,equations_to_solver_map%EQUATIONS_COL_TO_SOLVER_COLS_MAP(column_idx)% &
3413 & coupling_coefficients,
'(" Coupling coefficients :",5(X,E13.6))',
'(42X,5(X,E13.6))', &
3419 IF(
ASSOCIATED(linear_mapping))
THEN 3423 & equations_set_to_solver_map(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_SM(solver_matrix_idx)% &
3424 & number_of_linear_equations_matrices,err,error,*999)
3425 DO equations_matrix_idx=1,solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)% &
3426 & equations_to_solver_matrix_maps_sm(solver_matrix_idx)%NUMBER_OF_LINEAR_EQUATIONS_MATRICES
3427 equations_to_solver_map=>solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)% &
3428 & equations_to_solver_matrix_maps_sm(solver_matrix_idx)%LINEAR_EQUATIONS_TO_SOLVER_MATRIX_MAPS( &
3429 & equations_matrix_idx)%PTR
3432 equations_matrix=equations_to_solver_map%EQUATIONS_MATRIX_NUMBER
3436 & equations_to_solver_map%SOLVER_MATRIX_NUMBER,err,error,*999)
3437 DO column_idx=1,linear_mapping%EQUATIONS_MATRIX_TO_VAR_MAPS(equations_matrix)%NUMBER_OF_COLUMNS
3441 & equations_to_solver_map%EQUATIONS_COL_TO_SOLVER_COLS_MAP(column_idx)%NUMBER_OF_SOLVER_COLS,err,error,*999)
3442 IF(equations_to_solver_map%EQUATIONS_COL_TO_SOLVER_COLS_MAP(column_idx)%NUMBER_OF_SOLVER_COLS>0)
THEN 3444 & column_idx)%NUMBER_OF_SOLVER_COLS,5,5,equations_to_solver_map%EQUATIONS_COL_TO_SOLVER_COLS_MAP( &
3445 & column_idx)%SOLVER_COLS,
'(" Solver columns :",5(X,I13))',
'(40X,5(X,I13))', &
3448 & column_idx)%NUMBER_OF_SOLVER_COLS,5,5,equations_to_solver_map%EQUATIONS_COL_TO_SOLVER_COLS_MAP( &
3449 & column_idx)%COUPLING_COEFFICIENTS, &
3450 &
'(" Coupling coefficients :",5(X,E13.6))',
'(40X,5(X,E13.6))',err,error,*999)
3455 IF(
ASSOCIATED(nonlinear_mapping))
THEN 3458 DO equations_matrix_idx=1,nonlinear_mapping%NUMBER_OF_RESIDUAL_VARIABLES
3459 jacobian_to_solver_map=>solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)% &
3460 & equations_to_solver_matrix_maps_sm(solver_matrix_idx)%JACOBIAN_TO_SOLVER_MATRIX_MAPS(equations_matrix_idx)%PTR
3462 & solver_matrix_number,err,error,*999)
3463 DO column_idx=1,nonlinear_mapping%JACOBIAN_TO_VAR_MAP(equations_matrix_idx)%NUMBER_OF_COLUMNS
3466 & jacobian_to_solver_map%JACOBIAN_COL_TO_SOLVER_COLS_MAP(column_idx)%NUMBER_OF_SOLVER_COLS,err,error,*999)
3467 IF(jacobian_to_solver_map%JACOBIAN_COL_TO_SOLVER_COLS_MAP(column_idx)%NUMBER_OF_SOLVER_COLS>0)
THEN 3469 & column_idx)%NUMBER_OF_SOLVER_COLS,5,5,jacobian_to_solver_map%JACOBIAN_COL_TO_SOLVER_COLS_MAP(column_idx)% &
3470 & solver_cols,
'(" Solver columns :",5(X,I13))',
'(38X,5(X,I13))',err,error,*999)
3472 & column_idx)%NUMBER_OF_SOLVER_COLS,5,5,jacobian_to_solver_map%JACOBIAN_COL_TO_SOLVER_COLS_MAP(column_idx)% &
3473 & coupling_coefficients,
'(" Coupling coefficients :",5(X,E13.6))',
'(38X,5(X,E13.6))', &
3482 & equations_set_to_solver_map(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_SM(solver_matrix_idx)% &
3483 & number_of_variables,err,error,*999)
3485 & equations_to_solver_matrix_maps_sm(solver_matrix_idx)%NUMBER_OF_VARIABLES,5,5,solver_mapping% &
3486 & equations_set_to_solver_map(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_SM(solver_matrix_idx)% &
3487 & variable_types,
'(" Variable types :",5(X,I13))',
'(28X,5(X,I13))',err,error,*999)
3488 DO variable_idx=1,solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)% &
3489 & equations_to_solver_matrix_maps_sm(solver_matrix_idx)%NUMBER_OF_VARIABLES
3490 dependent_variable=>solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)% &
3491 & equations_to_solver_matrix_maps_sm(solver_matrix_idx)%VARIABLES(variable_idx)%PTR
3494 & number_of_dofs,err,error,*999)
3495 DO local_dof=1,dependent_variable%TOTAL_NUMBER_OF_DOFS
3498 & equations_set_to_solver_map(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_SM(solver_matrix_idx)% &
3499 & variable_to_solver_col_maps(variable_idx)%COLUMN_NUMBERS(local_dof),err,error,*999)
3501 & equations_set_to_solver_map(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_SM(solver_matrix_idx)% &
3502 & variable_to_solver_col_maps(variable_idx)%COUPLING_COEFFICIENTS(local_dof),err,error,*999)
3504 & equations_set_to_solver_map(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_SM(solver_matrix_idx)% &
3505 & variable_to_solver_col_maps(variable_idx)%ADDITIVE_CONSTANTS(local_dof),err,error,*999)
3509 IF(
ASSOCIATED(dynamic_mapping))
THEN 3511 DO equations_matrix_idx=1,dynamic_mapping%NUMBER_OF_DYNAMIC_EQUATIONS_MATRICES
3514 & equations_set_to_solver_map(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_EM(equations_matrix_idx)% &
3515 & number_of_solver_matrices,err,error,*999)
3516 DO solver_matrix_idx=1,solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)% &
3517 & equations_to_solver_matrix_maps_em(equations_matrix_idx)%NUMBER_OF_SOLVER_MATRICES
3518 equations_to_solver_map=>solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)% &
3519 & equations_to_solver_matrix_maps_em(equations_matrix_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS( &
3520 & solver_matrix_idx)%PTR
3523 & equations_matrix_number,err,error,*999)
3525 & solver_matrix_number,err,error,*999)
3529 IF(
ASSOCIATED(linear_mapping))
THEN 3531 DO equations_matrix_idx=1,linear_mapping%NUMBER_OF_LINEAR_EQUATIONS_MATRICES
3534 & equations_set_to_solver_map(equations_set_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS_EM(equations_matrix_idx)% &
3535 & number_of_solver_matrices,err,error,*999)
3536 DO solver_matrix_idx=1,solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)% &
3537 & equations_to_solver_matrix_maps_em(equations_matrix_idx)%NUMBER_OF_SOLVER_MATRICES
3538 equations_to_solver_map=>solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)% &
3539 & equations_to_solver_matrix_maps_em(equations_matrix_idx)%EQUATIONS_TO_SOLVER_MATRIX_MAPS( &
3540 & solver_matrix_idx)%PTR
3543 & equations_matrix_number,err,error,*999)
3545 & solver_matrix_number,err,error,*999)
3549 IF(
ASSOCIATED(nonlinear_mapping))
THEN 3551 DO equations_matrix_idx=1,nonlinear_mapping%NUMBER_OF_RESIDUAL_VARIABLES
3552 jacobian_to_solver_map=>solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP(equations_set_idx)% &
3553 & equations_to_solver_matrix_maps_jm(equations_matrix_idx)%PTR
3555 & solver_matrix_number,err,error,*999)
3560 IF(solver_mapping%NUMBER_OF_INTERFACE_CONDITIONS>0)
THEN 3562 DO interface_condition_idx=1,solver_mapping%NUMBER_OF_INTERFACE_CONDITIONS
3563 interface_condition=>solver_mapping%INTERFACE_CONDITIONS(interface_condition_idx)%PTR
3564 interface_equations=>interface_condition%INTERFACE_EQUATIONS
3565 interface_mapping=>interface_equations%INTERFACE_MAPPING
3567 DO solver_matrix_idx=1,solver_mapping%NUMBER_OF_SOLVER_MATRICES
3570 & interface_condition_to_solver_map(interface_condition_idx)%NUMBER_OF_EQUATIONS_SETS,err,error,*999)
3571 DO equations_set_idx=1,solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
3572 & number_of_equations_sets
3575 & interface_condition_to_solver_map(interface_condition_idx)%INTERFACE_TO_SOLVER_MATRIX_MAPS_EQUATIONS( &
3576 & equations_set_idx)%EQUATIONS_SET_INDEX,err,error,*999)
3578 & interface_condition_to_solver_map(interface_condition_idx)%INTERFACE_TO_SOLVER_MATRIX_MAPS_EQUATIONS( &
3579 & equations_set_idx)%INTERFACE_MATRIX_INDEX,err,error,*999)
3583 DO interface_matrix_idx=1,interface_mapping%NUMBER_OF_INTERFACE_MATRICES
3586 & interface_matrix_rows_to_var_maps(interface_matrix_idx)%TOTAL_NUMBER_OF_ROWS,err,error,*999)
3587 DO row_idx=1,interface_mapping%INTERFACE_MATRIX_ROWS_TO_VAR_MAPS(interface_matrix_idx)%TOTAL_NUMBER_OF_ROWS
3590 & interface_condition_to_solver_map(interface_condition_idx)%INTERFACE_TO_SOLVER_MATRIX_MAPS_IM( &
3591 & interface_matrix_idx)%INTERFACE_ROW_TO_SOLVER_ROWS_MAP(row_idx)%NUMBER_OF_SOLVER_ROWS,err,error,*999)
3592 IF(solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)%INTERFACE_TO_SOLVER_MATRIX_MAPS_IM( &
3593 & interface_matrix_idx)%INTERFACE_ROW_TO_SOLVER_ROWS_MAP(row_idx)%NUMBER_OF_SOLVER_ROWS>0)
THEN 3595 & interface_condition_to_solver_map(interface_condition_idx)%INTERFACE_TO_SOLVER_MATRIX_MAPS_IM( &
3596 & interface_matrix_idx)%INTERFACE_ROW_TO_SOLVER_ROWS_MAP(row_idx)%SOLVER_ROW,
"(I13)",err,error,*999)
3598 & interface_condition_to_solver_map(interface_condition_idx)%INTERFACE_TO_SOLVER_MATRIX_MAPS_IM( &
3599 & interface_matrix_idx)%INTERFACE_ROW_TO_SOLVER_ROWS_MAP(row_idx)%COUPLING_COEFFICIENT,
"(E13.6)",err,error,*999)
3606 & total_number_of_columns,err,error,*999)
3607 DO column_idx=1,interface_mapping%TOTAL_NUMBER_OF_COLUMNS
3610 & interface_condition_to_solver_map(interface_condition_idx)%INTERFACE_COLUMN_TO_SOLVER_ROWS_MAPS(column_idx)% &
3611 & number_of_solver_rows,err,error,*999)
3612 IF(solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
3613 & interface_column_to_solver_rows_maps(column_idx)%NUMBER_OF_SOLVER_ROWS>0)
THEN 3615 & interface_condition_to_solver_map(interface_condition_idx)%INTERFACE_COLUMN_TO_SOLVER_ROWS_MAPS(column_idx)% &
3616 & solver_row,
"(I13)",err,error,*999)
3618 & interface_condition_to_solver_map(interface_condition_idx)%INTERFACE_COLUMN_TO_SOLVER_ROWS_MAPS(column_idx)% &
3619 & coupling_coefficient,
"(E13.6)",err,error,*999)
3623 DO solver_matrix_idx=1,solver_mapping%NUMBER_OF_SOLVER_MATRICES
3628 & interface_condition_to_solver_map(interface_condition_idx)%INTERFACE_TO_SOLVER_MATRIX_MAPS_SM(solver_matrix_idx)% &
3629 & number_of_interface_matrices,err,error,*999)
3630 DO interface_matrix_idx=1,solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
3631 & interface_to_solver_matrix_maps_sm(solver_matrix_idx)%NUMBER_OF_INTERFACE_MATRICES
3632 interface_to_solver_map=>solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
3633 & interface_to_solver_matrix_maps_sm(solver_matrix_idx)%INTERFACE_EQUATIONS_TO_SOLVER_MATRIX_MAPS( &
3634 & interface_matrix_idx)%PTR
3638 & interface_matrix_number,err,error,*999)
3640 & solver_matrix_number,err,error,*999)
3641 DO row_idx=1,interface_mapping%INTERFACE_MATRIX_ROWS_TO_VAR_MAPS(interface_matrix_idx)%NUMBER_OF_ROWS
3645 & interface_to_solver_map%INTERFACE_ROW_TO_SOLVER_COLS_MAP(row_idx)%NUMBER_OF_SOLVER_COLS,err,error,*999)
3646 IF(interface_to_solver_map%INTERFACE_ROW_TO_SOLVER_COLS_MAP(row_idx)%NUMBER_OF_SOLVER_COLS>0)
THEN 3648 & row_idx)%NUMBER_OF_SOLVER_COLS,5,5,interface_to_solver_map%INTERFACE_ROW_TO_SOLVER_COLS_MAP(row_idx)% &
3649 & solver_cols,
'(" Solver columns :",5(X,I13))',
'(38X,5(X,I13))',err,error,*999)
3651 & row_idx)%NUMBER_OF_SOLVER_COLS,5,5,interface_to_solver_map%INTERFACE_ROW_TO_SOLVER_COLS_MAP(row_idx)% &
3652 & coupling_coefficients,
'(" Coupling coefficients :",5(X,E13.6))',
'(38X,5(X,E13.6))', &
3660 & interface_condition_to_solver_map(interface_condition_idx)%INTERFACE_TO_SOLVER_MATRIX_MAPS_SM(solver_matrix_idx)% &
3661 & lagrange_variable_type,err,error,*999)
3662 lagrange_variable=>solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
3663 & interface_to_solver_matrix_maps_sm(solver_matrix_idx)%LAGRANGE_VARIABLE
3665 & number_of_dofs,err,error,*999)
3666 DO local_dof=1,lagrange_variable%TOTAL_NUMBER_OF_DOFS
3669 & interface_condition_to_solver_map(interface_condition_idx)%INTERFACE_TO_SOLVER_MATRIX_MAPS_SM( &
3670 & solver_matrix_idx)%LAGRANGE_VARIABLE_TO_SOLVER_COL_MAP%COLUMN_NUMBERS(local_dof),err,error,*999)
3672 & interface_condition_to_solver_map(interface_condition_idx)%INTERFACE_TO_SOLVER_MATRIX_MAPS_SM( &
3673 & solver_matrix_idx)%LAGRANGE_VARIABLE_TO_SOLVER_COL_MAP%COUPLING_COEFFICIENTS(local_dof),err,error,*999)
3675 & interface_condition_to_solver_map(interface_condition_idx)%INTERFACE_TO_SOLVER_MATRIX_MAPS_SM( &
3676 & solver_matrix_idx)%LAGRANGE_VARIABLE_TO_SOLVER_COL_MAP%ADDITIVE_CONSTANTS(local_dof),err,error,*999)
3680 & interface_condition_to_solver_map(interface_condition_idx)%INTERFACE_TO_SOLVER_MATRIX_MAPS_SM(solver_matrix_idx)% &
3681 & number_of_dependent_variables,err,error,*999)
3683 & interface_condition_idx)%INTERFACE_TO_SOLVER_MATRIX_MAPS_SM(solver_matrix_idx)%NUMBER_OF_DEPENDENT_VARIABLES, &
3684 & 5,5,solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)%INTERFACE_TO_SOLVER_MATRIX_MAPS_SM( &
3685 & solver_matrix_idx)%DEPENDENT_VARIABLE_TYPES,
'(" Dependent variable types :",5(X,I13))', &
3686 &
'(38X,5(X,I13))',err,error,*999)
3687 DO variable_idx=1,solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
3688 & interface_to_solver_matrix_maps_sm(solver_matrix_idx)%NUMBER_OF_DEPENDENT_VARIABLES
3689 dependent_variable=>solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
3690 & interface_to_solver_matrix_maps_sm(solver_matrix_idx)%DEPENDENT_VARIABLES(variable_idx)%PTR
3693 & dependent_variable%NUMBER_OF_DOFS,err,error,*999)
3694 DO local_dof=1,dependent_variable%TOTAL_NUMBER_OF_DOFS
3697 & interface_condition_to_solver_map(interface_condition_idx)%INTERFACE_TO_SOLVER_MATRIX_MAPS_SM( &
3698 & solver_matrix_idx)%DEPENDENT_VARIABLE_TO_SOLVER_COL_MAPS(variable_idx)%COLUMN_NUMBERS(local_dof), &
3701 & interface_condition_to_solver_map(interface_condition_idx)%INTERFACE_TO_SOLVER_MATRIX_MAPS_SM( &
3702 & solver_matrix_idx)%DEPENDENT_VARIABLE_TO_SOLVER_COL_MAPS(variable_idx)%COUPLING_COEFFICIENTS(local_dof), &
3705 & interface_condition_to_solver_map(interface_condition_idx)%INTERFACE_TO_SOLVER_MATRIX_MAPS_SM( &
3706 & solver_matrix_idx)%DEPENDENT_VARIABLE_TO_SOLVER_COL_MAPS(variable_idx)%ADDITIVE_CONSTANTS(local_dof), &
3712 DO interface_matrix_idx=1,interface_mapping%NUMBER_OF_INTERFACE_MATRICES
3715 & interface_condition_to_solver_map(interface_condition_idx)%INTERFACE_TO_SOLVER_MATRIX_MAPS_IM( &
3716 & interface_matrix_idx)%NUMBER_OF_SOLVER_MATRICES,err,error,*999)
3717 DO solver_matrix_idx=1,solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
3718 & interface_to_solver_matrix_maps_im(interface_matrix_idx)%NUMBER_OF_SOLVER_MATRICES
3719 interface_to_solver_map=>solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)% &
3720 & interface_to_solver_matrix_maps_im(interface_matrix_idx)%INTERFACE_TO_SOLVER_MATRIX_MAPS( &
3721 & solver_matrix_idx)%PTR
3724 & interface_matrix_number,err,error,*999)
3726 & solver_matrix_number,err,error,*999)
3732 DO column_idx=1,interface_mapping%NUMBER_OF_COLUMNS
3735 & interface_condition_to_solver_map(interface_condition_idx)%INTERFACE_COLUMN_TO_SOLVER_ROWS_MAPS(column_idx)% &
3736 & number_of_solver_rows,err,error,*999)
3737 IF(solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP(interface_condition_idx)%INTERFACE_COLUMN_TO_SOLVER_ROWS_MAPS( &
3738 & column_idx)%NUMBER_OF_SOLVER_ROWS>0)
THEN 3740 & interface_condition_to_solver_map(interface_condition_idx)%INTERFACE_COLUMN_TO_SOLVER_ROWS_MAPS( &
3741 & column_idx)%SOLVER_ROW,
"(I13)",err,error,*999)
3743 & interface_condition_to_solver_map(interface_condition_idx)%INTERFACE_COLUMN_TO_SOLVER_ROWS_MAPS( &
3744 & column_idx)%COUPLING_COEFFICIENT,
"(E13.6)", &
3752 exits(
"SOLVER_MAPPING_CALCULATE")
3754 999
IF(
ALLOCATED(sub_matrix_information))
DEALLOCATE(sub_matrix_information)
3755 IF(
ALLOCATED(sub_matrix_list))
DEALLOCATE(sub_matrix_list)
3756 IF(
ALLOCATED(variable_rank_processed))
DEALLOCATE(variable_rank_processed)
3757 IF(
ALLOCATED(number_of_variable_global_solver_dofs))
DEALLOCATE(number_of_variable_global_solver_dofs)
3758 IF(
ALLOCATED(number_of_variable_local_solver_dofs))
DEALLOCATE(number_of_variable_local_solver_dofs)
3759 IF(
ALLOCATED(total_number_of_variable_local_solver_dofs))
DEALLOCATE(total_number_of_variable_local_solver_dofs)
3760 IF(
ALLOCATED(dummydofcoupling%globalDofs))
DEALLOCATE(dummydofcoupling%globalDofs)
3761 IF(
ALLOCATED(dummydofcoupling%localDofs))
DEALLOCATE(dummydofcoupling%localDofs)
3762 IF(
ALLOCATED(dummydofcoupling%coefficients))
DEALLOCATE(dummydofcoupling%coefficients)
3765 997 errorsexits(
"SOLVER_MAPPING_CALCULATE",err,error)
3778 INTEGER(INTG),
INTENT(OUT) :: ERR
3781 INTEGER(INTG) :: DUMMY_ERR
3784 enters(
"SOLVER_MAPPING_CREATE_FINISH",err,error,*998)
3786 IF(
ASSOCIATED(solver_mapping))
THEN 3787 IF(solver_mapping%SOLVER_MAPPING_FINISHED)
THEN 3788 CALL flagerror(
"Solver mapping has already been finished",err,error,*998)
3790 IF(
ASSOCIATED(solver_mapping%CREATE_VALUES_CACHE))
THEN 3793 solver_mapping%SOLVER_MAPPING_FINISHED=.true.
3795 CALL flagerror(
"Solver mapping create values cache is not associated",err,error,*999)
3799 CALL flagerror(
"Solver mapping is not associated",err,error,*998)
3802 exits(
"SOLVER_MAPPING_CREATE_FINISH")
3805 998 errorsexits(
"SOLVER_MAPPING_CREATE_FINISH",err,error)
3819 INTEGER(INTG),
INTENT(OUT) :: ERR
3823 enters(
"SOLVER_MAPPING_CREATE_START",err,error,*999)
3825 IF(
ASSOCIATED(solver_equations))
THEN 3826 IF(solver_equations%SOLVER_EQUATIONS_FINISHED)
THEN 3827 CALL flagerror(
"Solver equations has already been finished.",err,error,*999)
3829 IF(
ASSOCIATED(solver_mapping))
THEN 3830 CALL flagerror(
"Solver mapping is already associated.",err,error,*999)
3832 NULLIFY(solver_mapping)
3834 solver_mapping=>solver_equations%SOLVER_MAPPING
3838 CALL flagerror(
"Solver is not associated",err,error,*999)
3841 exits(
"SOLVER_MAPPING_CREATE_START")
3843 999 errorsexits(
"SOLVER_MAPPING_CREATE_START",err,error)
3856 INTEGER(INTG),
INTENT(OUT) :: ERR
3859 INTEGER(INTG) :: equations_set_idx,solver_matrix_idx
3861 enters(
"SOLVER_MAPPING_CREATE_VALUES_CACHE_FINALISE",err,error,*999)
3863 IF(
ASSOCIATED(create_values_cache))
THEN 3864 IF(
ASSOCIATED(create_values_cache%EQUATIONS_VARIABLE_LIST))
THEN 3865 DO solver_matrix_idx=1,
SIZE(create_values_cache%EQUATIONS_VARIABLE_LIST,1)
3866 IF(
ASSOCIATED(create_values_cache%EQUATIONS_VARIABLE_LIST(solver_matrix_idx)%PTR)) &
3867 &
CALL list_destroy(create_values_cache%EQUATIONS_VARIABLE_LIST(solver_matrix_idx)%PTR,err,error,*999)
3869 DEALLOCATE(create_values_cache%EQUATIONS_VARIABLE_LIST)
3871 IF(
ALLOCATED(create_values_cache%DYNAMIC_VARIABLE_TYPE))
DEALLOCATE(create_values_cache%DYNAMIC_VARIABLE_TYPE)
3872 IF(
ALLOCATED(create_values_cache%MATRIX_VARIABLE_TYPES))
DEALLOCATE(create_values_cache%MATRIX_VARIABLE_TYPES)
3873 IF(
ALLOCATED(create_values_cache%RESIDUAL_VARIABLE_TYPES))
DEALLOCATE(create_values_cache%RESIDUAL_VARIABLE_TYPES)
3874 IF(
ALLOCATED(create_values_cache%RHS_VARIABLE_TYPE))
DEALLOCATE(create_values_cache%RHS_VARIABLE_TYPE)
3875 IF(
ALLOCATED(create_values_cache%SOURCE_VARIABLE_TYPE))
DEALLOCATE(create_values_cache%SOURCE_VARIABLE_TYPE)
3876 IF(
ASSOCIATED(create_values_cache%INTERFACE_VARIABLE_LIST))
THEN 3877 DO solver_matrix_idx=1,
SIZE(create_values_cache%INTERFACE_VARIABLE_LIST,1)
3878 IF(
ASSOCIATED(create_values_cache%INTERFACE_VARIABLE_LIST(solver_matrix_idx)%PTR)) &
3879 &
CALL list_destroy(create_values_cache%INTERFACE_VARIABLE_LIST(solver_matrix_idx)%PTR,err,error,*999)
3881 DEALLOCATE(create_values_cache%INTERFACE_VARIABLE_LIST)
3883 IF(
ASSOCIATED(create_values_cache%INTERFACE_INDICES))
THEN 3884 DO equations_set_idx=1,
SIZE(create_values_cache%INTERFACE_INDICES,1)
3885 IF(
ASSOCIATED(create_values_cache%INTERFACE_INDICES(equations_set_idx)%PTR)) &
3886 &
CALL list_destroy(create_values_cache%INTERFACE_INDICES(equations_set_idx)%PTR, &
3889 DEALLOCATE(create_values_cache%INTERFACE_INDICES)
3891 DEALLOCATE(create_values_cache)
3894 exits(
"SOLVER_MAPPING_CREATE_VALUES_CACHE_FINALISE")
3896 999 errorsexits(
"SOLVER_MAPPING_CREATE_VALUES_CACHE_FINALISE",err,error)
3909 INTEGER(INTG),
INTENT(OUT) :: ERR
3912 INTEGER(INTG) :: DUMMY_ERR,equations_set_idx,solver_matrix_idx
3915 enters(
"SolverMapping_CreateValuesCacheInitialise",err,error,*998)
3917 IF(
ASSOCIATED(solver_mapping))
THEN 3918 IF(
ASSOCIATED(solver_mapping%CREATE_VALUES_CACHE))
THEN 3919 CALL flagerror(
"Solver mapping create values cache is already associated.",err,error,*998)
3921 ALLOCATE(solver_mapping%CREATE_VALUES_CACHE,stat=err)
3922 IF(err/=0)
CALL flagerror(
"Could not allocate solver mapping create values cache.",err,error,*999)
3923 ALLOCATE(solver_mapping%CREATE_VALUES_CACHE%EQUATIONS_VARIABLE_LIST(solver_mapping%NUMBER_OF_SOLVER_MATRICES),stat=err)
3924 IF(err/=0)
CALL flagerror(
"Could not allocate solver mapping create values cache equations variable list.", &
3926 ALLOCATE(solver_mapping%CREATE_VALUES_CACHE%DYNAMIC_VARIABLE_TYPE(solver_mapping%NUMBER_OF_EQUATIONS_SETS),stat=err)
3927 IF(err/=0)
CALL flagerror(
"Could not allocate solver mapping create values cache dynamic variable type.", &
3929 ALLOCATE(solver_mapping%CREATE_VALUES_CACHE%MATRIX_VARIABLE_TYPES(0:field_number_of_variable_types, &
3930 & solver_mapping%NUMBER_OF_EQUATIONS_SETS,solver_mapping%NUMBER_OF_SOLVER_MATRICES),stat=err)
3931 IF(err/=0)
CALL flagerror(
"Could not allocate solver mapping create values cache matrix variable types.", &
3933 ALLOCATE(solver_mapping%CREATE_VALUES_CACHE%RESIDUAL_VARIABLE_TYPES(0:field_number_of_variable_types, &
3934 & solver_mapping%NUMBER_OF_EQUATIONS_SETS),stat=err)
3935 IF(err/=0)
CALL flagerror(
"Could not allocate solver mapping create values cache residual variable type.", &
3937 ALLOCATE(solver_mapping%CREATE_VALUES_CACHE%RHS_VARIABLE_TYPE(solver_mapping%NUMBER_OF_EQUATIONS_SETS),stat=err)
3938 IF(err/=0)
CALL flagerror(
"Could not allocate solver mapping create values cache RHS variable type.", &
3940 ALLOCATE(solver_mapping%CREATE_VALUES_CACHE%SOURCE_VARIABLE_TYPE(solver_mapping%NUMBER_OF_EQUATIONS_SETS),stat=err)
3941 IF(err/=0)
CALL flagerror(
"Could not allocate solver mapping create values cache source variable type.", &
3943 ALLOCATE(solver_mapping%CREATE_VALUES_CACHE%INTERFACE_VARIABLE_LIST(solver_mapping%NUMBER_OF_SOLVER_MATRICES),stat=err)
3944 IF(err/=0)
CALL flagerror(
"Could not allocate solver mapping create values cache interface variable list.", &
3946 ALLOCATE(solver_mapping%CREATE_VALUES_CACHE%INTERFACE_INDICES(solver_mapping%NUMBER_OF_EQUATIONS_SETS),stat=err)
3947 IF(err/=0)
CALL flagerror(
"Could not allocate solver mapping create values cache interface condition indices.", &
3949 DO solver_matrix_idx=1,solver_mapping%NUMBER_OF_SOLVER_MATRICES
3950 NULLIFY(solver_mapping%CREATE_VALUES_CACHE%EQUATIONS_VARIABLE_LIST(solver_matrix_idx)%PTR)
3951 CALL list_create_start(solver_mapping%CREATE_VALUES_CACHE%EQUATIONS_VARIABLE_LIST(solver_matrix_idx)%PTR,err,error,*999)
3952 CALL list_data_type_set(solver_mapping%CREATE_VALUES_CACHE%EQUATIONS_VARIABLE_LIST(solver_matrix_idx)%PTR, &
3954 CALL list_data_dimension_set(solver_mapping%CREATE_VALUES_CACHE%EQUATIONS_VARIABLE_LIST(solver_matrix_idx)%PTR, &
3956 CALL list_create_finish(solver_mapping%CREATE_VALUES_CACHE%EQUATIONS_VARIABLE_LIST(solver_matrix_idx)%PTR,err,error,*999)
3957 NULLIFY(solver_mapping%CREATE_VALUES_CACHE%INTERFACE_VARIABLE_LIST(solver_matrix_idx)%PTR)
3958 CALL list_create_start(solver_mapping%CREATE_VALUES_CACHE%INTERFACE_VARIABLE_LIST(solver_matrix_idx)%PTR,err,error,*999)
3959 CALL list_data_type_set(solver_mapping%CREATE_VALUES_CACHE%INTERFACE_VARIABLE_LIST(solver_matrix_idx)%PTR, &
3961 CALL list_data_dimension_set(solver_mapping%CREATE_VALUES_CACHE%INTERFACE_VARIABLE_LIST(solver_matrix_idx)%PTR, &
3963 CALL list_create_finish(solver_mapping%CREATE_VALUES_CACHE%INTERFACE_VARIABLE_LIST(solver_matrix_idx)%PTR,err,error,*999)
3965 DO equations_set_idx=1,solver_mapping%NUMBER_OF_EQUATIONS_SETS
3966 NULLIFY(solver_mapping%CREATE_VALUES_CACHE%INTERFACE_INDICES(equations_set_idx)%PTR)
3967 CALL list_create_start(solver_mapping%CREATE_VALUES_CACHE%INTERFACE_INDICES(equations_set_idx)%PTR,err,error,*999)
3972 CALL list_key_dimension_set(solver_mapping%CREATE_VALUES_CACHE%INTERFACE_INDICES(equations_set_idx)%PTR,1, &
3974 CALL list_create_finish(solver_mapping%CREATE_VALUES_CACHE%INTERFACE_INDICES(equations_set_idx)%PTR, &
3977 solver_mapping%CREATE_VALUES_CACHE%DYNAMIC_VARIABLE_TYPE=0
3978 solver_mapping%CREATE_VALUES_CACHE%MATRIX_VARIABLE_TYPES=0
3979 solver_mapping%CREATE_VALUES_CACHE%RESIDUAL_VARIABLE_TYPES=0
3980 solver_mapping%CREATE_VALUES_CACHE%RHS_VARIABLE_TYPE=0
3981 solver_mapping%CREATE_VALUES_CACHE%SOURCE_VARIABLE_TYPE=0
3984 CALL flagerror(
"Solver mapping is not associated.",err,error,*998)
3987 exits(
"SolverMapping_CreateValuesCacheInitialise")
3990 998 errorsexits(
"SolverMapping_CreateValuesCacheInitialise",err,error)
4000 & variable_type,err,error,*)
4004 INTEGER(INTG),
INTENT(IN) :: solver_matrix_idx
4005 INTEGER(INTG),
INTENT(IN) :: equations_set_idx
4006 INTEGER(INTG),
INTENT(IN) :: variable_type
4007 INTEGER(INTG),
INTENT(OUT) :: ERR
4010 INTEGER(INTG) :: equations_set_idx2,NUMBER_OF_VARIABLES,variable_idx,VARIABLE_ITEM(2)
4011 LOGICAL :: VARIABLE_FOUND
4013 TYPE(
field_type),
POINTER :: DEPENDENT_FIELD,VAR_DEPENDENT_FIELD
4016 enters(
"SolverMapping_CreateValuesCacheEqnVarListAdd",err,error,*999)
4018 IF(
ASSOCIATED(solver_mapping))
THEN 4019 IF(equations_set_idx>0.AND.equations_set_idx<=solver_mapping%NUMBER_OF_EQUATIONS_SETS)
THEN 4020 equations_set=>solver_mapping%EQUATIONS_SETS(equations_set_idx)%PTR
4021 IF(
ASSOCIATED(equations_set))
THEN 4022 dependent_field=>equations_set%DEPENDENT%DEPENDENT_FIELD
4023 IF(
ASSOCIATED(dependent_field))
THEN 4024 IF(variable_type/=0)
THEN 4025 variable_found=.false.
4027 & number_of_variables,err,error,*999)
4028 DO variable_idx=1,number_of_variables
4029 CALL list_item_get(solver_mapping%CREATE_VALUES_CACHE%EQUATIONS_VARIABLE_LIST(solver_matrix_idx)%PTR, &
4030 & variable_idx,variable_item,err,error,*999)
4031 equations_set_idx2=variable_item(1)
4032 var_equations_set=>solver_mapping%EQUATIONS_SETS(equations_set_idx2)%PTR
4033 IF(
ASSOCIATED(var_equations_set))
THEN 4034 var_dependent_field=>var_equations_set%DEPENDENT%DEPENDENT_FIELD
4035 IF(
ASSOCIATED(var_dependent_field))
THEN 4036 IF(
ASSOCIATED(dependent_field,var_dependent_field))
THEN 4037 IF(variable_type==variable_item(2)) variable_found=.true.
4040 CALL flagerror(
"Variable dependent field is not associated.",err,error,*999)
4043 CALL flagerror(
"Variable equations set is not associated.",err,error,*999)
4046 IF(.NOT.variable_found)
THEN 4047 variable_item(1)=equations_set_idx
4048 variable_item(2)=variable_type
4049 CALL list_item_add(solver_mapping%CREATE_VALUES_CACHE%EQUATIONS_VARIABLE_LIST(solver_matrix_idx)%PTR, &
4050 & variable_item,err,error,*999)
4054 CALL flagerror(
"Dependent field is not associated.",err,error,*999)
4057 CALL flagerror(
"Equations set is not associated.",err,error,*999)
4060 local_error=
"The specified equations set index of "//
trim(
number_to_vstring(equations_set_idx,
"*",err,error))// &
4061 &
" is invalid. The index must be > 0 and <= "// &
4063 CALL flagerror(local_error,err,error,*999)
4066 CALL flagerror(
"Solver mapping is not associated.",err,error,*999)
4069 exits(
"SolverMapping_CreateValuesCacheEqnVarListAdd")
4071 999
errors(
"SolverMapping_CreateValuesCacheEqnVarListAdd",err,error)
4072 exits(
"SolverMapping_CreateValuesCacheEqnVarListAdd")
4083 & variable_type,err,error,*)
4087 INTEGER(INTG),
INTENT(IN) :: solver_matrix_idx
4088 INTEGER(INTG),
INTENT(IN) :: interface_condition_idx
4089 INTEGER(INTG),
INTENT(IN) :: variable_type
4090 INTEGER(INTG),
INTENT(OUT) :: ERR
4093 INTEGER(INTG) :: interface_condition_idx2,NUMBER_OF_VARIABLES,variable_idx,VARIABLE_ITEM(2)
4094 LOGICAL :: VARIABLE_FOUND
4096 TYPE(
field_type),
POINTER :: LAGRANGE_FIELD,VAR_LAGRANGE_FIELD
4099 enters(
"SolverMapping_CreateValuesCacheInterfVarListAdd",err,error,*999)
4101 IF(
ASSOCIATED(solver_mapping))
THEN 4102 IF(interface_condition_idx>0.AND.interface_condition_idx<=solver_mapping%NUMBER_OF_INTERFACE_CONDITIONS)
THEN 4103 interface_condition=>solver_mapping%INTERFACE_CONDITIONS(interface_condition_idx)%PTR
4104 IF(
ASSOCIATED(interface_condition))
THEN 4105 SELECT CASE(interface_condition%METHOD)
4107 IF(
ASSOCIATED(interface_condition%LAGRANGE))
THEN 4108 lagrange_field=>interface_condition%LAGRANGE%LAGRANGE_FIELD
4109 IF(
ASSOCIATED(lagrange_field))
THEN 4110 IF(variable_type/=0)
THEN 4111 variable_found=.false.
4113 & number_of_variables,err,error,*999)
4114 DO variable_idx=1,number_of_variables
4115 CALL list_item_get(solver_mapping%CREATE_VALUES_CACHE%INTERFACE_VARIABLE_LIST(solver_matrix_idx)%PTR, &
4116 & variable_idx,variable_item,err,error,*999)
4117 interface_condition_idx2=variable_item(1)
4118 var_interface_condition=>solver_mapping%INTERFACE_CONDITIONS(interface_condition_idx2)%PTR
4119 IF(
ASSOCIATED(var_interface_condition))
THEN 4120 SELECT CASE(var_interface_condition%METHOD)
4122 IF(
ASSOCIATED(interface_condition%LAGRANGE))
THEN 4123 var_lagrange_field=>var_interface_condition%LAGRANGE%LAGRANGE_FIELD
4124 IF(
ASSOCIATED(var_lagrange_field))
THEN 4125 IF(
ASSOCIATED(lagrange_field,var_lagrange_field))
THEN 4126 IF(variable_type==variable_item(2)) variable_found=.true.
4129 CALL flagerror(
"Variable Lagrange field is not associated.",err,error,*999)
4132 CALL flagerror(
"Variable interface Lagrange is not associated.",err,error,*999)
4135 CALL flagerror(
"Not implemented.",err,error,*999)
4137 CALL flagerror(
"Not implemented.",err,error,*999)
4139 local_error=
"The interface condition method of "// &
4142 CALL flagerror(local_error,err,error,*999)
4145 CALL flagerror(
"Variable equations set is not associated.",err,error,*999)
4148 IF(.NOT.variable_found)
THEN 4149 variable_item(1)=interface_condition_idx
4150 variable_item(2)=variable_type
4151 CALL list_item_add(solver_mapping%CREATE_VALUES_CACHE%INTERFACE_VARIABLE_LIST(solver_matrix_idx)%PTR, &
4152 & variable_item,err,error,*999)
4156 CALL flagerror(
"Lagrange field is not associated.",err,error,*999)
4159 CALL flagerror(
"Interface condition Lagrange is not asssociated.",err,error,*999)
4162 CALL flagerror(
"Not implemented.",err,error,*999)
4164 CALL flagerror(
"Not implemented.",err,error,*999)
4166 local_error=
"The interface condition method of "// &
4169 CALL flagerror(local_error,err,error,*999)
4172 CALL flagerror(
"Interface condition is not associated.",err,error,*999)
4175 local_error=
"The specified interface condition index of "// &
4177 &
" is invalid. The index must be > 0 and <= "// &
4179 CALL flagerror(local_error,err,error,*999)
4182 CALL flagerror(
"Solver mapping is not associated.",err,error,*999)
4185 exits(
"SolverMapping_CreateValuesCacheInterfVarListAdd")
4187 999
errors(
"SolverMapping_CreateValuesCacheInterfVarListAdd",err,error)
4188 exits(
"SolverMapping_CreateValuesCacheInterfVarListAdd")
4202 INTEGER(INTG),
INTENT(OUT) :: ERR
4206 enters(
"SOLVER_MAPPING_DESTROY",err,error,*999)
4208 IF(
ASSOCIATED(solver_mapping))
THEN 4211 CALL flagerror(
"Solver mapping is not associated",err,error,*999)
4214 exits(
"SOLVER_MAPPING_DESTROY")
4216 999 errorsexits(
"SOLVER_MAPPING_DESTROY",err,error)
4230 INTEGER(INTG),
INTENT(OUT) :: ERR
4234 enters(
"SolverMapping_EquatsColToSolColsMapFinalise",err,error,*999)
4236 IF(
ALLOCATED(equations_col_to_solver_cols_map%SOLVER_COLS)) &
4237 &
DEALLOCATE(equations_col_to_solver_cols_map%SOLVER_COLS)
4238 IF(
ALLOCATED(equations_col_to_solver_cols_map%COUPLING_COEFFICIENTS)) &
4239 &
DEALLOCATE(equations_col_to_solver_cols_map%COUPLING_COEFFICIENTS)
4241 exits(
"SolverMapping_EquatsColToSolColsMapFinalise")
4243 999 errorsexits(
"SolverMapping_EquatsColToSolColsMapFinalise",err,error)
4257 INTEGER(INTG),
INTENT(OUT) :: ERR
4261 enters(
"SolverMapping_EquatsColToSolColsMapInitialise",err,error,*999)
4263 equations_col_to_solver_cols_map%NUMBER_OF_SOLVER_COLS=0
4265 exits(
"SolverMapping_EquatsColToSolColsMapInitialise")
4267 999
errors(
"SolverMapping_EquatsColToSolColsMapInitialise",err,error)
4268 exits(
"SolverMapping_EquatsColToSolColsMapInitialise")
4279 & variable_types,err,error,*)
4283 INTEGER(INTG),
INTENT(IN) :: SOLVER_MATRIX
4284 INTEGER(INTG),
INTENT(IN) :: EQUATIONS_SET_INDEX
4285 INTEGER(INTG),
INTENT(IN) :: VARIABLE_TYPES(:)
4286 INTEGER(INTG),
INTENT(OUT) :: ERR
4289 INTEGER(INTG) :: variable_idx
4296 enters(
"SolverMapping_EquatsVarsToSolverMatrixSet",err,error,*999)
4298 IF(
ASSOCIATED(solver_mapping))
THEN 4299 IF(solver_mapping%SOLVER_MAPPING_FINISHED)
THEN 4300 CALL flagerror(
"Solver mappings has been finished",err,error,*999)
4302 IF(
ASSOCIATED(solver_mapping%CREATE_VALUES_CACHE))
THEN 4303 IF(solver_matrix>=1.AND.solver_matrix<=solver_mapping%NUMBER_OF_SOLVER_MATRICES)
THEN 4304 IF(equations_set_index>=1.AND.equations_set_index<=solver_mapping%NUMBER_OF_EQUATIONS_SETS)
THEN 4305 equations_set=>solver_mapping%EQUATIONS_SETS(equations_set_index)%PTR
4306 IF(
ASSOCIATED(equations_set))
THEN 4307 equations=>equations_set%EQUATIONS
4308 IF(
ASSOCIATED(equations))
THEN 4309 equations_mapping=>equations%EQUATIONS_MAPPING
4310 IF(
ASSOCIATED(equations_mapping))
THEN 4311 linear_mapping=>equations_mapping%LINEAR_MAPPING
4312 IF(
ASSOCIATED(linear_mapping))
THEN 4313 IF(
SIZE(variable_types,1)>=1.AND.
SIZE(variable_types,1)<=field_number_of_variable_types)
THEN 4314 DO variable_idx=1,
SIZE(variable_types,1)
4317 IF(variable_types(variable_idx)<1.OR. &
4318 & variable_types(variable_idx)>field_number_of_variable_types)
THEN 4319 local_error=
"The variable type of "// &
4322 &
" in the array is invalid. The number must be >=1 and <= "// &
4324 CALL flagerror(local_error,err,error,*999)
4326 IF(linear_mapping%VAR_TO_EQUATIONS_MATRICES_MAPS(variable_types(variable_idx))% &
4327 & number_of_equations_matrices==0)
THEN 4328 local_error=
"The variable type of "// &
4331 &
" in the array is invalid. That variable type is not mapped to any equations matrices" 4334 solver_mapping%CREATE_VALUES_CACHE%MATRIX_VARIABLE_TYPES(0,equations_set_index,solver_matrix)= &
4335 &
SIZE(variable_types,1)
4336 solver_mapping%CREATE_VALUES_CACHE%MATRIX_VARIABLE_TYPES(1:
SIZE(variable_types,1),equations_set_index, &
4337 & solver_matrix)=variable_types
4339 local_error=
"The supplied size of variable types array of "// &
4341 &
" is invalid. The size must be between 1 and "// &
4343 CALL flagerror(local_error,err,error,*999)
4346 CALL flagerror(
"Equations mapping linear mapping is not associated.",err,error,*999)
4349 CALL flagerror(
"Equations mapping is not associated.",err,error,*999)
4352 CALL flagerror(
"Equations is not associated.",err,error,*999)
4355 CALL flagerror(
"Equations set is not associated.",err,error,*999)
4358 local_error=
"The equations set index of "//
trim(
number_to_vstring(equations_set_index,
"*",err,error))// &
4359 &
" is invalid. The number must be >= 1 and <= "// &
4361 CALL flagerror(local_error,err,error,*999)
4364 local_error=
"The solver matrix number of "//
trim(
number_to_vstring(solver_matrix,
"*",err,error))// &
4365 &
" is invalid. The number must be >= 1 and <= "// &
4367 CALL flagerror(local_error,err,error,*999)
4370 CALL flagerror(
"Solver mapping create values cache is not associated",err,error,*999)
4374 CALL flagerror(
"Solver mapping is not associated",err,error,*999)
4377 exits(
"SolverMapping_EquatsVarsToSolverMatrixSet")
4379 999 errorsexits(
"SolverMapping_EquatsVarsToSolverMatrixSet",err,error)
4393 INTEGER(INTG),
INTENT(OUT) :: ERR
4397 enters(
"SolverMapping_EquatsRowToSolRowsMapFinalise",err,error,*999)
4399 IF(
ALLOCATED(equations_row_solver_rows_map%SOLVER_ROWS)) &
4400 &
DEALLOCATE(equations_row_solver_rows_map%SOLVER_ROWS)
4401 IF(
ALLOCATED(equations_row_solver_rows_map%COUPLING_COEFFICIENTS)) &
4402 &
DEALLOCATE(equations_row_solver_rows_map%COUPLING_COEFFICIENTS)
4404 exits(
"SolverMapping_EquatsRowToSolRowsMapFinalise")
4406 999 errorsexits(
"SolverMapping_EquatsRowToSolRowsMapFinalise",err,error)
4420 INTEGER(INTG),
INTENT(OUT) :: ERR
4424 enters(
"SolverMapping_EquatsRowToSolRowsMapInitialise",err,error,*999)
4426 equations_row_solver_rows_map%NUMBER_OF_SOLVER_ROWS=0
4428 exits(
"SolverMapping_EquatsRowToSolRowsMapInitialise")
4430 999
errors(
"SolverMapping_EquatsRowToSolRowsMapInitialise",err,error)
4431 exits(
"SolverMapping_EquatsRowToSolRowsMapInitialise")
4446 INTEGER(INTG),
INTENT(OUT) :: EQUATIONS_SET_INDEX
4447 INTEGER(INTG),
INTENT(OUT) :: ERR
4450 INTEGER(INTG) :: equations_set_idx,matrix_idx,solver_matrix_idx,variable_idx,variable_type
4451 INTEGER(INTG),
ALLOCATABLE :: NEW_DYNAMIC_VARIABLE_TYPE(:),NEW_MATRIX_VARIABLE_TYPES(:,:,:),NEW_RHS_VARIABLE_TYPE(:), &
4452 & NEW_RESIDUAL_VARIABLE_TYPES(:,:),NEW_SOURCE_VARIABLE_TYPE(:)
4453 LOGICAL :: MATRIX_DONE
4461 NULLIFY(new_interface_indices)
4463 enters(
"SOLVER_MAPPING_EQUATIONS_SET_ADD",err,error,*999)
4465 equations_set_index=0
4466 IF(
ASSOCIATED(solver_mapping))
THEN 4467 IF(solver_mapping%SOLVER_MAPPING_FINISHED)
THEN 4468 CALL flagerror(
"Solver mapping has been finished.",err,error,*999)
4470 solver_equations=>solver_mapping%SOLVER_EQUATIONS
4471 IF(
ASSOCIATED(solver_equations))
THEN 4472 IF(
ASSOCIATED(equations_set))
THEN 4473 IF(equations_set%EQUATIONS_SET_FINISHED)
THEN 4474 equations=>equations_set%EQUATIONS
4475 IF(
ASSOCIATED(equations))
THEN 4476 equations_mapping=>equations%EQUATIONS_MAPPING
4477 IF(
ASSOCIATED(equations_mapping))
THEN 4478 IF(
ASSOCIATED(solver_mapping%CREATE_VALUES_CACHE))
THEN 4479 IF(solver_mapping%NUMBER_OF_EQUATIONS_SETS>0)
THEN 4480 ALLOCATE(new_dynamic_variable_type(solver_mapping%NUMBER_OF_EQUATIONS_SETS+1),stat=err)
4481 IF(err/=0)
CALL flagerror(
"Could not allocate new dynamic variable type.",err,error,*999)
4482 ALLOCATE(new_matrix_variable_types(0:field_number_of_variable_types,solver_mapping% &
4483 & number_of_equations_sets+1,solver_mapping%NUMBER_OF_SOLVER_MATRICES),stat=err)
4484 IF(err/=0)
CALL flagerror(
"Could not allocate new matrix variable types.",err,error,*999)
4485 ALLOCATE(new_residual_variable_types(0:field_number_of_variable_types, &
4486 & solver_mapping%NUMBER_OF_EQUATIONS_SETS+1),stat=err)
4487 IF(err/=0)
CALL flagerror(
"Could not allocate new residual variable type.",err,error,*999)
4488 ALLOCATE(new_rhs_variable_type(solver_mapping%NUMBER_OF_EQUATIONS_SETS+1),stat=err)
4489 IF(err/=0)
CALL flagerror(
"Could not allocate new RHS variable type.",err,error,*999)
4490 ALLOCATE(new_source_variable_type(solver_mapping%NUMBER_OF_EQUATIONS_SETS+1),stat=err)
4491 IF(err/=0)
CALL flagerror(
"Could not allocate new source variable type.",err,error,*999)
4492 ALLOCATE(new_interface_indices(solver_mapping%NUMBER_OF_EQUATIONS_SETS+1),stat=err)
4493 IF(err/=0)
CALL flagerror(
"Could not allocate new interface indices.",err,error,*999)
4494 DO equations_set_idx=1,solver_mapping%NUMBER_OF_EQUATIONS_SETS
4495 new_interface_indices(equations_set_idx)%PTR=>solver_mapping%CREATE_VALUES_CACHE%INTERFACE_INDICES( &
4496 & equations_set_idx)%PTR
4498 ALLOCATE(new_equations_sets(solver_mapping%NUMBER_OF_EQUATIONS_SETS+1),stat=err)
4499 IF(err/=0)
CALL flagerror(
"Could not allocate new equations sets.",err,error,*999)
4501 IF(
ASSOCIATED(solver_mapping%CREATE_VALUES_CACHE%INTERFACE_INDICES)) &
4502 &
DEALLOCATE(solver_mapping%CREATE_VALUES_CACHE%INTERFACE_INDICES)
4504 new_dynamic_variable_type(1:solver_mapping% &
4505 & number_of_equations_sets)=solver_mapping%CREATE_VALUES_CACHE%DYNAMIC_VARIABLE_TYPE
4506 new_matrix_variable_types(:,1:solver_mapping% &
4507 & number_of_equations_sets,:)=solver_mapping%CREATE_VALUES_CACHE%MATRIX_VARIABLE_TYPES
4508 new_residual_variable_types(:,1:solver_mapping% &
4509 & number_of_equations_sets)=solver_mapping%CREATE_VALUES_CACHE%RESIDUAL_VARIABLE_TYPES
4510 new_rhs_variable_type(1:solver_mapping% &
4511 & number_of_equations_sets)=solver_mapping%CREATE_VALUES_CACHE%RHS_VARIABLE_TYPE
4512 new_source_variable_type(1:solver_mapping% &
4513 & number_of_equations_sets)=solver_mapping%CREATE_VALUES_CACHE%SOURCE_VARIABLE_TYPE
4514 DO equations_set_idx=1,solver_mapping%NUMBER_OF_EQUATIONS_SETS
4515 new_equations_sets(equations_set_idx)%PTR=>solver_mapping%EQUATIONS_SETS(equations_set_idx)%PTR
4517 solver_mapping%CREATE_VALUES_CACHE%INTERFACE_INDICES=>new_interface_indices
4519 new_dynamic_variable_type(solver_mapping%NUMBER_OF_EQUATIONS_SETS+1)=0
4520 new_matrix_variable_types(:,solver_mapping%NUMBER_OF_EQUATIONS_SETS+1,:)=0
4521 new_residual_variable_types(:,solver_mapping%NUMBER_OF_EQUATIONS_SETS+1)=0
4522 new_rhs_variable_type(solver_mapping%NUMBER_OF_EQUATIONS_SETS+1)=0
4523 new_source_variable_type(solver_mapping%NUMBER_OF_EQUATIONS_SETS+1)=0
4525 CALL move_alloc(new_dynamic_variable_type,solver_mapping%CREATE_VALUES_CACHE%DYNAMIC_VARIABLE_TYPE)
4526 CALL move_alloc(new_matrix_variable_types,solver_mapping%CREATE_VALUES_CACHE%MATRIX_VARIABLE_TYPES)
4527 CALL move_alloc(new_residual_variable_types,solver_mapping%CREATE_VALUES_CACHE%RESIDUAL_VARIABLE_TYPES)
4528 CALL move_alloc(new_rhs_variable_type,solver_mapping%CREATE_VALUES_CACHE%RHS_VARIABLE_TYPE)
4529 CALL move_alloc(new_source_variable_type,solver_mapping%CREATE_VALUES_CACHE%SOURCE_VARIABLE_TYPE)
4530 CALL move_alloc(new_equations_sets,solver_mapping%EQUATIONS_SETS)
4531 solver_mapping%CREATE_VALUES_CACHE%INTERFACE_INDICES=>new_interface_indices
4533 ELSE IF(solver_mapping%NUMBER_OF_EQUATIONS_SETS==0)
THEN 4534 ALLOCATE(new_dynamic_variable_type(solver_mapping%NUMBER_OF_EQUATIONS_SETS+1),stat=err)
4535 IF(err/=0)
CALL flagerror(
"Could not allocate dynamic variable type.",err,error,*999)
4536 ALLOCATE(new_matrix_variable_types(0:field_number_of_variable_types, &
4537 & solver_mapping%NUMBER_OF_EQUATIONS_SETS+1,solver_mapping%NUMBER_OF_SOLVER_MATRICES),stat=err)
4538 IF(err/=0)
CALL flagerror(
"Could not allocate matrix variable types.",err,error,*999)
4539 ALLOCATE(new_residual_variable_types(0:field_number_of_variable_types, &
4540 & solver_mapping%NUMBER_OF_EQUATIONS_SETS+1),stat=err)
4541 IF(err/=0)
CALL flagerror(
"Could not allocate residual variable type.",err,error,*999)
4542 ALLOCATE(new_rhs_variable_type(solver_mapping%NUMBER_OF_EQUATIONS_SETS+1),stat=err)
4543 IF(err/=0)
CALL flagerror(
"Could not allocate RHS variable type.",err,error,*999)
4544 ALLOCATE(new_source_variable_type(solver_mapping%NUMBER_OF_EQUATIONS_SETS+1),stat=err)
4545 IF(err/=0)
CALL flagerror(
"Could not allocate source variable type.",err,error,*999)
4546 ALLOCATE(new_interface_indices(solver_mapping%NUMBER_OF_EQUATIONS_SETS+1),stat=err)
4547 IF(err/=0)
CALL flagerror(
"Could not allocate new interface indices.",err,error,*999)
4548 ALLOCATE(new_equations_sets(solver_mapping%NUMBER_OF_EQUATIONS_SETS+1),stat=err)
4549 IF(err/=0)
CALL flagerror(
"Could not allocate new equations sets.",err,error,*999)
4551 new_dynamic_variable_type=0
4552 new_matrix_variable_types=0
4553 new_residual_variable_types=0
4554 new_rhs_variable_type=0
4555 new_source_variable_type=0
4557 CALL move_alloc(new_dynamic_variable_type,solver_mapping%CREATE_VALUES_CACHE%DYNAMIC_VARIABLE_TYPE)
4558 CALL move_alloc(new_matrix_variable_types,solver_mapping%CREATE_VALUES_CACHE%MATRIX_VARIABLE_TYPES)
4559 CALL move_alloc(new_residual_variable_types,solver_mapping%CREATE_VALUES_CACHE%RESIDUAL_VARIABLE_TYPES)
4560 CALL move_alloc(new_rhs_variable_type,solver_mapping%CREATE_VALUES_CACHE%RHS_VARIABLE_TYPE)
4561 CALL move_alloc(new_source_variable_type,solver_mapping%CREATE_VALUES_CACHE%SOURCE_VARIABLE_TYPE)
4562 CALL move_alloc(new_equations_sets,solver_mapping%EQUATIONS_SETS)
4563 IF(
ASSOCIATED(solver_mapping%CREATE_VALUES_CACHE%INTERFACE_INDICES)) &
4564 &
DEALLOCATE(solver_mapping%CREATE_VALUES_CACHE%INTERFACE_INDICES)
4565 solver_mapping%CREATE_VALUES_CACHE%INTERFACE_INDICES=>new_interface_indices
4567 CALL flagerror(
"The number of equations sets is < 0.",err,error,*999)
4569 NULLIFY(solver_mapping%CREATE_VALUES_CACHE%INTERFACE_INDICES(solver_mapping%NUMBER_OF_EQUATIONS_SETS+1)%PTR)
4570 CALL list_create_start(solver_mapping%CREATE_VALUES_CACHE%INTERFACE_INDICES(solver_mapping% &
4571 & number_of_equations_sets+1)%PTR,err,error,*999)
4572 CALL list_data_type_set(solver_mapping%CREATE_VALUES_CACHE%INTERFACE_INDICES(solver_mapping% &
4575 & number_of_equations_sets+1)%PTR,2,err,error,*999)
4577 & number_of_equations_sets+1)%PTR,1,err,error,*999)
4578 CALL list_create_finish(solver_mapping%CREATE_VALUES_CACHE%INTERFACE_INDICES(solver_mapping% &
4579 & number_of_equations_sets+1)%PTR,err,error,*999)
4580 SELECT CASE(equations%TIME_DEPENDENCE)
4582 SELECT CASE(equations%LINEARITY)
4584 IF(
ASSOCIATED(equations_mapping%LINEAR_MAPPING))
THEN 4589 DO matrix_idx=1,solver_mapping%NUMBER_OF_SOLVER_MATRICES
4591 DO WHILE(variable_type<=field_number_of_variable_types.AND..NOT.matrix_done)
4592 IF(equations_mapping%LINEAR_MAPPING%VAR_TO_EQUATIONS_MATRICES_MAPS(variable_type)% &
4593 & number_of_equations_matrices>0)
THEN 4594 solver_mapping%CREATE_VALUES_CACHE%MATRIX_VARIABLE_TYPES(0, &
4595 & solver_mapping%NUMBER_OF_EQUATIONS_SETS+1,matrix_idx)=1
4596 solver_mapping%CREATE_VALUES_CACHE%MATRIX_VARIABLE_TYPES(1, &
4597 & solver_mapping%NUMBER_OF_EQUATIONS_SETS+1,matrix_idx)=variable_type
4600 variable_type=variable_type+1
4603 IF(.NOT.matrix_done)
THEN 4605 local_error=
"Could not find any unmapped variables for solver matrix "// &
4607 CALL flagerror(local_error,err,error,*999)
4611 DO variable_idx=variable_type+1,field_number_of_variable_types
4612 IF(equations_mapping%LINEAR_MAPPING%VAR_TO_EQUATIONS_MATRICES_MAPS(variable_idx)% &
4613 & number_of_equations_matrices>0)
THEN 4615 &
" is mapped to a linear matrix but has not been mapped to any solver matrices." 4616 CALL flagerror(local_error,err,error,*999)
4620 CALL flagerror(
"Equations mapping linear mapping is not associated.",err,error,*999)
4623 IF(
ASSOCIATED(equations_mapping%NONLINEAR_MAPPING))
THEN 4625 solver_mapping%CREATE_VALUES_CACHE%RESIDUAL_VARIABLE_TYPES(0,solver_mapping%NUMBER_OF_EQUATIONS_SETS+1)= &
4626 & equations_mapping%NONLINEAR_MAPPING%NUMBER_OF_RESIDUAL_VARIABLES
4628 DO matrix_idx=1,equations_mapping%NONLINEAR_MAPPING%NUMBER_OF_RESIDUAL_VARIABLES
4629 solver_mapping%CREATE_VALUES_CACHE%RESIDUAL_VARIABLE_TYPES(matrix_idx,solver_mapping% &
4630 & number_of_equations_sets+1)=equations_mapping%NONLINEAR_MAPPING% &
4631 & jacobian_to_var_map(matrix_idx)%VARIABLE_TYPE
4633 IF(
ASSOCIATED(equations_mapping%LINEAR_MAPPING))
THEN 4636 IF(solver_mapping%NUMBER_OF_SOLVER_MATRICES==1)
THEN 4637 DO matrix_idx=1,equations_mapping%NONLINEAR_MAPPING%NUMBER_OF_RESIDUAL_VARIABLES
4638 variable_type=equations_mapping%NONLINEAR_MAPPING%JACOBIAN_TO_VAR_MAP(matrix_idx)%VARIABLE_TYPE
4639 IF(equations_mapping%LINEAR_MAPPING%VAR_TO_EQUATIONS_MATRICES_MAPS(variable_type)% &
4640 & number_of_equations_matrices>0)
THEN 4641 solver_mapping%CREATE_VALUES_CACHE%MATRIX_VARIABLE_TYPES(0, &
4642 & solver_mapping%NUMBER_OF_EQUATIONS_SETS+1,1)=1
4643 solver_mapping%CREATE_VALUES_CACHE%MATRIX_VARIABLE_TYPES(1, &
4644 & solver_mapping%NUMBER_OF_EQUATIONS_SETS+1,1)=variable_type
4648 local_error=
"Invalid number of solve matrices. For nonlinear solver equations there should "// &
4649 &
"be 1 solver matrix and there are "// &
4651 &
" solver matrices." 4652 CALL flagerror(local_error,err,error,*999)
4656 CALL flagerror(
"Equations mapping nonlinear mapping is not associated.",err,error,*999)
4659 local_error=
"The equations linearity type of "// &
4661 CALL flagerror(local_error,err,error,*999)
4664 SELECT CASE(equations%LINEARITY)
4666 IF(
ASSOCIATED(equations_mapping%DYNAMIC_MAPPING))
THEN 4667 solver_mapping%CREATE_VALUES_CACHE%DYNAMIC_VARIABLE_TYPE(solver_mapping%NUMBER_OF_EQUATIONS_SETS+1)= &
4668 & equations_mapping%DYNAMIC_MAPPING%DYNAMIC_VARIABLE_TYPE
4670 CALL flagerror(
"Equations mapping dynamic mapping is not associated.",err,error,*999)
4673 IF(
ASSOCIATED(equations_mapping%DYNAMIC_MAPPING))
THEN 4674 solver_mapping%CREATE_VALUES_CACHE%DYNAMIC_VARIABLE_TYPE(solver_mapping%NUMBER_OF_EQUATIONS_SETS+1)= &
4675 & equations_mapping%DYNAMIC_MAPPING%DYNAMIC_VARIABLE_TYPE
4676 DO matrix_idx=1,equations_mapping%NONLINEAR_MAPPING%NUMBER_OF_RESIDUAL_VARIABLES
4677 solver_mapping%CREATE_VALUES_CACHE%RESIDUAL_VARIABLE_TYPES(matrix_idx,solver_mapping% &
4678 & number_of_equations_sets+1)=equations_mapping%NONLINEAR_MAPPING% &
4679 & jacobian_to_var_map(matrix_idx)%VARIABLE_TYPE
4682 CALL flagerror(
"Equations mapping dynamic mapping is not associated.",err,error,*999)
4685 local_error=
"The equations linearity type of "// &
4687 CALL flagerror(local_error,err,error,*999)
4690 local_error=
"The equations time dependence type of "// &
4692 CALL flagerror(local_error,err,error,*999)
4694 IF(
ASSOCIATED(equations_mapping%RHS_MAPPING))
THEN 4695 solver_mapping%CREATE_VALUES_CACHE%RHS_VARIABLE_TYPE(solver_mapping%NUMBER_OF_EQUATIONS_SETS+1)= &
4696 & equations_mapping%RHS_MAPPING%RHS_VARIABLE_TYPE
4698 IF(
ASSOCIATED(equations_mapping%SOURCE_MAPPING))
THEN 4699 solver_mapping%CREATE_VALUES_CACHE%SOURCE_VARIABLE_TYPE(solver_mapping%NUMBER_OF_EQUATIONS_SETS+1)= &
4700 & equations_mapping%SOURCE_MAPPING%SOURCE_VARIABLE_TYPE
4702 solver_mapping%EQUATIONS_SETS(solver_mapping%NUMBER_OF_EQUATIONS_SETS+1)%PTR=>equations_set
4703 solver_mapping%NUMBER_OF_EQUATIONS_SETS=solver_mapping%NUMBER_OF_EQUATIONS_SETS+1
4704 equations_set_index=solver_mapping%NUMBER_OF_EQUATIONS_SETS
4707 variable_type=solver_mapping%CREATE_VALUES_CACHE%DYNAMIC_VARIABLE_TYPE(equations_set_index)
4710 DO solver_matrix_idx=1,solver_mapping%NUMBER_OF_SOLVER_MATRICES
4711 DO matrix_idx=1,solver_mapping%CREATE_VALUES_CACHE% &
4712 & matrix_variable_types(0,equations_set_index,solver_matrix_idx)
4713 variable_type=solver_mapping%CREATE_VALUES_CACHE% &
4714 & matrix_variable_types(matrix_idx,equations_set_index,solver_matrix_idx)
4716 & variable_type,err,error,*999)
4719 DO matrix_idx=1,solver_mapping%CREATE_VALUES_CACHE%RESIDUAL_VARIABLE_TYPES(0,equations_set_index)
4720 variable_type=solver_mapping%CREATE_VALUES_CACHE%RESIDUAL_VARIABLE_TYPES(matrix_idx,equations_set_index)
4725 CALL flagerror(
"Solvers mapping create values cache is not associated.",err,error,*999)
4728 CALL flagerror(
"Equations mapping is not associated.",err,error,*999)
4731 CALL flagerror(
"Equations set equations is not associated.",err,error,*999)
4734 CALL flagerror(
"Equations set has not been finished.",err,error,*999)
4737 CALL flagerror(
"Equations set is not associated.",err,error,*999)
4740 CALL flagerror(
"Solver mapping solver is not associated.",err,error,*999)
4744 CALL flagerror(
"Solver mapping is not associated.",err,error,*999)
4747 exits(
"SOLVER_MAPPING_EQUATIONS_SET_ADD")
4749 999
IF(
ALLOCATED(new_matrix_variable_types))
DEALLOCATE(new_matrix_variable_types)
4750 IF(
ALLOCATED(new_residual_variable_types))
DEALLOCATE(new_residual_variable_types)
4751 IF(
ALLOCATED(new_rhs_variable_type))
DEALLOCATE(new_rhs_variable_type)
4752 IF(
ALLOCATED(new_source_variable_type))
DEALLOCATE(new_source_variable_type)
4753 IF(
ALLOCATED(new_equations_sets))
DEALLOCATE(new_equations_sets)
4754 errorsexits(
"SOLVER_MAPPING_EQUATIONS_SET_ADD",err,error)
4768 INTEGER(INTG),
INTENT(OUT) :: ERR
4771 INTEGER(INTG) :: equations_matrix_idx,interface_condition_idx,row_idx,solver_matrix_idx
4773 enters(
"SolverMapping_EquationsSetToSolverMapFinalise",err,error,*999)
4775 IF(
ALLOCATED(equations_set_to_solver_map%EQUATIONS_TO_SOLVER_MATRIX_MAPS_INTERFACE))
THEN 4776 DO interface_condition_idx=1,
SIZE(equations_set_to_solver_map%EQUATIONS_TO_SOLVER_MATRIX_MAPS_INTERFACE,1)
4778 & equations_to_solver_matrix_maps_interface(interface_condition_idx),err,error,*999)
4780 DEALLOCATE(equations_set_to_solver_map%EQUATIONS_TO_SOLVER_MATRIX_MAPS_INTERFACE)
4782 IF(
ALLOCATED(equations_set_to_solver_map%EQUATIONS_TO_SOLVER_MATRIX_MAPS_SM))
THEN 4783 DO solver_matrix_idx=1,
SIZE(equations_set_to_solver_map%EQUATIONS_TO_SOLVER_MATRIX_MAPS_SM,1)
4785 & equations_to_solver_matrix_maps_sm(solver_matrix_idx),err,error,*999)
4787 DEALLOCATE(equations_set_to_solver_map%EQUATIONS_TO_SOLVER_MATRIX_MAPS_SM)
4789 IF(
ALLOCATED(equations_set_to_solver_map%EQUATIONS_TO_SOLVER_MATRIX_MAPS_EM))
THEN 4790 DO equations_matrix_idx=1,
SIZE(equations_set_to_solver_map%EQUATIONS_TO_SOLVER_MATRIX_MAPS_EM,1)
4792 & equations_to_solver_matrix_maps_em(equations_matrix_idx),err,error,*999)
4794 DEALLOCATE(equations_set_to_solver_map%EQUATIONS_TO_SOLVER_MATRIX_MAPS_EM)
4796 IF(
ALLOCATED(equations_set_to_solver_map%EQUATIONS_TO_SOLVER_MATRIX_MAPS_JM))
THEN 4798 & equations_to_solver_matrix_maps_jm,err,error,*999)
4799 DEALLOCATE(equations_set_to_solver_map%EQUATIONS_TO_SOLVER_MATRIX_MAPS_JM)
4801 IF(
ALLOCATED(equations_set_to_solver_map%EQUATIONS_ROW_TO_SOLVER_ROWS_MAPS))
THEN 4802 DO row_idx=1,
SIZE(equations_set_to_solver_map%EQUATIONS_ROW_TO_SOLVER_ROWS_MAPS,1)
4804 & equations_row_to_solver_rows_maps(row_idx),err,error,*999)
4806 DEALLOCATE(equations_set_to_solver_map%EQUATIONS_ROW_TO_SOLVER_ROWS_MAPS)
4809 exits(
"SolverMapping_EquationsSetToSolverMapFinalise")
4811 999
errors(
"SolverMapping_EquationsSetToSolverMapFinalise",err,error)
4812 exits(
"SolverMapping_EquationsSetToSolverMapFinalise")
4826 INTEGER(INTG),
INTENT(OUT) :: ERR
4830 enters(
"SolverMapping_EquationsSetToSolverMapInitialise",err,error,*999)
4832 equations_set_to_solver_map%EQUATIONS_SET_INDEX=0
4833 NULLIFY(equations_set_to_solver_map%SOLVER_MAPPING)
4834 NULLIFY(equations_set_to_solver_map%EQUATIONS)
4835 equations_set_to_solver_map%NUMBER_OF_INTERFACE_CONDITIONS=0
4837 exits(
"SolverMapping_EquationsSetToSolverMapInitialise")
4839 999
errors(
"SolverMapping_EquationsSetToSolverMapInitialise",err,error)
4840 exits(
"SolverMapping_EquationsSetToSolverMapInitialise")
4854 INTEGER(INTG),
INTENT(OUT) :: ERR
4857 INTEGER(INTG) :: column_idx
4859 enters(
"SolverMapping_EquationsToSolverMapsFinalise",err,error,*999)
4861 IF(
ASSOCIATED(equations_to_solver_map))
THEN 4862 IF(
ALLOCATED(equations_to_solver_map%EQUATIONS_COL_TO_SOLVER_COLS_MAP))
THEN 4863 DO column_idx=1,
SIZE(equations_to_solver_map%EQUATIONS_COL_TO_SOLVER_COLS_MAP,1)
4865 & equations_col_to_solver_cols_map(column_idx),err,error,*999)
4867 DEALLOCATE(equations_to_solver_map%EQUATIONS_COL_TO_SOLVER_COLS_MAP)
4871 exits(
"SolverMapping_EquationsToSolverMapsFinalise")
4873 999 errorsexits(
"SolverMapping_EquationsToSolverMapsFinalise",err,error)
4887 INTEGER(INTG),
INTENT(OUT) :: ERR
4891 enters(
"SolverMapping_EquationsToSolverMapsInitialise",err,error,*999)
4893 IF(
ASSOCIATED(equations_to_solver_map))
THEN 4894 equations_to_solver_map%EQUATIONS_MATRIX_TYPE=0
4895 equations_to_solver_map%EQUATIONS_MATRIX_NUMBER=0
4896 equations_to_solver_map%SOLVER_MATRIX_NUMBER=0
4897 NULLIFY(equations_to_solver_map%EQUATIONS_MATRIX)
4898 NULLIFY(equations_to_solver_map%SOLVER_MATRIX)
4900 CALL flagerror(
"Equations to solver map is not associated.",err,error,*999)
4903 exits(
"SolverMapping_EquationsToSolverMapsInitialise")
4905 999
errors(
"SolverMapping_EquationsToSolverMapsInitialise",err,error)
4906 exits(
"SolverMapping_EquationsToSolverMapsInitialise")
4920 INTEGER(INTG),
INTENT(OUT) :: ERR
4924 enters(
"SolverMapping_EquationsToSolverInterfaceFinalise",err,error,*999)
4926 equations_to_solver_interface_map%INTERFACE_CONDITION_INDEX=0
4927 NULLIFY(equations_to_solver_interface_map%INTERFACE_CONDITION)
4928 equations_to_solver_interface_map%INTERFACE_MATRIX_NUMBER=0
4930 exits(
"SolverMapping_EquationsToSolverInterfaceFinalise")
4932 999
errors(
"SolverMapping_EquationsToSolverInterfaceFinalise",err,error)
4933 exits(
"SolverMapping_EquationsToSolverInterfaceFinalise")
4947 INTEGER(INTG),
INTENT(OUT) :: ERR
4951 enters(
"SolverMapping_EquationsToSolverInterfaceInitialise",err,error,*999)
4953 equations_to_solver_interface_map%INTERFACE_CONDITION_INDEX=0
4954 NULLIFY(equations_to_solver_interface_map%INTERFACE_CONDITION)
4955 equations_to_solver_interface_map%INTERFACE_MATRIX_NUMBER=0
4957 exits(
"SolverMapping_EquationsToSolverInterfaceInitialise")
4959 999
errors(
"SolverMapping_EquationsToSolverInterfaceInitialise",err,error)
4960 exits(
"SolverMapping_EquationsToSolverInterfaceInitialise")
4974 INTEGER(INTG),
INTENT(OUT) :: ERR
4977 INTEGER(INTG) :: matrix_idx
4979 enters(
"SolverMapping_EquatsToSolMatMapsEMFinalise",err,error,*999)
4981 IF(
ALLOCATED(equations_to_solver_matrix_maps_em%EQUATIONS_TO_SOLVER_MATRIX_MAPS))
THEN 4982 DO matrix_idx=1,
SIZE(equations_to_solver_matrix_maps_em%EQUATIONS_TO_SOLVER_MATRIX_MAPS,1)
4984 & equations_to_solver_matrix_maps(matrix_idx)%PTR,err,error,*999)
4986 DEALLOCATE(equations_to_solver_matrix_maps_em%EQUATIONS_TO_SOLVER_MATRIX_MAPS)
4989 exits(
"SolverMapping_EquatsToSolMatMapsEMFinalise")
4991 999 errorsexits(
"SolverMapping_EquatsToSolMatMapsEMFinalise",err,error)
5005 INTEGER(INTG),
INTENT(OUT) :: ERR
5009 enters(
"SolverMapping_EquatsToSolMatMapsEMInitialise",err,error,*999)
5011 equations_to_solver_matrix_maps_em%EQUATIONS_MATRIX_NUMBER=0
5012 equations_to_solver_matrix_maps_em%NUMBER_OF_SOLVER_MATRICES=0
5014 exits(
"SolverMapping_EquatsToSolMatMapsEMInitialise")
5016 999
errors(
"SolverMapping_EquatsToSolMatMapsEMInitialise",err,error)
5017 exits(
"SolverMapping_EquatsToSolMatMapsEMInitialise")
5031 INTEGER(INTG),
INTENT(OUT) :: ERR
5034 INTEGER(INTG) :: equations_matrix_idx
5036 enters(
"SolverMapping_EquatsToSolMatMapsJMFinalise",err,error,*999)
5038 IF(
ALLOCATED(equations_to_solver_matrix_maps_jm))
THEN 5039 DO equations_matrix_idx=1,
SIZE(equations_to_solver_matrix_maps_jm,1)
5045 exits(
"SolverMapping_EquatsToSolMatMapsJMFinalise")
5047 999 errorsexits(
"SolverMapping_EquatsToSolMatMapsJMFinalise",err,error)
5061 INTEGER(INTG),
INTENT(OUT) :: ERR
5064 INTEGER(INTG) :: matrix_idx,variable_idx
5066 enters(
"SolverMapping_EquatsToSolMatMapsSMFinalise",err,error,*999)
5068 IF(
ALLOCATED(equations_to_solver_matrix_maps_sm%VARIABLE_TYPES))
DEALLOCATE(equations_to_solver_matrix_maps_sm%VARIABLE_TYPES)
5069 IF(
ALLOCATED(equations_to_solver_matrix_maps_sm%VARIABLES))
DEALLOCATE(equations_to_solver_matrix_maps_sm%VARIABLES)
5070 IF(
ALLOCATED(equations_to_solver_matrix_maps_sm%VARIABLE_TO_SOLVER_COL_MAPS))
THEN 5071 DO variable_idx=1,
SIZE(equations_to_solver_matrix_maps_sm%VARIABLE_TO_SOLVER_COL_MAPS,1)
5073 & variable_to_solver_col_maps(variable_idx),err,error,*999)
5075 DEALLOCATE(equations_to_solver_matrix_maps_sm%VARIABLE_TO_SOLVER_COL_MAPS)
5077 IF(
ALLOCATED(equations_to_solver_matrix_maps_sm%DYNAMIC_EQUATIONS_TO_SOLVER_MATRIX_MAPS))
THEN 5078 DO matrix_idx=1,
SIZE(equations_to_solver_matrix_maps_sm%DYNAMIC_EQUATIONS_TO_SOLVER_MATRIX_MAPS,1)
5080 & dynamic_equations_to_solver_matrix_maps(matrix_idx)%PTR,err,error,*999)
5082 DEALLOCATE(equations_to_solver_matrix_maps_sm%DYNAMIC_EQUATIONS_TO_SOLVER_MATRIX_MAPS)
5084 IF(
ALLOCATED(equations_to_solver_matrix_maps_sm%LINEAR_EQUATIONS_TO_SOLVER_MATRIX_MAPS))
THEN 5085 DO matrix_idx=1,
SIZE(equations_to_solver_matrix_maps_sm%LINEAR_EQUATIONS_TO_SOLVER_MATRIX_MAPS,1)
5087 & linear_equations_to_solver_matrix_maps(matrix_idx)%PTR,err,error,*999)
5089 DEALLOCATE(equations_to_solver_matrix_maps_sm%LINEAR_EQUATIONS_TO_SOLVER_MATRIX_MAPS)
5091 IF(
ALLOCATED(equations_to_solver_matrix_maps_sm%JACOBIAN_TO_SOLVER_MATRIX_MAPS))
THEN 5092 DO matrix_idx=1,
SIZE(equations_to_solver_matrix_maps_sm%JACOBIAN_TO_SOLVER_MATRIX_MAPS,1)
5094 & jacobian_to_solver_matrix_maps(matrix_idx)%PTR,err,error,*999)
5096 DEALLOCATE(equations_to_solver_matrix_maps_sm%JACOBIAN_TO_SOLVER_MATRIX_MAPS)
5099 exits(
"SolverMapping_EquatsToSolMatMapsSMFinalise")
5101 999 errorsexits(
"SolverMapping_EquatsToSolMatMapsSMFinalise",err,error)
5115 INTEGER(INTG),
INTENT(OUT) :: ERR
5119 enters(
"SolverMapping_EquatsToSolMatMapsSMInitialise",err,error,*999)
5121 equations_to_solver_matrix_maps_sm%SOLVER_MATRIX_NUMBER=0
5122 equations_to_solver_matrix_maps_sm%NUMBER_OF_VARIABLES=0
5123 equations_to_solver_matrix_maps_sm%NUMBER_OF_DYNAMIC_EQUATIONS_MATRICES=0
5124 equations_to_solver_matrix_maps_sm%NUMBER_OF_LINEAR_EQUATIONS_MATRICES=0
5125 equations_to_solver_matrix_maps_sm%NUMBER_OF_EQUATIONS_JACOBIANS=0
5127 exits(
"SolverMapping_EquatsToSolMatMapsSMInitialise")
5129 999
errors(
"SolverMapping_EquatsToSolMatMapsSMInitialise",err,error)
5130 exits(
"SolverMapping_EquatsToSolMatMapsSMInitialise")
5144 INTEGER(INTG),
INTENT(OUT) :: ERR
5147 INTEGER(INTG) :: equations_set_idx,interface_condition_idx,row_idx,solver_matrix_idx
5149 enters(
"SOLVER_MAPPING_FINALISE",err,error,*999)
5151 IF(
ASSOCIATED(solver_mapping))
THEN 5152 IF(
ALLOCATED(solver_mapping%VARIABLES_LIST))
THEN 5153 DO solver_matrix_idx=1,
SIZE(solver_mapping%VARIABLES_LIST,1)
5156 DEALLOCATE(solver_mapping%VARIABLES_LIST)
5158 IF(
ALLOCATED(solver_mapping%EQUATIONS_SETS))
DEALLOCATE(solver_mapping%EQUATIONS_SETS)
5159 IF(
ALLOCATED(solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP))
THEN 5160 DO equations_set_idx=1,
SIZE(solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP,1)
5162 & equations_set_idx),err,error,*999)
5164 DEALLOCATE(solver_mapping%EQUATIONS_SET_TO_SOLVER_MAP)
5166 IF(
ALLOCATED(solver_mapping%INTERFACE_CONDITIONS))
DEALLOCATE(solver_mapping%INTERFACE_CONDITIONS)
5167 IF(
ALLOCATED(solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP))
THEN 5168 DO interface_condition_idx=1,
SIZE(solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP,1)
5170 & interface_condition_idx),err,error,*999)
5172 DEALLOCATE(solver_mapping%INTERFACE_CONDITION_TO_SOLVER_MAP)
5174 IF(
ALLOCATED(solver_mapping%SOLVER_COL_TO_EQUATIONS_COLS_MAP))
THEN 5175 DO solver_matrix_idx=1,
SIZE(solver_mapping%SOLVER_COL_TO_EQUATIONS_COLS_MAP,1)
5177 & solver_matrix_idx),err,error,*999)
5179 DEALLOCATE(solver_mapping%SOLVER_COL_TO_EQUATIONS_COLS_MAP)
5181 IF(
ALLOCATED(solver_mapping%SOLVER_ROW_TO_EQUATIONS_ROWS_MAP))
THEN 5182 DO row_idx=1,
SIZE(solver_mapping%SOLVER_ROW_TO_EQUATIONS_ROWS_MAP,1)
5184 & row_idx),err,error,*999)
5186 DEALLOCATE(solver_mapping%SOLVER_ROW_TO_EQUATIONS_ROWS_MAP)
5190 DEALLOCATE(solver_mapping)
5193 exits(
"SOLVER_MAPPING_FINALISE")
5195 999 errorsexits(
"SOLVER_MAPPING_FINALISE",err,error)
5208 INTEGER(INTG),
INTENT(OUT) :: ERR
5211 INTEGER(INTG) :: DUMMY_ERR
5214 enters(
"SOLVER_MAPPING_INITIALISE",err,error,*998)
5216 IF(
ASSOCIATED(solver_equations))
THEN 5217 IF(
ASSOCIATED(solver_equations%SOLVER_MAPPING))
THEN 5218 CALL flagerror(
"Solver equations solver mapping is already associated",err,error,*998)
5220 ALLOCATE(solver_equations%SOLVER_MAPPING,stat=err)
5221 IF(err/=0)
CALL flagerror(
"Could not allocate solver equations solver mapping",err,error,*999)
5222 solver_equations%SOLVER_MAPPING%SOLVER_EQUATIONS=>solver_equations
5223 solver_equations%SOLVER_MAPPING%SOLVER_MAPPING_FINISHED=.false.
5224 solver_equations%SOLVER_MAPPING%NUMBER_OF_SOLVER_MATRICES=1
5225 solver_equations%SOLVER_MAPPING%NUMBER_OF_ROWS=0
5226 solver_equations%SOLVER_MAPPING%NUMBER_OF_GLOBAL_ROWS=0
5227 solver_equations%SOLVER_MAPPING%NUMBER_OF_EQUATIONS_SETS=0
5228 solver_equations%SOLVER_MAPPING%NUMBER_OF_INTERFACE_CONDITIONS=0
5229 NULLIFY(solver_equations%SOLVER_MAPPING%ROW_DOFS_MAPPING)
5230 NULLIFY(solver_equations%SOLVER_MAPPING%CREATE_VALUES_CACHE)
5234 CALL flagerror(
"Solver equations is not associated",err,error,*998)
5237 exits(
"SOLVER_MAPPING_INITIALISE")
5240 998 errorsexits(
"SOLVER_MAPPING_INITIALISE",err,error)
5254 INTEGER(INTG),
INTENT(OUT) :: INTERFACE_CONDITION_INDEX
5255 INTEGER(INTG),
INTENT(OUT) :: ERR
5258 INTEGER(INTG) :: equations_matrix_idx,equations_set_idx,interface_condition_idx,interface_matrix_idx,LIST_ITEM(2)
5259 INTEGER(INTG) :: number_of_interface_matrices
5260 LOGICAL :: EQUATIONS_SET_FOUND,VARIABLE_FOUND
5270 enters(
"SOLVER_MAPPING_INTERFACE_CONDITION_ADD",err,error,*999)
5272 interface_condition_index=0
5273 IF(
ASSOCIATED(solver_mapping))
THEN 5274 IF(solver_mapping%SOLVER_MAPPING_FINISHED)
THEN 5275 CALL flagerror(
"Solver mapping has been finished.",err,error,*999)
5277 solver_equations=>solver_mapping%SOLVER_EQUATIONS
5278 IF(
ASSOCIATED(solver_equations))
THEN 5279 IF(
ASSOCIATED(interface_condition))
THEN 5280 IF(interface_condition%INTERFACE_CONDITION_FINISHED)
THEN 5281 interface_equations=>interface_condition%INTERFACE_EQUATIONS
5282 IF(
ASSOCIATED(interface_equations))
THEN 5283 interface_mapping=>interface_equations%INTERFACE_MAPPING
5284 IF(
ASSOCIATED(interface_mapping))
THEN 5285 IF(
ASSOCIATED(solver_mapping%CREATE_VALUES_CACHE))
THEN 5287 SELECT CASE(interface_condition%METHOD)
5289 interface_dependent=>interface_condition%DEPENDENT
5290 IF(
ASSOCIATED(interface_dependent))
THEN 5291 SELECT CASE(interface_condition%METHOD)
5293 number_of_interface_matrices=interface_mapping%NUMBER_OF_INTERFACE_MATRICES
5295 number_of_interface_matrices=interface_mapping%NUMBER_OF_INTERFACE_MATRICES-1
5297 local_error=
"The interface condition method of "// &
5299 CALL flagerror(local_error,err,error,*999)
5301 DO interface_matrix_idx=1,number_of_interface_matrices
5302 equations_set=>interface_mapping%INTERFACE_MATRIX_ROWS_TO_VAR_MAPS(interface_matrix_idx)%EQUATIONS_SET
5303 IF(
ASSOCIATED(equations_set))
THEN 5304 equations_set_found=.false.
5305 DO equations_set_idx=1,solver_mapping%NUMBER_OF_EQUATIONS_SETS
5306 IF(
ASSOCIATED(equations_set,solver_mapping%EQUATIONS_SETS(equations_set_idx)%PTR))
THEN 5307 equations_set_found=.true.
5311 IF(equations_set_found)
THEN 5313 dependent_variable=>interface_mapping%INTERFACE_MATRIX_ROWS_TO_VAR_MAPS(interface_matrix_idx)%VARIABLE
5314 IF(
ASSOCIATED(dependent_variable))
THEN 5315 variable_found=.false.
5317 IF(solver_mapping%CREATE_VALUES_CACHE%DYNAMIC_VARIABLE_TYPE(equations_set_idx)== &
5318 & dependent_variable%VARIABLE_TYPE)
THEN 5319 variable_found=.true.
5322 DO equations_matrix_idx=1,solver_mapping%CREATE_VALUES_CACHE% &
5323 & matrix_variable_types(0,equations_set_idx,1)
5324 IF(solver_mapping%CREATE_VALUES_CACHE% &
5325 & matrix_variable_types(equations_matrix_idx,equations_set_idx,1)== &
5326 & dependent_variable%VARIABLE_TYPE)
THEN 5327 variable_found=.true.
5331 IF(.NOT.variable_found)
THEN 5333 DO equations_matrix_idx=1,solver_mapping%CREATE_VALUES_CACHE%RESIDUAL_VARIABLE_TYPES(0, &
5334 & equations_set_idx)
5335 IF(solver_mapping%CREATE_VALUES_CACHE%RESIDUAL_VARIABLE_TYPES(equations_matrix_idx, &
5336 & equations_set_idx)==dependent_variable%VARIABLE_TYPE)
THEN 5337 variable_found=.true.
5342 IF(variable_found)
THEN 5344 list_item(1)=solver_mapping%NUMBER_OF_INTERFACE_CONDITIONS+1
5345 list_item(2)=interface_matrix_idx
5346 CALL list_item_add(solver_mapping%CREATE_VALUES_CACHE%INTERFACE_INDICES(equations_set_idx)% &
5347 &
ptr,list_item,err,error,*999)
5349 local_error=
"The dependent variable associated with interface matrix number "// &
5351 &
" is not mapped to the solver equations." 5352 CALL flagerror(local_error,err,error,*999)
5355 local_error=
"The dependent variable associated with interface matrix number "// &
5357 CALL flagerror(local_error,err,error,*999)
5360 local_error=
"The equations set for the dependent variable associated with interface "// &
5362 &
" has not been added to the solver equations." 5363 CALL flagerror(local_error,err,error,*999)
5366 local_error=
"Equations set is not associated for interface matrix number "// &
5368 CALL flagerror(local_error,err,error,*999)
5372 CALL flagerror(
"Interface condition dependent is not associated.",err,error,*999)
5375 CALL flagerror(
"Not implemented.",err,error,*999)
5377 CALL flagerror(
"Not implemented.",err,error,*999)
5379 local_error=
"The interface condition method of "// &
5381 CALL flagerror(local_error,err,error,*999)
5383 IF(solver_mapping%NUMBER_OF_INTERFACE_CONDITIONS>0)
THEN 5384 ALLOCATE(old_interface_conditions(solver_mapping%NUMBER_OF_INTERFACE_CONDITIONS),stat=err)
5385 IF(err/=0)
CALL flagerror(
"Could not allocate old interface conditions.",err,error,*999)
5386 DO interface_condition_idx=1,solver_mapping%NUMBER_OF_INTERFACE_CONDITIONS
5387 old_interface_conditions(interface_condition_idx)%PTR=>solver_mapping% &
5388 & interface_conditions(interface_condition_idx)%PTR
5390 DEALLOCATE(solver_mapping%INTERFACE_CONDITIONS)
5391 ELSE IF(solver_mapping%NUMBER_OF_INTERFACE_CONDITIONS==0)
THEN 5394 CALL flagerror(
"The number of interface conditions is < 0.",err,error,*999)
5396 ALLOCATE(solver_mapping%INTERFACE_CONDITIONS(solver_mapping%NUMBER_OF_INTERFACE_CONDITIONS+1),stat=err)
5397 IF(err/=0)
CALL flagerror(
"Could not allocate interface conditions.",err,error,*999)
5398 DO interface_condition_idx=1,solver_mapping%NUMBER_OF_INTERFACE_CONDITIONS
5399 solver_mapping%INTERFACE_CONDITIONS(interface_condition_idx)%PTR=> &
5400 & old_interface_conditions(interface_condition_idx)%PTR
5402 solver_mapping%INTERFACE_CONDITIONS(solver_mapping%NUMBER_OF_INTERFACE_CONDITIONS+1)%PTR=>interface_condition
5403 solver_mapping%NUMBER_OF_INTERFACE_CONDITIONS=solver_mapping%NUMBER_OF_INTERFACE_CONDITIONS+1
5404 interface_condition_index=solver_mapping%NUMBER_OF_INTERFACE_CONDITIONS
5410 IF(
ALLOCATED(old_interface_conditions))
DEALLOCATE(old_interface_conditions)
5412 CALL flagerror(
"Solvers mapping create values cache is not associated.",err,error,*999)
5415 CALL flagerror(
"Interface equations mapping is not associated.",err,error,*999)
5418 CALL flagerror(
"Interface condition interface equations is not associated.",err,error,*999)
5421 CALL flagerror(
"Interface condition has not been finished.",err,error,*999)
5424 CALL flagerror(
"Interface condition is not associated.",err,error,*999)
5427 CALL flagerror(
"Solver mapping solver is not associated.",err,error,*999)
5431 CALL flagerror(
"Solver mapping is not associated.",err,error,*999)
5434 exits(
"SOLVER_MAPPING_INTERFACE_CONDITION_ADD")
5436 999
IF(
ALLOCATED(old_interface_conditions))
DEALLOCATE(old_interface_conditions)
5437 errorsexits(
"SOLVER_MAPPING_INTERFACE_CONDITION_ADD",err,error)
5451 INTEGER(INTG),
INTENT(OUT) :: ERR
5454 INTEGER(INTG) :: column_idx,equations_set_idx,interface_matrix_idx,solver_matrix_idx
5456 enters(
"SolverMapping_InterfConditionToSolverMapFinalise",err,error,*999)
5458 interface_condition_to_solver_map%INTERFACE_CONDITION_INDEX=0
5459 NULLIFY(interface_condition_to_solver_map%SOLVER_MAPPING)
5460 NULLIFY(interface_condition_to_solver_map%INTERFACE_EQUATIONS)
5461 interface_condition_to_solver_map%NUMBER_OF_EQUATIONS_SETS=0
5462 IF(
ALLOCATED(interface_condition_to_solver_map%INTERFACE_TO_SOLVER_MATRIX_MAPS_EQUATIONS))
THEN 5463 DO equations_set_idx=1,
SIZE(interface_condition_to_solver_map%INTERFACE_TO_SOLVER_MATRIX_MAPS_EQUATIONS,1)
5465 & interface_to_solver_matrix_maps_equations(equations_set_idx),err,error,*999)
5467 DEALLOCATE(interface_condition_to_solver_map%INTERFACE_TO_SOLVER_MATRIX_MAPS_EQUATIONS)
5469 IF(
ALLOCATED(interface_condition_to_solver_map%INTERFACE_TO_SOLVER_MATRIX_MAPS_SM))
THEN 5470 DO solver_matrix_idx=1,
SIZE(interface_condition_to_solver_map%INTERFACE_TO_SOLVER_MATRIX_MAPS_SM,1)
5472 & interface_to_solver_matrix_maps_sm(solver_matrix_idx),err,error,*999)
5474 DEALLOCATE(interface_condition_to_solver_map%INTERFACE_TO_SOLVER_MATRIX_MAPS_SM)
5476 IF(
ALLOCATED(interface_condition_to_solver_map%INTERFACE_TO_SOLVER_MATRIX_MAPS_IM))
THEN 5477 DO interface_matrix_idx=1,
SIZE(interface_condition_to_solver_map%INTERFACE_TO_SOLVER_MATRIX_MAPS_IM,1)
5479 & interface_to_solver_matrix_maps_im(interface_matrix_idx),err,error,*999)
5481 DEALLOCATE(interface_condition_to_solver_map%INTERFACE_TO_SOLVER_MATRIX_MAPS_IM)
5483 IF(
ALLOCATED(interface_condition_to_solver_map%INTERFACE_COLUMN_TO_SOLVER_ROWS_MAPS))
THEN 5484 DO column_idx=1,
SIZE(interface_condition_to_solver_map%INTERFACE_COLUMN_TO_SOLVER_ROWS_MAPS,1)
5486 & interface_column_to_solver_rows_maps(column_idx),err,error,*999)
5488 DEALLOCATE(interface_condition_to_solver_map%INTERFACE_COLUMN_TO_SOLVER_ROWS_MAPS)
5491 exits(
"SolverMapping_InterfConditionToSolverMapFinalise")
5493 999
errors(
"SolverMapping_InterfConditionToSolverMapFinalise",err,error)
5494 exits(
"SolverMapping_InterfConditionToSolverMapFinalise")
5508 INTEGER(INTG),
INTENT(OUT) :: ERR
5512 enters(
"SolverMapping_InterfConditionToSolverMapInitialise",err,error,*999)
5514 interface_condition_to_solver_map%INTERFACE_CONDITION_INDEX=0
5515 NULLIFY(interface_condition_to_solver_map%SOLVER_MAPPING)
5516 NULLIFY(interface_condition_to_solver_map%INTERFACE_EQUATIONS)
5517 interface_condition_to_solver_map%NUMBER_OF_EQUATIONS_SETS=0
5519 exits(
"SolverMapping_InterfConditionToSolverMapInitialise")
5521 999
errors(
"SolverMapping_InterfConditionToSolverMapInitialise",err,error)
5522 exits(
"SolverMapping_InterfConditionToSolverMapInitialise")
5536 INTEGER(INTG),
INTENT(OUT) :: ERR
5539 INTEGER(INTG) :: equations_set_idx,interface_column_idx
5541 enters(
"SolverMapping_InterfaceToSolverMapFinalise",err,error,*999)
5543 IF(
ASSOCIATED(interface_condition_to_solver_map))
THEN 5544 IF(
ALLOCATED(interface_condition_to_solver_map%INTERFACE_TO_SOLVER_MATRIX_MAPS_EQUATIONS))
THEN 5545 DO equations_set_idx=1,
SIZE(interface_condition_to_solver_map%INTERFACE_TO_SOLVER_MATRIX_MAPS_EQUATIONS,1)
5547 & interface_to_solver_matrix_maps_equations(equations_set_idx),err,error,*999)
5549 DEALLOCATE(interface_condition_to_solver_map%INTERFACE_TO_SOLVER_MATRIX_MAPS_EQUATIONS)
5551 IF(
ALLOCATED(interface_condition_to_solver_map%INTERFACE_COLUMN_TO_SOLVER_ROWS_MAPS))
THEN 5552 DO interface_column_idx=1,
SIZE(interface_condition_to_solver_map%INTERFACE_COLUMN_TO_SOLVER_ROWS_MAPS,1)
5554 & interface_column_to_solver_rows_maps(interface_column_idx),err,error,*999)
5556 DEALLOCATE(interface_condition_to_solver_map%INTERFACE_COLUMN_TO_SOLVER_ROWS_MAPS)
5558 DEALLOCATE(interface_condition_to_solver_map)
5561 exits(
"SolverMapping_InterfaceToSolverMapFinalise")
5563 999 errorsexits(
"SolverMapping_InterfaceToSolverMapFinalise",err,error)
5577 INTEGER(INTG),
INTENT(OUT) :: ERR
5581 enters(
"SolverMapping_InterfaceToSolverMapInitialise",err,error,*999)
5583 interface_condition_to_solver_map%INTERFACE_CONDITION_INDEX=0
5584 NULLIFY(interface_condition_to_solver_map%SOLVER_MAPPING)
5585 NULLIFY(interface_condition_to_solver_map%INTERFACE_EQUATIONS)
5586 interface_condition_to_solver_map%NUMBER_OF_EQUATIONS_SETS=0
5588 exits(
"SolverMapping_InterfaceToSolverMapInitialise")
5590 999
errors(
"SolverMapping_InterfaceToSolverMapInitialise",err,error)
5591 exits(
"SolverMapping_InterfaceToSolverMapInitialise")
5605 INTEGER(INTG),
INTENT(OUT) :: ERR
5608 INTEGER(INTG) :: row_idx
5610 enters(
"SolverMapping_InterfaceToSolverMapsFinalise",err,error,*999)
5612 IF(
ASSOCIATED(interface_to_solver_maps))
THEN 5613 IF(
ALLOCATED(interface_to_solver_maps%INTERFACE_ROW_TO_SOLVER_COLS_MAP))
THEN 5614 DO row_idx=1,
SIZE(interface_to_solver_maps%INTERFACE_ROW_TO_SOLVER_COLS_MAP,1)
5616 & interface_row_to_solver_cols_map(row_idx),err,error,*999)
5618 DEALLOCATE(interface_to_solver_maps%INTERFACE_ROW_TO_SOLVER_COLS_MAP)
5622 exits(
"SolverMapping_InterfaceToSolverMapsFinalise")
5624 999 errorsexits(
"SolverMapping_InterfaceToSolverMapsFinalise",err,error)
5638 INTEGER(INTG),
INTENT(OUT) :: ERR
5642 enters(
"SolverMapping_InterfaceToSolverMapsInitialise",err,error,*999)
5644 IF(
ASSOCIATED(interface_to_solver_maps))
THEN 5645 interface_to_solver_maps%INTERFACE_MATRIX_NUMBER=0
5646 interface_to_solver_maps%SOLVER_MATRIX_NUMBER=0
5647 NULLIFY(interface_to_solver_maps%INTERFACE_MATRIX)
5648 NULLIFY(interface_to_solver_maps%SOLVER_MATRIX)
5650 CALL flagerror(
"Interface to solver maps is not associated.",err,error,*999)
5653 exits(
"SolverMapping_InterfaceToSolverMapsInitialise")
5655 999
errors(
"SolverMapping_InterfaceToSolverMapsInitialise",err,error)
5656 exits(
"SolverMapping_InterfaceToSolverMapsInitialise")
5670 INTEGER(INTG),
INTENT(OUT) :: ERR
5674 enters(
"SolverMapping_InterfaceToSolverEquationsFinalise",err,error,*999)
5676 interface_to_solver_equations_maps%EQUATIONS_SET_INDEX=0
5677 NULLIFY(interface_to_solver_equations_maps%EQUATIONS_SET)
5678 interface_to_solver_equations_maps%INTERFACE_MATRIX_INDEX=0
5680 exits(
"SolverMapping_InterfaceToSolverEquationsFinalise")
5682 999
errors(
"SolverMapping_InterfaceToSolverEquationsFinalise",err,error)
5683 exits(
"SolverMapping_InterfaceToSolverEquationsFinalise")
5697 INTEGER(INTG),
INTENT(OUT) :: ERR
5701 enters(
"SolverMapping_InterfaceToSolverEquationsInitialise",err,error,*999)
5703 interface_to_solver_equations_maps%EQUATIONS_SET_INDEX=0
5704 NULLIFY(interface_to_solver_equations_maps%EQUATIONS_SET)
5705 interface_to_solver_equations_maps%INTERFACE_MATRIX_INDEX=0
5707 exits(
"SolverMapping_InterfaceToSolverEquationsInitialise")
5709 999
errors(
"SolverMapping_InterfaceToSolverEquationsInitialise",err,error)
5710 exits(
"SolverMapping_InterfaceToSolverEquationsInitialise")
5724 INTEGER(INTG),
INTENT(OUT) :: ERR
5728 enters(
"SolverMapping_InterfColToSolRowsMapFinalise",err,error,*999)
5730 interface_column_to_solver_rows_map%NUMBER_OF_SOLVER_ROWS=0
5731 interface_column_to_solver_rows_map%SOLVER_ROW=0
5732 interface_column_to_solver_rows_map%COUPLING_COEFFICIENT=0.0_dp
5734 exits(
"SolverMapping_InterfColToSolRowsMapFinalise")
5736 999 errorsexits(
"SolverMapping_InterfColToSolRowsMapFinalise",err,error)
5750 INTEGER(INTG),
INTENT(OUT) :: ERR
5754 enters(
"SolverMapping_InterfColToSolRowsMapInitialise",err,error,*999)
5756 interface_column_to_solver_rows_map%NUMBER_OF_SOLVER_ROWS=0
5757 interface_column_to_solver_rows_map%SOLVER_ROW=0
5758 interface_column_to_solver_rows_map%COUPLING_COEFFICIENT=0.0_dp
5760 exits(
"SolverMapping_InterfColToSolRowsMapInitialise")
5762 999
errors(
"SolverMapping_InterfColToSolRowsMapInitialise",err,error)
5763 exits(
"SolverMapping_InterfColToSolRowsMapInitialise")
5777 INTEGER(INTG),
INTENT(OUT) :: ERR
5781 enters(
"SolverMapping_InterfRowToSolRowsMapFinalise",err,error,*999)
5783 interface_row_to_solver_rows_map%NUMBER_OF_SOLVER_ROWS=0
5784 interface_row_to_solver_rows_map%SOLVER_ROW=0
5785 interface_row_to_solver_rows_map%COUPLING_COEFFICIENT=0.0_dp
5787 exits(
"SolverMapping_InterfRowToSolRowsMapFinalise")
5789 999 errorsexits(
"SolverMapping_InterfRowToSolRowsMapFinalise",err,error)
5803 INTEGER(INTG),
INTENT(OUT) :: ERR
5807 enters(
"SolverMapping_InterfRowToSolRowsMapInitialise",err,error,*999)
5809 interface_row_to_solver_rows_map%NUMBER_OF_SOLVER_ROWS=0
5810 interface_row_to_solver_rows_map%SOLVER_ROW=0
5811 interface_row_to_solver_rows_map%COUPLING_COEFFICIENT=0.0_dp
5813 exits(
"SolverMapping_InterfRowToSolRowsMapInitialise")
5815 999
errors(
"SolverMapping_InterfRowToSolRowsMapInitialise",err,error)
5816 exits(
"SolverMapping_InterfRowToSolRowsMapInitialise")
5830 INTEGER(INTG),
INTENT(OUT) :: ERR
5833 INTEGER(INTG) :: row_idx,solver_matrix_idx
5835 enters(
"SolverMapping_InterfToSolMatMapsIMFinalise",err,error,*999)
5837 interface_to_solver_matrix_maps_im%INTERFACE_MATRIX_NUMBER=0
5838 interface_to_solver_matrix_maps_im%NUMBER_OF_SOLVER_MATRICES=0
5839 IF(
ALLOCATED(interface_to_solver_matrix_maps_im%INTERFACE_TO_SOLVER_MATRIX_MAPS))
THEN 5840 DO solver_matrix_idx=1,
SIZE(interface_to_solver_matrix_maps_im%INTERFACE_TO_SOLVER_MATRIX_MAPS,1)
5842 & interface_to_solver_matrix_maps(solver_matrix_idx)%PTR,err,error,*999)
5844 DEALLOCATE(interface_to_solver_matrix_maps_im%INTERFACE_TO_SOLVER_MATRIX_MAPS)
5846 IF(
ALLOCATED(interface_to_solver_matrix_maps_im%INTERFACE_ROW_TO_SOLVER_ROWS_MAP))
THEN 5847 DO row_idx=1,
SIZE(interface_to_solver_matrix_maps_im%INTERFACE_ROW_TO_SOLVER_ROWS_MAP,1)
5849 interface_row_to_solver_rows_map(row_idx),err,error,*999)
5851 DEALLOCATE(interface_to_solver_matrix_maps_im%INTERFACE_ROW_TO_SOLVER_ROWS_MAP)
5854 exits(
"SolverMapping_InterfToSolMatMapsIMFinalise")
5856 999 errorsexits(
"SolverMapping_InterfToSolMatMapsIMFinalise",err,error)
5870 INTEGER(INTG),
INTENT(OUT) :: ERR
5874 enters(
"SolverMapping_InterfToSolMatMapsIMInitialise",err,error,*999)
5876 interface_to_solver_matrix_maps_im%INTERFACE_MATRIX_NUMBER=0
5877 interface_to_solver_matrix_maps_im%NUMBER_OF_SOLVER_MATRICES=0
5879 exits(
"SolverMapping_InterfToSolMatMapsIMInitialise")
5881 999
errors(
"SolverMapping_InterfToSolMatMapsIMInitialise",err,error)
5882 exits(
"SolverMapping_InterfToSolMatMapsIMInitialise")
5896 INTEGER(INTG),
INTENT(OUT) :: ERR
5899 INTEGER(INTG) :: column_idx,interface_matrix_idx
5901 enters(
"SolverMapping_InterfToSolMatMapsSMFinalise",err,error,*999)
5903 interface_to_solver_matrix_maps_sm%SOLVER_MATRIX_NUMBER=0
5904 interface_to_solver_matrix_maps_sm%LAGRANGE_VARIABLE_TYPE=0
5905 NULLIFY(interface_to_solver_matrix_maps_sm%LAGRANGE_VARIABLE)
5907 & lagrange_variable_to_solver_col_map,err,error,*999)
5908 interface_to_solver_matrix_maps_sm%NUMBER_OF_DEPENDENT_VARIABLES=0
5909 IF(
ALLOCATED(interface_to_solver_matrix_maps_sm%DEPENDENT_VARIABLE_TYPES)) &
5910 &
DEALLOCATE(interface_to_solver_matrix_maps_sm%DEPENDENT_VARIABLE_TYPES)
5911 IF(
ALLOCATED(interface_to_solver_matrix_maps_sm%DEPENDENT_VARIABLES)) &
5912 &
DEALLOCATE(interface_to_solver_matrix_maps_sm%DEPENDENT_VARIABLES)
5913 IF(
ALLOCATED(interface_to_solver_matrix_maps_sm%DEPENDENT_VARIABLE_TO_SOLVER_COL_MAPS))
THEN 5914 DO interface_matrix_idx=1,
SIZE(interface_to_solver_matrix_maps_sm%DEPENDENT_VARIABLE_TO_SOLVER_COL_MAPS,1)
5916 & dependent_variable_to_solver_col_maps(interface_matrix_idx),err,error,*999)
5918 DEALLOCATE(interface_to_solver_matrix_maps_sm%DEPENDENT_VARIABLE_TO_SOLVER_COL_MAPS)
5920 interface_to_solver_matrix_maps_sm%NUMBER_OF_INTERFACE_MATRICES=0
5921 IF(
ALLOCATED(interface_to_solver_matrix_maps_sm%INTERFACE_EQUATIONS_TO_SOLVER_MATRIX_MAPS))
THEN 5922 DO interface_matrix_idx=1,
SIZE(interface_to_solver_matrix_maps_sm%INTERFACE_EQUATIONS_TO_SOLVER_MATRIX_MAPS,1)
5924 interface_equations_to_solver_matrix_maps(interface_matrix_idx)%PTR,err,error,*999)
5926 DEALLOCATE(interface_to_solver_matrix_maps_sm%INTERFACE_EQUATIONS_TO_SOLVER_MATRIX_MAPS)
5928 IF(
ALLOCATED(interface_to_solver_matrix_maps_sm%INTERFACE_COL_TO_SOLVER_COLS_MAP))
THEN 5929 DO column_idx=1,
SIZE(interface_to_solver_matrix_maps_sm%INTERFACE_COL_TO_SOLVER_COLS_MAP,1)
5931 & interface_col_to_solver_cols_map(column_idx),err,error,*999)
5933 DEALLOCATE(interface_to_solver_matrix_maps_sm%INTERFACE_COL_TO_SOLVER_COLS_MAP)
5936 exits(
"SolverMapping_InterfToSolMatMapsSMFinalise")
5938 999 errorsexits(
"SolverMapping_InterfToSolMatMapsSMFinalise",err,error)
5952 INTEGER(INTG),
INTENT(OUT) :: ERR
5956 enters(
"SolverMapping_InterfToSolMatMapsSMInitialise",err,error,*999)
5958 interface_to_solver_matrix_maps_sm%SOLVER_MATRIX_NUMBER=0
5959 interface_to_solver_matrix_maps_sm%LAGRANGE_VARIABLE_TYPE=0
5960 NULLIFY(interface_to_solver_matrix_maps_sm%LAGRANGE_VARIABLE)
5962 & lagrange_variable_to_solver_col_map,err,error,*999)
5963 interface_to_solver_matrix_maps_sm%NUMBER_OF_DEPENDENT_VARIABLES=0
5964 interface_to_solver_matrix_maps_sm%NUMBER_OF_INTERFACE_MATRICES=0
5966 exits(
"SolverMapping_InterfToSolMatMapsSMInitialise")
5968 999
errors(
"SolverMapping_InterfToSolMatMapsSMInitialise",err,error)
5969 exits(
"SolverMapping_InterfToSolMatMapsSMInitialise")
5983 INTEGER(INTG),
INTENT(OUT) :: ERR
5987 enters(
"SolverMapping_JacColToSolColsMapFinalise",err,error,*999)
5989 IF(
ALLOCATED(jacobian_col_to_solver_cols_map%SOLVER_COLS)) &
5990 &
DEALLOCATE(jacobian_col_to_solver_cols_map%SOLVER_COLS)
5991 IF(
ALLOCATED(jacobian_col_to_solver_cols_map%COUPLING_COEFFICIENTS)) &
5992 &
DEALLOCATE(jacobian_col_to_solver_cols_map%COUPLING_COEFFICIENTS)
5994 exits(
"SolverMapping_JacColToSolColsMapFinalise")
5996 999 errorsexits(
"SolverMapping_JacColToSolColsMapFinalise",err,error)
6010 INTEGER(INTG),
INTENT(OUT) :: ERR
6014 enters(
"SolverMapping_JacColToSolColsMapInitialise",err,error,*999)
6016 jacobian_col_to_solver_cols_map%NUMBER_OF_SOLVER_COLS=0
6018 exits(
"SolverMapping_JacColToSolColsMapInitialise")
6020 999 errorsexits(
"SolverMapping_JacColToSolColsMapInitialise",err,error)
6034 INTEGER(INTG),
INTENT(OUT) :: ERR
6037 INTEGER(INTG) :: column_idx
6039 enters(
"SolverMapping_JacobianToSolverMapFinalise",err,error,*999)
6041 IF(
ASSOCIATED(jacobian_to_solver_map))
THEN 6042 IF(
ALLOCATED(jacobian_to_solver_map%JACOBIAN_COL_TO_SOLVER_COLS_MAP))
THEN 6043 DO column_idx=1,
SIZE(jacobian_to_solver_map%JACOBIAN_COL_TO_SOLVER_COLS_MAP,1)
6045 & jacobian_col_to_solver_cols_map(column_idx),err,error,*999)
6047 DEALLOCATE(jacobian_to_solver_map%JACOBIAN_COL_TO_SOLVER_COLS_MAP)
6051 exits(
"SolverMapping_JacobianToSolverMapFinalise")
6053 999 errorsexits(
"SolverMapping_JacobianToSolverMapFinalise",err,error)
6067 INTEGER(INTG),
INTENT(OUT) :: ERR
6070 INTEGER(INTG) :: DUMMY_ERR
6073 enters(
"SolverMapping_JacobianToSolverMapInitialise",err,error,*998)
6075 IF(
ASSOCIATED(jacobian_to_solver_matrix_map))
THEN 6076 jacobian_to_solver_matrix_map%SOLVER_MATRIX_NUMBER=0
6077 NULLIFY(jacobian_to_solver_matrix_map%JACOBIAN_MATRIX)
6078 NULLIFY(jacobian_to_solver_matrix_map%SOLVER_MATRIX)
6080 CALL flagerror(
"Jacobian to solver matrix map is not associated.",err,error,*999)
6083 exits(
"SolverMapping_JacobianToSolverMapInitialise")
6086 998 errorsexits(
"SolverMapping_JacobianToSolverMapInitialise",err,error)
6100 INTEGER(INTG),
INTENT(OUT) :: ERR
6104 enters(
"SolverMapping_SolverColToDEquationsMapFinalise",err,error,*999)
6106 IF(
ALLOCATED(solver_col_to_dynamic_equations_map%EQUATIONS_MATRIX_NUMBERS)) &
6107 &
DEALLOCATE(solver_col_to_dynamic_equations_map%EQUATIONS_MATRIX_NUMBERS)
6108 IF(
ALLOCATED(solver_col_to_dynamic_equations_map%EQUATIONS_COL_NUMBERS)) &
6109 &
DEALLOCATE(solver_col_to_dynamic_equations_map%EQUATIONS_COL_NUMBERS)
6110 IF(
ALLOCATED(solver_col_to_dynamic_equations_map%COUPLING_COEFFICIENTS)) &
6111 &
DEALLOCATE(solver_col_to_dynamic_equations_map%COUPLING_COEFFICIENTS)
6113 exits(
"SolverMapping_SolverColToDEquationsMapFinalise")
6115 999
errors(
"SolverMapping_SolverColToDEquationsMapFinalise",err,error)
6116 exits(
"SolverMapping_SolverColToDEquationsMapFinalise")
6130 INTEGER(INTG),
INTENT(OUT) :: ERR
6134 enters(
"SolverMapping_SolverColToDEquationsMapInitialise",err,error,*999)
6136 solver_col_to_dynamic_equations_map%NUMBER_OF_DYNAMIC_EQUATIONS_MATRICES=0
6138 exits(
"SolverMapping_SolverColToDEquationsMapInitialise")
6140 999
errors(
"SolverMapping_SolverColToDEquationsMapInitialise",err,error)
6141 exits(
"SolverMapping_SolverColToDEquationsMapInitialise")
6155 INTEGER(INTG),
INTENT(OUT) :: ERR
6159 enters(
"SolverMapping_SolverColToSEquationsMapFinalise",err,error,*999)
6161 IF(
ALLOCATED(solver_col_to_static_equations_map%EQUATIONS_MATRIX_NUMBERS)) &
6162 &
DEALLOCATE(solver_col_to_static_equations_map%EQUATIONS_MATRIX_NUMBERS)
6163 IF(
ALLOCATED(solver_col_to_static_equations_map%EQUATIONS_COL_NUMBERS)) &
6164 &
DEALLOCATE(solver_col_to_static_equations_map%EQUATIONS_COL_NUMBERS)
6165 IF(
ALLOCATED(solver_col_to_static_equations_map%COUPLING_COEFFICIENTS)) &
6166 &
DEALLOCATE(solver_col_to_static_equations_map%COUPLING_COEFFICIENTS)
6168 exits(
"SolverMapping_SolverColToSEquationsMapFinalise")
6170 999
errors(
"SolverMapping_SolverColToSEquationsMapFinalise",err,error)
6171 exits(
"SolverMapping_SolverColToSEquationsMapFinalise")
6185 INTEGER(INTG),
INTENT(OUT) :: ERR
6189 enters(
"SolverMapping_SolverColToSEquationsMapInitialise",err,error,*999)
6191 solver_col_to_static_equations_map%NUMBER_OF_LINEAR_EQUATIONS_MATRICES=0
6192 solver_col_to_static_equations_map%JACOBIAN_COL_NUMBER=0
6193 solver_col_to_static_equations_map%JACOBIAN_COUPLING_COEFFICIENT=0.0_dp
6195 exits(
"SolverMapping_SolverColToSEquationsMapInitialise")
6197 999
errors(
"SolverMapping_SolverColToSEquationsMapInitialise",err,error)
6198 exits(
"SolverMapping_SolverColToSEquationsMapInitialise")
6212 INTEGER(INTG),
INTENT(OUT) :: ERR
6215 INTEGER(INTG) :: col_idx
6217 enters(
"SolverMapping_SolColToEquatsSetMapFinalise",err,error,*999)
6219 IF(
ALLOCATED(solver_col_to_equations_set_map%SOLVER_COL_TO_DYNAMIC_EQUATIONS_MAPS))
THEN 6220 DO col_idx=1,
SIZE(solver_col_to_equations_set_map%SOLVER_COL_TO_DYNAMIC_EQUATIONS_MAPS,1)
6222 & solver_col_to_dynamic_equations_maps(col_idx),err,error,*999)
6224 DEALLOCATE(solver_col_to_equations_set_map%SOLVER_COL_TO_DYNAMIC_EQUATIONS_MAPS)
6225 solver_col_to_equations_set_map%HAVE_DYNAMIC=.false.
6227 IF(
ALLOCATED(solver_col_to_equations_set_map%SOLVER_COL_TO_STATIC_EQUATIONS_MAPS))
THEN 6228 DO col_idx=1,
SIZE(solver_col_to_equations_set_map%SOLVER_COL_TO_STATIC_EQUATIONS_MAPS,1)
6230 & solver_col_to_static_equations_maps(col_idx),err,error,*999)
6232 DEALLOCATE(solver_col_to_equations_set_map%SOLVER_COL_TO_STATIC_EQUATIONS_MAPS)
6233 solver_col_to_equations_set_map%HAVE_STATIC=.false.
6236 exits(
"SolverMapping_SolColToEquatsSetMapFinalise")
6238 999 errorsexits(
"SolverMapping_SolColToEquatsSetMapFinalise",err,error)
6251 INTEGER(INTG),
INTENT(OUT) :: ERR
6255 enters(
"SolverMapping_SolColToEquatsSetMapInitialise",err,error,*999)
6257 NULLIFY(solver_col_to_equations_set_map%EQUATIONS)
6258 solver_col_to_equations_set_map%HAVE_DYNAMIC=.false.
6259 solver_col_to_equations_set_map%HAVE_STATIC=.false.
6261 exits(
"SolverMapping_SolColToEquatsSetMapInitialise")
6263 999
errors(
"SolverMapping_SolColToEquatsSetMapInitialise",err,error)
6264 exits(
"SolverMapping_SolColToEquatsSetMapInitialise")
6278 INTEGER(INTG),
INTENT(OUT) :: ERR
6281 INTEGER(INTG) :: col_idx,equations_set_idx
6283 enters(
"SolverMapping_SolColToEquationsMapsFinalise",err,error,*999)
6285 IF(
ALLOCATED(solver_col_to_equations_maps%SOLVER_COL_TO_EQUATIONS_SET_MAPS))
THEN 6286 DO equations_set_idx=1,
SIZE(solver_col_to_equations_maps%SOLVER_COL_TO_EQUATIONS_SET_MAPS,1)
6288 solver_col_to_equations_set_maps(equations_set_idx),err,error,*999)
6290 DEALLOCATE(solver_col_to_equations_maps%SOLVER_COL_TO_EQUATIONS_SET_MAPS)
6292 IF(
ALLOCATED(solver_col_to_equations_maps%SOLVER_DOF_TO_VARIABLE_MAPS))
THEN 6293 DO col_idx=1,
SIZE(solver_col_to_equations_maps%SOLVER_DOF_TO_VARIABLE_MAPS,1)
6295 & col_idx),err,error,*999)
6297 DEALLOCATE(solver_col_to_equations_maps%SOLVER_DOF_TO_VARIABLE_MAPS)
6301 exits(
"SolverMapping_SolColToEquationsMapsFinalise")
6303 999 errorsexits(
"SolverMapping_SolColToEquationsMapsFinalise",err,error)
6317 INTEGER(INTG),
INTENT(OUT) :: ERR
6321 enters(
"SolverMapping_SolColToEquationsMapsInitialise",err,error,*999)
6323 solver_col_to_equations_maps%SOLVER_MATRIX_NUMBER=0
6324 NULLIFY(solver_col_to_equations_maps%SOLVER_MATRIX)
6325 NULLIFY(solver_col_to_equations_maps%SOLVER_MAPPING)
6326 solver_col_to_equations_maps%NUMBER_OF_COLUMNS=0
6327 solver_col_to_equations_maps%NUMBER_OF_DOFS=0
6328 solver_col_to_equations_maps%TOTAL_NUMBER_OF_DOFS=0
6329 solver_col_to_equations_maps%NUMBER_OF_GLOBAL_DOFS=0
6330 NULLIFY(solver_col_to_equations_maps%COLUMN_DOFS_MAPPING)
6332 exits(
"SolverMapping_SolColToEquationsMapsInitialise")
6334 999
errors(
"SolverMapping_SolColToEquationsMapsInitialise",err,error)
6335 exits(
"SolverMapping_SolColToEquationsMapsInitialise")
6349 INTEGER(INTG),
INTENT(OUT) :: ERR
6352 INTEGER(INTG) :: column_idx
6354 enters(
"SolverMapping_SolColToInterfMapFinalise",err,error,*999)
6356 NULLIFY(solver_col_to_interface_map%INTERFACE_EQUATIONS)
6357 IF(
ALLOCATED(solver_col_to_interface_map%SOLVER_COL_TO_INTERFACE_EQUATIONS_MAPS))
THEN 6358 DO column_idx=1,
SIZE(solver_col_to_interface_map%SOLVER_COL_TO_INTERFACE_EQUATIONS_MAPS,1)
6360 & solver_col_to_interface_equations_maps(column_idx),err,error,*999)
6362 DEALLOCATE(solver_col_to_interface_map%SOLVER_COL_TO_INTERFACE_EQUATIONS_MAPS)
6365 exits(
"SolverMapping_SolColToInterfMapFinalise")
6367 999 errorsexits(
"SolverMapping_SolColToInterfMapFinalise",err,error)
6380 INTEGER(INTG),
INTENT(OUT) :: ERR
6384 enters(
"SolverMapping_SolColToInterfMapInitialise",err,error,*999)
6386 NULLIFY(solver_col_to_interface_map%INTERFACE_EQUATIONS)
6388 exits(
"SolverMapping_SolColToInterfMapInitialise")
6390 999
errors(
"SolverMapping_SolColToInterfMapInitialise",err,error)
6391 exits(
"SolverMapping_SolColToInterfMapInitialise")
6405 INTEGER(INTG),
INTENT(OUT) :: ERR
6409 enters(
"SolverMapping_SolColToInterfEquatsMapFinalise",err,error,*999)
6411 solver_col_to_interface_equations_map%NUMBER_OF_INTERFACE_MATRICES=0
6412 IF(
ALLOCATED(solver_col_to_interface_equations_map%INTERFACE_MATRIX_NUMBERS)) &
6413 &
DEALLOCATE(solver_col_to_interface_equations_map%INTERFACE_MATRIX_NUMBERS)
6414 IF(
ALLOCATED(solver_col_to_interface_equations_map%INTERFACE_COL_NUMBERS)) &
6415 &
DEALLOCATE(solver_col_to_interface_equations_map%INTERFACE_COL_NUMBERS)
6416 IF(
ALLOCATED(solver_col_to_interface_equations_map%COUPLING_COEFFICIENTS)) &
6417 &
DEALLOCATE(solver_col_to_interface_equations_map%COUPLING_COEFFICIENTS)
6419 exits(
"SolverMapping_SolColToInterfEquatsMapFinalise")
6421 999
errors(
"SolverMapping_SolColToInterfEquatsMapFinalise",err,error)
6422 exits(
"SolverMapping_SolColToInterfEquatsMapFinalise")
6436 INTEGER(INTG),
INTENT(OUT) :: ERR
6440 enters(
"SolverMapping_SolColToInterfEquatsMapInitialise",err,error,*999)
6442 solver_col_to_interface_equations_map%NUMBER_OF_INTERFACE_MATRICES=0
6444 exits(
"SolverMapping_SolColToInterfEquatsMapInitialise")
6446 999
errors(
"SolverMapping_SolColToInterfEquatsMapInitialise",err,error)
6447 exits(
"SolverMapping_SolColToInterfEquatsMapInitialise")
6461 INTEGER(INTG),
INTENT(OUT) :: ERR
6465 enters(
"SolverMapping_SolverDofToVariableMapFinalise",err,error,*999)
6467 IF(
ALLOCATED(solver_dof_to_variable_map%EQUATIONS_TYPES))
DEALLOCATE(solver_dof_to_variable_map%EQUATIONS_TYPES)
6468 IF(
ALLOCATED(solver_dof_to_variable_map%EQUATIONS_INDICES))
DEALLOCATE(solver_dof_to_variable_map%EQUATIONS_INDICES)
6469 IF(
ALLOCATED(solver_dof_to_variable_map%VARIABLE))
DEALLOCATE(solver_dof_to_variable_map%VARIABLE)
6470 IF(
ALLOCATED(solver_dof_to_variable_map%VARIABLE_DOF))
DEALLOCATE(solver_dof_to_variable_map%VARIABLE_DOF)
6471 IF(
ALLOCATED(solver_dof_to_variable_map%VARIABLE_COEFFICIENT))
DEALLOCATE(solver_dof_to_variable_map%VARIABLE_COEFFICIENT)
6472 IF(
ALLOCATED(solver_dof_to_variable_map%ADDITIVE_CONSTANT))
DEALLOCATE(solver_dof_to_variable_map%ADDITIVE_CONSTANT)
6474 exits(
"SolverMapping_SolverDofToVariableMapFinalise")
6476 999
errors(
"SolverMapping_SolverDofToVariableMapFinalise",err,error)
6477 exits(
"SolverMapping_SolverDofToVariableMapFinalise")
6491 INTEGER(INTG),
INTENT(OUT) :: ERR
6495 enters(
"SolverMapping_SolverDofToVariableMapInitialise",err,error,*999)
6497 solver_dof_to_variable_map%NUMBER_OF_EQUATION_DOFS=0
6499 exits(
"SolverMapping_SolverDofToVariableMapInitialise")
6501 999
errors(
"SolverMapping_SolverDofToVariableMapInitialise",err,error)
6502 exits(
"SolverMapping_SolverDofToVariableMapInitialise")
6516 INTEGER(INTG),
INTENT(IN) :: NUMBER_OF_SOLVER_MATRICES
6517 INTEGER(INTG),
INTENT(OUT) :: ERR
6520 INTEGER(INTG) :: equations_set_idx,matrix_idx,MAXIMUM_NUMBER_OF_EQUATIONS_MATRICES
6521 INTEGER(INTG),
ALLOCATABLE :: OLD_MATRIX_VARIABLE_TYPES(:,:,:)
6528 enters(
"SOLVER_MAPPING_SOLVER_MATRICES_NUMBER_SET",err,error,*999)
6530 IF(
ASSOCIATED(solver_mapping))
THEN 6531 IF(solver_mapping%SOLVER_MAPPING_FINISHED)
THEN 6532 CALL flagerror(
"Solver mappings has been finished",err,error,*999)
6534 IF(
ASSOCIATED(solver_mapping%CREATE_VALUES_CACHE))
THEN 6535 maximum_number_of_equations_matrices=1
6536 DO equations_set_idx=1,solver_mapping%NUMBER_OF_EQUATIONS_SETS
6537 equations_set=>solver_mapping%EQUATIONS_SETS(equations_set_idx)%PTR
6538 equations=>equations_set%EQUATIONS
6539 equations_mapping=>equations%EQUATIONS_MAPPING
6540 linear_mapping=>equations_mapping%LINEAR_MAPPING
6541 IF(
ASSOCIATED(linear_mapping))
THEN 6542 IF(linear_mapping%NUMBER_OF_LINEAR_EQUATIONS_MATRICES>maximum_number_of_equations_matrices) &
6543 & maximum_number_of_equations_matrices=linear_mapping%NUMBER_OF_LINEAR_EQUATIONS_MATRICES
6547 IF(number_of_solver_matrices>0.AND.number_of_solver_matrices<=maximum_number_of_equations_matrices)
THEN 6549 IF(number_of_solver_matrices/=solver_mapping%NUMBER_OF_SOLVER_MATRICES)
THEN 6550 ALLOCATE(old_matrix_variable_types(0:field_number_of_variable_types, &
6551 & solver_mapping%NUMBER_OF_EQUATIONS_SETS,solver_mapping%NUMBER_OF_SOLVER_MATRICES),stat=err)
6552 IF(err/=0)
CALL flagerror(
"Could not allocate old matrix variable types",err,error,*999)
6553 old_matrix_variable_types(0:field_number_of_variable_types,1:solver_mapping%NUMBER_OF_EQUATIONS_SETS, &
6554 & 1:solver_mapping%NUMBER_OF_SOLVER_MATRICES)=solver_mapping%CREATE_VALUES_CACHE%MATRIX_VARIABLE_TYPES( &
6555 & 0:field_number_of_variable_types,1:solver_mapping%NUMBER_OF_EQUATIONS_SETS, &
6556 & 1:solver_mapping%NUMBER_OF_SOLVER_MATRICES)
6557 DEALLOCATE(solver_mapping%CREATE_VALUES_CACHE%MATRIX_VARIABLE_TYPES)
6558 ALLOCATE(solver_mapping%CREATE_VALUES_CACHE%MATRIX_VARIABLE_TYPES(0:field_number_of_variable_types, &
6559 & solver_mapping%NUMBER_OF_EQUATIONS_SETS,number_of_solver_matrices),stat=err)
6560 IF(err/=0)
CALL flagerror(
"Could not allocate matrix variable types",err,error,*999)
6561 IF(number_of_solver_matrices>solver_mapping%NUMBER_OF_SOLVER_MATRICES)
THEN 6562 solver_mapping%CREATE_VALUES_CACHE%MATRIX_VARIABLE_TYPES(:,:,1:solver_mapping%NUMBER_OF_SOLVER_MATRICES)= &
6563 & old_matrix_variable_types(:,:,1:solver_mapping%NUMBER_OF_SOLVER_MATRICES)
6564 DO matrix_idx=solver_mapping%NUMBER_OF_SOLVER_MATRICES+1,number_of_solver_matrices
6565 solver_mapping%CREATE_VALUES_CACHE%MATRIX_VARIABLE_TYPES(0,:,matrix_idx)=1
6566 solver_mapping%CREATE_VALUES_CACHE%MATRIX_VARIABLE_TYPES(1,:,matrix_idx)=field_u_variable_type
6567 solver_mapping%CREATE_VALUES_CACHE%MATRIX_VARIABLE_TYPES(2:field_number_of_variable_types,:,matrix_idx)=0
6570 solver_mapping%CREATE_VALUES_CACHE%MATRIX_VARIABLE_TYPES(:,:,1:number_of_solver_matrices)= &
6571 & old_matrix_variable_types(:,:,1:number_of_solver_matrices)
6573 solver_mapping%NUMBER_OF_SOLVER_MATRICES=number_of_solver_matrices
6574 IF(
ALLOCATED(old_matrix_variable_types))
DEALLOCATE(old_matrix_variable_types)
6577 local_error=
"The specified number of solver matrices of "// &
6579 &
" is invalid. The number must be >= 1 and <= "// &
6581 CALL flagerror(local_error,err,error,*999)
6584 CALL flagerror(
"Solver mapping create values cache is not associated",err,error,*999)
6588 CALL flagerror(
"Solver mapping is not associated",err,error,*999)
6591 exits(
"SOLVER_MAPPING_SOLVER_MATRICES_NUMBER_SET")
6593 999
IF(
ALLOCATED(old_matrix_variable_types))
DEALLOCATE(old_matrix_variable_types)
6594 errorsexits(
"SOLVER_MAPPING_SOLVER_MATRICES_NUMBER_SET",err,error)
6607 INTEGER(INTG),
INTENT(OUT) :: ERR
6611 enters(
"SolverMapping_SolRowToEquationsMapsFinalise",err,error,*999)
6613 solver_row_to_equations_maps%NUMBER_OF_EQUATIONS_SET_ROWS=0
6614 solver_row_to_equations_maps%INTERFACE_CONDITION_INDEX=0
6615 IF(
ALLOCATED(solver_row_to_equations_maps%EQUATIONS_INDEX)) &
6616 &
DEALLOCATE(solver_row_to_equations_maps%EQUATIONS_INDEX)
6617 IF(
ALLOCATED(solver_row_to_equations_maps%ROWCOL_NUMBER)) &
6618 &
DEALLOCATE(solver_row_to_equations_maps%ROWCOL_NUMBER)
6619 IF(
ALLOCATED(solver_row_to_equations_maps%COUPLING_COEFFICIENTS)) &
6620 &
DEALLOCATE(solver_row_to_equations_maps%COUPLING_COEFFICIENTS)
6622 exits(
"SolverMapping_SolRowToEquationsMapsFinalise")
6624 999 errorsexits(
"SolverMapping_SolRowToEquationsMapsFinalise",err,error)
6638 INTEGER(INTG),
INTENT(OUT) :: ERR
6642 enters(
"SolverMapping_SolRowToEquationsMapsInitialise",err,error,*999)
6644 solver_row_to_equations_maps%NUMBER_OF_EQUATIONS_SET_ROWS=0
6645 solver_row_to_equations_maps%INTERFACE_CONDITION_INDEX=0
6647 exits(
"SolverMapping_SolRowToEquationsMapsInitialise")
6649 999
errors(
"SolverMapping_SolRowToEquationsMapsInitialise",err,error)
6650 exits(
"SolverMapping_SolRowToEquationsMapsInitialise")
6664 INTEGER(INTG),
INTENT(OUT) :: ERR
6668 enters(
"SOLVER_MAPPING_VARIABLE_FINALISE",err,error,*999)
6670 NULLIFY(solver_mapping_variable%VARIABLE)
6671 solver_mapping_variable%VARIABLE_TYPE=0
6672 solver_mapping_variable%NUMBER_OF_EQUATIONS=0
6673 IF(
ALLOCATED(solver_mapping_variable%EQUATION_TYPES))
DEALLOCATE(solver_mapping_variable%EQUATION_TYPES)
6674 IF(
ALLOCATED(solver_mapping_variable%EQUATION_INDICES))
DEALLOCATE(solver_mapping_variable%EQUATION_INDICES)
6676 exits(
"SOLVER_MAPPING_VARIABLE_FINALISE")
6678 999 errorsexits(
"SOLVER_MAPPING_VARIABLE_FINALISE",err,error)
6691 INTEGER(INTG),
INTENT(OUT) :: ERR
6695 enters(
"SOLVER_MAPPING_VARIABLE_INITIALISE",err,error,*999)
6697 NULLIFY(solver_mapping_variable%VARIABLE)
6698 solver_mapping_variable%VARIABLE_TYPE=0
6699 solver_mapping_variable%NUMBER_OF_EQUATIONS=0
6701 exits(
"SOLVER_MAPPING_VARIABLE_INITIALISE")
6703 999 errorsexits(
"SOLVER_MAPPING_VARIABLE_INITIALISE",err,error)
6716 INTEGER(INTG),
INTENT(OUT) :: ERR
6719 INTEGER(INTG) :: variable_idx
6721 enters(
"SOLVER_MAPPING_VARIABLES_FINALISE",err,error,*999)
6723 solver_mapping_variables%NUMBER_OF_VARIABLES=0
6724 DO variable_idx=1,
SIZE(solver_mapping_variables%VARIABLES,1)
6728 exits(
"SOLVER_MAPPING_VARIABLES_FINALISE")
6730 999 errorsexits(
"SOLVER_MAPPING_VARIABLES_FINALISE",err,error)
6743 INTEGER(INTG),
INTENT(OUT) :: ERR
6747 enters(
"SOLVER_MAPPING_VARIABLES_INITIALISE",err,error,*999)
6749 solver_mapping_variables%NUMBER_OF_VARIABLES=0
6751 exits(
"SOLVER_MAPPING_VARIABLES_INITIALISE")
6753 999 errorsexits(
"SOLVER_MAPPING_VARIABLES_INITIALISE",err,error)
6766 INTEGER(INTG),
INTENT(OUT) :: ERR
6770 enters(
"SolverMapping_VariableToSolverColMapFinalise",err,error,*999)
6772 IF(
ALLOCATED(variable_to_solver_col_map%COLUMN_NUMBERS))
DEALLOCATE(variable_to_solver_col_map%COLUMN_NUMBERS)
6773 IF(
ALLOCATED(variable_to_solver_col_map%COUPLING_COEFFICIENTS))
DEALLOCATE(variable_to_solver_col_map%COUPLING_COEFFICIENTS)
6774 IF(
ALLOCATED(variable_to_solver_col_map%ADDITIVE_CONSTANTS))
DEALLOCATE(variable_to_solver_col_map%ADDITIVE_CONSTANTS)
6776 exits(
"SolverMapping_VariableToSolverColMapFinalise")
6778 999
errors(
"SolverMapping_VariableToSolverColMapFinalise",err,error)
6779 exits(
"SolverMapping_VariableToSolverColMapFinalise")
6793 INTEGER(INTG),
INTENT(OUT) :: ERR
6797 enters(
"SolverMapping_VariableToSolverColMapInitialise",err,error,*999)
6801 exits(
"SolverMapping_VariableToSolverColMapInitialise")
6803 999
errors(
"SolverMapping_VariableToSolverColMapInitialise",err,error)
6804 exits(
"SolverMapping_VariableToSolverColMapInitialise")
6819 INTEGER(INTG),
INTENT(OUT) :: couplingIndex
6820 INTEGER(INTG),
INTENT(OUT) :: err
6823 INTEGER(INTG) :: newSize
6826 enters(
"SolverDofCouplings_AddCoupling",err,error,*998)
6828 IF(solverdofcouplings%numberOfCouplings+1>solverdofcouplings%capacity)
THEN 6830 IF(solverdofcouplings%capacity==0)
THEN 6833 newsize=solverdofcouplings%capacity*2
6835 ALLOCATE(newdofcouplings(newsize),stat=err)
6836 IF(err/=0)
CALL flagerror(
"Could not allocate new DOF couplings array.",err,error,*999)
6837 IF(solverdofcouplings%capacity>0)
THEN 6838 newdofcouplings(1:solverdofcouplings%numberOfCouplings)= &
6839 & solverdofcouplings%dofCouplings(1:solverdofcouplings%numberOfCouplings)
6841 solverdofcouplings%capacity=newsize
6842 CALL move_alloc(newdofcouplings,solverdofcouplings%dofCouplings)
6845 solverdofcouplings%dofCouplings(solverdofcouplings%numberOfCouplings+1)%ptr=>coupling
6846 solverdofcouplings%numberOfCouplings=solverdofcouplings%numberOfCouplings+1
6847 couplingindex=solverdofcouplings%numberOfCouplings
6849 exits(
"SolverDofCouplings_AddCoupling")
6851 999
IF(
ALLOCATED(newdofcouplings))
DEALLOCATE(newdofcouplings)
6852 998 errorsexits(
"SolverDofCouplings_AddCoupling",err,error)
6866 INTEGER(INTG),
INTENT(OUT) :: err
6869 enters(
"SolverDofCouplings_Finalise",err,error,*999)
6871 IF(
ALLOCATED(solverdofcouplings%dofCouplings))
THEN 6874 DEALLOCATE(solverdofcouplings%dofCouplings)
6876 solverdofcouplings%numberOfCouplings=0
6877 solverdofcouplings%capacity=0
6879 exits(
"SolverDofCouplings_Finalise")
6881 999 errorsexits(
"SolverDofCouplings_Finalise",err,error)
6895 INTEGER(INTG),
INTENT(OUT) :: err
6898 enters(
"SolverDofCouplings_Initialise",err,error,*999)
6900 solverdofcouplings%numberOfCouplings=0
6901 solverdofcouplings%capacity=0
6903 exits(
"SolverDofCouplings_Initialise")
6905 999 errorsexits(
"SolverDofCouplings_Initialise",err,error)
subroutine solvermapping_solverdoftovariablemapinitialise(SOLVER_DOF_TO_VARIABLE_MAP, ERR, ERROR,)
Initialises the solver dof to variable mapping.
Contains information on the boundary conditions for the solver equations.
subroutine, public enters(NAME, ERR, ERROR,)
Records the entry into the named procedure and initialises the error code.
subroutine solver_mapping_create_values_cache_finalise(CREATE_VALUES_CACHE, ERR, ERROR,)
Finalises a solver mapping create values cache and deallocates all memory.
integer, parameter ptr
Pointer integer kind.
subroutine solvermapping_equationstosolvermapsfinalise(EQUATIONS_TO_SOLVER_MAP, ERR, ERROR,)
Finalises a equations set to solver matrix map and deallocates all memory.
Contains information on the equations mapping i.e., how field variable DOFS are mapped to the rows an...
Contains information about the equations in an equations set.
subroutine solvermapping_jacobiantosolvermapinitialise(JACOBIAN_TO_SOLVER_MATRIX_MAP, ERR, ERROR,)
Initialises a Jacobian to solver maps.
subroutine solvermapping_interfrowtosolrowsmapinitialise(INTERFACE_ROW_TO_SOLVER_ROWS_MAP, ERR, ERROR,)
Initialises am interface row to solver row map.
subroutine, public list_key_dimension_set(LIST, KEY_DIMENSION, ERR, ERROR,)
Sets/changes the key dimension (i.e., the dimension for searching and sorting) for a list...
This module handles all problem wide constants.
Converts a number to its equivalent varying string representation.
subroutine solvermapping_equationstosolverinterfaceinitialise(EQUATIONS_TO_SOLVER_INTERFACE_MAP, ERR, ERROR,)
Initialises a equations set to solver matrix interface map.
Contains information about mapping the solver dof to the field variable dofs in the equations set...
integer(intg), parameter, public boundary_condition_dof_free
The dof is free.
subroutine solvermapping_interftosolmatmapsiminitialise(INTERFACE_TO_SOLVER_MATRIX_MAPS_IM, ERR, ERROR,)
Initialises an interface to solver matrix maps im.
Contains information on the mappings from a solver row to the equations.
subroutine solvermapping_interfrowtosolrowsmapfinalise(INTERFACE_ROW_TO_SOLVER_ROWS_MAP, ERR, ERROR,)
Finalises a interface row to solver row map and deallocates all memory.
subroutine solvermapping_solverdoftovariablemapfinalise(SOLVER_DOF_TO_VARIABLE_MAP, ERR, ERROR,)
Finalises the solver dof to variable mapping and deallocates all memory.
Contains information about the mappings from a solver matrix to the equations in an equations set...
Contains information on the interface to solver matrix mappings when indexing by solver matrix number...
subroutine solvermapping_equationssettosolvermapfinalise(EQUATIONS_SET_TO_SOLVER_MAP, ERR, ERROR,)
Finalises a equations set to solver map and deallocates all memory.
integer(intg), parameter interface_condition_lagrange_multipliers_method
Lagrange multipliers interface condition method.
integer, parameter intg
Standard integer kind.
Contains information about the mapping from a solver matrix column to dynamic equations matrices and ...
subroutine solvermapping_interfacetosolverequationsfinalise(INTERFACE_TO_SOLVER_EQUATIONS_MAPS, ERR, ERROR,)
Finalises an interface to solver matrix equations map and deallocates all memory. ...
integer(intg), parameter equations_static
The equations are static and have no time dependence.
Contains information on an equations set.
subroutine solvermapping_equatscoltosolcolsmapfinalise(EQUATIONS_COL_TO_SOLVER_COLS_MAP, ERR, ERROR,)
Finalises a equations column to solver columns map and deallocates all memory.
subroutine solvermapping_equatstosolmatmapsemfinalise(EQUATIONS_TO_SOLVER_MATRIX_MAPS_EM, ERR, ERROR,)
Finalises a equations set to solver matrix map em and deallocates all memory.
This module contains all string manipulation and transformation routines.
subroutine, public list_number_of_items_get(LIST, NUMBER_OF_ITEMS, ERR, ERROR,)
Gets the current number of items in a list.
subroutine solvermapping_interftosolmatmapssmfinalise(INTERFACE_TO_SOLVER_MATRIX_MAPS_SM, ERR, ERROR,)
Finalises an interface to solver matrix map sm and deallocates all memory.
Contains information for a matrix.
Sorts a list into ascending order.
subroutine solvermapping_variabletosolvercolmapfinalise(VARIABLE_TO_SOLVER_COL_MAP, ERR, ERROR,)
Finalises a variable to solver column map and deallocates all memory.
Contains information for the interface condition data.
subroutine solvermapping_solcoltoequationsmapsfinalise(SOLVER_COL_TO_EQUATIONS_MAPS, ERR, ERROR,)
Finalises the solver column to equations map and deallocates all memory.
subroutine solvermapping_interfcoltosolrowsmapfinalise(INTERFACE_COLUMN_TO_SOLVER_ROWS_MAP, ERR, ERROR,)
Finalises a interface column to solver row map and deallocates all memory.
subroutine, public solver_mapping_solver_matrices_number_set(SOLVER_MAPPING, NUMBER_OF_SOLVER_MATRICES, ERR, ERROR,)
Sets/changes the number of solver matrices for the solver mapping.
integer(intg), parameter, public list_intg_type
Integer data type for a list.
Contains information for a field defined on a region.
logical, save, public diagnostics2
.TRUE. if level 2 diagnostic output is active in the current routine
This module provides an iso_varying_string module, conformant to the API specified in ISO/IEC 1539-2:...
This module handles all solver mapping routines.
subroutine, public list_remove_duplicates(LIST, ERR, ERROR,)
Removes duplicate entries from a list. A side effect of this is that the list is sorted.
Contains information on an interface mapping. TODO: Generalise to non-Lagrange multipler mappings...
integer(intg), parameter interface_condition_augmented_lagrange_method
Augmented Lagrange multiplers interface condition method.
Contains information about the mapping from a solver matrix column to static equations matrices and v...
Contains information for mapping field variables to the dynamic matrices in the equations set of the ...
subroutine solver_mapping_variables_finalise(SOLVER_MAPPING_VARIABLES, ERR, ERROR,)
Finalises the solver mapping variables and deallocates all memory.
integer(intg), parameter, public solver_mapping_equations_linear_matrix
The equations matrix in the solver mapping is a linear equations matrix.
subroutine solvermapping_createvaluescacheeqnvarlistadd(SOLVER_MAPPING, solver_matrix_idx, equations_set_idx, variable_type, ERR, ERROR,)
Adds a variable type from an equations set dependent field to the list of variables for a particular ...
integer(intg), parameter solver_equations_nonlinear
Solver equations are nonlinear.
subroutine solvermapping_solrowtoequationsmapsfinalise(SOLVER_ROW_TO_EQUATIONS_MAPS, ERR, ERROR,)
Finalises a solver row to equations map and deallocates all memory.
integer(intg), parameter, public domain_local_ghost
The domain item is ghosted from another domain.
subroutine solvermapping_jaccoltosolcolsmapinitialise(JACOBIAN_COL_TO_SOLVER_COLS_MAP, ERR, ERROR,)
Initialises an Jacobian column to solver columns map.
subroutine solvermapping_interfconditiontosolvermapfinalise(INTERFACE_CONDITION_TO_SOLVER_MAP, ERR, ERROR,)
Finalises an interface condition to solver map and deallocates all memory.
Contains information about the dependent field information for an interface condition.
Detaches the list values from a list and returns them as a pointer to a array of base type before des...
subroutine solvermapping_solcoltointerfmapinitialise(SOLVER_COL_TO_INTERFACE_MAP, ERR, ERROR,)
Initialises the solver column to interface mapping.
subroutine, public solver_mapping_destroy(SOLVER_MAPPING, ERR, ERROR,)
Destroy a solver mapping.
integer(intg), parameter equations_second_order_dynamic
The equations are a second order dynamic.
integer(intg), parameter solver_mapping_equations_nonlinear_matrix
The equations matrix in the solver mapping is a nonlinear equations (Jacobian) matrix.
integer(intg), parameter equations_first_order_dynamic
The equations are first order dynamic.
subroutine solvermapping_equatstosolmatmapssminitialise(EQUATIONS_TO_SOLVER_MATRIX_MAPS_SM, ERR, ERROR,)
Initialises an equations to solver matrix maps sm.
Contains information on the boundary conditions for a dependent field variable.
A pointer to the coupled equations DOF information for the DOF constraints.
Contains information on the equations to solver matrix mappings when indexing by equations matrix num...
A buffer type to allow for an array of pointers to a EQUATIONS_SET_TYPE.
subroutine solvermapping_equatstosolmatmapseminitialise(EQUATIONS_TO_SOLVER_MATRIX_MAPS_EM, ERR, ERROR,)
Initialises an equations to solver matrix maps em.
Contains information on the equations mapping for a source i.e., how a field variable is mapped to th...
Contains information about the mappings from a solver matrix to the equations in an equations set...
Contains information on the mapping from the equations rows in an equations set to the solver rows...
subroutine, public exits(NAME)
Records the exit out of the named procedure.
This module contains all type definitions in order to avoid cyclic module references.
Contains information on the equations mapping for nonlinear matrices i.e., how a field variable is ma...
The coupled equations DOF information for the DOF constraints. The BoundaryConditionsDofConstraintTyp...
This module contains all the low-level base routines e.g., all debug, control, and low-level communic...
subroutine solvermapping_solvercoltosequationsmapfinalise(SOLVER_COL_TO_STATIC_EQUATIONS_MAP, ERR, ERROR,)
Finalises the solver column to static equations map and deallocates all memory.
subroutine solvermapping_interfacetosolvermapsfinalise(INTERFACE_TO_SOLVER_MAPS, ERR, ERROR,)
Finalises an interface to solver matrix maps and deallocates all memory.
subroutine solvermapping_solvercoltosequationsmapinitialise(SOLVER_COL_TO_STATIC_EQUATIONS_MAP, ERR, ERROR,)
Initialises the solver column to static equations mapping and deallocates all memory.
subroutine, public domain_mappings_local_from_global_calculate(DOMAIN_MAPPING, ERR, ERROR,)
Calculates the domain mappings local map from a domain mappings global map.
subroutine, public list_create_finish(LIST, ERR, ERROR,)
Finishes the creation of a list created with LIST_CREATE_START.
integer(intg), parameter interface_condition_penalty_method
Penalty interface condition method.
subroutine solvermapping_createvaluescacheinterfvarlistadd(SOLVER_MAPPING, solver_matrix_idx, interface_condition_idx, variable_type, ERR, ERROR,)
Adds a variable type from an interface condition Lagrange field to the list of variables for a partic...
Contains information on the equations to solver matrix mappings when indexing by solver matrix number...
Contains information on the mappings from an equations set to the solver matrices.
subroutine solver_mapping_variables_initialise(SOLVER_MAPPING_VARIABLES, ERR, ERROR,)
Initialises the solver mapping variables and deallocates all memory.
subroutine, public solver_mapping_equations_set_add(SOLVER_MAPPING, EQUATIONS_SET, EQUATIONS_SET_INDEX, ERR, ERROR,)
Adds an equations set to a solver mapping.
Contains information on a list.
subroutine solver_mapping_variable_finalise(SOLVER_MAPPING_VARIABLE, ERR, ERROR,)
Finalises the solver mapping variable and deallocates all memory.
subroutine solvermapping_interfcoltosolrowsmapinitialise(INTERFACE_COLUMN_TO_SOLVER_ROWS_MAP, ERR, ERROR,)
Initialises am interface column to solver row map.
integer(intg), parameter, public solver_mapping_equations_equations_set
The equations in the solver mapping is from an equations set.
subroutine solvermapping_interfacetosolvermapfinalise(INTERFACE_CONDITION_TO_SOLVER_MAP, ERR, ERROR,)
Finalises a interface condition to solver map and deallocates all memory.
This module contains all computational environment variables.
subroutine solvermapping_variabletosolvercolmapinitialise(VARIABLE_TO_SOLVER_COL_MAP, ERR, ERROR,)
Initialises a variable to solver column map.
subroutine solvermapping_interfconditiontosolvermapinitialise(INTERFACE_CONDITION_TO_SOLVER_MAP, ERR, ERROR,)
Initialises an interface condition to solver map.
subroutine solvermapping_equatstosolmatmapsjmfinalise(EQUATIONS_TO_SOLVER_MATRIX_MAPS_JM, ERR, ERROR,)
Finalises a equations set to solver matrix map jm and deallocates all memory.
subroutine solvermapping_equationstosolverinterfacefinalise(EQUATIONS_TO_SOLVER_INTERFACE_MAP, ERR, ERROR,)
Finalises a equations set to solver matrix map and deallocates all memory.
This module handles all domain mappings routines.
subroutine solvermapping_interftosolmatmapsimfinalise(INTERFACE_TO_SOLVER_MATRIX_MAPS_IM, ERR, ERROR,)
Finalises an interface to solver matrix map im and deallocates all memory.
Contains information about the cached create values for a solver mapping.
subroutine, public solver_mapping_create_finish(SOLVER_MAPPING, ERR, ERROR,)
Finishes the process of creating a solver mapping.
Contains information about the solver equations for a solver.
Contains information on the interface to solver matrix mappings when indexing by interface matrix num...
type(computational_environment_type), target, public computational_environment
The computational environment the program is running in.
integer(intg), parameter, public domain_local_internal
The domain item is internal to the domain.
subroutine, public domain_mappings_mapping_initialise(DOMAIN_MAPPING, NUMBER_OF_DOMAINS, ERR, ERROR,)
Initialises the mapping for a domain mappings mapping.
Contains information on the mappings between field variable dofs inequations and the solver matrix co...
integer(intg), parameter equations_linear
The equations are linear.
subroutine, public list_data_dimension_set(LIST, DATA_DIMENSION, ERR, ERROR,)
Sets/changes the data dimension for a list.
subroutine solvermapping_createvaluescacheinitialise(SOLVER_MAPPING, ERR, ERROR,)
Initialises a solver mapping create values cache.
subroutine solvermapping_solcoltointerfequatsmapfinalise(SOLVER_COL_TO_INTERFACE_EQUATIONS_MAP, ERR, ERROR,)
Finalises the solver column to interface equations map and deallocates all memory.
logical, save, public diagnostics1
.TRUE. if level 1 diagnostic output is active in the current routine
A buffer type to allow for an array of pointers to a INTERFACE_CONDITION_TYPE.
This module handles all distributed matrix vector routines.
This module defines all constants shared across interface condition routines.
subroutine solvermapping_solcoltoequatssetmapfinalise(SOLVER_COL_TO_EQUATIONS_SET_MAP, ERR, ERROR,)
Finalises the solver column to equations set map and deallocates all memory.
This module handles all boundary conditions routines.
integer(intg), parameter interface_condition_point_to_point_method
Point to point interface condition method.
subroutine solverdofcouplings_finalise(solverDofCouplings, err, error,)
Initialise the list of solver row or column couplings.
subroutine solvermapping_equationssettosolvermapinitialise(EQUATIONS_SET_TO_SOLVER_MAP, ERR, ERROR,)
Initialises a equations set to solver map.
subroutine solver_mapping_calculate(SOLVER_MAPPING, ERR, ERROR,)
Calculates the solver mappings.
Contains information about an equations matrix.
subroutine, public solver_mapping_interface_condition_add(SOLVER_MAPPING, INTERFACE_CONDITION, INTERFACE_CONDITION_INDEX, ERR, ERROR,)
Adds an interface condition to a solver mapping.
subroutine, public domain_mappings_mapping_finalise(DOMAIN_MAPPING, ERR, ERROR,)
Finalises the mapping for a domain mappings mapping and deallocates all memory.
subroutine solverdofcouplings_initialise(solverDofCouplings, err, error,)
Initialise the list of solver row or column couplings.
subroutine solvermapping_solcoltointerfequatsmapinitialise(SOLVER_COL_TO_INTERFACE_EQUATIONS_MAP, ERR, ERROR,)
Initialises the solver column to interface equations mapping.
Returns an item in a list at a specififed position.
This module contains all routines dealing with (non-distributed) matrix and vectors types...
Contains information on the mapping from an interface condition column to a solver row...
integer(intg), parameter, public solver_mapping_equations_dynamic_matrix
The equations matrix in the solver mapping is a dynamic equations matrix.
subroutine solvermapping_interfacetosolvermapsinitialise(INTERFACE_TO_SOLVER_MAPS, ERR, ERROR,)
Initialises an interface to solver maps.
integer(intg), parameter, public diagnostic_output_type
Diagnostic output type.
Contains information on the solver mapping between the global equation sets and the solver matrices...
subroutine solver_mapping_finalise(SOLVER_MAPPING, ERR, ERROR,)
Finalises the solver mapping and deallocates all memory.
Contains information about the mapping from a solver matrix column to interface equations matrices an...
subroutine solvermapping_jacobiantosolvermapfinalise(JACOBIAN_TO_SOLVER_MAP, ERR, ERROR,)
Finalises a equations set to solver matrix map and deallocates all memory.
subroutine solvermapping_solvercoltodequationsmapinitialise(SOLVER_COL_TO_DYNAMIC_EQUATIONS_MAP, ERR, ERROR,)
Initialises the solver column to dynamic equations mapping and deallocates all memory.
subroutine, public list_create_start(LIST, ERR, ERROR,)
Starts the creation of a list and returns a pointer to the created list.
subroutine solvermapping_interfacetosolvermapinitialise(INTERFACE_CONDITION_TO_SOLVER_MAP, ERR, ERROR,)
Initialises an interface condition to solver map.
Contains information for a field variable defined on a field.
Describes linear constraints between solver DOFs in the solver mapping.
integer(intg), parameter, public boundary_condition_dof_constrained
The dof is constrained to be a linear combination of other DOFs.
subroutine solvermapping_solcoltointerfmapfinalise(SOLVER_COL_TO_INTERFACE_MAP, ERR, ERROR,)
Finalises the solver column to interface map and deallocates all memory.
Contains information on the domain mappings (i.e., local and global numberings).
subroutine solver_mapping_variable_initialise(SOLVER_MAPPING_VARIABLE, ERR, ERROR,)
Initialises the solver mapping and deallocates all memory.
subroutine solvermapping_interfacetosolverequationsinitialise(INTERFACE_TO_SOLVER_EQUATIONS_MAPS, ERR, ERROR,)
Initialises an interface to solver matrix equations map.
Adds an item to the end of a list.
subroutine solvermapping_jaccoltosolcolsmapfinalise(JACOBIAN_COL_TO_SOLVER_COLS_MAP, ERR, ERROR,)
Finalises a Jacobian column to solver columns map and deallocates all memory.
subroutine solvermapping_solrowtoequationsmapsinitialise(SOLVER_ROW_TO_EQUATIONS_MAPS, ERR, ERROR,)
Initialises a solver row to equations map.
subroutine, public domain_mappings_mapping_global_initialise(MAPPING_GLOBAL_MAP, ERR, ERROR,)
Finalises the global mapping in the given domain mappings.
subroutine solvermapping_equatsrowtosolrowsmapinitialise(EQUATIONS_ROW_SOLVER_ROWS_MAP, ERR, ERROR,)
Initialises an equations row to solver rows map.
Contains information on the equations mapping for a RHS i.e., how a field variable is mapped to the R...
subroutine, public errors(NAME, ERR, ERROR)
Records the exiting error of the subroutine.
This module defines all constants shared across equations set routines.
Implements lists of base types.
subroutine, public list_data_type_set(LIST, DATA_TYPE, ERR, ERROR,)
Sets/changes the data type for a list.
subroutine solverdofcouplings_addcoupling(solverDofCouplings, coupling, couplingIndex, err, error,)
Add a new DOF coupling to the list of global solver couplings.
subroutine, public list_destroy(LIST, ERR, ERROR,)
Destroys a list.
subroutine solvermapping_equatsrowtosolrowsmapfinalise(EQUATIONS_ROW_SOLVER_ROWS_MAP, ERR, ERROR,)
Finalises a equations row to solver rows map and deallocates all memory.
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 the variables involved in a solver matrix.
subroutine solvermapping_solcoltoequatssetmapinitialise(SOLVER_COL_TO_EQUATIONS_SET_MAP, ERR, ERROR,)
Initialises the solver column to equations set mapping and deallocates all memory.
Flags an error condition.
integer(intg), parameter, public solver_mapping_equations_interface_condition
The equations in the solver mapping is from an interface condition.
subroutine solvermapping_equationstosolvermapsinitialise(EQUATIONS_TO_SOLVER_MAP, ERR, ERROR,)
Initialises an equations to solver maps.
subroutine solver_mapping_initialise(SOLVER_EQUATIONS, ERR, ERROR,)
Initialises the solver mapping and deallocates all memory.
integer(intg), parameter equations_quasistatic
The equations are quasi-static.
Flags an error condition.
Contains information on the mapping from an interface condition column to a solver row...
subroutine solvermapping_solcoltoequationsmapsinitialise(SOLVER_COL_TO_EQUATIONS_MAPS, ERR, ERROR,)
Initialises the solver column to equations mapping and deallocates all memory.
Describes the coupled rows or columns in the solver mapping.
subroutine solvermapping_equatstosolmatmapssmfinalise(EQUATIONS_TO_SOLVER_MATRIX_MAPS_SM, ERR, ERROR,)
Finalises a equations set to solver matrix map sm and deallocates all memory.
Contains information on the mappings from a solver matrix to equations sets.
Buffer type to allow arrays of pointers to a list.
subroutine, public list_initial_size_set(LIST, INITIAL_SIZE, ERR, ERROR,)
Sets/changes the initial size for a list.
subroutine, public solvermapping_equatsvarstosolvermatrixset(SOLVER_MAPPING, SOLVER_MATRIX, EQUATIONS_SET_INDEX, VARIABLE_TYPES, ERR, ERROR,)
Sets/changes the mapping of global variables to a solver matrix for the solver mapping.
integer(intg), parameter equations_nonlinear
The equations are non-linear.
Contains information for mapping field variables to the linear matrices in the equations set of the m...
subroutine solvermapping_equatscoltosolcolsmapinitialise(EQUATIONS_COL_TO_SOLVER_COLS_MAP, ERR, ERROR,)
Initialises an equations column to solver columns map.
subroutine solvermapping_interftosolmatmapssminitialise(INTERFACE_TO_SOLVER_MATRIX_MAPS_SM, ERR, ERROR,)
Initialises an interface to solver matrix maps sm.
This module contains all kind definitions.
Contains information on the mappings from an interface condition to the solver matrices.
Contains information about the interface equations for an interface condition.
integer(intg), parameter solver_mapping_equations_interface_transpose
The equations in the solver mapping is from a transposed interface condition.
subroutine solvermapping_solvercoltodequationsmapfinalise(SOLVER_COL_TO_DYNAMIC_EQUATIONS_MAP, ERR, ERROR,)
Finalises the solver column to dynamic equations map and deallocates all memory.
subroutine, public solver_mapping_create_start(SOLVER_EQUATIONS, SOLVER_MAPPING, ERR, ERROR,)
Finishes the process of creating a solver mapping for a problem solver.