26 std::list<std::string>
const& well_path_fnames,
27 std::string& unique_model_name,
29 : _unique_name(unique_model_name)
31 for (
auto const& surface_fname : sfc_fnames)
33 INFO(
"PetrelInterface::PetrelInterface(): open surface file.");
34 std::ifstream in(surface_fname);
37 INFO(
"PetrelInterface::PetrelInterface(): \tdone.");
44 "PetrelInterface::PetrelInterface(): \tCould not open file "
50 for (
auto const& well_path_fname : well_path_fnames)
52 INFO(
"PetrelInterface::PetrelInterface(): open well path file.");
53 std::ifstream in(well_path_fname);
56 INFO(
"PetrelInterface::PetrelInterface(): \tdone.");
63 "PetrelInterface::PetrelInterface(): \tCould not open well "
80 std::getline(in, line);
84static std::list<std::string>
split(std::string
const& line)
93 if (line.find(
"# Petrel Points with attributes") != std::string::npos)
102 while (line.find(
"END HEADER") == std::string::npos)
110 auto point = std::make_unique<GeoLib::Point>();
111 in >> (*point)[0] >> (*point)[1] >> (*point)[2];
114 pnt_vec.push_back(point.release());
121 "PetrelInterface::readPetrelSurface(): problem reading petrel "
122 "points from line\n'{:s}'.",
128 std::string_view
const prefix,
129 std::string_view
const message)
131 for (
auto const& str : str_list)
133 INFO(
"PetrelInterface::{:s}(): {:s}: {:s}.", prefix, message, str);
139 return std::stod(*(--str_list.end()));
146 if (line.find(
"# WELL TRACE FROM PETREL") == std::string::npos)
151 auto printInfo = [](
auto const& list, std::string_view
const message)
161 printInfo(str_list,
"well head x coord");
166 printInfo(str_list,
"well head y coord");
171 printInfo(str_list,
"well kb entry");
174 INFO(
"PetrelInterface::readPetrelWellTrace(): {:f}, {:f}, {:f}.",
178 double const depth = 0.0;
179 std::string
const borehole_name =
"";
182 well_head_x, well_head_y, well_kb, depth, borehole_name, date));
198 while (line[0] ==
'#')
220 if (line.size() > 1 && line[0] !=
'#')
222 std::stringstream stream(line);
224 stream >> x >> y >> z;
227 ->addSoilLayer(x, y, z,
"unknown");
228 stream >> tvd >> dx >> dy >> azim >> incl >> dls;
Definition of the GEOObjects class.
void INFO(fmt::format_string< Args... > fmt, Args &&... args)
void WARN(fmt::format_string< Args... > fmt, Args &&... args)
Definition of the PetrelInterface class.
Definition of the StationBorehole class.
std::vector< GeoLib::Point * > pnt_vec
void readPetrelSurfacePoints(std::istream &in)
void readPetrelWellTrace(std::istream &in)
void readPetrelWellTraceData(std::istream &in)
PetrelInterface(std::list< std::string > const &sfc_fnames, std::list< std::string > const &well_path_fnames, std::string &unique_model_name, GeoLib::GEOObjects *geo_obj)
std::vector< GeoLib::Point * > well_vec
Container class for geometric objects.
void addPointVec(std::vector< Point * > &&points, std::string &name, PointVec::NameIdMap &&pnt_id_name_map, double const eps=std::sqrt(std::numeric_limits< double >::epsilon()))
void addStationVec(std::vector< Point * > &&stations, std::string &name)
Adds a vector of stations with the given name and colour to GEOObjects.
A borehole as a geometric object.
std::vector< std::string > splitString(std::string const &str)
static void printListInfo(const std::list< std::string > &str_list, std::string_view const prefix, std::string_view const message)
static std::string readLine(std::istream &in)
static double getLastNumberFromList(const std::list< std::string > &str_list)
static std::list< std::string > split(std::string const &line)