16 std::list<std::string>
const& well_path_fnames,
17 std::string& unique_model_name,
21 for (
auto const& surface_fname : sfc_fnames)
23 INFO(
"PetrelInterface::PetrelInterface(): open surface file.");
24 std::ifstream in(surface_fname);
27 INFO(
"PetrelInterface::PetrelInterface(): \tdone.");
34 "PetrelInterface::PetrelInterface(): \tCould not open file "
40 for (
auto const& well_path_fname : well_path_fnames)
42 INFO(
"PetrelInterface::PetrelInterface(): open well path file.");
43 std::ifstream in(well_path_fname);
46 INFO(
"PetrelInterface::PetrelInterface(): \tdone.");
53 "PetrelInterface::PetrelInterface(): \tCould not open well "
63 geo_obj->addStationVec(std::move(well_vec), _unique_name);
70 std::getline(in, line);
74static std::list<std::string>
split(std::string
const& line)
83 if (line.find(
"# Petrel Points with attributes") != std::string::npos)
92 while (line.find(
"END HEADER") == std::string::npos)
100 auto point = std::make_unique<GeoLib::Point>();
101 in >> (*point)[0] >> (*point)[1] >> (*point)[2];
104 pnt_vec.push_back(point.release());
111 "PetrelInterface::readPetrelSurface(): problem reading petrel "
112 "points from line\n'{:s}'.",
118 std::string_view
const prefix,
119 std::string_view
const message)
121 for (
auto const& str : str_list)
123 INFO(
"PetrelInterface::{:s}(): {:s}: {:s}.", prefix, message, str);
129 return std::stod(*(--str_list.end()));
136 if (line.find(
"# WELL TRACE FROM PETREL") == std::string::npos)
141 auto printInfo = [](
auto const& list, std::string_view
const message)
151 printInfo(str_list,
"well head x coord");
156 printInfo(str_list,
"well head y coord");
161 printInfo(str_list,
"well kb entry");
164 INFO(
"PetrelInterface::readPetrelWellTrace(): {:f}, {:f}, {:f}.",
168 double const depth = 0.0;
169 std::string
const borehole_name =
"";
172 well_head_x, well_head_y, well_kb, depth, borehole_name, date));
188 while (line[0] ==
'#')
210 if (line.size() > 1 && line[0] !=
'#')
212 std::stringstream stream(line);
214 stream >> x >> y >> z;
218 stream >> tvd >> dx >> dy >> azim >> incl >> dls;
void INFO(fmt::format_string< Args... > fmt, Args &&... args)
void WARN(fmt::format_string< Args... > fmt, Args &&... args)
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()))
A borehole as a geometric object.
void addSoilLayer(double thickness, const std::string &soil_name)
Add a soil layer to the boreholes stratigraphy.
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)