Skip to content

Commit

Permalink
+ minor update so that compile works when nlopt is found
Browse files Browse the repository at this point in the history
  • Loading branch information
TravisMitchell authored Jan 10, 2024
1 parent 65a7321 commit a81240c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Handlers/acOptimize.cpp.Rt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ int acOptimize::OptimizerInit () {
pugi::xml_attribute attr;
nlopt_result res;
material=0.0;
if (solver->mpi.rank == 0) {
if (solver->mpi_rank == 0) {
if (Pars == 0) {
ERROR("Error: No parameters defined!\n");
return -1;
Expand All @@ -18,7 +18,7 @@ int acOptimize::OptimizerInit () {
}
GetParameters(start);
DEBUG_M;
if (solver->mpi.rank == 0) {
if (solver->mpi_rank == 0) {
method="MMA";
attr = node.attribute("method");
if (attr) {
Expand All @@ -40,15 +40,15 @@ int acOptimize::OptimizerInit () {
}
}
double * bound = NULL;
if (solver->mpi.rank == 0) bound = new double[Pars];
if (solver->mpi_rank == 0) bound = new double[Pars];
Parameters(PAR_LOWER, bound);
if (solver->mpi.rank == 0) {
if (solver->mpi_rank == 0) {
output("lower set to %lf\n", bound[0]);
nlopt_set_lower_bounds(opt, bound);
for (int i=0;i<Pars;i++) if (start[i] < bound[i]) start[i] = bound[i];
}
Parameters(PAR_UPPER, bound);
if (solver->mpi.rank == 0) {
if (solver->mpi_rank == 0) {
output("upper set to %lf\n", bound[0]);
nlopt_set_upper_bounds(opt, bound);
for (int i=0;i<Pars;i++) if (start[i] > bound[i]) start[i] = bound[i];
Expand Down

0 comments on commit a81240c

Please sign in to comment.