File tree 1 file changed +10
-7
lines changed
1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -133,19 +133,22 @@ void ExcitonConfiguration::checkContentCoherence(){
133
133
if (excitonInfo.nbands == 0 && excitonInfo.bands .empty ()){
134
134
throw std::invalid_argument (" Must specify 'nbands' or 'bandlist' parameters" );
135
135
};
136
+
137
+ bool potentialFound = false ;
138
+ bool exchangePotentialFound = false ;
136
139
for (auto potential : supportedPotentials){
137
140
if (excitonInfo.potential == potential){
138
- break ;
141
+ potentialFound = true ;
142
+ }
143
+ if (excitonInfo.exchange && excitonInfo.exchangePotential == potential){
144
+ exchangePotentialFound = true ;
139
145
}
146
+ }
147
+ if (!potentialFound){
140
148
throw std::invalid_argument (" Specified 'potential' not supported. Use 'keldysh' or 'coulomb'" );
141
149
}
142
- if (excitonInfo.exchange ){
143
- for (auto potential : supportedPotentials){
144
- if (excitonInfo.exchangePotential == potential){
145
- break ;
146
- }
150
+ if (excitonInfo.exchange && !exchangePotentialFound){
147
151
throw std::invalid_argument (" Specified 'exchange.potential' not supported. Use 'keldysh' or 'coulomb'" );
148
- }
149
152
}
150
153
if (excitonInfo.mode != " realspace" && excitonInfo.mode != " reciprocalspace" ){
151
154
throw std::invalid_argument (" Invalid mode. Use 'realspace' or 'reciprocalspace'" );
You can’t perform that action at this time.
0 commit comments