74 INTEGER(INTG) :: connectivity_handle
75 INTEGER(INTG) :: layout_handle
80 INTEGER(INTG) :: connectivity_handle
81 INTEGER(INTG) :: reference_handle
82 INTEGER(INTG) :: layout_handle
103 INTEGER(INTG),
INTENT(OUT) :: ERR
106 enters(
"FIELDML_ASSERT_IS_OUT", err, error, *999 )
108 IF(.NOT.
ASSOCIATED(fieldml_info))
THEN 109 CALL flagerror(
"FieldML Info is not associated.", err, error, *999 )
110 ELSE IF( .NOT. fieldml_info%IS_OUT )
THEN 111 CALL flagerror(
"Inbound FieldML Info used for an output-only operation.", err, error, *999 )
114 exits(
"FIELDML_ASSERT_IS_OUT" )
116 999 errorsexits(
"FIELDML_ASSERT_IS_OUT", err, error )
128 INTEGER(INTG),
INTENT(IN) :: COLLAPSE_INFO(:)
130 INTEGER(INTG),
INTENT(OUT) :: ERR
136 enters(
"FIELDML_OUTPUT_GET_COLLAPSE_SUFFIX", err, error, *999 )
139 DO i = 1,
SIZE( collapse_info )
149 exits(
"FIELDML_OUTPUT_GET_COLLAPSE_SUFFIX" )
151 999 errorsexits(
"FIELDML_OUTPUT_GET_COLLAPSE_SUFFIX", err, error )
163 INTEGER(INTG),
INTENT(IN) :: FML_HANDLE
165 INTEGER(INTG),
INTENT(OUT) :: ERR
168 INTEGER(INTG) :: FIELDML_OUTPUT_IMPORT_FML
171 INTEGER(INTG) :: IMPORT_INDEX
173 enters(
"FIELDML_OUTPUT_IMPORT_FML", err, error, *999 )
175 fieldml_output_import_fml = fieldml_getobjectbyname( fml_handle,
cchar(remote_name) )
176 IF( fieldml_output_import_fml == fml_invalid_handle )
THEN 177 import_index = fieldml_addimportsource( fml_handle, &
178 &
"http://www.fieldml.org/resources/xml/0.5/FieldML_Library_0.5.xml"//c_null_char,
"library"//c_null_char )
179 fieldml_output_import_fml = fieldml_addimport( fml_handle, import_index,
cchar(remote_name),
cchar(remote_name) )
180 IF( fieldml_output_import_fml == fml_invalid_handle ) err = 1
183 exits(
"FIELDML_OUTPUT_IMPORT_FML" )
185 999 errorsexits(
"FIELDML_OUTPUT_IMPORT_FML", err, error )
198 INTEGER(INTG),
INTENT(OUT) :: ERR
201 INTEGER(INTG) :: FIELDML_OUTPUT_IMPORT
203 enters(
"FIELDML_OUTPUT_IMPORT", err, error, *999 )
207 exits(
"FIELDML_OUTPUT_IMPORT" )
209 999 errorsexits(
"FIELDML_OUTPUT_IMPORT", err, error )
223 INTEGER(INTG),
INTENT(OUT) :: ERR
226 INTEGER(INTG) :: FIELDML_OUTPUT_ADD_IMPORT
228 enters(
"FIELDML_OUTPUT_ADD_IMPORT", err, error, *999 )
234 exits(
"FIELDML_OUTPUT_ADD_IMPORT" )
236 999 errorsexits(
"FIELDML_OUTPUT_ADD_IMPORT", err, error )
247 INTEGER(INTG),
INTENT(IN) :: FML_HANDLE
248 INTEGER(INTG),
INTENT(IN) :: HANDLE
249 INTEGER(INTG),
INTENT(OUT) :: ERR
252 INTEGER(INTG) :: FIELDML_OUTPUT_IMPORT_HANDLE
255 INTEGER(INTG) :: IMPORT_INDEX, LOCAL_HANDLE
256 CHARACTER(KIND=C_CHAR,LEN=MAXSTRLEN) :: NAME
257 INTEGER(INTG) :: LENGTH
259 enters(
"FIELDML_OUTPUT_IMPORT_HANDLE", err, error, *999 )
261 fieldml_output_import_handle = fml_invalid_handle
262 length = fieldml_copyobjectdeclaredname( fml_handle, handle, name,
maxstrlen )
264 IF( fieldml_isobjectlocal( fml_handle, handle , 1 ) /= 1 )
THEN 265 IF( length > 0 )
THEN 266 local_handle = fieldml_getobjectbyname( fml_handle, name(1:length)//c_null_char )
267 IF( local_handle == fml_invalid_handle )
THEN 268 import_index = fieldml_addimportsource( fml_handle, &
269 &
"http://www.fieldml.org/resources/xml/0.5/FieldML_Library_0.5.xml"//c_null_char,
"library"//c_null_char )
270 fieldml_output_import_handle = fieldml_addimport( fml_handle, &
271 & import_index, name(1:length)//c_null_char, name(1:length)//c_null_char )
272 ELSE IF( local_handle == handle )
THEN 273 fieldml_output_import_handle = handle
278 exits(
"FIELDML_OUTPUT_IMPORT_HANDLE" )
280 999 errorsexits(
"FIELDML_OUTPUT_IMPORT_HANDLE", err, error )
292 LOGICAL,
INTENT(IN) :: DO_IMPORT
293 INTEGER(INTG),
INTENT(IN) :: TYPE_HANDLE
294 INTEGER(INTG),
INTENT(OUT) :: ERR
297 INTEGER(INTG) :: FIELDML_OUTPUT_GET_TYPE_ARGUMENT_HANDLE
300 CHARACTER(KIND=C_CHAR,LEN=MAXSTRLEN) :: NAME
301 INTEGER(INTG) :: LENGTH
302 INTEGER(INTG) :: HANDLE, FML_ERR
305 enters(
"FIELDML_OUTPUT_GET_TYPE_ARGUMENT_HANDLE", err, error, *999 )
307 length = fieldml_copyobjectname( fieldml_info%FML_HANDLE, type_handle, name,
maxstrlen )
308 IF( length < 1 )
THEN 309 length = fieldml_copyobjectdeclaredname( fieldml_info%FML_HANDLE, type_handle, name,
maxstrlen )
310 fieldml_output_get_type_argument_handle = fml_invalid_handle
311 exits(
"FIELDML_OUTPUT_GET_TYPE_ARGUMENT_HANDLE" )
316 full_name = name(1:length)//
".argument" 321 handle = fieldml_getobjectbyname( fieldml_info%FML_HANDLE, name(1:length)//
".argument"//c_null_char )
322 IF( handle == fml_invalid_handle )
THEN 323 fieldml_output_get_type_argument_handle = fml_invalid_handle
324 exits(
"FIELDML_OUTPUT_GET_TYPE_ARGUMENT_HANDLE" )
328 fieldml_output_get_type_argument_handle = handle
330 enters(
"FIELDML_OUTPUT_GET_TYPE_ARGUMENT_HANDLE", err, error, *999 )
331 exits(
"FIELDML_OUTPUT_GET_TYPE_ARGUMENT_HANDLE" )
333 999 errorsexits(
"FIELDML_OUTPUT_GET_TYPE_ARGUMENT_HANDLE", err, error )
345 INTEGER(INTG),
INTENT(IN) :: FIELDML_HANDLE
346 INTEGER(INTG),
INTENT(IN) :: COORDS_TYPE
347 INTEGER(INTG),
INTENT(IN) :: DIMENSIONS
348 LOGICAL,
INTENT(IN) :: DO_IMPORT
349 INTEGER(INTG),
INTENT(OUT) :: TYPE_HANDLE
350 INTEGER(INTG),
INTENT(OUT) :: ERR
355 INTEGER(INTG) :: TEMP
357 enters(
"FIELDML_OUTPUT_GET_COORDINATES_TYPE", err, error, *999 )
360 IF( dimensions == 1 )
THEN 361 type_name =
"coordinates.rc.1d" 362 ELSE IF( dimensions == 2 )
THEN 363 type_name =
"coordinates.rc.2d" 364 ELSE IF( dimensions == 3 )
THEN 365 type_name =
"coordinates.rc.3d" 367 type_handle = fml_invalid_handle
368 CALL flagerror(
var_str(
"Cannot get FieldML RC coordinates type of dimension ")//dimensions//
".", err, error, *999)
371 type_handle = fml_invalid_handle
372 CALL flagerror(
var_str(
"Cannot get FieldML coordinates for OpenCMISS type ")//coords_type//
".", err, error, *999 )
379 type_handle = fieldml_getobjectbyname( fieldml_handle,
cchar(type_name) )
383 exits(
"FIELDML_OUTPUT_GET_COORDINATES_TYPE" )
385 999 errorsexits(
"FIELDML_OUTPUT_GET_COORDINATES_TYPE", err, error )
397 INTEGER(INTG),
INTENT(IN) :: FIELDML_HANDLE
398 INTEGER(INTG),
INTENT(IN) :: DIMENSIONS
399 INTEGER(INTG),
INTENT(OUT) :: TYPE_HANDLE
400 LOGICAL,
INTENT(IN) :: DO_IMPORT
401 INTEGER(INTG),
INTENT(OUT) :: ERR
406 INTEGER(INTG) :: TEMP
408 enters(
"FIELDML_OUTPUT_GET_GENERIC_TYPE", err, error, *999 )
410 IF( dimensions == 1 )
THEN 411 type_name =
"real.1d" 412 ELSE IF( dimensions == 2 )
THEN 413 type_name =
"real.2d" 414 ELSE IF( dimensions == 3 )
THEN 415 type_name =
"real.3d" 417 type_handle = fml_invalid_handle
418 CALL flagerror(
var_str(
"Cannot get FieldML generic type of dimensionality ")//dimensions//
".", err, error, *999 )
425 type_handle = fieldml_getobjectbyname( fieldml_handle,
cchar(type_name) )
428 exits(
"FIELDML_OUTPUT_GET_GENERIC_TYPE" )
430 999 errorsexits(
"FIELDML_OUTPUT_GET_GENERIC_TYPE", err, error )
442 INTEGER(INTG),
INTENT(IN) :: FIELDML_HANDLE
443 INTEGER(INTG),
INTENT(IN) :: DIMENSIONS
444 LOGICAL,
INTENT(IN) :: DO_IMPORT
445 INTEGER(INTG),
INTENT(OUT) :: TYPE_HANDLE
446 INTEGER(INTG),
INTENT(OUT) :: ERR
450 INTEGER(INTG) :: TEMP
453 enters(
"FIELDML_OUTPUT_GET_XI_TYPE", err, error, *999 )
455 IF( dimensions == 1 )
THEN 456 type_name =
"chart.1d" 457 ELSE IF( dimensions == 2 )
THEN 458 type_name =
"chart.2d" 459 ELSE IF( dimensions == 3 )
THEN 460 type_name =
"chart.3d" 462 type_handle = fml_invalid_handle
463 CALL flagerror(
var_str(
"Chart dimensionality ")//dimensions//
" not supported.", err, error, *999 )
470 type_handle = fieldml_getobjectbyname( fieldml_handle,
cchar(type_name) )
473 exits(
"FIELDML_OUTPUT_GET_XI_TYPE" )
475 999 errorsexits(
"FIELDML_OUTPUT_GET_XI_TYPE", err, error )
487 INTEGER(INTG),
INTENT(IN) :: FML_HANDLE
488 TYPE(
field_type),
POINTER,
INTENT(IN) :: FIELD
489 INTEGER(INTG),
INTENT(IN) :: VARIABLE_TYPE
490 LOGICAL,
INTENT(IN) :: DO_IMPORT
491 INTEGER(INTG),
INTENT(OUT) :: TYPE_HANDLE
492 INTEGER(INTG),
INTENT(OUT) :: ERR
496 INTEGER(INTG) :: FIELDTYPE, SUB_TYPE, COUNT
500 enters(
"FIELDML_OUTPUT_GET_VALUE_TYPE", err, error, *999 )
502 region => field%REGION
504 CALL field_type_get( field, fieldtype, err, error, *999 )
505 CALL field_number_of_components_get( field, variable_type, count, err, error, *999 )
507 SELECT CASE( fieldtype )
508 CASE( field_geometric_type )
509 NULLIFY( coordinate_system )
524 exits(
"FIELDML_OUTPUT_GET_VALUE_TYPE" )
526 999 errorsexits(
"FIELDML_OUTPUT_GET_VALUE_TYPE", err, error )
537 & parameters_handle, err, error, * )
539 INTEGER(INTG),
INTENT(IN) :: FML_HANDLE
540 INTEGER(INTG),
INTENT(IN) :: XI_INTERPOLATIONS(:)
541 INTEGER(INTG),
INTENT(IN) :: COLLAPSE_INFO(:)
542 INTEGER(INTG),
INTENT(OUT) :: EVALUATOR_HANDLE
543 INTEGER(INTG),
INTENT(OUT) :: PARAMETERS_HANDLE
544 INTEGER(INTG),
INTENT(OUT) :: ERR
548 INTEGER(INTG) :: XI_COUNT, FIRST_INTERPOLATION, I
551 enters(
"FIELDML_OUTPUT_GET_TP_BASIS_EVALUATOR", err, error, *999 )
553 xi_count =
SIZE( xi_interpolations )
557 first_interpolation = xi_interpolations(i)
558 ELSE IF( xi_interpolations(i) /= first_interpolation )
THEN 560 CALL flagerror(
"Translation of inhomogeneous tensor-product basis not yet supported.", err, error, *999 )
566 evaluator_handle = fml_invalid_handle
567 parameters_handle = fml_invalid_handle
570 IF( xi_count == 1 )
THEN 571 interpolator_name =
"interpolator.1d.unit.quadraticLagrange" 572 parameter_name =
"parameters.1d.unit.quadraticLagrange" 573 ELSE IF( xi_count == 2 )
THEN 574 interpolator_name =
"interpolator.2d.unit.biquadraticLagrange"//suffix
575 parameter_name =
"parameters.2d.unit.biquadraticLagrange"//suffix
576 ELSE IF( xi_count == 3 )
THEN 577 interpolator_name =
"interpolator.3d.unit.triquadraticLagrange"//suffix
578 parameter_name =
"parameters.3d.unit.triquadraticLagrange"//suffix
581 CALL flagerror(
var_str(
"Quadratic Lagrangian interpolation not supported for ")//xi_count//
" dimensions.", &
585 IF( xi_count == 1 )
THEN 586 interpolator_name =
"interpolator.1d.unit.linearLagrange" 587 parameter_name =
"parameters.1d.unit.linearLagrange" 588 ELSE IF( xi_count == 2 )
THEN 589 interpolator_name =
"interpolator.2d.unit.bilinearLagrange"//suffix
590 parameter_name =
"parameters.2d.unit.bilinearLagrange"//suffix
591 ELSE IF( xi_count == 3 )
THEN 592 interpolator_name =
"interpolator.3d.unit.trilinearLagrange"//suffix
593 parameter_name =
"parameters.3d.unit.trilinearLagrange"//suffix
596 CALL flagerror(
var_str(
"Quadratic Lagrangian interpolation not supported for ")//xi_count//
" dimensions.", &
600 CALL flagerror(
var_str(
"FieldML translation not yet supported for interpolation type ")//first_interpolation//
".", &
605 IF( err /= 0 )
CALL flagerror(
"Could not import interpolator "//
char(interpolator_name)//
".", err, error, *999 )
608 IF( err /= 0 )
CALL flagerror(
"Could not import parameter type "//
char(parameter_name)//
".", err, error, *999 )
610 IF( evaluator_handle == fml_invalid_handle )
THEN 611 CALL flagerror(
"Cannot get a handle for basis evaluator "//
char(interpolator_name)//
".", err, error, *999 )
614 IF( parameters_handle == fml_invalid_handle )
THEN 615 CALL flagerror(
"Cannot get a handle for basis parameters "//
char(parameter_name)//
".", err, error, *999 )
618 exits(
"FIELDML_OUTPUT_GET_TP_BASIS_EVALUATOR" )
620 999 errorsexits(
"FIELDML_OUTPUT_GET_TP_BASIS_EVALUATOR", err, error )
632 & parametershandle, err, error, * )
634 INTEGER(INTG),
INTENT(IN) :: fmlHandle
635 INTEGER(INTG),
INTENT(IN) :: xiInterpolations(:)
636 INTEGER(INTG),
INTENT(OUT) :: evaluatorHandle
637 INTEGER(INTG),
INTENT(OUT) :: parametersHandle
638 INTEGER(INTG),
INTENT(OUT) :: err
642 INTEGER(INTG) :: xiCount, firstInterpolation, i
645 enters(
"FieldmlOutputGetSimplexBasisEvaluator", err, error, *999 )
647 xicount =
SIZE( xiinterpolations )
651 firstinterpolation = xiinterpolations(i)
652 ELSE IF( xiinterpolations(i) /= firstinterpolation )
THEN 654 CALL flag_error(
"Translation of inhomogeneous tensor-product basis not yet supported.", err, error, *999 )
658 evaluatorhandle = fml_invalid_handle
659 parametershandle = fml_invalid_handle
662 IF( xicount == 1 )
THEN 663 interpolatorname =
"interpolator.1d.unit.quadraticSimplex" 664 parametername =
"parameters.1d.unit.quadraticLagrange" 665 ELSE IF( xicount == 2 )
THEN 666 interpolatorname =
"interpolator.2d.unit.biquadraticSimplex.vtk" 667 parametername =
"parameters.2d.unit.biquadraticSimplex.vtk" 668 ELSE IF( xicount == 3 )
THEN 669 interpolatorname =
"interpolator.3d.unit.triquadraticSimplex.zienkiewicz" 670 parametername =
"parameters.3d.unit.triquadraticSimplex.zienkiewicz" 673 CALL flag_error(
var_str(
"Quadratic simplex interpolation not supported for ")//xicount//
" dimensions.", &
677 IF( xicount == 1 )
THEN 678 interpolatorname =
"interpolator.1d.unit.linearSimplex" 679 parametername =
"parameters.1d.unit.linearLagrange" 680 ELSE IF( xicount == 2 )
THEN 681 interpolatorname =
"interpolator.2d.unit.bilinearSimplex" 682 parametername =
"parameters.2d.unit.bilinearSimplex" 683 ELSE IF( xicount == 3 )
THEN 684 interpolatorname =
"interpolator.3d.unit.trilinearSimplex" 685 parametername =
"parameters.3d.unit.trilinearSimplex" 688 CALL flag_error(
var_str(
"Linear simplex interpolation not supported for ")//xicount//
" dimensions.", &
692 CALL flag_error(
var_str(
"FieldML translation not yet supported for interpolation type ")//firstinterpolation//
".", &
697 IF( err /= 0 )
CALL flag_error(
"Could not import interpolator "//
char(interpolatorname)//
".", err, error, *999 )
700 IF( err /= 0 )
CALL flag_error(
"Could not import parameter type "//
char(parametername)//
".", err, error, *999 )
702 IF( evaluatorhandle == fml_invalid_handle )
THEN 703 CALL flag_error(
"Cannot get a handle for basis evaluator "//
char(interpolatorname)//
".", err, error, *999 )
706 IF( parametershandle == fml_invalid_handle )
THEN 707 CALL flag_error(
"Cannot get a handle for basis parameters "//
char(parametername)//
".", err, error, *999 )
710 exits(
"FieldmlOutputGetSimplexBasisEvaluator" )
712 999 errorsexits(
"FieldmlOutputGetSimplexBasisEvaluator", err, error )
725 INTEGER(INTG),
INTENT(IN) :: FIELDML_HANDLE
726 INTEGER(INTG),
INTENT(IN) :: XI_INTERPOLATIONS(:)
727 INTEGER(INTG),
INTENT(IN) :: COLLAPSE_INFO(:)
728 LOGICAL,
INTENT(IN) :: DO_IMPORT
729 INTEGER(INTG),
INTENT(OUT) :: TYPE_HANDLE
730 INTEGER(INTG),
INTENT(OUT) :: ERR
734 INTEGER(INTG) :: XI_COUNT, FIRST_INTERPOLATION, I, IMPORT_INDEX, TEMP
737 enters(
"FIELDML_OUTPUT_GET_TP_CONNECTIVITY_TYPE", err, error, *999 )
739 xi_count =
SIZE( xi_interpolations )
741 import_index = fieldml_addimportsource( fieldml_handle, &
742 &
"http://www.fieldml.org/resources/xml/0.5/FieldML_Library_0.5.xml"//c_null_char,
"library"//c_null_char )
745 first_interpolation = xi_interpolations(1)
747 IF( xi_interpolations(i) /= first_interpolation )
THEN 749 CALL flagerror(
"FieldML translation of inhomogeneous tensor-product bases are not yet supported.", &
757 IF( xi_count == 1 )
THEN 758 layout_name =
"localNodes.1d.line3" 759 ELSE IF( xi_count == 2 )
THEN 760 layout_name =
"localNodes.2d.square3x3"//suffix
761 ELSE IF( xi_count == 3 )
THEN 762 layout_name =
"localNodes.3d.cube3x3x3"//suffix
765 CALL flagerror(
var_str(
"Quadratic Lagrangian interpolation not supported for ")//xi_count//
" dimensions.", &
769 IF( xi_count == 1 )
THEN 770 layout_name =
"localNodes.1d.line2" 771 ELSE IF( xi_count == 2 )
THEN 772 layout_name =
"localNodes.2d.square2x2"//suffix
773 ELSE IF( xi_count == 3 )
THEN 774 layout_name =
"localNodes.3d.cube2x2x2"//suffix
777 CALL flagerror(
var_str(
"Linear Lagrangian interpolation not supported for ")//xi_count//
" dimensions.", &
781 CALL flagerror(
var_str(
"FieldML translation not yet supported for interpolation type ")//first_interpolation//
".", &
789 type_handle = fieldml_getobjectbyname( fieldml_handle,
cchar(layout_name) )
792 exits(
"FIELDML_OUTPUT_GET_TP_CONNECTIVITY_TYPE" )
794 999 errorsexits(
"FIELDML_OUTPUT_GET_TP_CONNECTIVITY_TYPE", err, error )
806 INTEGER(INTG),
INTENT(IN) :: fieldmlHandle
807 INTEGER(INTG),
INTENT(IN) :: xiInterpolations(:)
808 LOGICAL,
INTENT(IN) :: doImport
809 INTEGER(INTG),
INTENT(OUT) :: typeHandle
810 INTEGER(INTG),
INTENT(OUT) :: err
814 INTEGER(INTG) :: xiCount, firstInterpolation, i, importIndex, temp
817 enters(
"FieldmlOutputGetSimplexConnectivityType", err, error, *999 )
819 xicount =
SIZE( xiinterpolations )
821 importindex = fieldml_addimportsource( fieldmlhandle, &
822 &
"http://www.fieldml.org/resources/xml/0.4/FieldML_Library_0.4.xml"//c_null_char,
"library"//c_null_char )
825 firstinterpolation = xiinterpolations(1)
827 IF( xiinterpolations(i) /= firstinterpolation )
THEN 829 CALL flag_error(
"FieldML translation of inhomogeneous simplex bases are not yet supported.", &
835 IF( xicount == 1 )
THEN 836 layoutname =
"localNodes.1d.line3" 837 ELSE IF( xicount == 2 )
THEN 838 layoutname =
"localNodes.2d.triangle6.vtk" 839 ELSE IF( xicount == 3 )
THEN 840 layoutname =
"localNodes.3d.tetrahedron10.zienkiewicz" 843 CALL flag_error(
var_str(
"Quadratic Simplex interpolation not supported for ")//xicount//
" dimensions.", &
847 IF( xicount == 1 )
THEN 848 layoutname =
"localNodes.1d.line2" 849 ELSE IF( xicount == 2 )
THEN 850 layoutname =
"localNodes.2d.triangle3" 851 ELSE IF( xicount == 3 )
THEN 852 layoutname =
"localNodes.3d.tetrahedron4" 855 CALL flag_error(
var_str(
"Linear Simplex interpolation not supported for ")//xicount//
" dimensions.", &
859 CALL flag_error(
var_str(
"FieldML translation not yet supported for interpolation type ")//firstinterpolation//
".", &
867 typehandle = fieldml_getobjectbyname( fieldmlhandle,
cchar(layoutname) )
870 exits(
"FieldmlOutputGetSimplexConnectivityType" )
872 999 errorsexits(
"FieldmlOutputGetSimplexConnectivityType", err, error )
884 INTEGER(INTG),
INTENT(IN) :: FIELDML_HANDLE
886 INTEGER(INTG),
INTENT(OUT) :: TYPE_HANDLE
887 INTEGER(INTG),
INTENT(OUT) :: ERR
891 INTEGER(INTG) :: BASISTYPE, XI_COUNT
892 INTEGER(INTG),
ALLOCATABLE :: XI_INTERPOLATIONS(:), COLLAPSE_INFO(:)
894 enters(
"FIELDML_OUTPUT_GET_CONNECTIVITY_ENSEMBLE", err, error, *999 )
896 type_handle = fml_invalid_handle
902 ALLOCATE( xi_interpolations( xi_count ), stat = err )
903 IF( err /= 0 )
CALL flagerror(
"Could not allocate xi interpolations array.", err, error, *999 )
904 ALLOCATE( collapse_info( xi_count ), stat = err )
905 IF( err /= 0 )
CALL flagerror(
"Could not allocate collapse info array.", err, error, *999 )
912 DEALLOCATE( xi_interpolations )
913 DEALLOCATE( collapse_info )
915 ALLOCATE( xi_interpolations( xi_count ), stat = err )
916 IF( err /= 0 )
CALL flagerror(
"Could not allocate xi interpolations array.", err, error, *999 )
922 DEALLOCATE( xi_interpolations )
924 CALL flagerror(
"Only translation of tensor product bases are currently supported", err, error, *999 )
927 exits(
"FIELDML_OUTPUT_GET_CONNECTIVITY_ENSEMBLE" )
929 999 errorsexits(
"FIELDML_OUTPUT_GET_CONNECTIVITY_ENSEMBLE", err, error )
942 INTEGER(INTG),
INTENT(IN) :: LAYOUT_HANDLE
943 INTEGER(INTG),
INTENT(OUT) :: ERR
947 INTEGER(INTG) :: FIELDML_OUTPUT_FIND_LAYOUT
952 enters(
"FIELDML_OUTPUT_FIND_LAYOUT", err, error, *999 )
954 fieldml_output_find_layout = -1
955 DO i = 1,
SIZE( connectivity_info )
956 IF( connectivity_info(i)%LAYOUT_HANDLE == layout_handle )
THEN 957 fieldml_output_find_layout = i
961 exits(
"FIELDML_OUTPUT_FIND_LAYOUT" )
963 999 errorsexits(
"FIELDML_OUTPUT_FIND_LAYOUT", err, error )
975 TYPE(
basis_type),
POINTER,
INTENT(IN) :: BASIS
976 INTEGER(INTG),
INTENT(OUT) :: ERR
980 INTEGER(INTG) :: FIELDML_OUTPUT_FIND_BASIS
985 enters(
"FIELDML_OUTPUT_FIND_BASIS", err, error, *999 )
987 fieldml_output_find_basis = -1
988 DO i = 1,
SIZE( basis_info )
989 IF(
ASSOCIATED( basis_info(i)%BASIS,
TARGET = basis ) )
THEN 990 fieldml_output_find_basis = i
994 exits(
"FIELDML_OUTPUT_FIND_BASIS" )
996 999 errorsexits(
"FIELDML_OUTPUT_FIND_BASIS", err, error )
1007 INTEGER(INTG),
INTENT(IN) :: FML_HANDLE
1008 INTEGER(INTG),
INTENT(IN) :: LAYOUT_HANDLE
1010 INTEGER(INTG),
INTENT(OUT) :: ERR
1014 CHARACTER(KIND=C_CHAR,LEN=MAXSTRLEN) :: FULL_NAME
1015 INTEGER(INTG) :: LENGTH
1017 enters(
"FIELDML_OUTPUT_GET_SIMPLE_LAYOUT_NAME", err, error, *999 )
1019 length = fieldml_copyobjectdeclaredname( fml_handle, layout_handle, full_name,
maxstrlen )
1022 IF(
index( full_name,
'localNodes.') /= 1 )
THEN 1023 name = full_name(1:length)
1025 name = full_name(12:length)
1028 exits(
"FIELDML_OUTPUT_GET_SIMPLE_LAYOUT_NAME" )
1030 999 errorsexits(
"FIELDML_OUTPUT_GET_SIMPLE_LAYOUT_NAME", err, error )
1042 INTEGER(INTG),
INTENT(IN) :: FML_HANDLE
1043 INTEGER(INTG),
INTENT(IN) :: BASIS_HANDLE
1045 INTEGER(INTG),
INTENT(OUT) :: ERR
1049 CHARACTER(KIND=C_CHAR,LEN=MAXSTRLEN) :: FULL_NAME
1050 INTEGER(INTG) :: LENGTH
1052 enters(
"FIELDML_OUTPUT_GET_SIMPLE_BASIS_NAME", err, error, *999 )
1054 length = fieldml_copyobjectdeclaredname( fml_handle, basis_handle, full_name,
maxstrlen )
1057 IF(
index( full_name,
'interpolator.1d.unit.') == 1 )
THEN 1058 name = full_name(22:length)
1059 ELSEIF(
index( full_name,
'interpolator.2d.unit.') == 1 )
THEN 1060 name = full_name(22:length)
1061 ELSEIF(
index( full_name,
'interpolator.3d.unit.') == 1 )
THEN 1062 name = full_name(22:length)
1064 name = full_name(1:length)
1067 exits(
"FIELDML_OUTPUT_GET_SIMPLE_BASIS_NAME" )
1069 999 errorsexits(
"FIELDML_OUTPUT_GET_SIMPLE_BASIS_NAME", err, error )
1084 INTEGER(INTG),
INTENT(OUT) :: ERR
1088 INTEGER(INTG) :: BASIS_TYPE, XI_COUNT, INTERPOLATION_PARAMETERS_HANDLE, HANDLE, EVALUATOR_HANDLE, valueType
1089 INTEGER(INTG) :: VARIABLE_HANDLE, AGGREGATE_HANDLE, INDEX_EVALUATOR_HANDLE, FML_ERR
1090 INTEGER(INTG),
ALLOCATABLE :: XI_INTERPOLATIONS(:), COLLAPSE_INFO(:)
1093 enters(
"FIELDML_OUTPUT_CREATE_BASIS_REFERENCE", err, error, *999 )
1099 ALLOCATE( xi_interpolations( xi_count ), stat = err )
1100 IF( err /= 0 )
CALL flagerror(
"Could not allocate xi interpolation array.", err, error, *999 )
1101 ALLOCATE( collapse_info( xi_count ), stat = err )
1106 & interpolation_parameters_handle, err, error, *999 )
1107 DEALLOCATE( xi_interpolations )
1108 DEALLOCATE( collapse_info )
1112 reference_name = base_name//name//
"_"//
trim(
number_to_vstring(basis_info%BASIS%USER_NUMBER,
"*",err,error))// &
1115 aggregate_handle = fieldml_createaggregateevaluator( fieldml_info%FML_HANDLE,
cchar(reference_name), &
1116 & interpolation_parameters_handle )
1118 & fieldml_info%FML_HANDLE, err, error, *999 )
1124 fml_err = fieldml_setindexevaluator( fieldml_info%FML_HANDLE, aggregate_handle, 1, index_evaluator_handle )
1126 & fieldml_info%FML_HANDLE, err, error, *999 )
1128 fml_err = fieldml_setdefaultevaluator( fieldml_info%FML_HANDLE, aggregate_handle, fieldml_info%NODE_DOFS_HANDLE )
1130 & fieldml_info%FML_HANDLE, err, error, *999 )
1132 handle = fieldml_getvaluetype( fieldml_info%FML_HANDLE, basis_info%CONNECTIVITY_HANDLE )
1135 fml_err = fieldml_setbind( fieldml_info%FML_HANDLE, aggregate_handle, variable_handle, basis_info%CONNECTIVITY_HANDLE )
1137 & fieldml_info%FML_HANDLE, err, error, *999 )
1139 reference_name = base_name//name//
"_"//
trim(
number_to_vstring(basis_info%BASIS%USER_NUMBER,
"*",err,error))// &
1142 valuetype = fieldml_getvaluetype( fieldml_info%FML_HANDLE, evaluator_handle )
1144 basis_info%REFERENCE_HANDLE = fieldml_createreferenceevaluator( fieldml_info%FML_HANDLE,
cchar(reference_name), &
1145 & evaluator_handle, valuetype )
1150 fml_err = fieldml_setbind( fieldml_info%FML_HANDLE, basis_info%REFERENCE_HANDLE, variable_handle, &
1151 & fieldml_info%XI_ARGUMENT_HANDLE )
1153 & fieldml_info%FML_HANDLE, err, error, *999 )
1158 fml_err = fieldml_setbind( fieldml_info%FML_HANDLE, basis_info%REFERENCE_HANDLE, variable_handle, &
1159 & aggregate_handle )
1161 & fieldml_info%FML_HANDLE, err, error, *999 )
1164 ALLOCATE( xi_interpolations( xi_count ), stat = err )
1165 IF( err /= 0 )
CALL flagerror(
"Could not allocate xi interpolation array.", err, error, *999 )
1170 & interpolation_parameters_handle, err, error, *999 )
1171 DEALLOCATE( xi_interpolations )
1175 reference_name = base_name//name//
"_"//
trim(
number_to_vstring(basis_info%BASIS%USER_NUMBER,
"*",err,error))// &
1178 aggregate_handle = fieldml_createaggregateevaluator( fieldml_info%FML_HANDLE,
cchar(reference_name), &
1179 & interpolation_parameters_handle )
1181 & fieldml_info%FML_HANDLE, err, error, *999 )
1187 fml_err = fieldml_setindexevaluator( fieldml_info%FML_HANDLE, aggregate_handle, 1, index_evaluator_handle )
1189 & fieldml_info%FML_HANDLE, err, error, *999 )
1191 fml_err = fieldml_setdefaultevaluator( fieldml_info%FML_HANDLE, aggregate_handle, fieldml_info%NODE_DOFS_HANDLE )
1193 & fieldml_info%FML_HANDLE, err, error, *999 )
1195 handle = fieldml_getvaluetype( fieldml_info%FML_HANDLE, basis_info%CONNECTIVITY_HANDLE )
1198 fml_err = fieldml_setbind( fieldml_info%FML_HANDLE, aggregate_handle, variable_handle, basis_info%CONNECTIVITY_HANDLE )
1200 & fieldml_info%FML_HANDLE, err, error, *999 )
1202 reference_name = base_name//name//
"_"//
trim(
number_to_vstring(basis_info%BASIS%USER_NUMBER,
"*",err,error))// &
1205 valuetype = fieldml_getvaluetype( fieldml_info%FML_HANDLE, evaluator_handle )
1207 basis_info%REFERENCE_HANDLE = fieldml_createreferenceevaluator( fieldml_info%FML_HANDLE,
cchar(reference_name), &
1208 & evaluator_handle, valuetype )
1213 fml_err = fieldml_setbind( fieldml_info%FML_HANDLE, basis_info%REFERENCE_HANDLE, variable_handle, &
1214 & fieldml_info%XI_ARGUMENT_HANDLE )
1216 & fieldml_info%FML_HANDLE, err, error, *999 )
1221 fml_err = fieldml_setbind( fieldml_info%FML_HANDLE, basis_info%REFERENCE_HANDLE, variable_handle, &
1222 & aggregate_handle )
1224 & fieldml_info%FML_HANDLE, err, error, *999 )
1227 basis_info%REFERENCE_HANDLE = fml_invalid_handle
1228 CALL flagerror(
"FieldML export code can currently only translate tensor-product bases.", err, error, *999 )
1231 exits(
"FIELDML_OUTPUT_CREATE_BASIS_REFERENCE" )
1233 999 errorsexits(
"FIELDML_OUTPUT_CREATE_BASIS_REFERENCE", err, error )
1244 & connectivity_info, err, error, * )
1247 INTEGER(INTG),
INTENT(IN) :: LAYOUT_HANDLE
1250 INTEGER(INTG),
INTENT(OUT) :: ERR
1255 INTEGER(INTG) :: INDEX_HANDLE, FML_ERR
1258 enters(
"FIELDML_OUTPUT_CREATE_LAYOUT_PARAMETERS", err, error, *999 )
1261 connectivity_name = component_name//name
1263 connectivity_info%LAYOUT_HANDLE = layout_handle
1264 connectivity_info%CONNECTIVITY_HANDLE = fieldml_createparameterevaluator( fieldml_info%FML_HANDLE, &
1265 &
cchar(connectivity_name), fieldml_info%NODES_HANDLE )
1267 & fieldml_info%FML_HANDLE, err, error, *999 )
1269 fml_err = fieldml_setparameterdatadescription( fieldml_info%FML_HANDLE, connectivity_info%CONNECTIVITY_HANDLE, &
1270 & fml_data_description_dense_array )
1272 & fieldml_info%FML_HANDLE, err, error, *999 )
1274 fml_err = fieldml_adddenseindexevaluator( fieldml_info%FML_HANDLE, connectivity_info%CONNECTIVITY_HANDLE, &
1275 & fieldml_info%ELEMENTS_ARGUMENT_HANDLE, fml_invalid_handle )
1277 & fieldml_info%FML_HANDLE, err, error, *999 )
1281 fml_err = fieldml_adddenseindexevaluator( fieldml_info%FML_HANDLE, connectivity_info%CONNECTIVITY_HANDLE, index_handle, &
1282 & fml_invalid_handle )
1284 & fieldml_info%FML_HANDLE, err, error, *999 )
1286 exits(
"FIELDML_OUTPUT_CREATE_LAYOUT_PARAMETERS" )
1288 999 errorsexits(
"FIELDML_OUTPUT_CREATE_LAYOUT_PARAMETERS", err, error )
1299 & mesh_elements, err, error, * )
1304 INTEGER(INTG),
INTENT(IN) :: COMPONENT_NUMBER
1306 INTEGER(INTG),
INTENT(OUT) :: ERR
1310 INTEGER(INTG) :: LAYOUT_HANDLE, CONNECTIVITY_HANDLE, ELEMENT_COUNT, DEFAULT_HANDLE, TEMPLATE_HANDLE, TYPE_HANDLE
1311 INTEGER(INTG) :: CONNECTIVITY_COUNT, BASIS_COUNT, I, J, LAYOUT_NODE_COUNT, IDX
1312 INTEGER(INTG),
ALLOCATABLE,
TARGET :: IBUFFER(:)
1314 INTEGER(INTG) :: WRITER, SOURCE_HANDLE, FML_ERR, RESOURCE_HANDLE
1316 TYPE(
basis_info_type),
ALLOCATABLE :: BASIS_INFO(:), TEMP_BASIS_INFO(:)
1318 INTEGER(INTG),
TARGET :: OFFSETS(2), SIZES(2)
1320 enters(
"FIELDML_OUTPUT_ADD_MESH_COMPONENT", err, error, *999 )
1322 element_count = fieldml_getmembercount( fieldml_info%FML_HANDLE, fieldml_info%ELEMENTS_HANDLE )
1324 & fieldml_info%FML_HANDLE, err, error, *999 )
1326 connectivity_count = 0
1331 type_handle = fieldml_getvaluetype( fieldml_info%FML_HANDLE, fieldml_info%NODE_DOFS_HANDLE )
1334 resource_handle = fieldml_createhrefdataresource( fieldml_info%FML_HANDLE, &
1335 &
cchar(component_name//
".connectivity.resource"),
cchar( connectivity_format ), &
1336 &
cchar(component_name//
".connectivity") )
1338 &
".connectivity.resource", fieldml_info%FML_HANDLE, err, error, *999 )
1340 template_handle = fieldml_createpiecewiseevaluator( fieldml_info%FML_HANDLE,
cchar(component_name//
".template"), &
1343 & fieldml_info%FML_HANDLE, err, error, *999 )
1344 fml_err = fieldml_setindexevaluator( fieldml_info%FML_HANDLE, template_handle, 1, fieldml_info%ELEMENTS_ARGUMENT_HANDLE )
1346 &
"Cannot set index evaluator for mesh omponent template "//component_name//
".template.", &
1347 & fieldml_info%FML_HANDLE, err, error, *999 )
1349 DO i = 1, element_count
1350 CALL mesh_topology_elements_element_basis_get( i, mesh_elements, basis, err, error, *999 )
1355 IF( connectivity_count > 0 )
THEN 1360 IF( idx == -1 )
THEN 1361 IF( connectivity_count == 0 )
THEN 1362 ALLOCATE( connectivity_info( connectivity_count + 1 ), stat = err )
1363 IF( err /= 0 )
CALL flagerror(
"Could not allocate connectivity info array.", err, error, *999 )
1365 ALLOCATE( temp_connectivity_info( connectivity_count ), stat = err )
1366 IF( err /= 0 )
CALL flagerror(
"Could not allocate temporary connectivity array.", err, error, *999 )
1367 temp_connectivity_info(:) = connectivity_info(:)
1368 DEALLOCATE( connectivity_info )
1369 ALLOCATE( connectivity_info( connectivity_count + 1 ), stat = err )
1370 IF( err /= 0 )
CALL flagerror(
"Could not allocate new connectivity info array.", err, error, *999 )
1371 connectivity_info( 1:connectivity_count ) = temp_connectivity_info( 1:connectivity_count )
1375 & connectivity_info(connectivity_count+1), err, error, *999 )
1377 layout_node_count = fieldml_getmembercount( fieldml_info%FML_HANDLE, &
1378 & connectivity_info(connectivity_count+1)%LAYOUT_HANDLE )
1381 array_location = array_location//( connectivity_count + 1 )
1382 sizes(1) = element_count
1383 sizes(2) = layout_node_count
1384 source_handle = fieldml_createarraydatasource( fieldml_info%FML_HANDLE,
cchar(component_name//
".connectivity"), &
1385 & resource_handle,
cchar(array_location), 2 )
1386 fml_err = fieldml_setarraydatasourcerawsizes( fieldml_info%FML_HANDLE, source_handle, c_loc(sizes) )
1387 fml_err = fieldml_setarraydatasourcesizes( fieldml_info%FML_HANDLE, source_handle, c_loc(sizes) )
1389 & fieldml_info%FML_HANDLE, err, error, *999 )
1391 fml_err = fieldml_setdatasource( fieldml_info%FML_HANDLE, connectivity_info(connectivity_count+1)%CONNECTIVITY_HANDLE, &
1394 & fieldml_info%FML_HANDLE, err, error, *999 )
1396 connectivity_count = connectivity_count + 1
1398 idx = connectivity_count
1400 connectivity_handle = connectivity_info(idx)%CONNECTIVITY_HANDLE
1402 IF( basis_count == 0 )
THEN 1408 IF( idx == -1 )
THEN 1409 IF( basis_count == 0 )
THEN 1410 ALLOCATE( basis_info( basis_count + 1 ), stat = err )
1411 IF( err /= 0 )
CALL flagerror(
"Could not allocate basis info array.", err, error, *999 )
1413 ALLOCATE( temp_basis_info( basis_count ), stat = err )
1414 IF( err /= 0 )
CALL flagerror(
"Could not allocate temporary basis info array.", err, error, *999 )
1415 temp_basis_info(:) = basis_info(:)
1416 DEALLOCATE( basis_info )
1417 ALLOCATE( basis_info( basis_count + 1 ), stat = err )
1418 IF( err /= 0 )
CALL flagerror(
"Could not allocate new basis info array.", err, error, *999 )
1419 basis_info( 1:basis_count ) = temp_basis_info( 1:basis_count )
1422 basis_count = basis_count + 1
1423 basis_info( basis_count )%BASIS => basis
1424 basis_info( basis_count )%CONNECTIVITY_HANDLE = connectivity_handle
1425 basis_info( basis_count )%LAYOUT_HANDLE = layout_handle
1431 default_handle = basis_info( idx )%REFERENCE_HANDLE
1432 fml_err = fieldml_setdefaultevaluator( fieldml_info%FML_HANDLE, template_handle, default_handle )
1433 ELSEIF( basis_info( idx )%REFERENCE_HANDLE /= default_handle )
THEN 1434 fml_err = fieldml_setevaluator( fieldml_info%FML_HANDLE, template_handle, i, basis_info( idx )%REFERENCE_HANDLE )
1437 & fieldml_info%FML_HANDLE, err, error, *999 )
1441 DO i = 1, connectivity_count
1442 layout_node_count = fieldml_getmembercount( fieldml_info%FML_HANDLE, connectivity_info(i)%LAYOUT_HANDLE )
1445 source_handle = fieldml_getdatasource( fieldml_info%FML_HANDLE, connectivity_info(i)%CONNECTIVITY_HANDLE )
1447 sizes(1) = element_count
1448 sizes(2) = layout_node_count
1450 writer = fieldml_openarraywriter( fieldml_info%FML_HANDLE, source_handle, fieldml_info%NODES_HANDLE, 0, c_loc(sizes), 2)
1452 writer = fieldml_openarraywriter( fieldml_info%FML_HANDLE, source_handle, fieldml_info%NODES_HANDLE, 1, c_loc(sizes), 2)
1456 ALLOCATE( ibuffer( layout_node_count ), stat = err )
1457 IF( err /= 0 )
CALL flagerror(
"Could not allocate layout buffer.", err, error, *999 )
1459 sizes(2) = layout_node_count
1461 DO j = 1, element_count
1462 CALL mesh_topology_elements_element_basis_get( j, mesh_elements, basis, err, error, *999 )
1465 IF( layout_handle == connectivity_info(i)%LAYOUT_HANDLE )
THEN 1466 CALL mesh_topology_elements_element_nodes_get( j, mesh_elements, ibuffer, err, error, *999 )
1470 fml_err = fieldml_writeintslab( writer, c_loc(offsets), c_loc(sizes), c_loc(ibuffer) )
1471 IF( fml_err /= fml_err_no_error )
THEN 1472 CALL flagerror(
var_str(
"I/O error while writing connectivity data for ")//base_name//
"("&
1474 & err, error, *999 )
1476 offsets(1) = offsets(1) + 1
1478 DEALLOCATE( ibuffer )
1479 fml_err = fieldml_closewriter( writer )
1481 & err, error, *999 )
1484 IF(
ALLOCATED( basis_info ) )
THEN 1485 DEALLOCATE( basis_info )
1487 IF(
ALLOCATED( connectivity_info ) )
THEN 1488 DEALLOCATE( connectivity_info )
1491 CALL list_item_set( fieldml_info%COMPONENT_HANDLES, component_number, template_handle, err, error, *999 )
1493 exits(
"FIELDML_OUTPUT_ADD_MESH_COMPONENT" )
1495 999 errorsexits(
"FIELDML_OUTPUT_ADD_MESH_COMPONENT", err, error )
1506 & field_component_numbers, variable_type, set_type, node_dofs_handle, err, error, * )
1511 INTEGER(INTG),
INTENT(IN) :: TYPE_HANDLE
1512 TYPE(
field_type),
POINTER,
INTENT(IN) :: FIELD
1513 INTEGER(INTG),
INTENT(IN) :: FIELD_COMPONENT_NUMBERS(:)
1514 INTEGER(INTG),
INTENT(IN) :: VARIABLE_TYPE
1515 INTEGER(INTG),
INTENT(IN) :: SET_TYPE
1516 INTEGER(INTG),
INTENT(INOUT) :: NODE_DOFS_HANDLE
1517 INTEGER(INTG),
INTENT(OUT) :: ERR
1522 INTEGER(INTG) :: TYPE_COMPONENT_HANDLE, REAL_1D_HANDLE, NODE_COUNT, INDEX_HANDLE, RESOURCE_HANDLE, SOURCE_HANDLE
1523 INTEGER(INTG) :: VERSION_NUMBER,COMPONENT_COUNT, I, J, INTERPOLATION_TYPE, GLOBAL_NODE_NUMBER, RANK
1524 INTEGER(INTG),
ALLOCATABLE :: MESH_COMPONENT_NUMBERS(:)
1525 INTEGER(INTG),
TARGET :: SIZES(2), OFFSETS(2), SINGLE_SIZE
1526 INTEGER(INTG) :: WRITER, FML_ERR
1527 REAL(C_DOUBLE),
ALLOCATABLE,
TARGET :: DBUFFER(:)
1528 REAL(C_DOUBLE) :: DVALUE
1529 LOGICAL :: NODE_EXISTS
1530 LOGICAL,
ALLOCATABLE :: IS_NODE_BASED(:)
1531 TYPE(c_ptr) :: SIZE_POINTER
1533 INTEGER(INTG) :: myComputationalNodeNumber,nodeDomain,meshComponentNumber
1535 enters(
"FIELDML_OUTPUT_ADD_FIELD_NODE_DOFS", err, error, *999 )
1537 mesh => field%DECOMPOSITION%MESH
1541 component_count = fieldml_gettypecomponentcount( fieldml_info%FML_HANDLE, type_handle )
1542 type_component_handle = fieldml_gettypecomponentensemble( fieldml_info%FML_HANDLE, type_handle )
1543 node_count = fieldml_getmembercount( fieldml_info%FML_HANDLE, fieldml_info%NODES_HANDLE )
1545 ALLOCATE( mesh_component_numbers( component_count ), stat = err )
1546 IF( err /= 0 )
CALL flagerror(
"Could not allocate mesh component array.", err, error, *999 )
1547 ALLOCATE( is_node_based( component_count ), stat = err )
1548 IF( err /= 0 )
CALL flagerror(
"Could not allocate nodal component array.", err, error, *999 )
1550 DO i = 1, component_count
1551 CALL field_component_mesh_component_get( field, variable_type, field_component_numbers(i), &
1552 & mesh_component_numbers(i), err, error, *999 )
1553 CALL field_component_interpolation_get( field, variable_type, field_component_numbers(i), interpolation_type, &
1554 & err, error, *999 )
1556 is_node_based( i ) = ( interpolation_type == field_node_based_interpolation )
1559 resource_handle = fieldml_createhrefdataresource( fieldml_info%FML_HANDLE,
cchar(base_name//
".dofs.node.resource"), &
1560 &
cchar( dof_format ),
cchar(base_name//
".dofs.node") )
1562 & fieldml_info%FML_HANDLE, err, error, *999 )
1564 node_dofs_handle = fieldml_createparameterevaluator( fieldml_info%FML_HANDLE,
cchar(base_name//
".dofs.node"), real_1d_handle )
1566 & fieldml_info%FML_HANDLE, err, error, *999 )
1567 fml_err = fieldml_setparameterdatadescription( fieldml_info%FML_HANDLE, node_dofs_handle, fml_data_description_dense_array )
1569 & fieldml_info%FML_HANDLE, err, error, *999 )
1571 sizes( 1 ) = node_count
1572 sizes( 2 ) = component_count
1573 single_size = node_count
1575 IF( component_count == 1 )
THEN 1577 size_pointer = c_loc(single_size)
1580 size_pointer = c_loc(sizes)
1583 array_location = array_location//1
1584 source_handle = fieldml_createarraydatasource( fieldml_info%FML_HANDLE,
cchar(base_name//
".dofs.node.data"), &
1585 & resource_handle,
cchar(array_location), rank )
1586 fml_err = fieldml_setarraydatasourcerawsizes( fieldml_info%FML_HANDLE, source_handle, size_pointer )
1587 fml_err = fieldml_setarraydatasourcesizes( fieldml_info%FML_HANDLE, source_handle, size_pointer )
1589 & fieldml_info%FML_HANDLE, err, error, *999 )
1591 fml_err = fieldml_setdatasource( fieldml_info%FML_HANDLE, node_dofs_handle, source_handle )
1593 & fieldml_info%FML_HANDLE, err, error, *999 )
1595 fml_err = fieldml_adddenseindexevaluator( fieldml_info%FML_HANDLE, node_dofs_handle, fieldml_info%NODES_ARGUMENT_HANDLE, &
1596 & fml_invalid_handle )
1598 & fieldml_info%FML_HANDLE, err, error, *999 )
1600 IF( type_component_handle /= fml_invalid_handle )
THEN 1605 fml_err = fieldml_adddenseindexevaluator( fieldml_info%FML_HANDLE, node_dofs_handle, index_handle, fml_invalid_handle )
1607 &
"Cannot add component index for nodal dofs parameter set "//base_name//
".dofs.node.", &
1608 & fieldml_info%FML_HANDLE, err, error, *999 )
1611 ALLOCATE( dbuffer( component_count ), stat = err )
1612 IF( err /= 0 )
CALL flagerror(
"Could not allocate nodal dofs array.", err, error, *999 )
1613 writer = fieldml_openarraywriter( fieldml_info%FML_HANDLE, source_handle, real_1d_handle, 0, size_pointer, rank )
1615 & fieldml_info%FML_HANDLE, err, error, *999 )
1619 sizes(2) = component_count
1620 DO i = 1, node_count
1621 DO j = 1, component_count
1623 IF( is_node_based(j) )
THEN 1624 CALL meshtopologynodecheckexists( mesh, mesh_component_numbers(j), i, node_exists, global_node_number, &
1625 & err, error, *999 )
1626 IF( node_exists )
THEN 1631 CALL decomposition_mesh_component_number_get(field%DECOMPOSITION,meshcomponentnumber,err,error,*999)
1632 CALL decomposition_node_domain_get(field%DECOMPOSITION,i,meshcomponentnumber,nodedomain,err,error,*999)
1633 IF(nodedomain==mycomputationalnodenumber)
THEN 1634 CALL field_parameter_set_get_node( field, variable_type, set_type, version_number, &
1635 &
no_global_deriv, i, field_component_numbers(j), dvalue, err, error, *999 )
1640 dbuffer( j ) = dvalue
1642 fml_err = fieldml_writedoubleslab( writer, c_loc(offsets), c_loc(sizes), c_loc(dbuffer) )
1643 IF( fml_err /= fml_err_no_error )
THEN 1644 CALL flagerror(
var_str(
"I/O error while writing nodal parameter values for ")//base_name//
"("// &
1647 offsets(1) = offsets(1) + 1
1649 fml_err = fieldml_closewriter( writer )
1651 & fieldml_info%FML_HANDLE, err, error, *999 )
1652 DEALLOCATE( dbuffer )
1654 DEALLOCATE( mesh_component_numbers )
1655 DEALLOCATE( is_node_based )
1657 exits(
"FIELDML_OUTPUT_ADD_FIELD_NODE_DOFS" )
1659 999 errorsexits(
"FIELDML_OUTPUT_ADD_FIELD_NODE_DOFS", err, error )
1670 & field_component_numbers, variable_type, set_type, element_dofs_handle, err, error, * )
1675 INTEGER(INTG),
INTENT(IN) :: TYPE_HANDLE
1676 TYPE(
field_type),
POINTER,
INTENT(IN) :: FIELD
1677 INTEGER(INTG),
INTENT(IN) :: FIELD_COMPONENT_NUMBERS(:)
1678 INTEGER(INTG),
INTENT(IN) :: VARIABLE_TYPE
1679 INTEGER(INTG),
INTENT(IN) :: SET_TYPE
1680 INTEGER(INTG),
INTENT(INOUT) :: ELEMENT_DOFS_HANDLE
1681 INTEGER(INTG),
INTENT(OUT) :: ERR
1685 INTEGER(INTG) :: TYPE_COMPONENT_HANDLE, REAL_1D_HANDLE, ELEMENT_COUNT, INDEX_HANDLE, RESOURCE_HANDLE, SOURCE_HANDLE
1686 INTEGER(INTG) :: COMPONENT_COUNT, I, J, INTERPOLATION_TYPE
1687 INTEGER(INTG),
ALLOCATABLE :: MESH_COMPONENT_NUMBERS(:)
1688 INTEGER(INTG) :: WRITER, FML_ERR
1689 INTEGER(INTG),
TARGET :: SIZES(2), OFFSETS(2)
1690 REAL(C_DOUBLE),
ALLOCATABLE,
TARGET :: DBUFFER(:)
1691 REAL(C_DOUBLE) :: DVALUE
1692 LOGICAL,
ALLOCATABLE :: IS_ELEMENT_BASED(:)
1695 exits(
"FIELDML_OUTPUT_ADD_FIELD_ELEMENT_DOFS" )
1699 component_count = fieldml_gettypecomponentcount( fieldml_info%FML_HANDLE, type_handle )
1700 type_component_handle = fieldml_gettypecomponentensemble( fieldml_info%FML_HANDLE, type_handle )
1702 element_count = fieldml_getmembercount( fieldml_info%FML_HANDLE, fieldml_info%ELEMENTS_HANDLE )
1704 ALLOCATE( mesh_component_numbers( component_count ), stat = err )
1705 IF( err /= 0 )
CALL flagerror(
"Could not allocate mesh component number array.", err, error, *999 )
1706 ALLOCATE( is_element_based( component_count ), stat = err )
1707 IF( err /= 0 )
CALL flagerror(
"Could not allocate element component array.", err, error, *999 )
1709 DO i = 1, component_count
1710 CALL field_component_mesh_component_get( field, variable_type, field_component_numbers(i), &
1711 & mesh_component_numbers(i), err, error, *999 )
1712 CALL field_component_interpolation_get( field, variable_type, field_component_numbers(i), interpolation_type, &
1713 & err, error, *999 )
1715 is_element_based( i ) = ( interpolation_type == field_element_based_interpolation )
1718 resource_handle = fieldml_createhrefdataresource( fieldml_info%FML_HANDLE,
cchar(base_name//
".dofs.element.resource"), &
1719 &
cchar( dof_format ),
cchar(base_name//
".dofs.element") )
1721 & fieldml_info%FML_HANDLE, err, error, *999 )
1723 element_dofs_handle = fieldml_createparameterevaluator( fieldml_info%FML_HANDLE,
cchar(base_name//
".dofs.element"), &
1726 & fieldml_info%FML_HANDLE, err, error, *999 )
1727 fml_err = fieldml_setparameterdatadescription( fieldml_info%FML_HANDLE, element_dofs_handle, fml_data_description_dense_array )
1729 & fieldml_info%FML_HANDLE, err, error, *999 )
1731 array_location = array_location//1
1732 source_handle = fieldml_createarraydatasource( fieldml_info%FML_HANDLE,
cchar(base_name//
".dofs.element.data"), &
1733 & resource_handle,
cchar(array_location), 2 )
1734 sizes( 1 ) = element_count
1735 sizes( 2 ) = component_count
1736 fml_err = fieldml_setarraydatasourcerawsizes( fieldml_info%FML_HANDLE, source_handle, c_loc( sizes ) )
1737 fml_err = fieldml_setarraydatasourcesizes( fieldml_info%FML_HANDLE, source_handle, c_loc( sizes ) )
1739 & fieldml_info%FML_HANDLE, err, error, *999 )
1741 fml_err = fieldml_setdatasource( fieldml_info%FML_HANDLE, element_dofs_handle, source_handle )
1743 & fieldml_info%FML_HANDLE, err, error, *999 )
1745 fml_err = fieldml_adddenseindexevaluator( fieldml_info%FML_HANDLE, element_dofs_handle, &
1746 & fieldml_info%ELEMENTS_ARGUMENT_HANDLE, fml_invalid_handle )
1748 & , fieldml_info%FML_HANDLE, err, error, *999 )
1750 IF( type_component_handle /= fml_invalid_handle )
THEN 1755 fml_err = fieldml_adddenseindexevaluator( fieldml_info%FML_HANDLE, element_dofs_handle, type_component_handle, &
1756 & fml_invalid_handle )
1758 &
".dofs.element.", fieldml_info%FML_HANDLE, err, error, *999 )
1761 ALLOCATE( dbuffer( component_count ), stat = err )
1762 IF( err /= 0 )
CALL flagerror(
"Could not allocate element dofs buffer.", err, error, *999 )
1763 writer = fieldml_openarraywriter( fieldml_info%FML_HANDLE, source_handle, real_1d_handle, 0, c_loc(sizes), 2 )
1765 & fieldml_info%FML_HANDLE, err, error, *999 )
1769 sizes(2) = component_count
1770 DO i = 1, element_count
1771 DO j = 1, component_count
1773 IF( is_element_based(j) )
THEN 1774 CALL field_parameter_set_get_element( field, variable_type, set_type, i, &
1775 & field_component_numbers(j), dvalue, err, error, *999 )
1777 dbuffer( j ) = dvalue
1779 fml_err = fieldml_writedoubleslab( writer, c_loc(offsets), c_loc(sizes), c_loc(dbuffer) )
1780 IF( fml_err /= fml_err_no_error )
THEN 1781 CALL flagerror(
var_str(
"I/O error while writing element parameter values for")//base_name//
"("&
1784 offsets(1) = offsets(1) + 1
1786 fml_err = fieldml_closewriter( writer )
1788 & fieldml_info%FML_HANDLE, err, error, *999 )
1789 DEALLOCATE( dbuffer )
1791 DEALLOCATE( mesh_component_numbers )
1792 DEALLOCATE( is_element_based )
1794 exits(
"FIELDML_OUTPUT_ADD_FIELD_ELEMENT_DOFS" )
1796 999 errorsexits(
"FIELDML_OUTPUT_ADD_FIELD_ELEMENT_DOFS", err, error )
1807 & field_component_numbers, variable_type, set_type, constant_dofs_handle, err, error, * )
1812 INTEGER(INTG),
INTENT(IN) :: TYPE_HANDLE
1813 TYPE(
field_type),
POINTER,
INTENT(IN) :: FIELD
1814 INTEGER(INTG),
INTENT(IN) :: FIELD_COMPONENT_NUMBERS(:)
1815 INTEGER(INTG),
INTENT(IN) :: VARIABLE_TYPE
1816 INTEGER(INTG),
INTENT(IN) :: SET_TYPE
1817 INTEGER(INTG),
INTENT(INOUT) :: CONSTANT_DOFS_HANDLE
1818 INTEGER(INTG),
INTENT(OUT) :: ERR
1822 INTEGER(INTG) :: DOFTYPE_HANDLE, TYPE_TYPE, COMPONENT_TYPE, DATA_TYPE, INDEX_HANDLE, RESOURCE_HANDLE, SOURCE_HANDLE
1823 INTEGER(INTG) :: COMPONENT_COUNT, I, J, INTERPOLATION_TYPE
1824 INTEGER(INTG),
ALLOCATABLE :: MESH_COMPONENT_NUMBERS(:)
1825 INTEGER(INTG),
TARGET :: OFFSETS(2), SINGLE_SIZE
1827 INTEGER(INTG) :: WRITER, FML_ERR
1828 REAL(C_DOUBLE),
ALLOCATABLE,
TARGET :: DBUFFER(:)
1829 INTEGER(INTG),
ALLOCATABLE,
TARGET :: IBUFFER(:)
1830 REAL(C_DOUBLE) :: DVALUE
1831 INTEGER(INTG) :: IVALUE
1833 LOGICAL,
ALLOCATABLE :: IS_CONSTANT(:)
1835 enters(
"FIELDML_OUTPUT_ADD_FIELD_CONSTANT_DOFS", err, error, *999 )
1837 type_type = fieldml_getobjecttype( fieldml_info%FML_HANDLE, type_handle )
1839 IF( type_type == fht_ensemble_type )
THEN 1840 doftype_handle = type_handle
1842 component_type = fml_invalid_handle
1846 component_count = fieldml_gettypecomponentcount( fieldml_info%FML_HANDLE, type_handle )
1847 component_type = fieldml_gettypecomponentensemble( fieldml_info%FML_HANDLE, type_handle )
1851 ALLOCATE( mesh_component_numbers( component_count ), stat = err )
1852 IF( err /= 0 )
CALL flagerror(
"Could not allocate mesh component array.", err, error, *999 )
1853 ALLOCATE( is_constant( component_count ), stat = err )
1854 IF( err /= 0 )
CALL flagerror(
"Could not allocate constant component array.", err, error, *999 )
1856 DO i = 1, component_count
1857 CALL field_component_mesh_component_get( field, variable_type, field_component_numbers(i), &
1858 & mesh_component_numbers(i), err, error, *999 )
1859 CALL field_component_interpolation_get( field, variable_type, field_component_numbers(i), interpolation_type, &
1860 & err, error, *999 )
1862 is_constant( i ) = ( interpolation_type == field_constant_interpolation )
1865 resource_handle = fieldml_createhrefdataresource( fieldml_info%FML_HANDLE,
cchar(base_name//
".dofs.constant.resource"), &
1866 &
cchar( dof_format ),
cchar(base_name//
".dofs.constant") )
1868 & fieldml_info%FML_HANDLE, err, error, *999 )
1870 constant_dofs_handle = fieldml_createparameterevaluator( fieldml_info%FML_HANDLE,
cchar(base_name//
".dofs.constant"), &
1873 & fieldml_info%FML_HANDLE, err, error, *999 )
1874 fml_err = fieldml_setparameterdatadescription( fieldml_info%FML_HANDLE, constant_dofs_handle, fml_data_description_dense_array )
1876 & fieldml_info%FML_HANDLE, err, error, *999 )
1878 array_location = array_location//1
1879 source_handle = fieldml_createarraydatasource( fieldml_info%FML_HANDLE,
cchar(base_name//
".dofs.element.data"), &
1880 & resource_handle,
cchar(array_location), 1 )
1881 single_size = component_count
1882 fml_err = fieldml_setarraydatasourcerawsizes( fieldml_info%FML_HANDLE, source_handle, c_loc(single_size) )
1883 fml_err = fieldml_setarraydatasourcesizes( fieldml_info%FML_HANDLE, source_handle, c_loc(single_size) )
1885 & fieldml_info%FML_HANDLE, err, error, *999 )
1887 fml_err = fieldml_setdatasource( fieldml_info%FML_HANDLE, constant_dofs_handle, source_handle )
1889 & fieldml_info%FML_HANDLE, err, error, *999 )
1891 IF( component_type /= fml_invalid_handle )
THEN 1896 fml_err = fieldml_adddenseindexevaluator( fieldml_info%FML_HANDLE, constant_dofs_handle, index_handle, fml_invalid_handle )
1898 &
".dofs.constant", fieldml_info%FML_HANDLE, err, error, *999 )
1901 writer = fieldml_openarraywriter( fieldml_info%FML_HANDLE, source_handle, doftype_handle, 0, c_loc(single_size), 1 )
1903 & fieldml_info%FML_HANDLE, err, error, *999 )
1905 CALL field_data_type_get( field, variable_type, data_type, err, error, *999 )
1906 IF( data_type == field_intg_type )
THEN 1908 ELSEIF( data_type == field_dp_type )
THEN 1913 single_size = component_count
1915 ALLOCATE( dbuffer( component_count ), stat = err )
1916 IF( err /= 0 )
CALL flagerror(
"Could not allocate constant dofs buffer.", err, error, *999 )
1917 DO j = 1, component_count
1919 IF( is_constant(j) )
THEN 1920 CALL field_parameter_set_get_constant( field, variable_type, set_type, &
1921 & field_component_numbers(j), dvalue, err, error, *999 )
1923 dbuffer( j ) = dvalue
1925 fml_err = fieldml_writedoubleslab( writer, c_loc(offsets), c_loc(single_size), c_loc(dbuffer) )
1926 IF( fml_err /= fml_err_no_error )
THEN 1927 CALL flagerror(
var_str(
"I/O error while writing constant parameter values for ")//base_name//
"(" &
1930 fml_err = fieldml_closewriter( writer )
1932 & fieldml_info%FML_HANDLE, err, error, *999 )
1933 DEALLOCATE( dbuffer )
1935 ALLOCATE( ibuffer( component_count ), stat = err )
1936 IF( err /= 0 )
CALL flagerror(
"Could not allocate constant dofs buffer.", err, error, *999 )
1937 DO j = 1, component_count
1939 IF( is_constant(j) )
THEN 1940 CALL field_parameter_set_get_constant( field, variable_type, set_type, &
1941 & field_component_numbers(j), ivalue, err, error, *999 )
1943 ibuffer( j ) = ivalue
1945 fml_err = fieldml_writeintslab( writer, c_loc(offsets), c_loc(single_size), c_loc(ibuffer) )
1946 IF( fml_err /= fml_err_no_error )
THEN 1947 CALL flagerror(
var_str(
"I/O while writing constant parameter values for ")//base_name//
"(" &
1950 fml_err = fieldml_closewriter( writer )
1952 & fieldml_info%FML_HANDLE, err, error, *999 )
1953 DEALLOCATE( ibuffer )
1956 DEALLOCATE( mesh_component_numbers )
1957 DEALLOCATE( is_constant )
1959 exits(
"FIELDML_OUTPUT_ADD_FIELD_CONSTANT_DOFS" )
1961 999 errorsexits(
"FIELDML_OUTPUT_ADD_FIELD_CONSTANT_DOFS", err, error )
1973 TYPE(
mesh_type),
POINTER,
INTENT(IN) :: MESH
1978 INTEGER(INTG),
INTENT(OUT) :: ERR
1983 INTEGER(INTG) :: COMPONENT_COUNT, I, NODE_COUNT, ELEMENT_COUNT, DIMENSIONS
1984 INTEGER(INTG) :: REAL_1D_HANDLE, XI_COMPONENT_HANDLE, FML_ERR, SHAPE_HANDLE
1990 enters(
"FIELDML_OUTPUT_INITIALISE_INFO", err, error, *999 )
1992 region => mesh%REGION
1994 dimensions = mesh%NUMBER_OF_DIMENSIONS
1998 fieldml_info%FML_HANDLE = fieldml_create(
cchar(location),
cchar(base_name) )
2000 & fieldml_info%FML_HANDLE, err, error, *999 )
2004 CALL nodes_number_of_nodes_get( nodes, node_count, err, error, *999 )
2006 fieldml_info%NODES_HANDLE = fieldml_createensembletype( fieldml_info%FML_HANDLE,
cchar(base_name//
".nodes") )
2008 & fieldml_info%FML_HANDLE, err, error, *999 )
2009 fml_err = fieldml_setensemblemembersrange( fieldml_info%FML_HANDLE, fieldml_info%NODES_HANDLE, 1, node_count, 1 )
2011 & fieldml_info%FML_HANDLE, err, error, *999 )
2013 fieldml_info%NODES_ARGUMENT_HANDLE = fieldml_createargumentevaluator( fieldml_info%FML_HANDLE, &
2014 &
cchar(base_name//
".nodes.argument"), fieldml_info%NODES_HANDLE )
2016 & fieldml_info%FML_HANDLE, err, error, *999 )
2018 CALL mesh_number_of_elements_get( mesh, element_count, err, error, *999 )
2020 fieldml_info%MESH_HANDLE = fieldml_createmeshtype( fieldml_info%FML_HANDLE,
cchar(base_name//
".mesh") )
2022 & err, error, *999 )
2024 fieldml_info%ELEMENTS_HANDLE = fieldml_createmeshelementstype( fieldml_info%FML_HANDLE, fieldml_info%MESH_HANDLE, &
2025 &
"element"//c_null_char )
2027 & fieldml_info%FML_HANDLE, err, error, *999 )
2028 fml_err = fieldml_setensemblemembersrange( fieldml_info%FML_HANDLE, fieldml_info%ELEMENTS_HANDLE, 1, element_count, 1 )
2030 & fieldml_info%FML_HANDLE, err, error, *999 )
2032 fieldml_info%XI_HANDLE = fieldml_createmeshcharttype( fieldml_info%FML_HANDLE, fieldml_info%MESH_HANDLE,
"xi"//c_null_char )
2034 & fieldml_info%FML_HANDLE, err, error, *999 )
2035 xi_component_handle = fieldml_createcontinuoustypecomponents( fieldml_info%FML_HANDLE, fieldml_info%XI_HANDLE, &
2036 &
cchar(base_name//
".mesh.xi.component"), dimensions )
2038 & fieldml_info%FML_HANDLE, err, error, *999 )
2040 fml_err = fieldml_createargumentevaluator( fieldml_info%FML_HANDLE,
cchar(base_name//
".mesh.argument"), &
2041 & fieldml_info%MESH_HANDLE )
2043 & fieldml_info%FML_HANDLE, err, error, *999 )
2045 fieldml_info%XI_ARGUMENT_HANDLE = fieldml_getobjectbyname( fieldml_info%FML_HANDLE,
cchar(base_name//
".mesh.argument.xi") )
2047 & fieldml_info%FML_HANDLE, err, error, *999 )
2048 fieldml_info%ELEMENTS_ARGUMENT_HANDLE = fieldml_getobjectbyname( fieldml_info%FML_HANDLE, &
2049 &
cchar(base_name//
".mesh.argument.element") )
2051 & fieldml_info%FML_HANDLE, err, error, *999 )
2056 fieldml_info%NODE_DOFS_HANDLE = fieldml_createargumentevaluator( fieldml_info%FML_HANDLE,
cchar(base_name//
".dofs.node"), &
2059 & fieldml_info%FML_HANDLE, err, error, *999 )
2069 CALL mesh_number_of_components_get( mesh, component_count, err, error, *999 )
2070 DO i = 1, component_count
2071 NULLIFY( mesh_elements )
2072 CALL list_item_add( fieldml_info%COMPONENT_HANDLES, fml_invalid_handle, err, error, *999 )
2073 CALL mesh_topology_elements_get( mesh, i, mesh_elements, err, error, *999 )
2075 & err, error, *999 )
2076 basis =>mesh_elements%ELEMENTS( 1 )%BASIS
2081 IF( dimensions == 1 )
THEN 2082 shape_name =
"shape.unit.line" 2083 ELSE IF( dimensions == 2 )
THEN 2084 SELECT CASE(basis%TYPE)
2086 shape_name =
"shape.unit.triangle" 2088 shape_name =
"shape.unit.square" 2091 SELECT CASE(basis%TYPE)
2093 shape_name =
"shape.unit.tetrahedron" 2095 shape_name =
"shape.unit.cube" 2102 fml_err = fieldml_setmeshshapes( fieldml_info%FML_HANDLE, fieldml_info%MESH_HANDLE, shape_handle )
2105 exits(
"FIELDML_OUTPUT_INITIALISE_INFO" )
2108 999 errorsexits(
"FIELDML_OUTPUT_INITIALISE_INFO", err, error )
2119 & field_component_numbers, variable_type, set_type, err, error, * )
2122 INTEGER(INTG),
INTENT(IN) :: TYPE_HANDLE
2125 TYPE(
field_type),
POINTER,
INTENT(IN) :: FIELD
2126 INTEGER(INTG),
INTENT(IN) :: FIELD_COMPONENT_NUMBERS(:)
2127 INTEGER(INTG),
INTENT(IN) :: VARIABLE_TYPE
2128 INTEGER(INTG),
INTENT(IN) :: SET_TYPE
2129 INTEGER(INTG),
INTENT(OUT) :: ERR
2134 INTEGER(INTG) :: FIELD_HANDLE, COMPONENT_HANDLE, NODAL_DOFS_HANDLE, ELEMENT_DOFS_HANDLE, CONSTANT_DOFS_HANDLE, INDEX_HANDLE
2135 INTEGER(INTG) :: COMPONENT_COUNT, I, MESH_COMPONENT_NUMBER, INTERPOLATION_TYPE, FML_ERR, valueType
2136 INTEGER(INTG),
ALLOCATABLE,
TARGET :: COMPONENT_EVALUATORS(:)
2138 enters(
"FIELDML_OUTPUT_ADD_FIELD_COMPONENTS", err, error, *999 )
2142 mesh => field%DECOMPOSITION%MESH
2144 component_handle = fieldml_gettypecomponentensemble( fieldml_info%FML_HANDLE, type_handle )
2145 component_count = fieldml_gettypecomponentcount( fieldml_info%FML_HANDLE, type_handle )
2146 ALLOCATE( component_evaluators( component_count ), stat = err )
2147 IF( err /= 0 )
CALL flagerror(
"Could not allocate component evaluators array.", err, error, *999 )
2149 IF(
SIZE( field_component_numbers ) /= component_count )
THEN 2150 CALL flagerror(
var_str(
"Fieldml Component count ")//
SIZE( field_component_numbers )//&
2151 &
" must match value type component count "//component_count//
".", err, error, *999 )
2154 nodal_dofs_handle = fml_invalid_handle
2155 element_dofs_handle = fml_invalid_handle
2156 constant_dofs_handle = fml_invalid_handle
2158 DO i = 1, component_count
2159 CALL field_component_interpolation_get( field, variable_type, field_component_numbers(i), interpolation_type, &
2160 & err, error, *999 )
2162 IF( interpolation_type == field_node_based_interpolation )
THEN 2163 IF( nodal_dofs_handle == fml_invalid_handle )
THEN 2165 & field_component_numbers, variable_type, set_type, nodal_dofs_handle, err, error, *999 )
2167 CALL field_component_mesh_component_get( field, variable_type, field_component_numbers(i), &
2168 & mesh_component_number, err, error, *999 )
2169 CALL list_item_get( fieldml_info%COMPONENT_HANDLES, mesh_component_number, component_evaluators( i ), &
2170 & err, error, *999 )
2171 ELSEIF( interpolation_type == field_element_based_interpolation )
THEN 2172 IF( element_dofs_handle == fml_invalid_handle )
THEN 2174 & field_component_numbers, variable_type, set_type, element_dofs_handle, err, error, *999 )
2176 component_evaluators( i ) = element_dofs_handle
2177 ELSEIF( interpolation_type == field_constant_interpolation )
THEN 2178 IF( constant_dofs_handle == fml_invalid_handle )
THEN 2180 & field_component_numbers, variable_type, set_type, constant_dofs_handle, err, error, *999 )
2182 component_evaluators( i ) = constant_dofs_handle
2186 IF( component_handle /= fml_invalid_handle )
THEN 2187 field_handle = fieldml_createaggregateevaluator( fieldml_info%FML_HANDLE,
cchar(base_name), type_handle )
2189 & fieldml_info%FML_HANDLE, err, error, *999 )
2192 fml_err = fieldml_setindexevaluator( fieldml_info%FML_HANDLE, field_handle, 1, index_handle )
2194 & fieldml_info%FML_HANDLE, err, error, *999 )
2196 DO i = 1, component_count
2197 fml_err = fieldml_setevaluator( fieldml_info%FML_HANDLE, field_handle, i, component_evaluators( i ) )
2199 & fieldml_info%FML_HANDLE, err, error, *999 )
2202 valuetype = fieldml_getvaluetype( fieldml_info%FML_HANDLE, component_evaluators( 1 ) )
2203 field_handle = fieldml_createreferenceevaluator( fieldml_info%FML_HANDLE,
cchar(base_name), component_evaluators( 1 ), &
2206 & fieldml_info%FML_HANDLE, err, error, *999 )
2209 IF( nodal_dofs_handle /= fml_invalid_handle )
THEN 2210 fml_err = fieldml_setbind( fieldml_info%FML_HANDLE, field_handle, fieldml_info%NODE_DOFS_HANDLE, nodal_dofs_handle )
2212 & fieldml_info%FML_HANDLE, err, error, *999 )
2226 DEALLOCATE( component_evaluators )
2227 exits(
"FIELDML_OUTPUT_ADD_FIELD_COMPONENTS" )
2229 999
DEALLOCATE( component_evaluators )
2230 errorsexits(
"FIELDML_OUTPUT_ADD_FIELD_COMPONENTS", err, error )
2246 TYPE(
field_type),
POINTER,
INTENT(IN) :: FIELD
2247 INTEGER(INTG),
INTENT(IN) :: VARIABLE_TYPE
2248 INTEGER(INTG),
INTENT(IN) :: SET_TYPE
2249 INTEGER(INTG),
INTENT(OUT) :: ERR
2253 INTEGER(INTG) :: TYPE_HANDLE
2255 enters(
"FIELDML_OUTPUT_ADD_FIELD_NO_TYPE", err, error, *999 )
2262 & err, error, *999 )
2264 exits(
"FIELDML_OUTPUT_ADD_FIELD_NO_TYPE" )
2266 999 errorsexits(
"FIELDML_OUTPUT_ADD_FIELD_NO_TYPE", err, error )
2277 & type_handle, err, error, * )
2282 TYPE(
field_type),
POINTER,
INTENT(IN) :: FIELD
2283 INTEGER(INTG),
INTENT(IN) :: VARIABLE_TYPE
2284 INTEGER(INTG),
INTENT(IN) :: SET_TYPE
2285 INTEGER(INTG),
INTENT(IN) :: TYPE_HANDLE
2286 INTEGER(INTG),
INTENT(OUT) :: ERR
2290 INTEGER(INTG) :: I, COMPONENT_COUNT
2291 INTEGER(INTG),
ALLOCATABLE :: FIELD_COMPONENT_NUMBERS(:)
2294 enters(
"FIELDML_OUTPUT_ADD_FIELD_WITH_TYPE", err, error, *999 )
2298 mesh => field%DECOMPOSITION%MESH
2300 IF( type_handle == fml_invalid_handle )
THEN 2301 CALL flagerror(
var_str(
"Cannot get value type for field ")//base_name//
".", err, error, *999 )
2304 CALL field_number_of_components_get( field, variable_type, component_count, err, error, *999 )
2306 ALLOCATE( field_component_numbers( component_count ), stat = err )
2307 IF( err /= 0 )
CALL flagerror(
"Could not allocate component numbers array.", err, error, *999 )
2308 DO i = 1, component_count
2309 field_component_numbers(i) = i
2313 & variable_type, set_type, err, error, *999 )
2315 DEALLOCATE( field_component_numbers )
2317 exits(
"FIELDML_OUTPUT_ADD_FIELD_WITH_TYPE" )
2319 999 errorsexits(
"FIELDML_OUTPUT_ADD_FIELD_WITH_TYPE", err, error )
2333 INTEGER(INTG),
INTENT(OUT) :: ERR
2337 INTEGER(INTG) :: FML_ERR
2339 enters(
"FIELDML_OUTPUT_WRITE", err, error, *999 )
2343 fml_err = fieldml_writefile( fieldml_info%FML_HANDLE,
cchar(filename) )
2345 & err, error, *999 )
2347 exits(
"FIELDML_OUTPUT_WRITE" )
2349 999 errorsexits(
"FIELDML_OUTPUT_WRITE", err, error )
This module contains all basis function routines.
subroutine, public enters(NAME, ERR, ERROR,)
Records the entry into the named procedure and initialises the error code.
integer(intg), parameter, public basis_xi_collapsed
The Xi direction is collapsed.
integer(intg), parameter, public basis_quadratic_lagrange_interpolation
Quadratic Lagrange interpolation specification.
This module contains all coordinate transformation and support routines.
integer(intg) function fieldml_output_get_type_argument_handle(FIELDML_INFO, TYPE_HANDLE, DO_IMPORT, ERR, ERROR)
Get the argument corresponding to the given type (named *.argument), importing it if needed...
integer(intg) function fieldml_output_import_fml(FML_HANDLE, REMOTE_NAME, ERR, ERROR)
Import the named object from the built-in library into the current FieldML document. The local name will be the same as the remote name.
Contains information for a region.
subroutine, public fieldml_output_write(FIELDML_INFO, FILENAME, ERR, ERROR,)
Write the given FieldML document to the given file.
integer(intg) function fieldml_output_import_handle(FML_HANDLE, HANDLE, ERR, ERROR)
Import the given FieldML object if it is not already imported or local.
integer(intg), parameter no_global_deriv
No global derivative i.e., u.
Converts a number to its equivalent varying string representation.
subroutine fieldmloutputgetsimplexbasisevaluator(fmlHandle, xiInterpolations, evaluatorHandle, parametersHandle, err, error,)
Get an evaluator from the built-in library that corresponds to the given OpenCMISS simplex basis...
This module contains all region routines.
integer(intg), parameter, public basis_collapsed_at_xi0
The Xi direction at the xi=0 end of this Xi direction is collapsed.
subroutine fieldml_output_get_simple_basis_name(FML_HANDLE, BASIS_HANDLE, NAME, ERR, ERROR,)
Returns the simplified name of the given basis. This is used for naming associated reference evaluato...
Contains information on the current FieldML parsing state.
This module contains all string manipulation and transformation routines.
integer(intg), parameter, public basis_quadratic_simplex_interpolation
Quadratic Simplex interpolation specification.
subroutine, public basis_interpolation_xi_get(BASIS, INTERPOLATION_XI, ERR, ERROR,)
Gets/changes the interpolation type in each xi directions for a basis identified by a pointer...
Utility routines for FieldML.
subroutine fieldml_output_get_value_type(FML_HANDLE, FIELD, VARIABLE_TYPE, DO_IMPORT, TYPE_HANDLE, ERR, ERROR,)
Returns a FieldML type appropriate for the given OpenCMISS field.
subroutine, public basis_collapsed_xi_get(BASIS, COLLAPSED_XI, ERR, ERROR,)
Gets the collapsed xi flags for a basis is identified by a a pointer.
integer(intg), parameter, public basis_simplex_type
Simplex basis type.
Contains information for a field defined on a region.
integer(intg) function, public fieldml_output_add_import(FIELDML_INFO, REMOTE_NAME, ERR, ERROR)
Import the named object from the built-in library into the current FieldML document. The local name will be the same as the remote name.
subroutine, public region_nodes_get(REGION, NODES, ERR, ERROR,)
Returns a pointer to the nodes for a region.
This module provides an iso_varying_string module, conformant to the API specified in ISO/IEC 1539-2:...
subroutine fieldml_output_add_field_with_type(FIELDML_INFO, BASE_NAME, DOF_FORMAT, FIELD, VARIABLE_TYPE, SET_TYPE, TYPE_HANDLE, ERR, ERROR,)
Add the given field to the given FieldML document using the given FieldML type.
subroutine fieldml_output_get_tp_basis_evaluator(FML_HANDLE, XI_INTERPOLATIONS, COLLAPSE_INFO, EVALUATOR_HANDLE, PARAMETERS_HANDLE, ERR, ERROR,)
Get an evaluator from the built-in library that corresponds to the given OpenCMISS tensor-product bas...
Contains information on a coordinate system.
This module contains all program wide constants.
integer(intg), parameter, public basis_linear_simplex_interpolation
Linear Simplex interpolation specification.
subroutine fieldml_output_get_tp_connectivity_type(FIELDML_HANDLE, XI_INTERPOLATIONS, COLLAPSE_INFO, DO_IMPORT, TYPE_HANDLE, ERR, ERROR,)
Return the FieldML connectivity ensemble corresponding to the given tensor-product basis info...
subroutine fieldml_output_get_coordinates_type(FIELDML_HANDLE, COORDS_TYPE, DIMENSIONS, DO_IMPORT, TYPE_HANDLE, ERR, ERROR,)
Get the FieldML built-in library type corresponding to the given OpenCMISS coordinate system type...
integer(intg), parameter maxstrlen
Maximum string length fro character strings.
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.
subroutine fieldml_output_get_connectivity_ensemble(FIELDML_HANDLE, BASIS, TYPE_HANDLE, ERR, ERROR,)
Get the connectivity ensemble for the given basis. Currently, only tensor-product bases are supported...
This module contains all the low-level base routines e.g., all debug, control, and low-level communic...
integer(intg) function fieldml_output_import(FIELDML_INFO, REMOTE_NAME, ERR, ERROR)
Import the named object from the built-in library into the current FieldML document. The local name will be the same as the remote name.
subroutine fieldmloutputgetsimplexconnectivitytype(fieldmlHandle, xiInterpolations, doImport, typeHandle, err, error,)
Return the FieldML connectivity ensemble corresponding to the given simplex basis info...
This module contains all computational environment variables.
subroutine, public coordinate_system_type_get(COORDINATE_SYSTEM, SYSTEM_TYPE, ERR, ERROR,)
Gets the coordinate system type.
subroutine fieldml_output_get_generic_type(FIELDML_HANDLE, DIMENSIONS, TYPE_HANDLE, DO_IMPORT, ERR, ERROR,)
Returns a generic n-dimensional real type from the built-in library.
subroutine fieldml_assert_is_out(FIELDML_INFO, ERR, ERROR,)
Asserts that the FieldML Info is associated and created for output.
integer(intg), parameter, public coordinate_rectangular_cartesian_type
Rectangular Cartesian coordinate system type.
subroutine, public fieldml_io_initialise(FIELDML_INFO, IS_OUT, ERR, ERROR,)
integer(intg) function fieldml_output_find_basis(BASIS_INFO, BASIS, ERR, ERROR)
Returns the index of the basis handle used by the given basis info array, or -1 if none can be found...
Contains information on a mesh defined on a region.
subroutine fieldml_output_add_field_constant_dofs(FIELDML_INFO, BASE_NAME, DOF_FORMAT, TYPE_HANDLE, FIELD, FIELD_COMPONENT_NUMBERS, VARIABLE_TYPE, SET_TYPE, CONSTANT_DOFS_HANDLE, ERR, ERROR,)
Create a parameter evaluator and associated data source containing the globally constant dofs for the...
subroutine fieldml_output_add_field_node_dofs(FIELDML_INFO, BASE_NAME, DOF_FORMAT, TYPE_HANDLE, FIELD, FIELD_COMPONENT_NUMBERS, VARIABLE_TYPE, SET_TYPE, NODE_DOFS_HANDLE, ERR, ERROR,)
Create a parameter evaluator and associated data source containing the nodal dofs for the given field...
subroutine, public fieldml_output_add_field_components(FIELDML_INFO, TYPE_HANDLE, BASE_NAME, DOF_FORMAT, FIELD, FIELD_COMPONENT_NUMBERS, VARIABLE_TYPE, SET_TYPE, ERR, ERROR,)
Add the components of the given field to the given FieldML evaluator, creating component templates as...
integer(intg), parameter, public basis_lagrange_hermite_tp_type
Lagrange-Hermite tensor product basis type.
subroutine fieldml_output_get_collapse_suffix(COLLAPSE_INFO, SUFFIX, ERR, ERROR,)
Get the text suffix corresponding to the given array of collapse constants.
subroutine, public basis_type_get(BASIS, TYPE, ERR, ERROR,)
get the type for a basis is identified by a a pointer.
integer(intg), parameter, public basis_collapsed_at_xi1
The Xi direction at the xi=1 end of this Xi direction is collapsed.
integer(intg) function fieldml_output_find_layout(CONNECTIVITY_INFO, LAYOUT_HANDLE, ERR, ERROR)
Returns the index of the layout handle used by the given connectivity info array, or -1 if none can b...
Returns an item in a list at a specififed position.
subroutine, public basis_number_of_xi_get(BASIS, NUMBER_OF_XI, ERR, ERROR,)
Gets the number of xi directions for a basis.
Contains information on the nodes defined on a region.
subroutine fieldml_output_create_layout_parameters(FIELDML_INFO, LAYOUT_HANDLE, COMPONENT_NAME, CONNECTIVITY_INFO, ERR, ERROR,)
Create a parameter evaluator for the given local node layout.
Sets an item in the list.
subroutine fieldml_output_get_xi_type(FIELDML_HANDLE, DIMENSIONS, DO_IMPORT, TYPE_HANDLE, ERR, ERROR,)
Returns a type in the built-in library corresponding to a chart of the given dimensionality.
Adds an item to the end of a list.
Output routines for FieldML.
subroutine fieldml_output_add_field_no_type(FIELDML_INFO, BASE_NAME, DOF_FORMAT, FIELD, VARIABLE_TYPE, SET_TYPE, ERR, ERROR,)
Add the given field to the given FieldML document. The field's type will be determined by FieldmlUtil...
Implements lists of base types.
Contains all information about a basis .
Flags an error condition.
subroutine fieldml_output_add_field_element_dofs(FIELDML_INFO, BASE_NAME, DOF_FORMAT, TYPE_HANDLE, FIELD, FIELD_COMPONENT_NUMBERS, VARIABLE_TYPE, SET_TYPE, ELEMENT_DOFS_HANDLE, ERR, ERROR,)
Create a parameter evaluator and associated data source containing the element dofs for the given fie...
subroutine fieldml_output_create_basis_reference(FIELDML_INFO, BASE_NAME, BASIS_INFO, ERR, ERROR,)
Create a basis evaluator from the given basis info.
subroutine fieldml_output_get_simple_layout_name(FML_HANDLE, LAYOUT_HANDLE, NAME, ERR, ERROR,)
Returns the simplified name of the given layout. This is used for naming associated connectivity eval...
Flags an error condition.
subroutine, public region_coordinate_system_get(REGION, COORDINATE_SYSTEM, ERR, ERROR,)
Returns the coordinate system of region.
integer(intg), parameter, public basis_linear_lagrange_interpolation
Linear Lagrange interpolation specification.
subroutine fieldml_output_add_mesh_component(FIELDML_INFO, BASE_NAME, CONNECTIVITY_FORMAT, COMPONENT_NUMBER, MESH_ELEMENTS, ERR, ERROR,)
Add an evaluator corresponding to the given component of the given OpenCMISS mesh.
integer(intg) function, public computational_node_number_get(ERR, ERROR)
Returns the number/rank of the computational nodes.
Contains the information for the elements of a mesh.
This module contains all kind definitions.
subroutine, public fieldml_output_initialise_info(MESH, LOCATION, BASE_NAME, CONNECTIVITY_FORMAT, FIELDML_INFO, ERR, ERROR,)
Initialize the given FieldML parsing state for use with the given mesh.