mirror of
				https://github.com/OPM/opm-simulators.git
				synced 2025-02-25 18:55:30 -06:00 
			
		
		
		
	avoid usage of deck on all processes setting up EclPolymerModule
This commit is contained in:
		@@ -606,17 +606,19 @@ public:
 | 
				
			|||||||
        this->model().addOutputModule(new VtkEclTracerModule<TypeTag>(simulator));
 | 
					        this->model().addOutputModule(new VtkEclTracerModule<TypeTag>(simulator));
 | 
				
			||||||
        // Tell the black-oil extensions to initialize their internal data structures
 | 
					        // Tell the black-oil extensions to initialize their internal data structures
 | 
				
			||||||
        const auto& vanguard = simulator.vanguard();
 | 
					        const auto& vanguard = simulator.vanguard();
 | 
				
			||||||
        PolymerModule::initFromDeck(vanguard.deck(), vanguard.eclState());
 | 
					 | 
				
			||||||
        FoamModule::initFromDeck(vanguard.deck(), vanguard.eclState());
 | 
					        FoamModule::initFromDeck(vanguard.deck(), vanguard.eclState());
 | 
				
			||||||
        const auto& comm = this->gridView().comm();
 | 
					        const auto& comm = this->gridView().comm();
 | 
				
			||||||
        if (comm.rank() == 0) {
 | 
					        if (comm.rank() == 0) {
 | 
				
			||||||
            SolventModule::initFromDeck(vanguard.deck(), vanguard.eclState());
 | 
					            SolventModule::initFromDeck(vanguard.deck(), vanguard.eclState());
 | 
				
			||||||
 | 
					            PolymerModule::initFromDeck(vanguard.deck(), vanguard.eclState());
 | 
				
			||||||
            if (comm.size() > 1) {
 | 
					            if (comm.size() > 1) {
 | 
				
			||||||
                EclMpiSerializer ser(comm);
 | 
					                EclMpiSerializer ser(comm);
 | 
				
			||||||
                size_t size = SolventModule::packSize(ser);
 | 
					                size_t size = SolventModule::packSize(ser) +
 | 
				
			||||||
 | 
					                              PolymerModule::packSize(ser);
 | 
				
			||||||
                std::vector<char> buffer(size);
 | 
					                std::vector<char> buffer(size);
 | 
				
			||||||
                int position = 0;
 | 
					                int position = 0;
 | 
				
			||||||
                SolventModule::pack(buffer, position, ser);
 | 
					                SolventModule::pack(buffer, position, ser);
 | 
				
			||||||
 | 
					                PolymerModule::pack(buffer, position, ser);
 | 
				
			||||||
                comm.broadcast(&position, 1, 0);
 | 
					                comm.broadcast(&position, 1, 0);
 | 
				
			||||||
                comm.broadcast(buffer.data(), position, 0);
 | 
					                comm.broadcast(buffer.data(), position, 0);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
@@ -628,6 +630,7 @@ public:
 | 
				
			|||||||
            int position = 0;
 | 
					            int position = 0;
 | 
				
			||||||
            EclMpiSerializer ser(comm);
 | 
					            EclMpiSerializer ser(comm);
 | 
				
			||||||
            SolventModule::unpack(buffer, position, ser);
 | 
					            SolventModule::unpack(buffer, position, ser);
 | 
				
			||||||
 | 
					            PolymerModule::unpack(buffer, position, ser);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // create the ECL writer
 | 
					        // create the ECL writer
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user