26 #include <fcs_fconfig.h> 28 #include "fcs4fortran_definitions.h" 40 integer(kind = fcs_boolean_kind),
parameter ::
fcs_true = 1
41 integer(kind = fcs_boolean_kind),
parameter ::
fcs_false = 0
45 integer(kind = fcs_integer_kind_isoc),
parameter ::
fcs_success = fcs4fortran_success
58 integer(kind = fcs_integer_kind_isoc),
parameter ::
fcs_method_none = fcs4fortran_method_none
59 integer(kind = fcs_integer_kind_isoc),
parameter ::
fcs_method_direct = fcs4fortran_method_direct
60 integer(kind = fcs_integer_kind_isoc),
parameter ::
fcs_method_ewald = fcs4fortran_method_ewald
61 integer(kind = fcs_integer_kind_isoc),
parameter ::
fcs_method_fmm = fcs4fortran_method_fmm
62 integer(kind = fcs_integer_kind_isoc),
parameter ::
fcs_method_memd = fcs4fortran_method_memd
63 integer(kind = fcs_integer_kind_isoc),
parameter ::
fcs_method_mmm1d = fcs4fortran_method_mmm1d
64 integer(kind = fcs_integer_kind_isoc),
parameter ::
fcs_method_mmm2d = fcs4fortran_method_mmm2d
65 integer(kind = fcs_integer_kind_isoc),
parameter ::
fcs_method_p2nfft = fcs4fortran_method_p2nfft
66 integer(kind = fcs_integer_kind_isoc),
parameter ::
fcs_method_p3m = fcs4fortran_method_p3m
67 integer(kind = fcs_integer_kind_isoc),
parameter ::
fcs_method_pepc = fcs4fortran_method_pepc
68 integer(kind = fcs_integer_kind_isoc),
parameter ::
fcs_method_pp3mg = fcs4fortran_method_pp3mg
69 integer(kind = fcs_integer_kind_isoc),
parameter ::
fcs_method_vmg = fcs4fortran_method_vmg
70 integer(kind = fcs_integer_kind_isoc),
parameter ::
fcs_method_wolf = fcs4fortran_method_wolf
76 integer(kind = fcs_integer_kind_isoc),
parameter ::
fcs_fmm_cusp = 65
108 type(c_ptr),
value :: res
114 type(c_ptr),
value :: res
115 integer(kind = fcs_integer_kind_isoc) :: fcs_result_get_return_code_f
122 type(c_ptr),
value :: res
123 type(c_ptr) :: fcs_result_get_message_f
130 type(c_ptr),
value :: res
131 type(c_ptr) :: fcs_result_get_function_f
138 function fcs_init(handle,method_name,communicator) bind(C,name="fcs_init_f")
141 type(c_ptr) :: handle
142 character(kind = c_char) :: method_name(*)
143 integer,
value :: communicator
144 type(c_ptr) :: fcs_init
147 function fcs_tune(handle,n_locparts,positions,charges) bind(C,name="fcs_tune")
150 type(c_ptr),
value :: handle
151 integer(kind = fcs_integer_kind_isoc),
value :: n_locparts
152 real(kind = fcs_real_kind_isoc) :: positions(3*n_locparts)
153 real(kind = fcs_real_kind_isoc) :: charges(n_locparts)
154 type(c_ptr) :: fcs_tune
158 function fcs_run(handle,n_locparts,positions,charges,fields,&
159 potentials) bind(C,name="fcs_run")
162 type(c_ptr),
value :: handle
163 integer(kind = fcs_integer_kind_isoc),
value :: n_locparts
164 real(kind = fcs_real_kind_isoc) :: positions(3*n_locparts)
165 real(kind = fcs_real_kind_isoc) :: charges(n_locparts)
166 real(kind = fcs_real_kind_isoc) :: fields(3*n_locparts)
167 real(kind = fcs_real_kind_isoc) :: potentials(n_locparts)
168 type(c_ptr) :: fcs_run
174 type(c_ptr),
value :: handle
175 type(c_ptr) :: fcs_destroy
185 type(c_ptr),
value :: handle
186 integer(kind = fcs_integer_kind_isoc) :: fcs_get_method
193 type(c_ptr),
value :: handle
194 integer :: fcs_get_communicator
198 box_origin, periodicity, total_parts) bind(C,name="fcs_set_common")
201 type(c_ptr),
value :: handle
202 integer(kind = fcs_integer_kind_isoc),
value :: near_field_flag
203 real(kind = fcs_real_kind_isoc) :: box_a(3)
204 real(kind = fcs_real_kind_isoc) :: box_b(3)
205 real(kind = fcs_real_kind_isoc) :: box_c(3)
206 real(kind = fcs_real_kind_isoc) :: box_origin(3)
207 integer(kind = fcs_integer_kind_isoc) :: periodicity(3)
208 integer(kind = fcs_integer_kind_isoc),
value :: total_parts
209 type(c_ptr) :: fcs_set_common_f
213 bind(c,name=
"fcs_set_dimensions")
216 type(c_ptr),
value :: handle
217 integer(kind = fcs_integer_kind_isoc),
value :: dim_
218 type(c_ptr) :: fcs_set_dimensions
222 bind(c,name=
"fcs_get_dimensions")
225 type(c_ptr),
value :: handle
226 integer(kind = fcs_integer_kind_isoc) :: fcs_get_dimensions
230 bind(c,name=
"fcs_set_near_field_flag")
233 type(c_ptr),
value :: handle
234 integer(kind = fcs_integer_kind_isoc),
value :: near_field_flag
235 type(c_ptr) :: fcs_set_near_field_flag
239 bind(c,name=
"fcs_get_near_field_flag")
242 type(c_ptr),
value :: handle
243 integer(kind = fcs_integer_kind_isoc) :: fcs_get_near_field_flag
249 type(c_ptr),
value :: handle
250 real(kind = fcs_real_kind_isoc) :: box_a(3)
251 type(c_ptr) :: fcs_set_box_a
266 type(c_ptr),
value :: handle
267 real(kind = fcs_real_kind_isoc) :: box_b(3)
268 type(c_ptr) :: fcs_set_box_b
276 type(c_ptr),
value :: handle
277 real(kind = fcs_real_kind_isoc) :: box_c(3)
278 type(c_ptr) :: fcs_set_box_c
286 type(c_ptr),
value :: handle
287 real(kind = fcs_real_kind_isoc) :: box_origin(3)
288 type(c_ptr) :: fcs_set_box_origin
294 bind(c,name=
"fcs_set_periodicity")
297 type(c_ptr),
value :: handle
298 integer(kind = fcs_integer_kind_isoc) :: periodicity(3)
299 type(c_ptr) :: fcs_set_periodicity_f
305 bind(c,name=
"fcs_set_total_particles")
308 type(c_ptr),
value :: handle
309 integer(kind = fcs_integer_kind_isoc),
value :: total_particles
310 type(c_ptr) :: fcs_set_total_particles
314 bind(c,name=
"fcs_get_total_particles")
317 type(c_ptr),
value :: handle
318 integer(kind = fcs_integer_kind_isoc) :: fcs_get_total_particles
322 bind(c,name=
"fcs_set_max_local_particles")
325 type(c_ptr),
value :: handle
326 integer(kind = fcs_integer_kind_isoc),
value :: max_local_particles
327 type(c_ptr) :: fcs_set_max_local_particles
331 bind(c,name=
"fcs_get_max_local_particles")
334 type(c_ptr),
value :: handle
335 integer(kind = fcs_integer_kind_isoc) :: fcs_get_max_local_particles
339 bind(c,name=
"fcs_set_tolerance")
342 type(c_ptr),
value :: handle
343 integer(kind = fcs_integer_kind_isoc),
value :: tolerance_type
344 real(kind = fcs_real_kind_isoc),
value :: tolerance
345 type(c_ptr) :: fcs_set_tolerance
350 bind(c,name=
"fcs_get_tolerance")
353 type(c_ptr),
value :: handle
354 integer(kind = fcs_integer_kind_isoc) :: tolerance_type
355 real(kind = fcs_real_kind_isoc),
value :: tolerance
356 type(c_ptr) :: fcs_get_tolerance
362 type(c_ptr),
value :: handle
363 real(kind = fcs_real_kind_isoc),
value :: r_cut
364 type(c_ptr) :: fcs_set_r_cut
370 type(c_ptr),
value :: handle
371 type(c_ptr) :: fcs_unset_r_cut
377 type(c_ptr),
value :: handle
378 real(kind = fcs_real_kind_isoc) :: r_cut
379 type(c_ptr) :: fcs_get_r_cut
385 type(c_ptr),
value :: handle
386 character(kind = c_char) :: parameters(*)
387 type(c_ptr) :: fcs_set_parameters
388 integer(kind = fcs_boolean_kind_isoc) :: continue_on_errors
394 type(c_ptr),
value :: handle
402 charges, epsilon, field_correction, &
404 bind(c,name=
"fcs_compute_dipole_correction")
407 type(c_ptr),
value :: handle
408 integer(kind = fcs_integer_kind_isoc),
value :: local_particles
409 real(kind = fcs_real_kind_isoc),
dimension(3*local_particles) :: positions
410 real(kind = fcs_real_kind_isoc),
dimension(local_particles) :: charges
411 real(kind = fcs_real_kind_isoc),
value :: epsilon
412 real(kind = fcs_real_kind_isoc),
dimension(3) :: field_correction
413 real(kind = fcs_real_kind_isoc) :: energy_correction
414 type(c_ptr) :: fcs_compute_dipole_correction
420 type(c_ptr),
value :: handle
421 integer(kind = fcs_integer_kind_isoc) :: has_near
422 type(c_ptr) :: fcs_get_near_field_delegation_f
428 type(c_ptr),
value :: handle
429 real(kind = fcs_real_kind_isoc),
value :: dist
430 real(kind = fcs_real_kind_isoc) :: pot
431 real(kind = fcs_real_kind_isoc) :: field
432 type(c_ptr) :: fcs_compute_near
438 type(c_ptr),
value :: handle
439 real(kind = fcs_real_kind_isoc),
value :: dist
440 real(kind = fcs_real_kind_isoc) :: pot
441 type(c_ptr) :: fcs_compute_near_potential
447 type(c_ptr),
value :: handle
448 real(kind = fcs_real_kind_isoc),
value :: dist
449 real(kind = fcs_real_kind_isoc) :: field
450 type(c_ptr) :: fcs_compute_near_field
456 type(c_ptr),
value :: handle
457 integer(kind = fcs_integer_kind_isoc),
value :: flag
458 type(c_ptr) :: fcs_set_compute_virial_f
466 type(c_ptr),
value :: handle
467 real(kind = fcs_real_kind_isoc) :: virial(9)
468 type(c_ptr) :: fcs_get_virial
475 #ifdef FCS_ENABLE_DIRECT 477 bind(c,name=
"fcs_direct_setup")
480 type(c_ptr),
value :: handle
481 real(kind = fcs_real_kind_isoc),
value :: cutoff
482 type(c_ptr) :: fcs_direct_setup
485 #ifdef FCS_ENABLE_EWALD 487 bind(c,name=
"fcs_ewald_set_tolerance_field_abs")
490 type(c_ptr),
value :: handle
491 real(kind = fcs_real_kind_isoc),
value :: tolerance_field_abs
492 type(c_ptr) :: fcs_ewald_set_tolerance_field_abs
495 #ifdef FCS_ENABLE_FMM 496 function fcs_fmm_setup(handle, absrel, energy_tolerance, dipole_correction, system, maxdepth, unroll_limit, balanceload) &
497 bind(c,name=
"fcs_fmm_setup")
500 type(c_ptr),
value :: handle
501 integer(kind = fcs_integer_kind_isoc),
value :: absrel
502 real(kind = fcs_real_kind_isoc),
value :: energy_tolerance
503 integer(kind = fcs_integer_kind_isoc),
value :: dipole_correction
504 integer(kind = c_long_long),
value :: system
505 integer(kind = c_long_long),
value :: maxdepth
506 integer(kind = c_long_long),
value :: unroll_limit
507 integer(kind = c_long_long),
value :: balanceload
508 type(c_ptr) :: fcs_fmm_setup
511 #ifdef FCS_ENABLE_PEPC 513 bind(c,name=
"fcs_pepc_setup")
516 type(c_ptr),
value :: handle
517 real(kind = fcs_real_kind_isoc),
value :: epsilon
518 real(kind = fcs_real_kind_isoc),
value :: theta
519 integer(kind = fcs_integer_kind_isoc),
value :: level
520 type(c_ptr) :: fcs_pepc_setup
524 #ifdef FCS_ENABLE_VMG 526 gamma, precision, near_field_cells) &
527 bind(c,name=
"fcs_vmg_setup")
530 type(c_ptr),
value :: handle
531 integer(kind = fcs_integer_kind_isoc),
value :: max_level
532 integer(kind = fcs_integer_kind_isoc),
value :: max_iterations
533 integer(kind = fcs_integer_kind_isoc),
value :: smooth_steps
534 integer(kind = fcs_integer_kind_isoc),
value :: gamma
535 integer(kind = fcs_integer_kind_isoc),
value :: near_field_cells
536 real(kind = fcs_real_kind_isoc),
value :: precision
538 type(c_ptr) :: fcs_vmg_setup
545 #ifdef FCS_ENABLE_DIRECT 548 bind(c,name=
"fcs_direct_set_cutoff")
551 type(c_ptr),
value :: handle
552 real(kind = fcs_real_kind_isoc),
value :: cutoff
553 type(c_ptr) :: fcs_direct_set_cutoff
557 bind(c,name=
"fcs_direct_get_cutoff")
560 type(c_ptr),
value :: handle
561 real(kind = fcs_real_kind_isoc) :: cutoff
562 type(c_ptr) :: fcs_direct_get_cutoff
565 #ifdef FCS_ENABLE_FMM 567 bind(c,name=
"fcs_fmm_set_absrel")
570 type(c_ptr),
value :: handle
571 integer(kind = fcs_integer_kind_isoc),
value :: absrel
572 type(c_ptr) :: fcs_fmm_set_absrel
576 bind(c,name=
"fcs_fmm_get_absrel")
579 type(c_ptr),
value :: handle
580 integer(kind = fcs_integer_kind_isoc) :: absrel
581 type(c_ptr) :: fcs_fmm_get_absrel
585 bind(c,name=
"fcs_fmm_set_dipole_correction")
588 type(c_ptr),
value :: handle
589 integer(kind = fcs_integer_kind_isoc),
value :: dipole_correction
590 type(c_ptr) :: fcs_fmm_set_dipole_correction
594 bind(c,name=
"fcs_fmm_get_dipole_correction")
597 type(c_ptr),
value :: handle
598 integer(kind = fcs_integer_kind_isoc) :: dipole_correction
599 type(c_ptr) :: fcs_fmm_get_dipole_correction
603 bind(c,name=
"fcs_fmm_set_potential")
606 type(c_ptr),
value :: handle
607 integer(kind = fcs_integer_kind_isoc),
value :: potential
608 type(c_ptr) :: fcs_fmm_set_potential
612 bind(c,name=
"fcs_fmm_get_potential")
615 type(c_ptr),
value :: handle
616 integer(kind = fcs_integer_kind_isoc) :: potential
617 type(c_ptr) :: fcs_fmm_get_potential
621 bind(c,name=
"fcs_fmm_set_cusp_radius")
624 type(c_ptr),
value :: handle
625 real(kind = fcs_real_kind_isoc),
value :: cusp_radius
626 type(c_ptr) :: fcs_fmm_set_cusp_radius
630 bind(c,name=
"fcs_fmm_get_cusp_radius")
633 type(c_ptr),
value :: handle
634 real(kind = fcs_real_kind_isoc) :: cusp_radius
635 type(c_ptr) :: fcs_fmm_get_cusp_radius
639 bind(c,name=
"fcs_fmm_set_tolerance_energy")
642 type(c_ptr),
value :: handle
643 real(kind = fcs_real_kind_isoc),
value :: tolerance
644 type(c_ptr) :: fcs_fmm_set_tolerance_energy
648 bind(c,name=
"fcs_fmm_get_tolerance_energy")
651 type(c_ptr),
value :: handle
652 real(kind = fcs_real_kind_isoc) :: tolerance
653 type(c_ptr) :: fcs_fmm_get_tolerance_energy
657 bind(c,name=
"fcs_fmm_set_maxdepth")
660 type(c_ptr),
value :: handle
661 integer(kind = c_long_long),
value :: maxdepth
662 type(c_ptr) :: fcs_fmm_set_maxdepth
666 bind(c,name=
"fcs_fmm_get_maxdepth")
669 type(c_ptr),
value :: handle
670 integer(kind = c_long_long),
value :: maxdepth
671 type(c_ptr) :: fcs_fmm_get_maxdepth
675 bind(c,name=
"fcs_fmm_set_unroll_limit")
678 type(c_ptr),
value :: handle
679 integer(kind = c_long_long),
value :: unroll_limit
680 type(c_ptr) :: fcs_fmm_set_unroll_limit
684 bind(c,name=
"fcs_fmm_get_unroll_limit")
687 type(c_ptr),
value :: handle
688 integer(kind = c_long_long),
value :: unroll_limit
689 type(c_ptr) :: fcs_fmm_get_unroll_limit
693 bind(c,name=
"fcs_fmm_set_balanceload")
696 type(c_ptr),
value :: handle
697 integer(kind = c_long_long),
value :: balanceload
698 type(c_ptr) :: fcs_fmm_set_balanceload
702 bind(c,name=
"fcs_fmm_get_balanceload")
705 type(c_ptr),
value :: handle
706 integer(kind = c_long_long),
value :: balanceload
707 type(c_ptr) :: fcs_fmm_get_balanceload
711 bind(c,name=
"fcs_fmm_set_internal_tuning")
714 type(c_ptr),
value :: handle
715 integer(kind = c_long_long),
value :: tuning
716 type(c_ptr) :: fcs_fmm_set_internal_tuning
720 bind(c,name=
"fcs_fmm_get_internal_tuning")
723 type(c_ptr),
value :: handle
724 integer(kind = c_long_long),
value :: tuning
725 type(c_ptr) :: fcs_fmm_get_internal_tuning
729 #ifdef FCS_ENABLE_MEMD 731 bind(c,name=
"fcs_memd_set_periodicity")
734 type(c_ptr),
value :: handle
735 integer(kind = fcs_integer_kind_isoc),
value :: periodicity
736 type(c_ptr) :: fcs_memd_set_periodicity
740 bind(c,name=
"fcs_memd_get_periodicity")
743 type(c_ptr),
value :: handle
744 integer(kind = fcs_integer_kind_isoc) :: periodicity
745 type(c_ptr) :: fcs_memd_get_periodicity
748 #ifdef FCS_ENABLE_MMM1D 750 bind(c,name=
"fcs_mmm1d_set_far_switch_radius")
753 type(c_ptr),
value :: handle
754 real(kind = fcs_real_kind_isoc),
value :: radius
755 type(c_ptr) :: fcs_mmm1d_set_far_switch_radius
759 bind(c,name=
"fcs_mmm1d_get_far_switch_radius")
762 type(c_ptr),
value :: handle
763 real(kind = fcs_real_kind_isoc) :: radius
764 type(c_ptr) :: fcs_mmm1d_get_far_switch_radius
767 function fcs_mmm1d_set_maxpwerror(handle, error) &
768 bind(c,name=
"fcs_mmm1d_set_maxPWerror")
771 type(c_ptr),
value :: handle
772 real(kind = fcs_real_kind_isoc),
value :: error
773 type(c_ptr) :: fcs_mmm1d_set_maxPWerror
776 function fcs_mmm1d_get_maxpwerror(handle, error) &
777 bind(c,name=
"fcs_mmm1d_get_maxPWerror")
780 type(c_ptr),
value :: handle
781 real(kind = fcs_real_kind_isoc) :: error
782 type(c_ptr) :: fcs_mmm1d_get_maxPWerror
786 bind(c,name=
"fcs_mmm1d_set_coulomb_prefactor")
789 type(c_ptr),
value :: handle
790 real(kind = fcs_real_kind_isoc),
value :: prefac
791 type(c_ptr) :: fcs_mmm1d_set_coulomb_prefactor
795 bind(c,name=
"fcs_mmm1d_get_coulomb_prefactor")
798 type(c_ptr),
value :: handle
799 real(kind = fcs_real_kind_isoc) :: prefac
800 type(c_ptr) :: fcs_mmm1d_get_coulomb_prefactor
804 bind(c,name=
"fcs_mmm1d_set_bessel_cutoff")
807 type(c_ptr),
value :: handle
808 integer(kind = fcs_integer_kind_isoc),
value :: cutoff
809 type(c_ptr) :: fcs_mmm1d_set_bessel_cutoff
813 bind(c,name=
"fcs_mmm1d_get_bessel_cutoff")
816 type(c_ptr),
value :: handle
817 integer(kind = fcs_integer_kind_isoc) :: cutoff
818 type(c_ptr) :: fcs_mmm1d_get_bessel_cutoff
821 #ifdef FCS_ENABLE_P2NFFT 823 bind(c,name=
"fcs_p2nfft_set_required_accuracy")
826 type(c_ptr),
value :: handle
827 real(kind = fcs_real_kind_isoc),
value :: required_accuracy
828 type(c_ptr) :: fcs_p2nfft_set_required_accuracy
832 #ifdef FCS_ENABLE_P3M 834 bind(c,name=
"fcs_p3m_set_tolerance_field_abs")
837 type(c_ptr),
value :: handle
838 real(kind = fcs_real_kind_isoc),
value :: tolerance_field_abs
839 type(c_ptr) :: fcs_p3m_set_tolerance_field_abs
843 #ifdef FCS_ENABLE_VMG 845 bind(c,name=
"fcs_vmg_set_gamma")
848 type(c_ptr),
value :: handle
849 integer(kind = fcs_integer_kind_isoc),
value :: gamma
850 type(c_ptr) :: fcs_vmg_set_gamma
854 bind(c,name=
"fcs_vmg_get_gamma")
857 type(c_ptr),
value :: handle
858 integer(kind = fcs_integer_kind_isoc) :: gamma
859 type(c_ptr) :: fcs_vmg_get_gamma
863 bind(c,name=
"fcs_vmg_set_max_iterations")
866 type(c_ptr),
value :: handle
867 integer(kind = fcs_integer_kind_isoc),
value :: max_iterations
868 type(c_ptr) :: fcs_vmg_set_max_iterations
872 bind(c,name=
"fcs_vmg_get_max_iterations")
875 type(c_ptr),
value :: handle
876 integer(kind = fcs_integer_kind_isoc) :: max_iterations
877 type(c_ptr) :: fcs_vmg_get_max_iterations
881 bind(c,name=
"fcs_vmg_set_max_level")
884 type(c_ptr),
value :: handle
885 integer(kind = fcs_integer_kind_isoc),
value :: max_level
886 type(c_ptr) :: fcs_vmg_set_max_level
890 bind(c,name=
"fcs_vmg_get_max_level")
893 type(c_ptr),
value :: handle
894 integer(kind = fcs_integer_kind_isoc) :: max_level
895 type(c_ptr) :: fcs_vmg_get_max_level
899 bind(c,name=
"fcs_vmg_set_near_field_cells")
902 type(c_ptr),
value :: handle
903 integer(kind = fcs_integer_kind_isoc),
value :: near_field_cells
904 type(c_ptr) :: fcs_vmg_set_near_field_cells
908 bind(c,name=
"fcs_vmg_get_near_field_cells")
911 type(c_ptr),
value :: handle
912 integer(kind = fcs_integer_kind_isoc) :: near_field_cells
913 type(c_ptr) :: fcs_vmg_get_near_field_cells
917 bind(c,name=
"fcs_vmg_set_precision")
920 type(c_ptr),
value :: handle
921 real(kind = fcs_real_kind_isoc),
value :: prec
922 type(c_ptr) :: fcs_vmg_set_precision
926 bind(c,name=
"fcs_vmg_get_precision")
929 type(c_ptr),
value :: handle
930 real(kind = fcs_real_kind_isoc) :: prec
931 type(c_ptr) :: fcs_vmg_get_precision
935 bind(c,name=
"fcs_vmg_set_smoothing_steps")
938 type(c_ptr),
value :: handle
939 integer(kind = fcs_integer_kind_isoc),
value :: smoothing_steps
940 type(c_ptr) :: fcs_vmg_set_smoothing_steps
944 bind(c,name=
"fcs_vmg_get_smoothing_steps")
947 type(c_ptr),
value :: handle
948 integer(kind = fcs_integer_kind_isoc) :: smoothing_steps
949 type(c_ptr) :: fcs_vmg_get_smoothing_steps
969 type(c_ptr),
target :: res
970 integer(kind = fcs_integer_kind_isoc) :: fcs_result_get_return_code
972 if (c_associated(res))
then 983 type(c_ptr),
target :: res
984 character(kind = c_char, len = MAX_MESSAGE_LENGTH) :: fcs_result_get_message
985 character(kind = c_char, len = MAX_MESSAGE_LENGTH),
dimension(:),
pointer :: message
988 if (c_associated(res))
then 990 call c_f_pointer(cptr = c_str, fptr = message, shape = [1])
991 fcs_result_get_message = message(1)
993 fcs_result_get_message =
"no specific error message availiable" 995 fcs_result_get_message = fcs_result_get_message(1:
fcs_get_position_char(fcs_result_get_message,c_null_char)-1)
998 fcs_result_get_message =
"call successful" 1005 type(c_ptr),
target :: res
1006 character(kind = c_char, len = MAX_MESSAGE_LENGTH) :: fcs_result_get_function
1007 character(kind = c_char, len = MAX_MESSAGE_LENGTH),
dimension(:),
pointer :: message
1008 type(c_ptr) :: c_str
1010 if (c_associated(res))
then 1012 call c_f_pointer(cptr = c_str, fptr = message, shape = [1])
1013 fcs_result_get_function = message(1)
1015 fcs_result_get_function =
"no specific error source availiable" 1017 fcs_result_get_function = fcs_result_get_function(1:
fcs_get_position_char(fcs_result_get_function,c_null_char)-1)
1020 fcs_result_get_function =
"" 1025 function fcs_set_common(handle, near_field_flag, box_a, box_b, box_c, &
1026 box_origin, periodicity, total_parts)
1029 type(c_ptr) :: handle
1030 logical :: near_field_flag
1031 real(kind = fcs_real_kind_isoc) :: box_a(3)
1032 real(kind = fcs_real_kind_isoc) :: box_b(3)
1033 real(kind = fcs_real_kind_isoc) :: box_c(3)
1034 real(kind = fcs_real_kind_isoc) :: box_origin(3)
1035 logical :: periodicity(3)
1036 integer(kind = fcs_integer_kind_isoc) :: total_parts
1037 integer(kind = fcs_integer_kind_isoc) :: p_c(3)
1038 integer(kind = fcs_integer_kind_isoc) :: srf_c
1039 type(c_ptr) :: fcs_set_common
1047 if (near_field_flag)
then 1053 fcs_set_common =
fcs_set_common_f(handle, srf_c, box_a, box_b, box_c, box_origin, p_c, total_parts)
1059 type(c_ptr) :: handle
1060 integer(kind = fcs_integer_kind_isoc) :: p_c(3)
1061 logical :: periodicity(3)
1062 type(c_ptr) :: fcs_set_periodicity
1077 type(c_ptr) :: handle
1079 type(c_ptr) :: fcs_set_compute_virial
1080 integer(kind = fcs_integer_kind_isoc) :: c_flag
1094 type(c_ptr),
value :: handle
1096 type(c_ptr) :: fcs_get_near_field_delegation
1097 integer(kind = fcs_integer_kind_isoc) :: c_has_near
1100 if (c_has_near == 0)
then 1114 character(kind = c_char, len = *) :: str
1115 character(kind = c_char) :: c
1120 if (str(i:i) == c)
then
integer(kind=fcs_integer_kind_isoc), parameter fcs_method_pp3mg
integer(kind=fcs_integer_kind_isoc), parameter fcs_fmm_no_dipole_correction
integer(kind=fcs_integer_kind_isoc), parameter fcs_tolerance_type_energy
integer(kind=fcs_integer_kind_isoc), parameter fcs_method_vmg
integer, parameter max_message_length
integer(kind=fcs_integer_kind_isoc), parameter fcs_fmm_coulomb
integer(kind=fcs_integer_kind_isoc), parameter fcs_error_alloc_failed
FCSResult fcs_get_near_field_delegation(FCS handle, fcs_int *near_field_delegation)
function to return whether the solver method supports the delegation of near-field computations to an...
integer(kind=fcs_integer_kind_isoc), parameter fcs_fmm_custom_absolute
integer(kind=fcs_integer_kind_isoc), parameter fcs_method_mmm2d
integer(kind=fcs_integer_kind_isoc), parameter fcs_error_incompatible_method
integer(kind=fcs_integer_kind_isoc), parameter fcs_tolerance_type_potential_rel
FCSResult fcs_set_common(FCS handle, fcs_int near_field_flag, const fcs_float *box_a, const fcs_float *box_b, const fcs_float *box_c, const fcs_float *box_origin, const fcs_int *periodicity, fcs_int total_particles)
function to set all obligatory parameters for an FCS solver
integer(kind=fcs_integer_kind_isoc), parameter fcs_tolerance_type_field_rel
fcs_int fcs_result_get_return_code(FCSResult result)
function to return the return code associated with an return state
integer(kind=fcs_integer_kind_isoc), parameter fcs_error_wrong_argument
integer(kind=fcs_integer_kind_isoc), parameter fcs_method_mmm1d
integer(kind=fcs_integer_kind_isoc), parameter fcs_fmm_standard_dipole_correction
integer(kind=fcs_integer_kind_isoc), parameter fcs_tolerance_type_energy_rel
integer(kind=fcs_integer_kind_isoc), parameter fcs_error_logical_error
const char * fcs_result_get_function(FCSResult result)
function to return the function name associated with an return state
const char * fcs_result_get_message(FCSResult result)
function to return the description message associated with an return state
integer(kind=fcs_integer_kind_isoc), parameter fcs_method_direct
integer(kind=fcs_integer_kind_isoc), parameter fcs_error_missing_element
integer(kind=fcs_integer_kind_isoc), parameter fcs_error_not_implemented
integer(kind=fcs_integer_kind_isoc), parameter fcs_error_result_create
integer(kind=fcs_integer_kind_isoc), parameter fcs_error_fortran_call_error
integer, parameter fcs_boolean_kind
integer(kind=fcs_boolean_kind), parameter fcs_true
integer(kind=fcs_integer_kind_isoc), parameter fcs_fmm_custom_relative
integer(kind=fcs_integer_kind_isoc), parameter fcs_method_p2nfft
integer(kind=fcs_integer_kind_isoc), parameter fcs_method_wolf
integer(kind=fcs_integer_kind_isoc), parameter fcs_method_pepc
integer function fcs_get_position_char(str, c)
integer(kind=fcs_integer_kind_isoc), parameter fcs_method_fmm
integer(kind=fcs_integer_kind_isoc), parameter fcs_error_null_argument
integer(kind=fcs_integer_kind_isoc), parameter fcs_tolerance_type_potential
FCSResult fcs_set_periodicity(FCS handle, const fcs_int *periodicity)
function to set the periodicity of the system
integer(kind=fcs_integer_kind_isoc), parameter fcs_method_p3m
integer(kind=fcs_integer_kind_isoc), parameter fcs_fmm_standard_error
FCSResult fcs_set_compute_virial(FCS handle, fcs_int compute_virial)
function to set whether the virial should be computed
integer(kind=fcs_boolean_kind), parameter fcs_false
integer(kind=fcs_integer_kind_isoc), parameter fcs_fmm_active_dipole_correction
integer(kind=fcs_integer_kind_isoc), parameter fcs_method_none
integer(kind=fcs_integer_kind_isoc), parameter fcs_tolerance_type_undefined
integer(kind=fcs_integer_kind_isoc), parameter fcs_tolerance_type_field
integer(kind=fcs_integer_kind_isoc), parameter fcs_method_ewald
integer, parameter max_function_length
integer(kind=fcs_integer_kind_isoc), parameter fcs_method_memd
integer(kind=fcs_integer_kind_isoc), parameter fcs_fmm_cusp
integer(kind=fcs_integer_kind_isoc), parameter fcs_success