Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: address some code analysis issues #3456

Open
wants to merge 12 commits into
base: develop
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ void PhillipsBrineViscosityUpdate::compute( real64 const & pressure,
using Deriv = constitutive::multifluid::DerivativeOffset;

// compute the viscosity of pure water as a function of temperature
real64 dPureWaterVisc_dTemperature;
real64 dPureWaterVisc_dTemperature = 0.0;
real64 const pureWaterVisc = m_waterViscosityTable.compute( &temperature, &dPureWaterVisc_dTemperature );

// then compute the brine viscosity, accounting for the presence of salt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ void ElasticIsotropicPressureDependentUpdates::smallStrainUpdate( localIndex con
real64 eps_v_elastic;
real64 oldElasticStrainVol;
real64 oldElasticStrainDev;
real64 bulkModulus = -p0/Cr;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reassigned below, down in the code

real64 bulkModulus;

for( localIndex i=0; i<6; ++i )
{
Expand Down
2 changes: 1 addition & 1 deletion src/coreComponents/dataRepository/xmlWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ size_t findAttribute( string const & attName, string const & xmlBuffer, size_t c
{
return candidatePos;
}
searchStart = candidatePos + attName.size();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not used

//searchStart = candidatePos + attName.size();
paveltomin marked this conversation as resolved.
Show resolved Hide resolved
}
}
catch( std::regex_error const & )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,9 @@ dataRepository::Group const * HistoryCollectionBase::getTargetObject( DomainPart
}
else
{
string const targetTokensStr = stringutilities::join( targetTokens.begin(),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not used

targetTokens.begin()+pathLevel,
'/' );
// string const targetTokensStr = stringutilities::join( targetTokens.begin(),
paveltomin marked this conversation as resolved.
Show resolved Hide resolved
// targetTokens.begin()+pathLevel,
// '/' );
GEOS_THROW( targetTokens[pathLevel] << " not found in path " <<
objectPath << std::endl << targetGroup->dumpSubGroupsNames(),
std::domain_error );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
#ifndef GEOS_MESH_UTILITIES_STRUCTUREDGRIDUTILITIES_HPP
#define GEOS_MESH_UTILITIES_STRUCTUREDGRIDUTILITIES_HPP

#include "common/logger/Logger.hpp"
#include "common/GeosxMacros.hpp"
#include <vector>

/**
* @file StructuredGridUtilities.hpp
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ class SolutionScalingAndCheckingKernelBase

StackVariables( real64 _localMinVal )
:
localRow( -1 ),
Copy link
Contributor

@MelReyCG MelReyCG Nov 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a question: why -1 instead of 0? (=> localRow())

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-1 to force it to crash when something goes wrong

localMinVal( _localMinVal )
{ }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
#define GEOS_PHYSICSSOLVERS_FLUIDFLOW_SINGLEPHASE_RESIDUALNORMKERNEL_HPP

#include "physicsSolvers/PhysicsSolverBaseKernels.hpp"
#include "mesh/ElementSubRegionBase.hpp"
#include "physicsSolvers/fluidFlow/FlowSolverBaseFields.hpp"

namespace geos
{
Expand Down
Loading