2626#ifndef INPUTMANAGER_HPP
2727#define INPUTMANAGER_HPP
2828
29+ #include < algorithm>
2930#include < iostream>
3031#include < string>
3132
@@ -66,6 +67,13 @@ struct cavityInput {
6667 int pad; // Without padding the two strings are lumped together...
6768 char restart_name[20 ];
6869 double min_radius;
70+ /* ! Cleans up the char arrays in this struct
71+ */
72+ void cleaner () {
73+ std::fill (cavity_type, cavity_type + 8 , 0 );
74+ std::fill (radii_set, radii_set + 8 , 0 );
75+ std::fill (restart_name, restart_name + 20 , 0 );
76+ }
6977 friend std::ostream & operator <<(std::ostream & os, cavityInput & o) {
7078 os << " cavity type " << std::string (o.cavity_type ) << std::endl;
7179 os << " patch level " << o.patch_level << std::endl;
@@ -101,6 +109,13 @@ struct solverInput {
101109 char equation_type[11 ];
102110 double correction;
103111 double probe_radius;
112+ /* ! Cleans up the char arrays in this struct
113+ */
114+ void cleaner () {
115+ std::fill (solver_type, solver_type + 7 , 0 );
116+ std::fill (solvent, solvent + 16 , 0 );
117+ std::fill (equation_type, equation_type + 11 , 0 );
118+ }
104119 friend std::ostream & operator <<(std::ostream & os, solverInput & o) {
105120 os << " solver type " << std::string (o.solver_type ) << std::endl;
106121 os << " solvent " << std::string (o.solvent ) << std::endl;
@@ -124,6 +139,12 @@ struct greenInput {
124139 char inside_type[7 ];
125140 double outside_epsilon;
126141 char outside_type[22 ];
142+ /* ! Cleans up the char arrays in this struct
143+ */
144+ void cleaner () {
145+ std::fill (inside_type, inside_type + 7 , 0 );
146+ std::fill (outside_type, outside_type + 22 , 0 );
147+ }
127148 friend std::ostream & operator <<(std::ostream & os, greenInput & o) {
128149 os << " inside type " << std::string (o.inside_type ) << std::endl;
129150 os << " outside type " << std::string (o.outside_type ) << std::endl;
0 commit comments