Ejemplo n.º 1
0
 GeometryModel & buildGeom(const ModelTpl<Scalar,Options,JointCollectionTpl> & model,
                           const std::istream & xmlStream,
                           const GeometryType type,
                           GeometryModel & geomModel,
                           const std::string & packageDir,
                           hpp::fcl::MeshLoaderPtr meshLoader = hpp::fcl::MeshLoaderPtr())
 throw (std::invalid_argument)
 {
   const std::vector<std::string> dirs(1,packageDir);
   return buildGeom(model,xmlStream,type,geomModel,dirs, meshLoader);
 }
Ejemplo n.º 2
0
    /// Read the Eclipse grid format ('.grdecl').
    void CpGridData::processEclipseFormat(const grdecl& input_data, double z_tolerance, bool remove_ij_boundary, bool turn_normals)
    {
        // Process.
#ifdef VERBOSE
        std::cout << "Processing eclipse data." << std::endl;
#endif
        processed_grid output;
        process_grdecl(&input_data, z_tolerance, &output);
        if (remove_ij_boundary) {
            removeOuterCellLayer(output);
            // removeUnusedNodes(output);
        }

        // Move data into the grid's structures.
#ifdef VERBOSE
        std::cout << "Building topology." << std::endl;
#endif
        std::vector<int> face_to_output_face;
        buildTopo(output, global_cell_, cell_to_face_, face_to_cell_, face_to_point_, cell_to_point_, face_to_output_face);
        std::copy(output.dimensions, output.dimensions + 3, logical_cartesian_size_.begin());

#ifdef VERBOSE
        std::cout << "Building geometry." << std::endl;
#endif
        buildGeom(output, cell_to_face_, cell_to_point_, face_to_output_face, geometry_, face_normals_, allcorners_, turn_normals);

#ifdef VERBOSE
        std::cout << "Assigning face tags." << std::endl;
#endif
        int nf = face_to_output_face.size();
        std::vector<enum face_tag> temp_tags(nf);
        for (int i = 0; i < nf; ++i) {
            temp_tags[i] = output.face_tag[face_to_output_face[i]];
        }
        face_tag_.assign(temp_tags.begin(), temp_tags.end());

#ifdef VERBOSE
        std::cout << "Cleaning up." << std::endl;
#endif
        // Clean up the output struct.
        free_processed_grid(&output);

        computeUniqueBoundaryIds();

#ifdef VERBOSE
        std::cout << "Done with grid processing." << std::endl;
#endif
    }