38 class WLIOHandler final:
public WellGroupIOHandler {
40 void load(
const std::string& filename, WellGroup3D& wells )
final 42 GEO::LineInput in( filename );
44 throw RINGMeshException(
"I/O",
"Could not open file" );
47 std::unique_ptr< LineMesh3D > mesh = LineMesh3D::create_mesh(
48 GeogramLineMesh3D::type_name_static() );
49 std::unique_ptr< LineMeshBuilder3D > builder =
50 LineMeshBuilder3D::create_builder( *mesh );
58 if( in.nb_fields() == 0 )
continue;
59 if( in.field_matches( 0,
"name:" ) ) {
61 }
else if( in.field_matches( 0,
"ZPOSITIVE" ) ) {
62 if( in.field_matches( 1,
"Depth" ) ) {
65 }
else if( in.field_matches( 0,
"WREF" ) ) {
66 vertex_ref[0] = in.field_as_double( 1 );
67 vertex_ref[1] = in.field_as_double( 2 );
68 vertex_ref[2] = z_sign * in.field_as_double( 3 );
69 builder->create_vertex( vertex_ref );
70 }
else if( in.field_matches( 0,
"PATH" ) ) {
71 if( in.field_as_double( 1 ) == 0. )
continue;
73 vertex[2] = z_sign * in.field_as_double( 2 );
74 vertex[0] = in.field_as_double( 3 ) + vertex_ref[0];
75 vertex[1] = in.field_as_double( 4 ) + vertex_ref[1];
76 index_t
id = builder->create_vertex( vertex );
77 builder->create_edge(
id - 1,
id );
78 }
else if( in.field_matches( 0,
"END" ) ) {
79 wells.add_well( *mesh, name );
81 > ::create_mesh( GeogramLineMesh3D::type_name_static() );
82 builder = LineMeshBuilder3D::create_builder( *mesh );
86 void save(
const WellGroup3D& wells,
const std::string& filename )
final 90 throw RINGMeshException(
"I/O",
91 "Saving of a WellGroup from Gocad not implemented yet" );
void ringmesh_unused(const T &)