@@ -39,7 +39,7 @@ void host_writer(const char * message) { fprintf(output, "%s\n", message); }
3939
4040int main () {
4141
42- output = fopen ("C_host.log " , "w+" );
42+ output = fopen ("C_host.out " , "w+" );
4343 if (!pcmsolver_is_compatible_library ()) {
4444 fprintf (stderr , "%s\n" , "PCMSolver library not compatible" );
4545 exit (EXIT_FAILURE );
@@ -48,17 +48,36 @@ int main() {
4848 fprintf (output , "%s\n" , "Starting a PCMSolver calculation" );
4949 // Use C2H4 in D2h symmetry
5050 double charges [NR_NUCLEI ] = {6.0 , 1.0 , 1.0 , 6.0 , 1.0 , 1.0 };
51- double coordinates [3 * NR_NUCLEI ] = {
52- 0.0 , 0.000000 , 1.257892 , 0.0 , 1.745462 , 2.342716 , 0.0 , -1.745462 , 2.342716 ,
53- 0.0 , 0.000000 , -1.257892 , 0.0 , 1.745462 , -2.342716 , 0.0 , -1.745462 , -2.342716 };
51+ double coordinates [3 * NR_NUCLEI ] = {0.0 ,
52+ 0.000000 ,
53+ 1.257892 ,
54+ 0.0 ,
55+ 1.745462 ,
56+ 2.342716 ,
57+ 0.0 ,
58+ -1.745462 ,
59+ 2.342716 ,
60+ 0.0 ,
61+ 0.000000 ,
62+ -1.257892 ,
63+ 0.0 ,
64+ 1.745462 ,
65+ -2.342716 ,
66+ 0.0 ,
67+ -1.745462 ,
68+ -2.342716 };
5469 // This means the molecular point group has three generators:
5570 // the Oxy, Oxz and Oyz planes
5671 int symmetry_info [4 ] = {3 , 4 , 2 , 1 };
5772 struct PCMInput host_input = pcmsolver_input ();
5873
59- pcmsolver_context_t * pcm_context =
60- pcmsolver_new (PCMSOLVER_READER_HOST , NR_NUCLEI , charges , coordinates ,
61- symmetry_info , & host_input , host_writer );
74+ pcmsolver_context_t * pcm_context = pcmsolver_new (PCMSOLVER_READER_HOST ,
75+ NR_NUCLEI ,
76+ charges ,
77+ coordinates ,
78+ symmetry_info ,
79+ & host_input ,
80+ host_writer );
6281
6382 pcmsolver_print (pcm_context );
6483
@@ -89,8 +108,8 @@ int main() {
89108 // This is the B3g irreducible representation
90109 irrep = 3 ;
91110 pcmsolver_compute_response_asc (pcm_context , mep_lbl , asc_neq_B3g_lbl , irrep );
92- pcmsolver_get_surface_function (pcm_context , grid_size , asc_neq_B3g ,
93- asc_neq_B3g_lbl );
111+ pcmsolver_get_surface_function (
112+ pcm_context , grid_size , asc_neq_B3g , asc_neq_B3g_lbl );
94113
95114 // Equilibrium ASC in B3g symmetry.
96115 // This is an internal check: the relevant segment of the vector
@@ -104,33 +123,39 @@ int main() {
104123 // Cavity size
105124 const int ref_size = 576 ;
106125 if (grid_size != ref_size ) {
107- fprintf (stderr , "%s\n" , "Error in the cavity size, please file an issue on: "
108- "https://github.com/PCMSolver/pcmsolver" );
126+ fprintf (stderr ,
127+ "%s\n" ,
128+ "Error in the cavity size, please file an issue on: "
129+ "https://github.com/PCMSolver/pcmsolver" );
109130 exit (EXIT_FAILURE );
110131 } else {
111132 fprintf (output , "%s\n" , "Test on cavity size: PASSED" );
112133 }
113134 // Irreducible cavity size
114135 const int ref_irr_size = 72 ;
115136 if (irr_grid_size != ref_irr_size ) {
116- fprintf (stderr , "%s\n" , "Error in the irreducible cavity size, please file an "
117- "issue on: https://github.com/PCMSolver/pcmsolver" );
137+ fprintf (stderr ,
138+ "%s\n" ,
139+ "Error in the irreducible cavity size, please file an "
140+ "issue on: https://github.com/PCMSolver/pcmsolver" );
118141 exit (EXIT_FAILURE );
119142 } else {
120143 fprintf (output , "%s\n" , "Test on irreducible cavity size: PASSED" );
121144 }
122145 // Polarization energy
123146 const double ref_energy = -0.437960027982 ;
124147 if (!check_unsigned_error (energy , ref_energy , 1.0e-7 )) {
125- fprintf (stderr , "%s\n" , "Error in the polarization energy, please file an issue "
126- "on: https://github.com/PCMSolver/pcmsolver" );
148+ fprintf (stderr ,
149+ "%s\n" ,
150+ "Error in the polarization energy, please file an issue "
151+ "on: https://github.com/PCMSolver/pcmsolver" );
127152 exit (EXIT_FAILURE );
128153 } else {
129154 fprintf (output , "%s\n" , "Test on polarization energy: PASSED" );
130155 }
131156 // Surface functions
132- test_surface_functions (output , grid_size , mep , asc_Ag , asc_B3g , asc_neq_B3g ,
133- areas );
157+ test_surface_functions (
158+ output , grid_size , mep , asc_Ag , asc_B3g , asc_neq_B3g , areas );
134159
135160 pcmsolver_write_timings (pcm_context );
136161
0 commit comments