Commit Graph
100 Commits
Author SHA1 Message Date
Markus Blatt 5449047682 Splits a very long line. 2015-11-13 15:52:01 +01:00
Markus Blatt 8148c37d57 Improved documentation 2015-11-13 15:46:45 +01:00
Markus Blatt 980928bfa9 Fix boolean in specialization.
The default implementation is the parallel version. Therefore the boolean
in the specialization (sequential run) needs to be false.
2015-11-13 15:46:34 +01:00
Markus Blatt f8715e31e7 Calculate parallel averages in RateConverter.
Previously, local averages were calculated and used in the
well equations. With this commit we add versions of defineState and
calcAverages that take into account the parallel domain decomposition
and calculate correct averages.

Function  calcAverages has a boolean template parameter
indicating whether this is a parallel run. Additionally we introduce
AverageIncrementCalculator with the same boolean template parameter.
In a parallel run we check whether the cell is owned by the process and
only in this case return an increment bigger than zero. In a sequential run
(no MPI or just one process -> empty boost::any parameter) no overhead is
introduced.
2015-11-13 15:46:34 +01:00
Markus Blatt e729c26b26 Only specialize distributeGridAndData for CpGrid if MPI is found. 2015-10-30 13:23:52 +01:00
Markus Blatt 113949190b Removes unused typedef 2015-10-29 16:35:58 +01:00
Markus Blatt d29a181336 Adapts flow_solvent to change in redistribution interface. 2015-10-29 16:15:30 +01:00
Markus Blatt 1916c8d35a Prevent copying the porevolume when checking for convergence.
As it is just used to compute the tempV value there is no need to
copy it to a new vector. With commit we use a reference to
geo.poreVolume() instead to prevent the copy.
2015-10-29 16:12:54 +01:00
Markus Blatt f167d321aa Added some spaces around parenthesis. 2015-10-28 16:44:14 +01:00
Markus Blatt 134b47a5e2 Fixes SaturationPropsFromDeck handling during redistribution.
It needs a material law manager that works on the processes local
grid partition. Therfore copying the one from the global representation
does not work. Instead we now create an new SaturationPropsFromDeck and
initialize it with the local material law manager.
2015-10-28 16:44:14 +01:00
Markus Blatt 4526cce41b Setup a distributed material law manager and copy values.
Since the refactoring to using opm-material a material law  manager for
the global grid was used. This meant that the properties used for
elements of the local grid were wrong. With this commit we set up a
manager that is based on the local grid only.
2015-10-28 16:39:47 +01:00
Markus Blatt 6ee021f0c6 Fixed indentation. 2015-10-28 16:26:45 +01:00
Markus Blatt c17af8efe6 Update and improve documentation. 2015-10-28 16:23:07 +01:00
Markus Blatt f447cf648a fix compilation of flow_solvent. 2015-10-27 17:13:01 +01:00
Markus Blatt e555cd45f1 Correctly compute the scaling factor for the equations in parallel.
When running parallel one cannot use Eigen::Array::mean() for this
as the it is just a local part of the complete array. With this commit
we correctly compute the number of global cells in the grid and use this
together with a parallel reduction to compute a global mean value.
2015-10-27 01:58:16 +01:00
Markus Blatt 87e02a1059 Communicate rock properties, too.
Somehow I was mislead by the name rock properties that the data stored in
them is not associated to grid cells, but to rock regions. With this commit
we determine the porosity and permeability by communication.
2015-10-26 10:49:35 +01:00
Markus Blatt 975ac0dc37 Removes superfluous wellMap_ member from WellStateFullyImplicitBlackoil.hpp
There is a using `BaseType::wellMap` directive that redirects all the
well map accesses to the base class. In consequence the local wellMap_
is alway empty and just makes debugging harder. Therefore it is
removed in this commit.
2015-10-23 10:47:14 +02:00
Markus Blatt ba9f227a5b Cater for wells null pointer
In the rare occasion that there are no wells int the model the wells_ pointer in
BlackoilModelBase class is a null pointer. Therefore we need to test whether it is
null and only process well information if it is not.

This problem was reintroduced with PR #460 and gets fixed by this
one. No we can run the equilibrium examples without wells again.
Sorry for the inconvenience.
2015-10-22 16:28:18 +02:00
Markus Blatt f5e34e01ca Remove unnecessary shared_ptr for geology and black oil properties. 2015-10-22 15:24:25 +02:00
Markus Blatt 82a73d969e Renamed flow_cp to flow_mpi 2015-10-12 10:59:01 +02:00
Markus Blatt d7e6886f4b Return 0 as hydrostatic correction for unperforated cells.
There might be wells without any perforations. It it happens
to be the last well will supscript over the bounds. In other
cases we actually return the correction for the next well.

Not sure whether returning 0 makes any sense, though.
2015-09-24 14:47:45 +02:00
Markus Blatt 32b8ed654e Prevent memory leaks in case SeqILU0 throws an exception. 2015-09-08 14:38:29 +02:00
Markus Blatt 3c1498ce92 Only construct SeqILU0 in try block.
The rest is not needed and this simplyfies code.
2015-09-08 12:06:03 +02:00
Markus Blatt 2d50408b5f Catch and process exception during ILU0 in parallel for CPR, too. 2015-09-08 12:05:27 +02:00
Markus Blatt c97f125b56 Include rank into error message. 2015-09-08 11:48:06 +02:00
Markus Blatt 315251da2c Fix typo wether->whether. 2015-09-08 11:44:46 +02:00
Markus Blatt de8c638308 Put space around braces where it seems approppriate. 2015-09-08 11:15:46 +02:00
Markus Blatt ccac548420 Introduces parallel exception handling for ILU0 preconditioner.
When running Norne with the interleaved solver sometimes exceptions
(diagonal matrix block is not invertible) occur for some rows in the
ILU decomposition. In a parallel run this means that some, but not all
processes will see the exceptions. This leads to a classic deadlock.

With this commit we catch the exception during the setup of the preconditioner,
determine with the other processes whether there were any exceptions, and
in this case all the processes will throw an exception.

Currently this limited to Dune::MatrixBlockError, but we could extend this.
2015-09-08 09:46:35 +02:00
Markus Blatt b91fb70e92 Adds new header to CMakeLists_files.cmake
The new header 	opm/autodiff/AdditionalObjectDeleter.hpp
was not there yet.
2015-09-07 11:03:08 +02:00
Markus Blatt 8ed72cdf9f Remove unused experimental header include.
The include of ParallelRestrictedAdditiveSchwarz.hh was a left over
from some experiments and should not be here yet.
2015-09-07 10:48:34 +02:00
Markus Blatt 02120d14d1 Directly initialize variable with global value.
Previously we initialized a variable for a global
(i.e. sum over all processes) value with the local
value first and the overwrote it with the computed
global. This meant the name did not reflect the value
during the first initialization.

With this commit we fix this by using an additional
variable for the local value that is used to compute
the global one.
2015-09-07 09:50:36 +02:00
Markus Blatt 4cc87c28f6 Fixes parallel runs with solve_welleq_initially
If this option was set there were some branches in
the code that did depend on the local number of wells
but should depend on the number of wells in the reservoir
no matter on which process they are stored.

With this commit we introduce BlackOilModelBase::localWellsActive()
which only takes local wells into account. The function now
BlackOilModelBase::wellsActive() considers all active wells in the
reservoir.
2015-09-05 20:24:50 +02:00
Markus Blatt 45fdb3ac48 [bugfix] Use correct parameters for ParallelIstlInformation::copyValuesTo.
The last parameter of this functions specifies how vector/martix
entries there are per index/cell of the grid. For the interleaved
versions all components end up in one block. Therefore this number
needs to be one here (in contrast to the number of phases for the
non-interleaved version).

This commit new uses the correct number.
2015-09-05 16:09:33 +02:00
Markus Blatt 0adde744bf [bugfix] Make sequential preconditioner live as long as the parallel one.
It holds a reference to the sequential code. Previously this reference
point to a temporary object that was deleted upon exit of
constructPrecond.

With this commit use a unique_ptr to store the parallel
preconditioner. It also gets a custom deleter that will delete the
nested sequential iterator during destruction.
2015-09-05 16:09:33 +02:00
Markus Blatt 6890e8db71 Renames ParallelPreconditionerDeleter and moves it to a separate header.
The class is not limited to parallel preconditioners. To reflect this
we rename it to AdditionalObjectDeleter. As it will also be used for
the parallel interleaved version we move the class to a separate header.
2015-09-05 16:09:33 +02:00
Markus Blatt c527e15b63 Use well information during load balancing.
With this commit we pass the well information to
the loadbalance method of CpGrid to ensure that
each well is stored completely on one process.
2015-09-03 20:28:13 +02:00
Markus Blatt ff669bc32b [bugfix] Correctl resize satOilMax in a parallel run.
Previously, we tried to make an empty container bigger by
resizing it with its current size. Of course this is wrong and does
not change anything. With this commit we use the size of another
container which already has the correct size.
2015-09-01 20:30:30 +02:00
Markus Blatt 67d5a1f503 Prevents initializing std::shared_ptr from nullptr.
For g++-4.4 support for nullptr is not complete. Using it
to initialize an empty shared_ptr breaks compilation:

/home/mblatt/src/dune/opm/opm-autodiff/opm/autodiff/AutoDiffHelpers.hpp: In constructor ‘Opm::HelperOps::HelperOps(const Grid&, Opm::EclipseStateConstPtr)’:
/home/mblatt/src/dune/opm/opm-autodiff/opm/autodiff/AutoDiffHelpers.hpp:87: error: no match for ternary ‘operator?:’ in ‘(bool)eclState ? eclState->.Opm::EclipseState::getNNC() : nullptr’
/home/mblatt/src/dune/opm/opm-autodiff/opm/autodiff/AutoDiffHelpers.hpp:87: note: candidates are: operator?:(bool, const Opm::NNC* std::__shared_ptr<const Opm::NNC, (__gnu_cxx::_Lock_policy)2u>::*, const Opm::NNC* std::__shared_ptr<const Opm::NNC, (__gnu_cxx::_Lock_policy)2u>::*) <built-in>
/home/mblatt/src/dune/opm/opm-autodiff/opm/autodiff/AutoDiffHelpers.hpp:87: note:                 operator?:(bool, const Opm::NNC* std::__shared_ptr<const Opm::NNC, (__gnu_cxx::_Lock_policy)2u>::*, T*) <built-in>

Here no conversion to shared_ptr happens.

/home/mblatt/src/dune/opm/opm-autodiff/opm/autodiff/ImpesTPFAAD.cpp: In constructor ‘Opm::HelperOps::HelperOps(const Grid&, Opm::EclipseStateConstPtr) [with Grid = UnstructuredGrid]’:
/home/mblatt/src/dune/opm/opm-autodiff/opm/autodiff/ImpesTPFAAD.cpp:160: error: no matching function for call to ‘std::shared_ptr<const Opm::EclipseState>::shared_ptr(const dune_nullptr_t&)’
/usr/include/c++/4.4/bits/shared_ptr.h:1263: note: candidates are: std::shared_ptr<_Tp>::shared_ptr(std::shared_ptr<_Tp>&&) [with _Tp = const Opm::EclipseState]
/usr/include/c++/4.4/bits/shared_ptr.h:1238: note:                 std::shared_ptr<_Tp>::shared_ptr() [with _Tp = const Opm::EclipseState]
/usr/include/c++/4.4/bits/shared_ptr.h:1236: note:                 std::shared_ptr<const Opm::EclipseState>::shared_ptr(const std::shared_ptr<const Opm::EclipseState>&)

Here the DUNE's nullptr implementation is used with std::shared_ptr which are not
compatible.

We fix this by using the emptry constructor of std::shared_ptr to create a nullptr.
2015-07-23 15:33:45 +02:00
Markus Blatt 2180ccddbc Activates the parallelism in the adaptive time stepping schemes.
It does this simply by passing the information about the
parallelization to the adaptive time stepper.
2015-05-22 21:12:10 +02:00
Markus Blatt f6e3be5381 Adds space around some binary operators. 2015-05-20 17:54:43 +02:00
Markus Blatt f0f38d7ac2 Fix seting of parallel_run_ member.
We are having a parallel only if there are more than one processes,
and not already with only one.

Kudos to @atgeirr for finding this in the review.
2015-05-20 17:53:54 +02:00
Markus Blatt 11211ca7d2 Update copyright notices 2015-05-20 09:26:25 +02:00
Markus Blatt 764e1e26c1 Used the correct parallel information for the whole system.
The whole system consists out of three equations per cell. Using
the parallel index set of the grid cells for it is wrong. Therefore
we use PR OPM/opm-core#803 to set up an  additional parallel index set
for the whole system and use this for the communication that is needed e.g.
by the ILU preconditioner.
2015-05-19 19:41:32 +02:00
Markus Blatt cb4970c9a6 Prevent unused paramerter warning for RedistributeDatahandle. 2015-05-19 19:40:59 +02:00
Markus Blatt d987e75b6d Rename createPreconditioner to the more accurate name createEllipticPreconditioner. 2015-05-19 19:40:11 +02:00
Markus Blatt 523ba001f6 Correctly compute the infinity norms of the well equations in parallel.
Here we assume that a complete well can be represented on one process.
Thus we only need to compute the local norms followed by a global reduction.
2015-05-15 15:57:50 +02:00
Markus Blatt bf13922ff9 Correctly compute the infinity norm in parallel.
For this we need to use ParallelIstlInformation for the reduction operation.
2015-05-15 15:57:50 +02:00
Markus Blatt 48ce90fcc7 Compute scaled well residuals correctly for parallel runs.
This commit adapts the PR #375 for parallel runs. That is, the norms are
calculated over all wells, not just the ones that perforate the local grid
cells.
As this is a reduction, too, we move the computation to convergenceReduction
method.
2015-05-15 15:57:50 +02:00
Markus Blatt 9e0b2fed4f Notify well manager whether this is a parallel run.
In a parallel the well handling needs to be slightly
adapted, see PR OPM/opm-core#799. Therefore, we need to
pass a boolean flag to the well manager indicating whether
this is a parallel run or not.

With this commit we do this.
2015-05-15 15:57:50 +02:00
Markus Blatt f4ff1ea4c4 Added missing explicite braces around if branch. 2015-05-15 15:10:42 +02:00
Markus Blatt 0cd174f246 Adds spaces to binary operator. 2015-05-15 14:58:06 +02:00
Markus Blatt c37cf08ee0 Removes unused residualNorm method.
This method seems to be some leftover from refactoring.
In flow we now use computeResidualNorms() instead and
residualNorm() is not used anywhere. Therefore this commit
removes it to prevent confusion.
2015-05-12 17:30:27 +02:00
Markus Blatt f0691504af Prevent printing stats on more than 1 process for CPR. 2015-05-08 13:15:59 +02:00
Markus Blatt 1fbe8e3b6d Distribute the geology information.
As it turns out initializing the Geology on a distributed grid
result in wrong values for e.g. saturation. Therefore with this
commit we resort to initializing the global geology and distribute
it using communication.
2015-05-07 12:21:06 +02:00
Markus Blatt a31aa46744 Send all phases for surface volume and saturation.
Previously, we only did send the information for the
first phase which led to computing wrong values in
a simulation. With this patch we now send all the data
for all the phases.
2015-05-07 12:21:06 +02:00
Markus Blatt 0329b0138d Prevent unsigned vs. signed int comparison warning 2015-04-30 15:47:09 +02:00
Markus Blatt 80056b8ef2 [bugfix] Pass parallel information to AMG preconditioner within CPR.
Previously only passed the parallel information to the ILU preconditioner,
but of course needs this information to set up the communication, too.
With this commit we pass the parallel information object to AMG's constructor.
2015-04-30 14:09:24 +02:00
Markus Blatt c57a10ff76 [bugfix] Use full set of processes to determine whether to redistribute or not.
Previously we used the size of the communicator within the CpGrid to check
whether we are running in parallel and need to redistribute the grid.
Unfortunately, this is MPI_COMM_SELF until we actually loadbalance and redistribute.
Therefore we now use the size of the MPI_Helper (i.e. MPI_COMM_WORLD) which
gives us the number of all available processes.

Note that the wrong behaviour was provoked with 656e5de331. Before that we
redistributed in any case which luckily included runs with more than 1 process.
2015-04-30 14:02:13 +02:00
Markus Blatt 5e66f2844b Moves include of iterterator facades to cornerpoint 2015-03-02 16:22:22 +01:00
Markus Blatt aaf82d2a65 [bugfix] read only from the sendState in BlackoilStateDataHandle.
During BlackoilStateDataHandle::gather we did read values from the
state where we should only receive values to. With this commit we
read from the state where we should send values.

Kudos to Bard for noticing this.
2015-03-02 11:10:02 +01:00
Markus Blatt d62264d567 Moves functions that do not depend on Eigen to Opm::UgGridHelpers.
As a result we only have one faceCentroid(int) function the returns const double* and
FieldVector<double,3> for UnstructuredGrid and CpGrid, respectively. The codes is
adapted to this.
2015-02-23 12:24:40 +01:00
Markus Blatt 97fcd69d77 Removes empty namespace regions. 2015-02-23 11:38:03 +01:00
Markus Blatt 9fa1bba8da Moves Opm::UgGridHelpers from opm-autodiff to dune-cornerpoint
For historic (or no apparent) reason the free function grid interface
was added to opm-autodiff. As it depends on whether or not dune-cornerpoint
is present this seems rather unnatural. Therefore this commit removes the
functionality unconditionally from opm-autodiff.

Note that there is a corresponding commit in dune-cornerpoint that adds it
there.
2015-02-23 11:02:13 +01:00
Markus Blatt bc58cfb3b9 Corrects missing space around if and operators. 2015-02-20 16:06:19 +01:00
Markus Blatt fd10c97e46 Fxied typo wether -> whether. 2015-02-20 16:03:08 +01:00
Markus Blatt bcc3ab7d95 Rename variable verbosity_ to terminal_output_. 2015-02-20 16:02:06 +01:00
Markus Blatt 62507b9cf6 [bugfix] Do not check verbosity when increase omega due to oscillation.
If oscillating then the same measures have to be taken on all
processes. This was not the case before the commit. Instead only
process 0 would have adapted omegas and we have produced wrong
results.

Kudos to Atgeirr for detecting this while reading the code.
2015-02-20 15:56:34 +01:00
Markus Blatt 9517dc08b3 Do not print message about querying output parameter for p>0. 2015-02-20 15:47:57 +01:00
Markus Blatt 4b110fb00b Fixes missing indentation. 2015-02-20 15:44:28 +01:00
Markus Blatt 46e0e0b0f7 Makes one argument constructors explicit to prevent type conversion. 2015-02-20 15:31:38 +01:00
Markus Blatt 007acfe018 Modified sim_fibo_ad_cp to also allow running with EQUIL keyword.
With now generic implementation of the initStateEquil in opm-core
we added the necessary grid helper functionlality for CpGrid and activated
the processing if the EQUIL keyword is there.
2015-02-20 12:23:35 +01:00
Markus Blatt d35d301a4b Print status output only on rank 0 for parallel runs. 2015-02-20 11:35:47 +01:00
Markus Blatt 5e72774b89 Remove the unsused grid members from BlackoilPropsDataHandle.
Previously BlackoilPropsDataHandle did hold a grid for sending
and receiving that were either not used or we could prevent their
usage. Therefore this commit removes them from the class and queries
all needed information from the property objects.
2015-02-19 09:35:18 +01:00
Markus Blatt 684da9aa84 Throw an excpetion if either eclipse or matlab output is activated. 2015-02-16 11:52:50 +01:00
Markus Blatt 3eb13e74dd Adds braces to if() return; 2015-02-16 11:42:42 +01:00
Markus Blatt f19a83bbda Remove superluous casts. 2015-02-16 11:40:49 +01:00
Markus Blatt 3575fdce6a Removes stackobject_to_heap. 2015-02-16 11:24:05 +01:00
Markus Blatt 60cdc583ae Make right hand passed to the linear solver consistent.
Previously, we had to use two layers of overlap cells such the
innermost layer contains the rightvalues automatically (as it is
surrounded by internal edges). No we use communication to get
the correct values in the whole overlap region and one layer
suffices as it should.
2015-02-12 21:33:41 +01:00
Markus Blatt 01ea7bacba Adds data redistribution capabilities and makes sim_fibo_ad_cp parallel.
With this commit we add the possibility to start with a global representation
of a simulator that is read on each process and afterwards this presentation
is redistributed among the processors together with the properties and
state data needed to initialize the simulation.

There still is no parallel well handling and no parallel output. But with the
equilibrium example of @dr-robertk and deactivated output we can already
perform parallel runs.
2015-02-12 21:33:41 +01:00
Markus Blatt fc137afcd5 Adds a constructor to BlackoilPropsAdFromDeck that allows copy the grid independant part.
In the parallel simulator we will have to be able adress only poperties on
some part of the global grid. To create thos properties we need to be able
to copy the grid independant data of the properties object and resize the rest.
This commit adds a construct taking a properties object for reading and a
new number of cells to accomplish this.
2015-02-12 21:33:41 +01:00
Markus Blatt 70fb0e7b79 Store the boost::any of ParallelIstlInformation by value.
During the constructor the underlying object only holds smart
pointers and an empty vector. The FullyImplicitBlackoilSolver
obtains  a reference to it from the NewtInterationInterface instances.
Therefore copying boost::any and storing it by value should be cheap
and safe.
2015-02-12 14:04:53 +01:00
Markus Blatt d1239d0a35 Adds space between parameters and stops eliding zeros. 2015-02-12 10:41:45 +01:00
Markus Blatt be7221aa9b Moved output parameters to the end of the list in extractParallelGridInformationToISTL 2015-02-12 10:41:44 +01:00
Markus Blatt 11848acf0c Added braces around else statement (coding guidelines) 2015-02-12 10:41:44 +01:00
Markus Blatt a37421d2ad Rely on delete being null safe. 2015-02-12 10:41:44 +01:00
Markus Blatt 31da0de909 Fixes indentation in CMakeLists_files.cmake 2015-02-12 10:41:44 +01:00
Markus Blatt bf281a74b8 Make symbol extractParallelGridInformationToISTL available if CpGrid is there. 2015-02-12 10:41:44 +01:00
Markus Blatt dd63c2489f Do not reimplement null_deleter from dune-common.
Instead we use Dune::stackobject_to_shared_ptr to create a
shared_ptr that does not delete the pointer.
2015-02-12 10:41:44 +01:00
Markus Blatt 39a6e19099 Fixes compilation issues when no MPI is available. 2015-02-12 10:41:44 +01:00
Markus Blatt 11cb82e815 Correctly compute the global number of cells and pore volume. 2015-02-12 10:41:44 +01:00
Markus Blatt 70d5d18560 Prevent copying of a matrix. 2015-02-12 10:41:44 +01:00
Markus Blatt b73f1c86fc Fixed typos in documentatio of deleter. 2015-02-12 10:41:44 +01:00
Markus Blatt a7f1614f63 Adds copyright declarations and more documentation. 2015-02-12 10:41:44 +01:00
Markus Blatt ff9b8d790d Added a parallel version for computing the global reductions. 2015-02-12 10:41:44 +01:00
Markus Blatt 4527ce8ffd Add access to the underlying information about the parallelization.
We need it serveral places and all of them seem to have access to
NewtonIterationBlackoilInterface. This makes it natural to give access
to it and prevent users from having to forward it manually at several
places in the simulator driver.
2015-02-12 10:41:43 +01:00
Markus Blatt 221565f038 Enable the use of parallel dune-istl solvers.
As with opm-core we use boost::any to provide additional
information about a parallel run. It is used to set a
ParallelISTLInformation object and and fill it with the
information obtained from a parallel Cpgrid.

Note that the simulator currently compiles sucessfully. Still,
we have to test the runs and do debugging.
2015-02-12 10:41:43 +01:00
Markus Blatt 2be2dd5e41 [bugfix] Fixes dependency clause.
It caused dunecontrol to abort because of using a comma as a separator.
This commit removes the eroneous comma and adds a required version.
2015-02-11 12:35:40 +01:00
Markus Blatt ed36a439f8 Explicitly list dune-istl as a dependency.
This is in line with and closes issue #295
2015-02-06 11:28:42 +01:00
Markus Blatt 60c0f30388 Use const where appropriate and polish code formatting. 2015-01-30 15:26:55 +01:00
Markus Blatt 9d2d942396 Prevent copying of pore volume vector. 2015-01-30 15:26:33 +01:00