bool Hdf5Dataset::getSphereRI(MapVecDouble &mvec) { hsize_t dims_out[2], count[2], offset[2], dimsm[2]; hid_t dataspace = H5Dget_space(this->sphere_dataset_); // dataspace handle int rank = H5Sget_simple_extent_ndims(dataspace); herr_t status_n = H5Sget_simple_extent_dims(dataspace, dims_out, NULL); herr_t status; offset[0] = 0; offset[1] = 0; count[0] = dims_out[0]; count[1] = 4; double data_out[count[0]][count[1]]; status = H5Sselect_hyperslab(dataspace, H5S_SELECT_SET, offset, NULL, count, NULL); dimsm[0] = count[0]; dimsm[1] = count[1]; hid_t memspace; memspace = H5Screate_simple(RANK_OUT, dimsm, NULL); status = H5Dread(this->sphere_dataset_, H5T_NATIVE_DOUBLE, memspace, dataspace, H5P_DEFAULT, data_out); for (int i = 0; i < count[0]; i++) { std::vector< double > sphere_center(3); double ri; for (int j = 0; j < 3; j++) { sphere_center[j] = data_out[i][j]; } for (int k = 3; k < 4; k++) { ri = data_out[i][k]; } mvec.insert(std::pair< std::vector< double >, double >(sphere_center, ri)); } return 0; }
int makeGeometry(Box& a_domain) { Real dx; RealVect origin; int eekflag = 0; //parse input file ParmParse pp; Vector<int> n_cell(SpaceDim); pp.getarr("n_cell",n_cell,0,SpaceDim); CH_assert(n_cell.size() == SpaceDim); IntVect lo = IntVect::Zero; IntVect hi; for (int ivec = 0; ivec < SpaceDim; ivec++) { if (n_cell[ivec] <= 0) { pout() << " bogus number of cells input = " << n_cell[ivec]; return(-1); } hi[ivec] = n_cell[ivec] - 1; } a_domain.setSmall(lo); a_domain.setBig(hi); Vector<Real> prob_lo(SpaceDim, 1.0); Real prob_hi; pp.getarr("prob_lo",prob_lo,0,SpaceDim); pp.get("prob_hi",prob_hi); dx = (prob_hi-prob_lo[0])/n_cell[0]; RealVect dxVect = dx*RealVect::Unit; for (int idir = 0; idir < SpaceDim; idir++) { origin[idir] = prob_lo[idir]; } int verbosity = 0; int whichgeom; pp.get("which_geom",whichgeom); EBIndexSpace* ebisPtr = Chombo_EBIS::instance(); if (whichgeom == 0) { //allregular pout() << "all regular geometry" << endl; AllRegularService regserv; ebisPtr->define(a_domain, origin, dx, regserv); } else if (whichgeom == 1) { pout() << "ramp geometry" << endl; int upDir; int indepVar; Real startPt; Real slope; pp.get("up_dir",upDir); pp.get("indep_var",indepVar); pp.get("start_pt", startPt); pp.get("ramp_slope", slope); RealVect normal = RealVect::Zero; normal[upDir] = 1.0; normal[indepVar] = -slope; RealVect point = RealVect::Zero; point[upDir] = -slope*startPt; bool normalInside = true; PlaneIF ramp(normal,point,normalInside); GeometryShop workshop(ramp,verbosity,dxVect); //this generates the new EBIS ebisPtr->define(a_domain, origin, dx, workshop); } else if (whichgeom == 5) { pout() << "sphere geometry" << endl; vector<Real> sphere_center(SpaceDim); pp.getarr("sphere_center",sphere_center, 0, SpaceDim); RealVect sphereCenter; for (int idir = 0; idir < SpaceDim; idir++) { sphereCenter[idir] = sphere_center[idir]; } Real sphereRadius; pp.get("sphere_radius", sphereRadius); bool insideRegular = false; SphereIF implicit(sphereRadius,sphereCenter,insideRegular); GeometryShop workshop(implicit,verbosity,dxVect); //this generates the new EBIS ebisPtr->define(a_domain, origin, dx, workshop); } else if (whichgeom == 13) { pout() << "rhodonea geometry" << endl; vector<Real> tmp(SpaceDim); pp.getarr("rhodonea_center", tmp, 0, SpaceDim); RealVect rhodoneaCenter; for (int idir = 0; idir < SpaceDim; idir++) { rhodoneaCenter[idir] = tmp[idir]; } Real innerRadius; pp.get("inner_radius", innerRadius); Real outerRadius; pp.get("outer_radius", outerRadius); int frequency; pp.get("frequency", frequency); bool insideRegular = false; RhodoneaIF implicit(innerRadius, outerRadius, frequency, rhodoneaCenter, insideRegular); GeometryShop workshop(implicit,verbosity,dxVect); //this generates the new EBIS ebisPtr->define(a_domain, origin, dx, workshop); } else if (whichgeom == 18) { pout() << "Low swirl burner geometry" << endl; // AttachDebugger(); Box domain; for (int idir = 0; idir < SpaceDim; idir++) { origin[idir] = prob_lo[idir]; } Real outerRadius; pp.get("outer_radius",outerRadius); Real outerThick; pp.get("outer_thick",outerThick); Real outerHeight; pp.get("outer_height",outerHeight); Real outerOffset = ((prob_hi - prob_lo[0]) - outerHeight) / 2.0 + prob_lo[0]; Real innerRadius; pp.get("inner_radius",innerRadius); Real innerThick; pp.get("inner_thick",innerThick); Real innerOffset = 0.0; innerOffset += outerOffset; Real innerHeight; pp.get("inner_height",innerHeight); Real plateHeight; pp.get("plate_height",plateHeight); plateHeight += outerOffset; Real plateThick; pp.get("plate_thick",plateThick); int doHoles; pp.get("do_holes",doHoles); Real holeRadius; pp.get("hole_radius",holeRadius); Real holeSpace; pp.get("hole_space",holeSpace); int vaneNum; pp.get("vane_num",vaneNum); Real vaneThick; pp.get("vane_thick",vaneThick); RealVect vaneNorm; Vector<Real> vectVaneNorm; pp.getarr("vane_norm",vectVaneNorm,0,SpaceDim); for (int idir = 0; idir < SpaceDim; idir++) { vaneNorm[idir] = vectVaneNorm[idir]; } Real vaneOffset; pp.get("vane_offset",vaneOffset); Real vaneHeight = innerHeight - 2*vaneOffset; vaneOffset += outerOffset; // Make the outer chamber BaseIF* outerChamber = makeChamber(outerRadius,outerThick, outerOffset,outerHeight); // Make the inner chamber BaseIF* innerChamber = makeChamber(innerRadius,innerThick, innerOffset,innerHeight); // Make the inner plate with holes BaseIF* holyPlate = makePlate(plateHeight,plateThick,innerRadius, doHoles,holeRadius,holeSpace); // Make the vanes BaseIF* vanes = makeVanes(vaneNum,vaneThick,vaneNorm,innerRadius,outerRadius, vaneOffset,vaneHeight); // Union all the pieces together Vector<BaseIF*> pieces; pieces.push_back(outerChamber); pieces.push_back(innerChamber); pieces.push_back(holyPlate); pieces.push_back(vanes); UnionIF swirl(pieces); ComplementIF outside(swirl,true); GeometryShop workshop(outside,verbosity,dxVect); // This generates the new EBIS EBIndexSpace* ebisPtr = Chombo_EBIS::instance(); ebisPtr->define(a_domain, origin, dx, workshop); } else { //bogus which_geom pout() << " bogus which_geom input = " << whichgeom; eekflag = 33; } return eekflag; }
void Renderer::FrustumCull(const Scene * scene, const Vector3f& camera_position, const Array<SceneObject*> & scene_objects, Array<RenderData*> & render_data_vector, const Matrix4f &vp_matrix, const OESShader * oesShader) { for (auto it = scene_objects.Begin(); it != scene_objects.End(); ++it) { SceneObject *scene_object = (*it); RenderData* render_data = scene_object->GetRenderData(); if (render_data == nullptr || render_data->GetMaterial() == nullptr) { continue; } // Check for frustum culling flag if (!scene->GetFrustumCulling()) { //No occlusion or frustum tests enabled render_data_vector.PushBack(render_data); continue; } // Frustum culling setup Mesh* currentMesh = render_data->GetMesh(); if (currentMesh == nullptr) { continue; } BoundingBoxInfo bounding_box_info = currentMesh->GetBoundingBoxInfo(); Matrix4f modelMatrixTmp = render_data->GetOwnerObject()->GetMatrixWorld(); Matrix4f mvpMatrixTmp(vp_matrix * modelMatrixTmp); // Frustum float frustum[6][4]; // Matrix to array float mvp_matrix_array[16] = { 0.0 }; const float *mat_to_array = (const float*)mvpMatrixTmp.Transposed().M[0]; // TODO this is originally glm::mat4 so transposed memcpy(mvp_matrix_array, mat_to_array, sizeof(float) * 16); // Build the frustum BuildFrustum(frustum, mvp_matrix_array); // Check for being inside or outside frustum bool is_inside = IsCubeInFrustum(frustum, bounding_box_info); // Only push those scene objects that are inside of the frustum if (!is_inside) { scene_object->SetInFrustum(false); continue; } // Transform the bounding sphere const BoundingSphereInfo sphereInfo = currentMesh->GetBoundingSphereInfo(); Vector4f sphere_center(sphereInfo.center, 1.0f); Vector4f transformed_sphere_center = mvpMatrixTmp.Transform(sphere_center); // Calculate distance from camera Vector4f position(camera_position, 1.0f); Vector4f difference = transformed_sphere_center - position; float distance = difference.Dot(difference); // this distance will be used when sorting transparent objects render_data->SetCameraDistance(distance); // Check if this is the correct LOD level if (!scene_object->InLODRange(distance)) { // not in range, don't add it to the list continue; } scene_object->SetInFrustum(); bool visible = scene_object->IsVisible(); //If visibility flag was set by an earlier occlusion query, //turn visibility on for the object if (visible) { render_data_vector.PushBack(render_data); } if (render_data->GetMaterial() == nullptr || !scene->GetOcclusionCulling()) { continue; } } }
void sphereGeometry(Box& a_coarsestDomain, Real& a_dx) { ParmParse ppgodunov; //parse input file int max_level = 0; ppgodunov.get("max_level",max_level); int num_read_levels = Max(max_level,1); std::vector<int> refRatios; // (num_read_levels,1); // note this requires a refRatio to be defined for the // finest level (even though it will never be used) ppgodunov.getarr("ref_ratio",refRatios,0,num_read_levels+1); ParmParse pp; RealVect origin = RealVect::Zero; Vector<int> n_cell(SpaceDim); pp.getarr("n_cell",n_cell,0,SpaceDim); CH_assert(n_cell.size() == SpaceDim); IntVect lo = IntVect::Zero; IntVect hi; for (int ivec = 0; ivec < SpaceDim; ivec++) { if (n_cell[ivec] <= 0) { pout() << " bogus number of cells input = " << n_cell[ivec]; MayDay::Error(); } hi[ivec] = n_cell[ivec] - 1; } a_coarsestDomain = Box(lo, hi); Box finestDomain = a_coarsestDomain; for (int ilev = 0; ilev < max_level; ilev++) { finestDomain.refine(refRatios[ilev]); } Real prob_hi; int numOpen = n_cell[0]; pp.get("domain_length",prob_hi); a_dx = prob_hi/numOpen; Real fineDx = a_dx; int ebMaxCoarsen = 2; for (int ilev = 0; ilev < max_level; ilev++) { fineDx /= refRatios[ilev]; ebMaxCoarsen += refRatios[ilev]/2; } int ebMaxSize; ppgodunov.get("max_grid_size", ebMaxSize); EBIndexSpace* ebisPtr = Chombo_EBIS::instance(); pout() << "sphere geometry" << endl; vector<Real> sphere_center(SpaceDim); pp.getarr("sphere_center",sphere_center, 0, SpaceDim); RealVect sphereCenter; for (int idir = 0; idir < SpaceDim; idir++) { sphereCenter[idir] = sphere_center[idir]; } Real sphereRadius; pp.get("sphere_radius", sphereRadius); int inside_fluid; pp.get("sphere_fluid_inside", inside_fluid); bool insideFluid = (inside_fluid==1); SphereIF sphereIF(sphereRadius, sphereCenter, insideFluid); RealVect vectFineDx(D_DECL(fineDx,fineDx,fineDx)); GeometryShop workshop(sphereIF,0,vectFineDx); //this generates the new EBIS ebisPtr->define(finestDomain, origin, fineDx, workshop, ebMaxSize, ebMaxCoarsen); }
struct vector raytrace(struct vector rayorig, struct vector raydir, sphere_t *spheres, int nspheres, int depth) { int inside; int i, j; /* Loop indexes. */ float t0; float t1; sphere_t s; struct vector surface_color; /* Color of the surface. */ struct vector phit; /* Point of intersection. */ struct vector nhit; /* Normal at the intersection point. */ struct vector lightdir; /* Light direction. */ struct vector refldir; struct vector refrdir; struct vector tmp1, tmp3; struct vector reflection; struct vector refraction; float tnear; float facingratio; float fresneleffect; float ior; float cosi; float k; float eta; int transmission; t0 = INFINITY; t1 = INFINITY; tnear = INFINITY; s = NULL; /* * Find closest sphere in the scene * that the ray intercepts. */ for (i = 0; i < nspheres; i++) { /* This sphere is intercepted. */ if (sphere_intersects(spheres[i], rayorig, raydir, &t0, &t1)) { if (t0 < 0) t0 = t1; /* Closest sphere found. */ if (t0 < tnear) { tnear = t0; s = spheres[i]; } } } /* * There is no intersection * so return background color. */ if (s == NULL) return (VECTOR(2, 2, 2)); surface_color = VECTOR(0, 0, 0); phit = vector_scalar(raydir, tnear); phit = vector_add(phit, rayorig); nhit = vector_sub(phit, sphere_center(s)); nhit = vector_normalize(nhit); inside = 0; if (vector_dot(raydir, nhit) > 0) { nhit = vector_invert(nhit); inside = 1; } tmp3 = vector_scalar(nhit, BIAS); tmp3 = vector_add(tmp3, phit); if (((s->transparency > 0) || (s->reflection > 0)) && (depth < max_depth)) { facingratio = -vector_dot(raydir, nhit); fresneleffect = mix(pow(1 - facingratio, 3), 1, 0.1); tmp1 = vector_scalar(nhit, 2*vector_dot(raydir, nhit)); refldir = vector_sub(raydir, tmp1); refldir = vector_normalize(refldir); reflection = raytrace(tmp3, refldir, spheres, nspheres, depth + 1); refraction = VECTOR(0, 0, 0); if (s->transparency > 0) { ior = 1.1; eta = (inside) ? ior : 1/ior; cosi = -vector_dot(nhit, raydir); k = 1 - eta*eta*(1 - cosi*cosi); refrdir = vector_scalar(raydir, eta); tmp1 = vector_scalar(nhit, eta*cosi - sqrt(k)); refrdir = vector_add(refrdir, tmp1); refrdir = vector_normalize(refrdir); tmp3 = vector_scalar(nhit, BIAS); tmp3 = vector_sub(phit, tmp3); refraction = raytrace(tmp3, refrdir, spheres, nspheres, depth + 1); } refraction =vector_scalar(refraction,(1-fresneleffect)*s->transparency); reflection = vector_scalar(reflection, fresneleffect); tmp1 = vector_add(reflection, refraction); surface_color = vector_cross(tmp1, s->surface_color); } else { /* * It is a diffuse object, so there * is no need to raytrace any further. */ for (i = 0; i < nspheres; i++) { /* This is a light source. */ if (spheres[i]->emission_color.x > 0) { transmission = 1; lightdir = vector_sub(spheres[i]->center, phit); lightdir = vector_normalize(lightdir); for (j = 0; j < nspheres; j++) { if (i == j) continue; /* Shade this point. */ if (sphere_intersects(spheres[j], tmp3, lightdir, NULL, NULL)) { transmission = 0; break; } } if (transmission) { tmp1 = vector_scalar(s->surface_color, max(0, vector_dot(nhit, lightdir))); tmp1 = vector_cross(tmp1, spheres[i]->emission_color); surface_color = vector_add(surface_color, tmp1); } } } } return (vector_add(surface_color, s->emission_color)); }
int makeGeometry(Box& a_domain) { Real dx; RealVect origin; int eekflag = 0; //parse input file ParmParse pp; Vector<int> n_cell(SpaceDim); pp.getarr("n_cell",n_cell,0,SpaceDim); CH_assert(n_cell.size() == SpaceDim); IntVect lo = IntVect::Zero; IntVect hi; for (int ivec = 0; ivec < SpaceDim; ivec++) { if (n_cell[ivec] <= 0) { pout() << " bogus number of cells input = " << n_cell[ivec]; return(-1); } hi[ivec] = n_cell[ivec] - 1; } a_domain.setSmall(lo); a_domain.setBig(hi); Vector<Real> prob_lo(SpaceDim, 1.0); Real prob_hi; pp.getarr("prob_lo",prob_lo,0,SpaceDim); pp.get("prob_hi",prob_hi); dx = (prob_hi-prob_lo[0])/n_cell[0]; RealVect dxVect = dx*RealVect::Unit; for (int idir = 0; idir < SpaceDim; idir++) { origin[idir] = prob_lo[idir]; } int verbosity = 0; int whichgeom; pp.get("which_geom",whichgeom); EBIndexSpace* ebisPtr = Chombo_EBIS::instance(); if (whichgeom == 0) { //allregular pout() << "all regular geometry" << endl; AllRegularService regserv; ebisPtr->define(a_domain, origin, dx, regserv); } else if (whichgeom == 1) { pout() << "ramp geometry" << endl; int upDir; int indepVar; Real startPt; Real slope; pp.get("up_dir",upDir); pp.get("indep_var",indepVar); pp.get("start_pt", startPt); pp.get("ramp_slope", slope); RealVect normal = RealVect::Zero; normal[upDir] = 1.0; normal[indepVar] = -slope; RealVect point = RealVect::Zero; point[upDir] = -slope*startPt; bool normalInside = true; PlaneIF ramp(normal,point,normalInside); GeometryShop workshop(ramp,verbosity,dxVect); //this generates the new EBIS ebisPtr->define(a_domain, origin, dx, workshop); } else if (whichgeom == 5) { pout() << "sphere geometry" << endl; vector<Real> sphere_center(SpaceDim); pp.getarr("sphere_center",sphere_center, 0, SpaceDim); RealVect sphereCenter; for (int idir = 0; idir < SpaceDim; idir++) { sphereCenter[idir] = sphere_center[idir]; } Real sphereRadius; pp.get("sphere_radius", sphereRadius); bool insideRegular = false; SphereIF implicit(sphereRadius,sphereCenter,insideRegular); GeometryShop workshop(implicit,verbosity,dxVect); //this generates the new EBIS ebisPtr->define(a_domain, origin, dx, workshop); } else if (whichgeom == 13) { pout() << "rhodonea geometry" << endl; vector<Real> tmp(SpaceDim); pp.getarr("rhodonea_center", tmp, 0, SpaceDim); RealVect rhodoneaCenter; for (int idir = 0; idir < SpaceDim; idir++) { rhodoneaCenter[idir] = tmp[idir]; } Real innerRadius; pp.get("inner_radius", innerRadius); Real outerRadius; pp.get("outer_radius", outerRadius); int frequency; pp.get("frequency", frequency); bool insideRegular = false; RhodoneaIF implicit(innerRadius, outerRadius, frequency, rhodoneaCenter, insideRegular); GeometryShop workshop(implicit,verbosity,dxVect); //this generates the new EBIS ebisPtr->define(a_domain, origin, dx, workshop); } else { //bogus which_geom pout() << " bogus which_geom input = " << whichgeom; eekflag = 33; } return eekflag; }
bool Hdf5Dataset::getMultimap(MultiMap &mMap) { hsize_t dims_out[2], count[2], offset[2]; hid_t dataspace = H5Dget_space(this->poses_dataset_); /* dataspace handle */ int rank = H5Sget_simple_extent_ndims(dataspace); herr_t status_n = H5Sget_simple_extent_dims(dataspace, dims_out, NULL); herr_t status; int chunk_size, chunk_itr; if (dims_out[0] % 10) { chunk_itr = 11; } else { chunk_itr = 10; } chunk_size = (dims_out[0] / 10); offset[0] = 0; for (int it = 0; it < chunk_itr; it++) { offset[1] = 0; if ((dims_out[0] - (chunk_size * it)) / chunk_size != 0) { count[0] = chunk_size; offset[0] = chunk_size * it; } else { count[0] = (dims_out[0] - (chunk_size * it)); offset[0] = count[0]; } count[1] = 10; double data_out[count[0]][count[1]]; status = H5Sselect_hyperslab(dataspace, H5S_SELECT_SET, offset, NULL, count, NULL); hsize_t dimsm[2]; dimsm[0] = count[0]; dimsm[1] = count[1]; hid_t memspace; memspace = H5Screate_simple(RANK_OUT, dimsm, NULL); status = H5Dread(this->poses_dataset_, H5T_NATIVE_DOUBLE, memspace, dataspace, H5P_DEFAULT, data_out); for(int i=0; i<count[0]; i++) { std::vector<double> sphere_center(3); std::vector<double> Poses(7); for(int j=0; j<3;j++) { sphere_center[j] = data_out[i][j]; } for(int k=3;k<10; k++) { Poses[k-3] = data_out[i][k]; } mMap.insert(std::make_pair(sphere_center, Poses)); } } return 0; }
int makeGeometry(Box& a_domain, RealVect& a_dx) { int eekflag = 0; //parse input file ParmParse pp; int verbosity = 0; RealVect origin = RealVect::Zero; Vector<int> n_cell(SpaceDim); pp.getarr("n_cell",n_cell,0,SpaceDim); CH_assert(n_cell.size() == SpaceDim); IntVect lo = IntVect::Zero; IntVect hi; for (int ivec = 0; ivec < SpaceDim; ivec++) { if (n_cell[ivec] <= 0) { pout() << " bogus number of cells input = " << n_cell[ivec]; return(-1); } hi[ivec] = n_cell[ivec] - 1; } a_domain.setSmall(lo); a_domain.setBig(hi); Vector<Real> prob_lo(SpaceDim, 1.0); Real prob_hi; pp.getarr("prob_lo",prob_lo,0,SpaceDim); pp.get("prob_hi",prob_hi); for (int idir = 0; idir < SpaceDim; idir++) { a_dx[idir] = (prob_hi-prob_lo[idir])/n_cell[idir]; origin[idir] = prob_lo[idir]; } int whichgeom; pp.get("which_geom",whichgeom); CH_XD::EBIndexSpace* ebisPtr = Chombo_EBIS::instance(); if (whichgeom == 0) { //allregular pout() << "all regular geometry" << endl; AllRegularService regserv; ebisPtr->define(a_domain, origin, a_dx[0], regserv); } else if (whichgeom == 1) { pout() << "ramp geometry" << endl; int upDir; int indepVar; Real startPt; Real slope; pp.get("up_dir",upDir); pp.get("indep_var",indepVar); pp.get("start_pt", startPt); pp.get("ramp_slope", slope); RealVect normal = RealVect::Zero; normal[upDir] = 1.0; normal[indepVar] = -slope; RealVect point = RealVect::Zero; point[upDir] = -slope*startPt; bool normalInside = true; PlaneIF ramp(normal,point,normalInside); GeometryShop workshop(ramp,verbosity,a_dx); //this generates the new EBIS ebisPtr->define(a_domain, origin, a_dx[0], workshop); } else if (whichgeom == 5) { pout() << "sphere geometry" << endl; vector<Real> sphere_center(SpaceDim); pp.getarr("sphere_center",sphere_center, 0, SpaceDim); RealVect sphereCenter; for (int idir = 0; idir < SpaceDim; idir++) { sphereCenter[idir] = sphere_center[idir]; } Real sphereRadius; pp.get("sphere_radius", sphereRadius); bool insideRegular = false; SphereIF implicit(sphereRadius,sphereCenter,insideRegular); GeometryShop workshop(implicit,verbosity,a_dx); //this generates the new EBIS ebisPtr->define(a_domain, origin, a_dx[0], workshop); } else if (whichgeom == 6) { pout() << "multisphere geometry" << endl; int numSpheres; pp.get("num_spheres", numSpheres); Vector<Real> radius(numSpheres); Vector<RealVect> center(numSpheres); for (int isphere = 0; isphere < numSpheres; isphere++) { char radiusString[80]; char centerString[80]; sprintf(radiusString, "sphere_radius_%d", isphere); sprintf(centerString, "sphere_center_%d", isphere); vector<Real> sphere_center(SpaceDim); Real sphereRadius; pp.get(radiusString, sphereRadius); pp.getarr(centerString,sphere_center, 0, SpaceDim); RealVect sphereCenter; for (int idir = 0; idir < SpaceDim; idir++) { sphereCenter[idir] = sphere_center[idir]; } center[isphere] = sphereCenter; radius[isphere] = sphereRadius; } bool inside = false; MultiSphereIF spheres(radius, center, inside); GeometryShop workshop(spheres,verbosity,a_dx); //this generates the new EBIS ebisPtr->define(a_domain, origin, a_dx[0], workshop); } else { //bogus which_geom pout() << " bogus which_geom input = " << whichgeom; eekflag = 33; } return eekflag; }