/* Copyright 2013--2018 James E. McClure, Virginia Polytechnic & State University This file is part of the Open Porous Media project (OPM). OPM is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. OPM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OPM. If not, see . */ /* Copyright 2013--2018 James E. McClure, Virginia Polytechnic & State University This file is part of the Open Porous Media project (OPM). OPM is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. OPM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OPM. If not, see . */ #include #include #include #include #include #include #include #include #include "common/Array.h" #include "common/Utilities.h" #include "common/MPI_Helpers.h" #include "common/Communication.h" #include "common/Database.h" #include "common/SpherePack.h" // Inline function to read line without a return argument static inline void fgetl( char * str, int num, FILE * stream ) { char* ptr = fgets( str, num, stream ); if ( 0 ) {char *temp = (char *)&ptr; temp++;} } void WriteLocalSolidID(char *FILENAME, char *ID, int N) { char value; ofstream File(FILENAME,ios::binary); for (int n=0; nNx) imin = Nx; if (imax<0) imax = 0; if (imax>Nx) imax = Nx; if (jmin<0) jmin = 0; if (jmin>Ny) jmin = Ny; if (jmax<0) jmax = 0; if (jmax>Ny) jmax = Ny; if (kmin<0) kmin = 0; if (kmin>Nz) kmin = Nz; if (kmax<0) kmax = 0; if (kmax>Nz) kmax = Nz; // Loop over the domain for this sphere (may be null) for (i=imin;iNx) imin = Nx; if (imax<0) imax = 0; if (imax>Nx) imax = Nx; if (jmin<0) jmin = 0; if (jmin>Ny) jmin = Ny; if (jmax<0) jmax = 0; if (jmax>Ny) jmax = Ny; if (kmin<0) kmin = 0; if (kmin>Nz) kmin = Nz; if (kmax<0) kmax = 0; if (kmax>Nz) kmax = Nz; // Loop over the domain for this sphere (may be null) for (i=imin;i