clang-format: Set column width to 140

* Set column width to 140
* Use c++20
* Remove redundant virtual
This commit is contained in:
Magne Sjaastad
2023-02-26 10:48:40 +01:00
parent 2bf3a511fe
commit 42b901ec28
1535 changed files with 10456 additions and 19398 deletions

View File

@@ -47,10 +47,7 @@ RimStreamlineDataAccess::~RimStreamlineDataAccess()
//--------------------------------------------------------------------------------------------------
/// Set up data accessors to access the selected flroil/gas/wat data for all faces
//--------------------------------------------------------------------------------------------------
bool RimStreamlineDataAccess::setupDataAccess( RigMainGrid* grid,
RigEclipseCaseData* data,
std::list<RiaDefines::PhaseType> phases,
int timeIdx )
bool RimStreamlineDataAccess::setupDataAccess( RigMainGrid* grid, RigEclipseCaseData* data, std::list<RiaDefines::PhaseType> phases, int timeIdx )
{
m_grid = grid;
m_data = data;
@@ -84,9 +81,8 @@ bool RimStreamlineDataAccess::setupDataAccess( RigMainGrid*
//--------------------------------------------------------------------------------------------------
/// Return a data accessor for the given phase and face and time step
//--------------------------------------------------------------------------------------------------
cvf::ref<RigResultAccessor> RimStreamlineDataAccess::getDataAccessor( cvf::StructGridInterface::FaceType faceIdx,
RiaDefines::PhaseType phase,
int timeIdx )
cvf::ref<RigResultAccessor>
RimStreamlineDataAccess::getDataAccessor( cvf::StructGridInterface::FaceType faceIdx, RiaDefines::PhaseType phase, int timeIdx )
{
RiaDefines::PorosityModelType porModel = RiaDefines::PorosityModelType::MATRIX_MODEL;
@@ -107,8 +103,7 @@ cvf::ref<RigResultAccessor> RimStreamlineDataAccess::getDataAccessor( cvf::Struc
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimStreamlineDataAccess::gridResultNameFromPhase( RiaDefines::PhaseType phase,
cvf::StructGridInterface::FaceType faceIdx ) const
QString RimStreamlineDataAccess::gridResultNameFromPhase( RiaDefines::PhaseType phase, cvf::StructGridInterface::FaceType faceIdx ) const
{
QString retval = "";
switch ( phase )
@@ -149,9 +144,7 @@ QString RimStreamlineDataAccess::gridResultNameFromPhase( RiaDefines::PhaseType
//--------------------------------------------------------------------------------------------------
/// Return the face scalar value for the given cell and NEG_? face, by using the neighbor cell
//--------------------------------------------------------------------------------------------------
double RimStreamlineDataAccess::negFaceRate( RigCell cell,
cvf::StructGridInterface::FaceType faceIdx,
RiaDefines::PhaseType phase ) const
double RimStreamlineDataAccess::negFaceRate( RigCell cell, cvf::StructGridInterface::FaceType faceIdx, RiaDefines::PhaseType phase ) const
{
double retval = 0.0;
@@ -177,9 +170,7 @@ double RimStreamlineDataAccess::negFaceRate( RigCell
//--------------------------------------------------------------------------------------------------
/// Return the face scalar value for the given cell and POS_? face
//--------------------------------------------------------------------------------------------------
double RimStreamlineDataAccess::posFaceRate( RigCell cell,
cvf::StructGridInterface::FaceType faceIdx,
RiaDefines::PhaseType phase ) const
double RimStreamlineDataAccess::posFaceRate( RigCell cell, cvf::StructGridInterface::FaceType faceIdx, RiaDefines::PhaseType phase ) const
{
std::vector<cvf::ref<RigResultAccessor>> access = m_dataAccess.at( phase );
double retval = access[faceIdx]->cellScalar( cell.mainGridCellIndex() );
@@ -198,9 +189,7 @@ double RimStreamlineDataAccess::posFaceRate( RigCell
/// Return the face scalar value for the given cell and face
/// Positive values is flow out of the cell, negative values is flow into the cell
//--------------------------------------------------------------------------------------------------
double RimStreamlineDataAccess::faceRate( RigCell cell,
cvf::StructGridInterface::FaceType faceIdx,
RiaDefines::PhaseType phase ) const
double RimStreamlineDataAccess::faceRate( RigCell cell, cvf::StructGridInterface::FaceType faceIdx, RiaDefines::PhaseType phase ) const
{
if ( faceIdx % 2 == 0 ) return posFaceRate( cell, faceIdx, phase );
return negFaceRate( cell, faceIdx, phase );

View File

@@ -57,9 +57,8 @@ public:
const RigMainGrid* grid() const { return m_grid; }
protected:
cvf::ref<RigResultAccessor>
getDataAccessor( cvf::StructGridInterface::FaceType faceIdx, RiaDefines::PhaseType phase, int timeIdx );
QString gridResultNameFromPhase( RiaDefines::PhaseType phase, cvf::StructGridInterface::FaceType faceIdx ) const;
cvf::ref<RigResultAccessor> getDataAccessor( cvf::StructGridInterface::FaceType faceIdx, RiaDefines::PhaseType phase, int timeIdx );
QString gridResultNameFromPhase( RiaDefines::PhaseType phase, cvf::StructGridInterface::FaceType faceIdx ) const;
double posFaceRate( RigCell cell, cvf::StructGridInterface::FaceType faceIdx, RiaDefines::PhaseType phase ) const;
double negFaceRate( RigCell cell, cvf::StructGridInterface::FaceType faceIdx, RiaDefines::PhaseType phase ) const;

View File

@@ -64,10 +64,7 @@ RimStreamlineGenerator::~RimStreamlineGenerator()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimStreamlineGenerator::generateTracer( RigCell cell,
double direction,
QString simWellName,
std::list<RimStreamline*>& outStreamlines )
void RimStreamlineGenerator::generateTracer( RigCell cell, double direction, QString simWellName, std::list<RimStreamline*>& outStreamlines )
{
RiaDefines::PhaseType dominantPhase = m_phases.front();
@@ -108,10 +105,7 @@ void RimStreamlineGenerator::generateTracer( RigCell cell,
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimStreamlineGenerator::growStreamline( RimStreamline* streamline,
size_t cellIdx,
cvf::StructGridInterface::FaceType faceIdx,
double direction )
void RimStreamlineGenerator::growStreamline( RimStreamline* streamline, size_t cellIdx, cvf::StructGridInterface::FaceType faceIdx, double direction )
{
// get the cell
RigCell cell = m_dataAccess->grid()->cell( cellIdx );
@@ -125,8 +119,7 @@ void RimStreamlineGenerator::growStreamline( RimStreamline*
rate *= direction;
// grow from start cell center to face center, exiting if we reach the max length
if ( !growStreamlineFromTo( streamline, cell.center(), cell.faceCenter( faceIdx ), rate, dominantPhaseOut ) )
return;
if ( !growStreamlineFromTo( streamline, cell.center(), cell.faceCenter( faceIdx ), rate, dominantPhaseOut ) ) return;
while ( rate >= m_flowThreshold )
{
@@ -136,8 +129,7 @@ void RimStreamlineGenerator::growStreamline( RimStreamline*
faceIdx = cvf::StructGridInterface::oppositeFace( faceIdx );
// grow from given face center to cell center, exiting if we reach the max length
if ( !growStreamlineFromTo( streamline, cell.faceCenter( faceIdx ), cell.center(), rate, dominantPhaseOut ) )
break;
if ( !growStreamlineFromTo( streamline, cell.faceCenter( faceIdx ), cell.center(), rate, dominantPhaseOut ) ) break;
const size_t cellIdx = cell.gridLocalCellIndex();
@@ -158,7 +150,7 @@ void RimStreamlineGenerator::growStreamline( RimStreamline*
if ( face == faceIdx ) continue;
RiaDefines::PhaseType tempDominantFace;
double faceRate = m_dataAccess->combinedFaceRate( cell, face, m_phases, direction, tempDominantFace );
double faceRate = m_dataAccess->combinedFaceRate( cell, face, m_phases, direction, tempDominantFace );
// if we go backwards from a producer, the rate needs to be flipped
faceRate *= direction;
@@ -181,15 +173,13 @@ void RimStreamlineGenerator::growStreamline( RimStreamline*
{
if ( kvp.first == exitFace ) continue;
if ( kvp.second >= m_flowThreshold )
m_seeds.push( StreamlineSeedPoint( kvp.second, cell.gridLocalCellIndex(), kvp.first ) );
if ( kvp.second >= m_flowThreshold ) m_seeds.push( StreamlineSeedPoint( kvp.second, cell.gridLocalCellIndex(), kvp.first ) );
}
rate = maxRate;
// grow from cell center to exit face center, stopping if we reach the max point limit
if ( !growStreamlineFromTo( streamline, cell.center(), cell.faceCenter( exitFace ), rate, dominantPhaseOut ) )
break;
if ( !growStreamlineFromTo( streamline, cell.center(), cell.faceCenter( exitFace ), rate, dominantPhaseOut ) ) break;
faceIdx = exitFace;
}

View File

@@ -41,16 +41,9 @@ public:
void generateTracer( RigCell cell, double direction, QString simWellName, std::list<RimStreamline*>& outStreamlines ) override;
protected:
void growStreamline( RimStreamline* streamline,
size_t cellIdx,
cvf::StructGridInterface::FaceType faceIdx,
double direction );
void growStreamline( RimStreamline* streamline, size_t cellIdx, cvf::StructGridInterface::FaceType faceIdx, double direction );
bool growStreamlineFromTo( RimStreamline* streamline,
cvf::Vec3d startPos,
cvf::Vec3d endpos,
double rate,
RiaDefines::PhaseType dominantPhase );
bool growStreamlineFromTo( RimStreamline* streamline, cvf::Vec3d startPos, cvf::Vec3d endpos, double rate, RiaDefines::PhaseType dominantPhase );
std::priority_queue<StreamlineSeedPoint> m_seeds;
};

View File

@@ -45,8 +45,7 @@ public:
void initGenerator( RimStreamlineDataAccess* dataAccess, std::list<RiaDefines::PhaseType> phases );
virtual void
generateTracer( RigCell cell, double direction, QString simWellName, std::list<RimStreamline*>& outStreamlines ) = 0;
virtual void generateTracer( RigCell cell, double direction, QString simWellName, std::list<RimStreamline*>& outStreamlines ) = 0;
protected:
double m_flowThreshold;

View File

@@ -306,8 +306,7 @@ void RimStreamlineInViewCollection::mappingRange( double& min, double& max ) con
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimStreamlineInViewCollection::updateLegendRangesTextAndVisibility( RiuViewer* nativeOrOverrideViewer,
bool isUsingOverrideViewer )
void RimStreamlineInViewCollection::updateLegendRangesTextAndVisibility( RiuViewer* nativeOrOverrideViewer, bool isUsingOverrideViewer )
{
if ( m_isActive() && ( m_streamlines.size() > 0 ) && m_legendConfig->showLegend() )
{
@@ -326,8 +325,7 @@ void RimStreamlineInViewCollection::updateLegendRangesTextAndVisibility( RiuView
if ( colorMode() == ColorMode::VELOCITY )
{
nativeOrOverrideViewer->addColorLegendToBottomLeftCorner( m_legendConfig->titledOverlayFrame(),
isUsingOverrideViewer );
nativeOrOverrideViewer->addColorLegendToBottomLeftCorner( m_legendConfig->titledOverlayFrame(), isUsingOverrideViewer );
}
}
}
@@ -457,10 +455,8 @@ void RimStreamlineInViewCollection::updateStreamlines()
// set up the data access helper
RimStreamlineDataAccess dataAccess;
bool accessOk = dataAccess.setupDataAccess( eclipseCase()->eclipseCaseData()->mainGrid(),
eclipseCase()->eclipseCaseData(),
phases(),
timeIdx );
bool accessOk =
dataAccess.setupDataAccess( eclipseCase()->eclipseCaseData()->mainGrid(), eclipseCase()->eclipseCaseData(), phases(), timeIdx );
// did we find the data we needed?
if ( accessOk )
@@ -593,8 +589,7 @@ void RimStreamlineInViewCollection::defineUiOrdering( QString uiConfigName, caf:
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimStreamlineInViewCollection::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering,
QString uiConfigName /*= "" */ )
void RimStreamlineInViewCollection::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName /*= "" */ )
{
uiTreeOrdering.add( &m_legendConfig );
uiTreeOrdering.skipRemainingChildren();
@@ -648,9 +643,7 @@ void RimStreamlineInViewCollection::defineEditorAttribute( const caf::PdmFieldHa
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimStreamlineInViewCollection::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
const QVariant& oldValue,
const QVariant& newValue )
void RimStreamlineInViewCollection::fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue )
{
if ( changedField == &m_animationSpeed || changedField == &m_animationIndex || changedField == &m_tracerLength ||
changedField == &m_visualizationMode )
@@ -659,8 +652,7 @@ void RimStreamlineInViewCollection::fieldChangedByUi( const caf::PdmFieldHandle*
}
if ( changedField == &m_lengthThreshold || changedField == &m_flowThreshold || changedField == &m_resolution ||
changedField == &m_maxDays || changedField == &m_useProducers || changedField == &m_useInjectors ||
changedField == &m_phases )
changedField == &m_maxDays || changedField == &m_useProducers || changedField == &m_useInjectors || changedField == &m_phases )
{
m_shouldGenerateTracers = true;
}

View File

@@ -92,8 +92,8 @@ public:
const RimRegularLegendConfig* legendConfig() const;
void mappingRange( double& min, double& max ) const;
void updateLegendRangesTextAndVisibility( RiuViewer* nativeOrOverrideViewer, bool isUsingOverrideViewer );
void updateFromCurrentTimeStep( int timeStep );
void updateLegendRangesTextAndVisibility( RiuViewer* nativeOrOverrideViewer, bool isUsingOverrideViewer );
void updateFromCurrentTimeStep( int timeStep );
protected:
caf::PdmFieldHandle* objectToggleField() override;
@@ -107,9 +107,7 @@ private:
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
void defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "" ) override;
void defineEditorAttribute( const caf::PdmFieldHandle* field,
QString uiConfigName,
caf::PdmUiEditorAttribute* attribute ) override;
void defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) override;
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
void outputSummary() const;