@@ -449,8 +449,8 @@ void handleWELLSTRE(HandlerContext& handlerContext)
449
449
{
450
450
auto & inj_streams = handlerContext.state ().inj_streams ;
451
451
for (const auto & record : handlerContext.keyword ) {
452
- const std::string& stream_name = record.getItem ( " STREAM" ).getTrimmedString (0 );
453
- const auto & composition = record.getItem ( " COMPOSITIONS" ). getData < double > ();
452
+ const auto stream_name = record.getItem <ParserKeywords::WELLSTRE:: STREAM>( ).getTrimmedString (0 );
453
+ const auto & composition = record.getItem <ParserKeywords::WELLSTRE:: COMPOSITIONS>(). getSIDoubleData ();
454
454
const std::size_t num_comps = handlerContext.static_schedule ().m_runspec .numComps ();
455
455
if (composition.size () != num_comps) {
456
456
const std::string msg = fmt::format (" The number of the composition values for stream '{}' is not the same as the number of components." , stream_name);
@@ -462,8 +462,8 @@ void handleWELLSTRE(HandlerContext& handlerContext)
462
462
const std::string msg = fmt::format (" The sum of the composition values for stream '{}' is not 1.0, but {}." , stream_name, sum);
463
463
throw OpmInputError (msg, handlerContext.keyword .location ());
464
464
}
465
- auto composition_ptr = std::make_shared<std::vector<double >>(std::move ( composition) );
466
- inj_streams.update (stream_name, composition_ptr);
465
+ auto composition_ptr = std::make_shared<std::vector<double >>(composition);
466
+ inj_streams.update (stream_name, std::move ( composition_ptr) );
467
467
}
468
468
469
469
}
@@ -554,9 +554,7 @@ void handleWINJGAS(HandlerContext& handlerContext)
554
554
{
555
555
// \Note: we do not support the item 4 MAKEUPGAS and item 5 STAGE in WINJGAS keyword yet
556
556
for (const auto & record : handlerContext.keyword ) {
557
- const std::string& wellNamePattern = record.getItem (" WELL" ).getTrimmedString (0 );
558
- const auto well_names = handlerContext.wellNames (wellNamePattern, false );
559
- const std::string fluid_nature = record.getItem (" FLUID" ).getTrimmedString (0 );
557
+ const std::string fluid_nature = record.getItem <ParserKeywords::WINJGAS::FLUID>().getTrimmedString (0 );
560
558
561
559
// \Note: technically, only the first two characters are significant
562
560
// with some testing, we can determine whether we want to enforce this.
@@ -565,15 +563,17 @@ void handleWINJGAS(HandlerContext& handlerContext)
565
563
const std::string msg = fmt::format (" The fluid nature '{}' is not supported in WINJGAS keyword." , fluid_nature);
566
564
throw OpmInputError (msg, handlerContext.keyword .location ());
567
565
}
568
- const std::string stream_name = record.getItem (" STREAM" ).getTrimmedString (0 );
569
566
567
+ const std::string stream_name = record.getItem <ParserKeywords::WINJGAS::STREAM>().getTrimmedString (0 );
570
568
// we make sure the stream is defined in WELLSTRE keyword
571
569
const auto & inj_streams = handlerContext.state ().inj_streams ;
572
570
if (!inj_streams.has (stream_name)) {
573
571
const std::string msg = fmt::format (" The stream '{}' is not defined in WELLSTRE keyword." , stream_name);
574
572
throw OpmInputError (msg, handlerContext.keyword .location ());
575
573
}
576
574
575
+ const std::string wellNamePattern = record.getItem <ParserKeywords::WINJGAS::WELL>().getTrimmedString (0 );
576
+ const auto well_names = handlerContext.wellNames (wellNamePattern, false );
577
577
for (const auto & well_name : well_names) {
578
578
auto well2 = handlerContext.state ().wells .get (well_name);
579
579
auto injection = std::make_shared<Well::WellInjectionProperties>(well2.getInjectionProperties ());
0 commit comments