diff --git a/inputFiles/frictionDriver/frictionDriver_Coulomb.xml b/inputFiles/constitutiveDriver/friction/frictionDriver_Coulomb.xml similarity index 85% rename from inputFiles/frictionDriver/frictionDriver_Coulomb.xml rename to inputFiles/constitutiveDriver/friction/frictionDriver_Coulomb.xml index 3a1c0a5b630..6fd8f7907a2 100644 --- a/inputFiles/frictionDriver/frictionDriver_Coulomb.xml +++ b/inputFiles/constitutiveDriver/friction/frictionDriver_Coulomb.xml @@ -9,8 +9,8 @@ jumpControl="jFunction" xTiltAngle="80" tractionControl="tFunction" - steps="10" - output="FrictionDriver.txt" /> + steps="10" + output="frictionDriver_Coulomb.txt" /> diff --git a/inputFiles/frictionDriver/frictionDriver_base.xml b/inputFiles/constitutiveDriver/friction/frictionDriver_base.xml similarity index 66% rename from inputFiles/frictionDriver/frictionDriver_base.xml rename to inputFiles/constitutiveDriver/friction/frictionDriver_base.xml index df5ef688301..bf4b23983db 100644 --- a/inputFiles/frictionDriver/frictionDriver_base.xml +++ b/inputFiles/constitutiveDriver/friction/frictionDriver_base.xml @@ -1,12 +1,24 @@ + + + + + + @@ -37,26 +49,4 @@ voxelFile="tables/tractions.geos"/> - - - - - - - - - - diff --git a/inputFiles/frictionDriver/tables/jumps.geos b/inputFiles/constitutiveDriver/friction/tables/jumps.geos similarity index 100% rename from inputFiles/frictionDriver/tables/jumps.geos rename to inputFiles/constitutiveDriver/friction/tables/jumps.geos diff --git a/inputFiles/frictionDriver/tables/time.geos b/inputFiles/constitutiveDriver/friction/tables/time.geos similarity index 100% rename from inputFiles/frictionDriver/tables/time.geos rename to inputFiles/constitutiveDriver/friction/tables/time.geos diff --git a/inputFiles/frictionDriver/tables/tractions.geos b/inputFiles/constitutiveDriver/friction/tables/tractions.geos similarity index 100% rename from inputFiles/frictionDriver/tables/tractions.geos rename to inputFiles/constitutiveDriver/friction/tables/tractions.geos diff --git a/src/coreComponents/constitutiveDrivers/CMakeLists.txt b/src/coreComponents/constitutiveDrivers/CMakeLists.txt index 6c38181d3fc..b3554ad559c 100644 --- a/src/coreComponents/constitutiveDrivers/CMakeLists.txt +++ b/src/coreComponents/constitutiveDrivers/CMakeLists.txt @@ -37,6 +37,8 @@ set( constitutiveDrivers_headers # set( constitutiveDrivers_sources ConstitutiveDriver.cpp + contact/FrictionDriver.cpp + contact/FrictionDriverRunTest.cpp fluid/multiFluid/PVTDriver.cpp fluid/multiFluid/constant/PVTDriverRunTestInvariantImmiscibleFluid.cpp fluid/multiFluid/blackOil/PVTDriverRunTestDeadOilFluid.cpp @@ -59,8 +61,6 @@ set( constitutiveDrivers_sources relativePermeability/RelpermDriverTableRelativeRunTest.cpp relativePermeability/RelpermDriverTableRelativeHysteresisRunTest.cpp solid/TriaxialDriver.cpp - contact/FrictionDriver.cpp - contact/FrictionDriverRunTest.cpp ) set( dependencyList ${parallelDeps} constitutive events ) diff --git a/src/coreComponents/constitutiveDrivers/contact/FrictionDriver.cpp b/src/coreComponents/constitutiveDrivers/contact/FrictionDriver.cpp index 985077a7bba..c2538822f04 100644 --- a/src/coreComponents/constitutiveDrivers/contact/FrictionDriver.cpp +++ b/src/coreComponents/constitutiveDrivers/contact/FrictionDriver.cpp @@ -13,18 +13,15 @@ * ------------------------------------------------------------------------------------------------------------ */ -#include "common/MpiWrapper.hpp" +#include "FrictionDriver.hpp" + #include "constitutive/ConstitutiveManager.hpp" -#include "constitutiveDrivers/contact/LogLevelsInfo.hpp" +#include "constitutiveDrivers/LogLevelsInfo.hpp" #include "constitutive/contact/FrictionBase.hpp" #include "constitutive/contact/FrictionSelector.hpp" #include "functions/FunctionManager.hpp" #include "functions/TableFunction.hpp" -#include -#include - -#include "FrictionDriver.hpp" namespace geos { @@ -33,8 +30,7 @@ using namespace dataRepository; using namespace constitutive; FrictionDriver::FrictionDriver( const string & name, Group * const parent ) - : - TaskBase( name, parent ) + : ConstitutiveDriver( name, parent ) { registerWrapper( viewKeyStruct::frictionNameString(), &m_frictionName ). setRTTypeName( rtTypes::CustomTypes::groupNameRef ). @@ -61,133 +57,55 @@ FrictionDriver::FrictionDriver( const string & name, Group * const parent ) setInputFlag( InputFlags::INVALID ). setDescription( "Number of increment step to take in both jumps and traction increments" ); - registerWrapper( viewKeyStruct::outputString(), &m_outputFile ). - setInputFlag( InputFlags::OPTIONAL ). - setApplyDefaultValue( "none" ). - setDescription( "Output file" ); - - registerWrapper( viewKeyStruct::baselineString(), &m_baselineFile ). - setInputFlag( InputFlags::OPTIONAL ). - setApplyDefaultValue( "none" ). - setDescription( "Baseline file" ); - addLogLevel< logInfo::LogOutput >(); } -void FrictionDriver::compareWithBaseline() -{ - // open baseline file - - std::ifstream file( m_baselineFile.c_str() ); - GEOS_THROW_IF( !file.is_open(), GEOS_FMT( "Can't seem to open the baseline file ", m_baselineFile ), InputError ); - - // discard file header - - string line; - for( integer row=0; row < m_numColumns; ++row ) - { - getline( file, line ); - } - - // read data block. we assume the file size is consistent with m_table, - // but check for a premature end-of-file. we then compare results value by value. - // we ignore the newton iteration and residual columns, as those may be platform - // specific. - - real64 value; - real64 error; - - for( integer row=0; row < m_table.size( 0 ); ++row ) - { - for( integer col=0; col < m_table.size( 1 ); ++col ) - { - GEOS_THROW_IF( file.eof(), "Baseline file appears shorter than internal results", InputError ); - file >> value; - - error = fabs( m_table[row][col]-value ) / ( fabs( value )+1 ); - GEOS_THROW_IF( error > m_baselineTol, GEOS_FMT( "Results do not match baseline at data row {} (row {} with header) and column {}", - row+1, - row+10, - col+1 ), - InputError ); - - } - } - - // check we actually reached the end of the baseline file - - file >> value; - GEOS_THROW_IF( !file.eof(), "Baseline file appears longer than internal results", InputError ); - - // success - - GEOS_LOG_LEVEL_RANK_0( logInfo::LogOutput, " Comparison ........ Internal results consistent with baseline." ); - - file.close(); -} - -void FrictionDriver::outputResults() +void FrictionDriver::postInputInitialization() { - // TODO: improve file path output to grab command line -o directory - // for the moment, we just use the specified m_outputFile directly + ConstitutiveDriver::postInputInitialization(); - FILE * fp = fopen( m_outputFile.c_str(), "w" ); + // Check that the functions exist + FunctionManager & functionManager = FunctionManager::getInstance(); + GEOS_ERROR_IF( !functionManager.hasGroup< TableFunction >( m_jumpFunctionName ), + GEOS_FMT( "Jump function with name '{}' not found", m_jumpFunctionName ), + getWrapperDataContext( viewKeyStruct::jumpFunctionString() ) ); - fprintf( fp, "# column 1 = index \n" ); - fprintf( fp, "# column 2-3 = normal and in-plane displacement jump\n" ); - fprintf( fp, "# columns 5-7 = normal and in-place tractions\n" ); - fprintf( fp, "# columns 8 = fracture state (0:Stick,1-2:[new]Slip,3:Open)\n" ); - fprintf( fp, "# columns 9 = tau lim\n" ); + GEOS_ERROR_IF( !functionManager.hasGroup< TableFunction >( m_tractionFunctionName ), + GEOS_FMT( "Traction function with name '{}' not found", m_tractionFunctionName ), + getWrapperDataContext( viewKeyStruct::tractionFunctionString() ) ); - for( integer n = 0; n < m_table.size( 0 ); ++n ) - { - for( integer col = 0; col < m_table.size( 1 ); ++col ) - { - fprintf( fp, "%.4e ", m_table( n, col ) ); - } - fprintf( fp, "\n" ); - } - fclose( fp ); + string_array columnNames; + getColumnNames( columnNames ); + integer const numCols = static_cast< integer >(columnNames.size()); -} + // initialize functions + TableFunction & jumpFunction = functionManager.getGroup< TableFunction >( m_jumpFunctionName ); + TableFunction & tractionFunction = functionManager.getGroup< TableFunction >( m_tractionFunctionName ); + jumpFunction.initializeFunction(); + tractionFunction.initializeFunction(); -void FrictionDriver::postInputInitialization() -{ -// ConstitutiveManager -// & constitutiveManager = this->getGroupByPath< ConstitutiveManager >( "/Problem/domain/Constitutive" ); -// FrictionBase& baseFriction = constitutiveManager.getGroup< FrictionBase >( m_frictionName ); + // TODO: Maybe we should take the maximum extent of jumpFunction and tractionFunction + ArrayOfArraysView< real64 > coordinates = jumpFunction.getCoordinates(); + real64 const minTime = coordinates[0][0]; + real64 const maxTime = coordinates[0][coordinates.sizeOfArray( 0 )-1]; -// // m_numPhases = baseFriction.numSubGroups(); + // Allocate the data + allocateTable( numCols, minTime, maxTime ); + // set input columns + initializeTable(); } - -bool FrictionDriver::execute( const geos::real64 GEOS_UNUSED_PARAM( time_n ), - const geos::real64 GEOS_UNUSED_PARAM( dt ), - const geos::integer GEOS_UNUSED_PARAM( cycleNumber ), - const geos::integer GEOS_UNUSED_PARAM( eventCounter ), - const geos::real64 GEOS_UNUSED_PARAM( eventProgress ), - geos::DomainPartition & - GEOS_UNUSED_PARAM( domain ) ) +bool FrictionDriver::execute() { - // this code only makes sense in serial - - GEOS_THROW_IF( MpiWrapper::commRank() > 0, "FrictionDriver should only be run in serial", geos::RuntimeError ); - - - ConstitutiveManager - & constitutiveManager = this->getGroupByPath< ConstitutiveManager >( "/Problem/domain/Constitutive" ); - FrictionBase - & baseFriction = constitutiveManager.getGroup< FrictionBase >( m_frictionName ); + FrictionBase & baseFriction = getFriction(); GEOS_LOG_LEVEL_RANK_0( logInfo::LogOutput, "Launching Friction Driver" ); - GEOS_LOG_LEVEL_RANK_0( logInfo::LogOutput, " Friction .................. " << m_frictionName ); + GEOS_LOG_LEVEL_RANK_0( logInfo::LogOutput, " Friction ............... " << m_frictionName ); GEOS_LOG_LEVEL_RANK_0( logInfo::LogOutput, " Type ................... " << baseFriction.getCatalogName() ); -// GEOS_LOG_LEVEL_RANK_0( logInfo::LogOutput, " No. of Phases .......... " << m_numPhases ); GEOS_LOG_LEVEL_RANK_0( logInfo::LogOutput, " Steps .................. " << m_numSteps ); GEOS_LOG_LEVEL_RANK_0( logInfo::LogOutput, " Output ................. " << m_outputFile ); - GEOS_LOG_LEVEL_RANK_0( logInfo::LogOutput, " Baseline ............... " << m_baselineFile ); // create a dummy discretization with one quadrature point for // storing constitutive data @@ -196,113 +114,88 @@ bool FrictionDriver::execute( const geos::real64 GEOS_UNUSED_PARAM( time_n ), dataRepository::Group rootGroup( "root", node ); dataRepository::Group discretization( "discretization", &rootGroup ); - discretization.resize( 1 ); // one element + integer const numRows = m_table.size( 0 ); + discretization.resize( numRows ); // numRows elements baseFriction.allocateConstitutiveData( discretization, 1 ); // one quadrature point constitutiveUpdatePassThru( baseFriction, [&]( auto & selectedFrictionModel ) { using FRICTION_TYPE = TYPEOFREF( selectedFrictionModel ); - resizeTables< FRICTION_TYPE >(); runTest< FRICTION_TYPE >( selectedFrictionModel, m_table ); } ); - // move table back to host for output - m_table.move( LvArray::MemorySpace::host ); - - if( m_outputFile != "none" ) - { - outputResults(); - } + return false; +} - if( m_baselineFile != "none" ) +void FrictionDriver::getColumnNames( string_array & columnNames ) const +{ + columnNames.emplace_back( "time" ); + columnNames.emplace_back( "traction,normal" ); + columnNames.emplace_back( "traction,tangent1" ); + columnNames.emplace_back( "traction,tangent2" ); + columnNames.emplace_back( "displacement jump,normal" ); + columnNames.emplace_back( "displacement jump,tangent1" ); + columnNames.emplace_back( "displacement jump,tangent2" ); + columnNames.emplace_back( "fracture state" ); + + if( dynamic_cast< CoulombFriction const * >(&getFriction()) != nullptr ) { - compareWithBaseline(); + columnNames.emplace_back( "tau limit" ); } - - return false; } - -template< typename FRICTION_TYPE > -void FrictionDriver::resizeTables() +void FrictionDriver::initializeTable() { - ConstitutiveManager - & constitutiveManager = this->getGroupByPath< ConstitutiveManager >( "/Problem/domain/Constitutive" ); - FrictionBase - & baseFriction = constitutiveManager.getGroup< FrictionBase >( m_frictionName ); + integer const numRows = m_table.size( 0 ); - // initialize table functions FunctionManager & functionManager = FunctionManager::getInstance(); + TableFunction const & jumpFunction = functionManager.getGroup< TableFunction >( m_jumpFunctionName ); + TableFunction const & tractionFunction = functionManager.getGroup< TableFunction >( m_tractionFunctionName ); - TableFunction & jumpFunction = functionManager.getGroup< TableFunction >( m_jumpFunctionName ); - TableFunction & tractionFunction = functionManager.getGroup< TableFunction >( m_tractionFunctionName ); - - jumpFunction.initializeFunction(); - tractionFunction.initializeFunction(); - - ArrayOfArraysView< real64 > coordinates = jumpFunction.getCoordinates(); - real64 const minTime = coordinates[0][0]; - real64 const maxTime = coordinates[0][coordinates.sizeOfArray( 0 )-1]; - real64 const dt = (maxTime-minTime) / m_numSteps; + real64 const cos_theta = cos( m_theta * M_PI/180.0 ); + real64 const sin_theta = sin( m_theta * M_PI/180.0 ); - // set input columns - resizeTable< FRICTION_TYPE >(); + real64 const cos_phi = cos( m_phi * M_PI/180.0 ); + real64 const sin_phi = sin( m_phi * M_PI/180.0 ); - // set time column - for( integer k=0; k ) { + m_table( index, NJUMP ) = jump*sin_theta; + m_table( index, SLIP0 ) = jump*cos_theta*cos_phi; + m_table( index, SLIP1 ) = jump*cos_theta*sin_phi; - cohesion = dynamic_cast< CoulombFriction * >(&baseFriction)->getCohesion(); - frictionCoeff = dynamic_cast< CoulombFriction * >(&baseFriction)->getFrictionCoeff(); + m_table( index, FS ) = fields::contact::FractureState::Stick; } - //All variation - for( integer nt = 0; nt < m_numSteps+1; ++nt ) + if( CoulombFriction const * coulombFriction = dynamic_cast< CoulombFriction const * >(&getFriction()) ) { - for( integer nj = 0; nj < m_numSteps+1; ++nj ) + real64 const cohesion = coulombFriction->getCohesion(); + real64 const frictionCoeff = coulombFriction->getFrictionCoeff(); + for( integer index = 0; index < numRows; ++index ) { - - integer index = nt * (m_numSteps+1) + nj; - m_table( index, NTRAC ) = tractionFunction.evaluate( &m_table( nt, TIME ))*sin( m_theta * M_PI/180 ); - m_table( index, STRAC0 ) = tractionFunction.evaluate( &m_table( nt, TIME ))*cos( m_theta * M_PI/180 ); - m_table( index, STRAC1 ) = tractionFunction.evaluate( &m_table( nt, TIME ))*cos( m_theta * M_PI/180 ); - - m_table( index, NJUMP ) = jumpFunction.evaluate( &m_table( nj, TIME ))*sin( m_theta * M_PI/180 ); - m_table( index, SLIP0 ) = jumpFunction.evaluate( &m_table( nj, TIME ))*cos( m_theta * M_PI/180 ); - m_table( index, SLIP1 ) = jumpFunction.evaluate( &m_table( nj, TIME ))*cos( m_theta * M_PI/180 ); - - m_table( index, FS ) = fields::contact::FractureState::Stick; - - //Only for Coulomb - m_table( index, TLIM ) = cohesion - m_table( index, NTRAC ) * frictionCoeff; - + real64 const normal_traction = m_table( index, NTRAC ); + m_table( index, TLIM ) = cohesion - normal_traction * frictionCoeff; } } - } -//TODO updateConfig proxy -// simultaneaous branch -// unsim -// checkconstaint -// *keep track of iter - +FrictionBase & FrictionDriver::getFriction() +{ + return getConstitutiveManager().getGroup< FrictionBase >( m_frictionName ); +} -template< typename FRICTION_TYPE > -void -FrictionDriver::resizeTable() +FrictionBase const & FrictionDriver::getFriction() const { - m_table.resize((m_numSteps + 1)*(m_numSteps + 1), m_numColumns ); + return getConstitutiveManager().getGroup< FrictionBase >( m_frictionName ); } REGISTER_CATALOG_ENTRY( TaskBase, diff --git a/src/coreComponents/constitutiveDrivers/contact/FrictionDriver.hpp b/src/coreComponents/constitutiveDrivers/contact/FrictionDriver.hpp index 6374d6c49d1..d912eed02d6 100644 --- a/src/coreComponents/constitutiveDrivers/contact/FrictionDriver.hpp +++ b/src/coreComponents/constitutiveDrivers/contact/FrictionDriver.hpp @@ -13,17 +13,20 @@ * ------------------------------------------------------------------------------------------------------------ */ -#ifndef GEOS_frictionDRIVER_HPP_ -#define GEOS_frictionDRIVER_HPP_ +#ifndef GEOS_CONSTITUTIVEDRIVERS_CONTACT_FRICTIONDRIVER_HPP +#define GEOS_CONSTITUTIVEDRIVERS_CONTACT_FRICTIONDRIVER_HPP -#include "events/tasks/TaskBase.hpp" +#include "constitutiveDrivers/ConstitutiveDriver.hpp" namespace geos { - -class FrictionDriver : public TaskBase +namespace constitutive { +class FrictionBase; +} +class FrictionDriver : public ConstitutiveDriver +{ public: FrictionDriver( const string & name, Group * const parent ); @@ -33,62 +36,32 @@ class FrictionDriver : public TaskBase void postInputInitialization() override; - virtual bool execute( real64 const GEOS_UNUSED_PARAM( time_n ), - real64 const GEOS_UNUSED_PARAM( dt ), - integer const GEOS_UNUSED_PARAM( cycleNumber ), - integer const GEOS_UNUSED_PARAM( eventCounter ), - real64 const GEOS_UNUSED_PARAM( eventProgress ), - DomainPartition & - GEOS_UNUSED_PARAM( domain ) ) override; - - // /** - // * @brief Run test using loading protocol in table - // * @param i friction constitutive model - // * @param table Table with input/output time history - // */ - // template< typename friction_TYPE > - // std::enable_if_t< std::is_same< constitutive::TableRelativePermeabilityHysteresis, friction_TYPE >::value, void > - // runTest( friction_TYPE & friction, - // const arrayView2d< real64, 1 > & table ); + bool execute() override; + + void getColumnNames( string_array & columnNames ) const override; template< typename FRICTION_TYPE > void runTest( FRICTION_TYPE & friction, const arrayView2d< real64, 1 > & table ); +private: /** - * @brief Ouput table to file for easy plotting - */ - void outputResults(); - - /** - * @brief Read in a baseline table from file and compare with computed one (for unit testing purposes) + * @brief Get the friction model from the catalog */ - void compareWithBaseline(); - -private: + constitutive::FrictionBase & getFriction(); + constitutive::FrictionBase const & getFriction() const; - template< typename FRICTION_TYPE > - void resizeTable(); - - template< typename FRICTION_TYPE > - void resizeTables(); - - // template< typename friction_TYPE > - // std::enable_if_t< !std::is_same< constitutive::TableRelativePermeabilityHysteresis, friction_TYPE >::value, void > - // resizeTable(); + void initializeTable(); /** * @struct viewKeyStruct holds char strings and viewKeys for fast lookup */ - struct viewKeyStruct + struct viewKeyStruct : ConstitutiveDriver::viewKeyStruct { constexpr static char const * frictionNameString() { return "friction"; } - constexpr static char const * numStepsString() - { return "steps"; } - constexpr static char const * jumpFunctionString() { return "jumpControl"; } @@ -100,36 +73,20 @@ class FrictionDriver : public TaskBase constexpr static char const * phiString() { return "yTiltAngle";} - - constexpr static char const * outputString() - { return "output"; } - - constexpr static char const * baselineString() - { return "baseline"; } - }; - integer m_numSteps; ///< Number of load steps - static integer const m_numColumns = 9; ///< Number of columns in dat - enum columnKeys { TIME, NJUMP, SLIP0, SLIP1, NTRAC, STRAC0, STRAC1, FS, TLIM }; + // Time is defined in base class + enum columnKeys { NJUMP = 1, SLIP0, SLIP1, NTRAC, STRAC0, STRAC1, FS, TLIM }; string m_jumpFunctionName; ///< string m_tractionFunctionName; ///< - float m_theta, m_phi;///< x- and y-tilt of fault + real64 m_theta{0.0}; ///< x-tilt of fault + real64 m_phi{0.0}; ///< y-tilt of fault string m_frictionName; ///< frictionType identifier - string m_outputFile; ///< Output file (optional, no output if not specified) - - array2d< real64 > m_table; ///< Table storing time-history of input/output - - Path m_baselineFile; ///< Baseline file (optional, for unit testing of solid models) - - - static constexpr real64 m_baselineTol = 1e-3; ///< Comparison tolerance for baseline results }; - } -#endif //GEOS_FRICTIONDRIVER_HPP_ +#endif //GEOS_CONSTITUTIVEDRIVERS_CONTACT_FRICTIONDRIVER_HPP diff --git a/src/coreComponents/constitutiveDrivers/contact/FrictionDriverRunTest.hpp b/src/coreComponents/constitutiveDrivers/contact/FrictionDriverRunTest.hpp index b05e42a8fc4..5c0e5875dfa 100644 --- a/src/coreComponents/constitutiveDrivers/contact/FrictionDriverRunTest.hpp +++ b/src/coreComponents/constitutiveDrivers/contact/FrictionDriverRunTest.hpp @@ -20,56 +20,42 @@ #include "physicsSolvers/solidMechanics/contact/FractureState.hpp" #include "constitutive/solid/SolidFields.hpp" - namespace geos { - template< typename FRICTION_TYPE > void FrictionDriver::runTest( FRICTION_TYPE & friction, const arrayView2d< real64 > & table ) { + // Create kernel wrapper + typename FRICTION_TYPE::KernelWrapper const kernelWrapper = friction.createKernelUpdates(); - array2d< real64 > jumps, tractions; - jumps.resize( table.size( 0 ), 3 ); - tractions.resize( table.size( 0 ), 3 ); - - for( integer n = 0; n < table.size( 0 ); ++n ) + integer const numRows = m_table.size( 0 ); + forAll< parallelDevicePolicy<> >( numRows, + [ kernelWrapper, table ] + GEOS_HOST_DEVICE ( integer const ei ) { - jumps[n][0] = table( n, NJUMP ); - jumps[n][1] = table( n, SLIP0 ); - jumps[n][2] = table( n, SLIP1 ); - - tractions[n][0] = table( n, NTRAC ); - tractions[n][1] = table( n, STRAC0 ); - tractions[n][2] = table( n, STRAC1 ); + stackArray1d< real64, 3 > jump( 3 ); + stackArray1d< real64, 3 > traction( 3 ); - } + jump[0] = table( ei, NJUMP ); + jump[1] = table( ei, SLIP0 ); + jump[2] = table( ei, SLIP1 ); + traction[0] = table( ei, NTRAC ); + traction[1] = table( ei, STRAC0 ); + traction[2] = table( ei, STRAC1 ); - // create kernel wrapper - typename FRICTION_TYPE::KernelWrapper const kernelWrapper = friction.createKernelUpdates(); + integer fracture_state = fields::contact::FractureState::Stick; + kernelWrapper.updateFractureState( jump.toSliceConst(), + traction.toSliceConst(), + fracture_state ); - forAll< parallelDevicePolicy<> >( 1, - [ kernelWrapper, table, jumps, tractions ] - GEOS_HOST_DEVICE ( integer const GEOS_UNUSED_PARAM( ei ) ) - { - - for( integer i = 1; i < table.size( 0 ); ++i ) - { - integer fs = fields::contact::FractureState::Stick; - kernelWrapper.updateFractureState( jumps[i], - tractions[i], - fs ); - - table( i, FS ) = fs; - } + table( ei, FS ) = fracture_state; } ); - } } - #endif //GEOS_FRICTIONDRIVERRUNTEST_HPP_ diff --git a/src/coreComponents/constitutiveDrivers/contact/LogLevelsInfo.hpp b/src/coreComponents/constitutiveDrivers/contact/LogLevelsInfo.hpp deleted file mode 100644 index 1a0319a7db4..00000000000 --- a/src/coreComponents/constitutiveDrivers/contact/LogLevelsInfo.hpp +++ /dev/null @@ -1,52 +0,0 @@ -/* - * ------------------------------------------------------------------------------------------------------------ - * SPDX-License-Identifier: LGPL-2.1-only - * - * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC - * Copyright (c) 2018-2024 TotalEnergies - * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University - * Copyright (c) 2023-2024 Chevron - * Copyright (c) 2019- GEOS/GEOSX Contributors - * All rights reserved - * - * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. - * ------------------------------------------------------------------------------------------------------------ - */ - -/** - * @file LogLevelsInfo.hpp - * This file contains common log level informations for PVT driver - */ - -#ifndef GEOS_CONSTITUTIVEDRIVERS_CONTACT_LOGLEVELSINFO_HPP_ -#define GEOS_CONSTITUTIVEDRIVERS_CONTACT_LOGLEVELSINFO_HPP_ - -#include "common/DataTypes.hpp" - -namespace geos -{ - -namespace logInfo -{ - -/** - * @name Common LogLevels info structures. They must comply with the `is_log_level_info` trait. - */ -///@{ - -/// @cond DO_NOT_DOCUMENT - -struct LogOutput -{ - static constexpr int getMinLogLevel() { return 1; } - static constexpr std::string_view getDescription() { return "Enable log output"; } -}; - -/// @endcond -///@} - -} - -} - -#endif // GEOS_CONSTITUTIVEDRIVERS_CONTACT_LOGLEVELSINFO_HPP_ diff --git a/src/coreComponents/schema/schema.xsd b/src/coreComponents/schema/schema.xsd index 9a9bb51d843..30a9887b6a5 100644 --- a/src/coreComponents/schema/schema.xsd +++ b/src/coreComponents/schema/schema.xsd @@ -569,6 +569,10 @@ + + + + @@ -6266,6 +6270,7 @@ When set to `all` output both convergence & iteration information to a csv.--> + @@ -6380,6 +6385,29 @@ Information output from lower logLevels is added with the desired log level + + + + + + + + + + + + + + + + + + + + + + + +