Merge pull request #3635 from akva2/add_strequil
Add STREQUIL keyword and internalization
This commit is contained in:
@@ -6,8 +6,21 @@
|
||||
|
||||
namespace Opm {
|
||||
class DeckKeyword;
|
||||
class DeckRecord;
|
||||
|
||||
class EquilRecord {
|
||||
public:
|
||||
EquilRecord() = default;
|
||||
EquilRecord(double datum_depth_arg, double datum_depth_pc_arg,
|
||||
double woc_depth, double woc_pc,
|
||||
double goc_depth, double goc_pc,
|
||||
bool live_oil_init,
|
||||
bool wet_gas_init,
|
||||
int target_accuracy,
|
||||
bool humid_gas_init);
|
||||
explicit EquilRecord(const DeckRecord& record);
|
||||
|
||||
static EquilRecord serializationTestObject();
|
||||
double datumDepth() const;
|
||||
double datumDepthPressure() const;
|
||||
double waterOilContactDepth() const;
|
||||
@@ -20,10 +33,6 @@ namespace Opm {
|
||||
int initializationTargetAccuracy() const;
|
||||
bool humidGasInitConstantRvw() const;
|
||||
|
||||
EquilRecord();
|
||||
|
||||
EquilRecord( double datum_depth_arg, double datum_depth_pc_arg, double woc_depth, double woc_pc, double goc_depth, double goc_pc, bool live_oil_init, bool wet_gas_init, int target_accuracy, bool humid_gas_init);
|
||||
|
||||
bool operator==(const EquilRecord& data) const;
|
||||
|
||||
template<class Serializer>
|
||||
@@ -42,29 +51,75 @@ namespace Opm {
|
||||
}
|
||||
|
||||
private:
|
||||
double datum_depth;
|
||||
double datum_depth_ps;
|
||||
double water_oil_contact_depth;
|
||||
double water_oil_contact_capillary_pressure;
|
||||
double gas_oil_contact_depth;
|
||||
double gas_oil_contact_capillary_pressure;
|
||||
double datum_depth = 0.0;
|
||||
double datum_depth_ps = 0.0;
|
||||
double water_oil_contact_depth = 0.0;
|
||||
double water_oil_contact_capillary_pressure = 0.0;
|
||||
double gas_oil_contact_depth = 0.0;
|
||||
double gas_oil_contact_capillary_pressure = 0.0;
|
||||
|
||||
bool live_oil_init_proc;
|
||||
bool wet_gas_init_proc;
|
||||
int init_target_accuracy;
|
||||
bool humid_gas_init_proc;
|
||||
bool live_oil_init_proc = false;
|
||||
bool wet_gas_init_proc = false;
|
||||
int init_target_accuracy = 0;
|
||||
bool humid_gas_init_proc = false;
|
||||
};
|
||||
|
||||
class Equil {
|
||||
class StressEquilRecord {
|
||||
public:
|
||||
using const_iterator = std::vector< EquilRecord >::const_iterator;
|
||||
StressEquilRecord() = default;
|
||||
explicit StressEquilRecord(const DeckRecord& record);
|
||||
|
||||
Equil() = default;
|
||||
explicit Equil( const DeckKeyword& );
|
||||
static StressEquilRecord serializationTestObject();
|
||||
|
||||
static Equil serializationTestObject();
|
||||
bool operator==(const StressEquilRecord& data) const;
|
||||
|
||||
const EquilRecord& getRecord( size_t id ) const;
|
||||
double datumDepth() const;
|
||||
double datumPosX() const;
|
||||
double datumPosY() const;
|
||||
double stressXX() const;
|
||||
double stressXX_grad() const;
|
||||
double stressYY() const;
|
||||
double stressYY_grad() const;
|
||||
double stressZZ() const;
|
||||
double stressZZ_grad() const;
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer(datum_depth);
|
||||
serializer(datum_posx);
|
||||
serializer(datum_posy);
|
||||
serializer(stress_xx);
|
||||
serializer(stress_xx_grad);
|
||||
serializer(stress_yy);
|
||||
serializer(stress_yy_grad);
|
||||
serializer(stress_zz);
|
||||
serializer(stress_zz_grad);
|
||||
}
|
||||
|
||||
private:
|
||||
double datum_depth = 0.0;
|
||||
double datum_posx = 0.0;
|
||||
double datum_posy = 0.0;
|
||||
double stress_xx = 0.0;
|
||||
double stress_xx_grad = 0.0;
|
||||
double stress_yy = 0.0;
|
||||
double stress_yy_grad = 0.0;
|
||||
double stress_zz = 0.0;
|
||||
double stress_zz_grad = 0.0;
|
||||
};
|
||||
|
||||
template<class RecordType>
|
||||
class EquilContainer {
|
||||
public:
|
||||
using const_iterator = typename std::vector<RecordType>::const_iterator;
|
||||
|
||||
EquilContainer() = default;
|
||||
explicit EquilContainer( const DeckKeyword& );
|
||||
|
||||
static EquilContainer serializationTestObject();
|
||||
|
||||
const RecordType& getRecord(std::size_t id) const;
|
||||
|
||||
size_t size() const;
|
||||
bool empty() const;
|
||||
@@ -72,7 +127,7 @@ namespace Opm {
|
||||
const_iterator begin() const;
|
||||
const_iterator end() const;
|
||||
|
||||
bool operator==(const Equil& data) const;
|
||||
bool operator==(const EquilContainer& data) const;
|
||||
|
||||
template<class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
@@ -81,9 +136,11 @@ namespace Opm {
|
||||
}
|
||||
|
||||
private:
|
||||
std::vector< EquilRecord > m_records;
|
||||
std::vector<RecordType> m_records;
|
||||
};
|
||||
|
||||
using Equil = EquilContainer<EquilRecord>;
|
||||
using StressEquil = EquilContainer<StressEquilRecord>;
|
||||
}
|
||||
|
||||
#endif //OPM_EQUIL_HPP
|
||||
|
||||
@@ -45,6 +45,9 @@ namespace Opm {
|
||||
bool hasEquil() const;
|
||||
const Equil& getEquil() const;
|
||||
|
||||
bool hasStressEquil() const;
|
||||
const StressEquil& getStressEquil() const;
|
||||
|
||||
bool hasGravity() const;
|
||||
|
||||
bool hasFoamConfig() const;
|
||||
@@ -64,6 +67,7 @@ namespace Opm {
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer(equil);
|
||||
serializer(stress_equil);
|
||||
serializer(foamconfig);
|
||||
serializer(m_filleps);
|
||||
serializer(m_gravity);
|
||||
@@ -74,6 +78,7 @@ namespace Opm {
|
||||
|
||||
private:
|
||||
Equil equil;
|
||||
StressEquil stress_equil;
|
||||
FoamConfig foamconfig;
|
||||
bool m_filleps;
|
||||
bool m_gravity = true;
|
||||
|
||||
@@ -2,23 +2,13 @@
|
||||
|
||||
#include <opm/input/eclipse/Deck/DeckKeyword.hpp>
|
||||
#include <opm/input/eclipse/Parser/ParserKeywords/E.hpp>
|
||||
#include <opm/input/eclipse/Parser/ParserKeywords/S.hpp>
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
namespace Opm {
|
||||
|
||||
EquilRecord::EquilRecord()
|
||||
: EquilRecord(0.0, 0.0,
|
||||
0.0, 0.0,
|
||||
0.0, 0.0,
|
||||
false,
|
||||
false,
|
||||
0,
|
||||
false)
|
||||
{}
|
||||
|
||||
EquilRecord::EquilRecord(const double datum_depth_arg, const double datum_depth_pc_arg,
|
||||
const double woc_depth , const double woc_pc,
|
||||
const double goc_depth , const double goc_pc,
|
||||
@@ -38,6 +28,24 @@ namespace Opm {
|
||||
, humid_gas_init_proc(humid_gas_init)
|
||||
{}
|
||||
|
||||
EquilRecord::EquilRecord(const DeckRecord& record)
|
||||
: datum_depth(record.getItem<ParserKeywords::EQUIL::DATUM_DEPTH>().getSIDouble(0))
|
||||
, datum_depth_ps(record.getItem<ParserKeywords::EQUIL::DATUM_PRESSURE>().getSIDouble(0))
|
||||
, water_oil_contact_depth(record.getItem<ParserKeywords::EQUIL::OWC>().getSIDouble(0))
|
||||
, water_oil_contact_capillary_pressure(record.getItem<ParserKeywords::EQUIL::PC_OWC>().getSIDouble(0))
|
||||
, gas_oil_contact_depth(record.getItem<ParserKeywords::EQUIL::GOC>().getSIDouble(0))
|
||||
, gas_oil_contact_capillary_pressure(record.getItem<ParserKeywords::EQUIL::PC_GOC>().getSIDouble(0))
|
||||
, live_oil_init_proc(record.getItem<ParserKeywords::EQUIL::BLACK_OIL_INIT>().get<int>(0) <= 0)
|
||||
, wet_gas_init_proc(record.getItem<ParserKeywords::EQUIL::BLACK_OIL_INIT_WG>().get<int>(0) <= 0)
|
||||
, init_target_accuracy(record.getItem<ParserKeywords::EQUIL::OIP_INIT>().get<int>(0))
|
||||
, humid_gas_init_proc(record.getItem<ParserKeywords::EQUIL::BLACK_OIL_INIT_HG>().get<int>(0) <= 0)
|
||||
{}
|
||||
|
||||
EquilRecord EquilRecord::serializationTestObject()
|
||||
{
|
||||
return EquilRecord{1.0, 2.0, 3.0, 4.0, 5.0, 6.0, true, false, 1, false};
|
||||
}
|
||||
|
||||
double EquilRecord::datumDepth() const {
|
||||
return this->datum_depth;
|
||||
}
|
||||
@@ -93,60 +101,136 @@ namespace Opm {
|
||||
humid_gas_init_proc == data.humid_gas_init_proc;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------- */
|
||||
StressEquilRecord::StressEquilRecord(const DeckRecord& record)
|
||||
: datum_depth(record.getItem<ParserKeywords::STREQUIL::DATUM_DEPTH>().getSIDouble(0))
|
||||
, datum_posx(record.getItem<ParserKeywords::STREQUIL::DATUM_POSX>().getSIDouble(0))
|
||||
, datum_posy(record.getItem<ParserKeywords::STREQUIL::DATUM_POSY>().getSIDouble(0))
|
||||
, stress_xx(record.getItem<ParserKeywords::STREQUIL::STRESSXX>().getSIDouble(0))
|
||||
, stress_xx_grad(record.getItem<ParserKeywords::STREQUIL::STRESSXXGRAD>().getSIDouble(0))
|
||||
, stress_yy(record.getItem<ParserKeywords::STREQUIL::STRESSYY>().getSIDouble(0))
|
||||
, stress_yy_grad(record.getItem<ParserKeywords::STREQUIL::STRESSYYGRAD>().getSIDouble(0))
|
||||
, stress_zz(record.getItem<ParserKeywords::STREQUIL::STRESSZZ>().getSIDouble(0))
|
||||
, stress_zz_grad(record.getItem<ParserKeywords::STREQUIL::STRESSZZGRAD>().getSIDouble(0))
|
||||
{}
|
||||
|
||||
Equil::Equil( const DeckKeyword& keyword )
|
||||
StressEquilRecord StressEquilRecord::serializationTestObject()
|
||||
{
|
||||
using ParserKeywords::EQUIL;
|
||||
|
||||
for (const auto& record : keyword) {
|
||||
const auto datum_depth_arg = record.getItem<EQUIL::DATUM_DEPTH>().getSIDouble(0);
|
||||
const auto datum_depth_pc_arg = record.getItem<EQUIL::DATUM_PRESSURE>().getSIDouble(0);
|
||||
const auto woc_depth = record.getItem<EQUIL::OWC>().getSIDouble(0);
|
||||
const auto woc_pc = record.getItem<EQUIL::PC_OWC>().getSIDouble(0);
|
||||
const auto goc_depth = record.getItem<EQUIL::GOC>().getSIDouble(0);
|
||||
const auto goc_pc = record.getItem<EQUIL::PC_GOC>().getSIDouble(0);
|
||||
const auto live_oil_init = record.getItem<EQUIL::BLACK_OIL_INIT>().get<int>(0) <= 0;
|
||||
const auto wet_gas_init = record.getItem<EQUIL::BLACK_OIL_INIT_WG>().get<int>(0) <= 0;
|
||||
const auto target_accuracy = record.getItem<EQUIL::OIP_INIT>().get<int>(0);
|
||||
const auto humid_gas_init = record.getItem<EQUIL::BLACK_OIL_INIT_HG>().get<int>(0) <= 0;
|
||||
|
||||
this->m_records.emplace_back(datum_depth_arg, datum_depth_pc_arg,
|
||||
woc_depth , woc_pc,
|
||||
goc_depth , goc_pc,
|
||||
live_oil_init, wet_gas_init, target_accuracy, humid_gas_init);
|
||||
}
|
||||
}
|
||||
|
||||
Equil Equil::serializationTestObject()
|
||||
{
|
||||
Equil result;
|
||||
result.m_records = {{1.0, 2.0, 3.0, 4.0, 5.0, 6.0, true, false, 1, false}};
|
||||
StressEquilRecord result;
|
||||
result.datum_depth = 1.0;
|
||||
result.datum_posx = 2.0;
|
||||
result.datum_posy = 3.0;
|
||||
result.stress_xx = 4.0;
|
||||
result.stress_xx_grad = 5.0;
|
||||
result.stress_yy = 6.0;
|
||||
result.stress_yy_grad = 7.0;
|
||||
result.stress_zz = 8.0;
|
||||
result.stress_zz_grad = 9.0;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
const EquilRecord& Equil::getRecord( size_t id ) const {
|
||||
double StressEquilRecord::datumDepth() const {
|
||||
return this->datum_depth;
|
||||
}
|
||||
|
||||
double StressEquilRecord::datumPosX() const {
|
||||
return this->datum_posx;
|
||||
}
|
||||
|
||||
double StressEquilRecord::datumPosY() const {
|
||||
return this->datum_posy;
|
||||
}
|
||||
|
||||
double StressEquilRecord::stressXX() const {
|
||||
return this->stress_xx;
|
||||
}
|
||||
|
||||
double StressEquilRecord::stressXX_grad() const {
|
||||
return this->stress_xx_grad;
|
||||
}
|
||||
|
||||
double StressEquilRecord::stressYY() const {
|
||||
return this->stress_yy;
|
||||
}
|
||||
|
||||
double StressEquilRecord::stressYY_grad() const {
|
||||
return this->stress_yy_grad;
|
||||
}
|
||||
|
||||
double StressEquilRecord::stressZZ() const {
|
||||
return this->stress_zz;
|
||||
}
|
||||
|
||||
double StressEquilRecord::stressZZ_grad() const {
|
||||
return this->stress_zz_grad;
|
||||
}
|
||||
|
||||
bool StressEquilRecord::operator==(const StressEquilRecord& data) const {
|
||||
return datum_depth == data.datum_depth &&
|
||||
datum_posx == data.datum_posx &&
|
||||
datum_posy == data.datum_posy &&
|
||||
stress_xx == data.stress_xx &&
|
||||
stress_xx_grad == data.stress_xx_grad &&
|
||||
stress_yy == data.stress_yy &&
|
||||
stress_yy_grad == data.stress_yy_grad &&
|
||||
stress_zz == data.stress_zz &&
|
||||
stress_zz_grad == data.stress_zz_grad;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------- */
|
||||
|
||||
template<class RecordType>
|
||||
EquilContainer<RecordType>::EquilContainer(const DeckKeyword& keyword)
|
||||
{
|
||||
using ParserKeywords::EQUIL;
|
||||
|
||||
for (const auto& record : keyword) {
|
||||
this->m_records.emplace_back(record);
|
||||
}
|
||||
}
|
||||
|
||||
template<class RecordType>
|
||||
EquilContainer<RecordType> EquilContainer<RecordType>::serializationTestObject()
|
||||
{
|
||||
EquilContainer<RecordType> result;
|
||||
result.m_records = {RecordType::serializationTestObject()};
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
template<class RecordType>
|
||||
const RecordType& EquilContainer<RecordType>::getRecord(std::size_t id) const {
|
||||
return this->m_records.at( id );
|
||||
}
|
||||
|
||||
size_t Equil::size() const {
|
||||
template<class RecordType>
|
||||
std::size_t EquilContainer<RecordType>::size() const {
|
||||
return this->m_records.size();
|
||||
}
|
||||
|
||||
bool Equil::empty() const {
|
||||
template<class RecordType>
|
||||
bool EquilContainer<RecordType>::empty() const {
|
||||
return this->m_records.empty();
|
||||
}
|
||||
|
||||
Equil::const_iterator Equil::begin() const {
|
||||
template<class RecordType>
|
||||
typename EquilContainer<RecordType>::const_iterator
|
||||
EquilContainer<RecordType>::begin() const {
|
||||
return this->m_records.begin();
|
||||
}
|
||||
|
||||
Equil::const_iterator Equil::end() const {
|
||||
template<class RecordType>
|
||||
typename EquilContainer<RecordType>::const_iterator
|
||||
EquilContainer<RecordType>::end() const {
|
||||
return this->m_records.end();
|
||||
}
|
||||
|
||||
bool Equil::operator==(const Equil& data) const {
|
||||
template<class RecordType>
|
||||
bool EquilContainer<RecordType>::
|
||||
operator==(const EquilContainer<RecordType>& data) const {
|
||||
return this->m_records == data.m_records;
|
||||
}
|
||||
|
||||
template class EquilContainer<EquilRecord>;
|
||||
template class EquilContainer<StressEquilRecord>;
|
||||
}
|
||||
|
||||
@@ -38,6 +38,11 @@ namespace Opm {
|
||||
return Equil( deck.get<ParserKeywords::EQUIL>( ).back() );
|
||||
}
|
||||
|
||||
static inline DeckKeyword stressequils( const Deck& deck ) {
|
||||
if( !deck.hasKeyword<ParserKeywords::STREQUIL>( ) ) return {};
|
||||
return deck.get<ParserKeywords::STREQUIL>( ).back();
|
||||
}
|
||||
|
||||
InitConfig::InitConfig()
|
||||
: m_filleps(false)
|
||||
{
|
||||
@@ -45,6 +50,7 @@ namespace Opm {
|
||||
|
||||
InitConfig::InitConfig(const Deck& deck)
|
||||
: equil(equils(deck))
|
||||
, stress_equil(stressequils(deck))
|
||||
, foamconfig(deck)
|
||||
, m_filleps(PROPSSection{deck}.hasKeyword("FILLEPS"))
|
||||
{
|
||||
@@ -82,6 +88,7 @@ namespace Opm {
|
||||
{
|
||||
InitConfig result;
|
||||
result.equil = Equil::serializationTestObject();
|
||||
result.stress_equil = StressEquil::serializationTestObject();
|
||||
result.foamconfig = FoamConfig::serializationTestObject();
|
||||
result.m_filleps = true;
|
||||
result.m_gravity = false;
|
||||
@@ -121,6 +128,17 @@ namespace Opm {
|
||||
return this->equil;
|
||||
}
|
||||
|
||||
bool InitConfig::hasStressEquil() const {
|
||||
return !this->stress_equil.empty();
|
||||
}
|
||||
|
||||
const StressEquil& InitConfig::getStressEquil() const {
|
||||
if( !this->hasStressEquil() )
|
||||
throw std::runtime_error( "Error: No 'STREQUIL' present" );
|
||||
|
||||
return this->stress_equil;
|
||||
}
|
||||
|
||||
bool InitConfig::hasGravity() const {
|
||||
return m_gravity;
|
||||
}
|
||||
@@ -139,6 +157,7 @@ namespace Opm {
|
||||
|
||||
bool InitConfig::operator==(const InitConfig& data) const {
|
||||
return equil == data.equil &&
|
||||
stress_equil == data.stress_equil &&
|
||||
foamconfig == data.foamconfig &&
|
||||
m_filleps == data.m_filleps &&
|
||||
m_gravity == data.m_gravity &&
|
||||
|
||||
66
src/opm/input/eclipse/share/keywords/900_OPM/S/STREQUIL
Normal file
66
src/opm/input/eclipse/share/keywords/900_OPM/S/STREQUIL
Normal file
@@ -0,0 +1,66 @@
|
||||
{
|
||||
"name": "STREQUIL",
|
||||
"sections": [
|
||||
"SOLUTION"
|
||||
],
|
||||
"description": "The STREQUIL item is used when equilibrating the mechanics model. The item should consist of exactly one record for each EQUIL region",
|
||||
"items": [
|
||||
{
|
||||
"item": 1,
|
||||
"name": "DATUM_DEPTH",
|
||||
"value_type": "DOUBLE",
|
||||
"default": 0,
|
||||
"dimension": "Length"
|
||||
},
|
||||
{
|
||||
"item": 2,
|
||||
"name": "DATUM_POSX",
|
||||
"value_type": "DOUBLE",
|
||||
"default": 0,
|
||||
"dimension": "Length"
|
||||
},
|
||||
{
|
||||
"item": 3,
|
||||
"name": "DATUM_POSY",
|
||||
"value_type": "DOUBLE",
|
||||
"default": 0,
|
||||
"dimension": "Length"
|
||||
},
|
||||
{
|
||||
"item": 4,
|
||||
"name": "STRESSXX",
|
||||
"value_type": "DOUBLE",
|
||||
"dimension": "Pressure"
|
||||
},
|
||||
{
|
||||
"item": 5,
|
||||
"name": "STRESSXXGRAD",
|
||||
"value_type": "DOUBLE",
|
||||
"dimension": "Pressure/Length"
|
||||
},
|
||||
{
|
||||
"item": 6,
|
||||
"name": "STRESSYY",
|
||||
"value_type": "DOUBLE",
|
||||
"dimension": "Pressure"
|
||||
},
|
||||
{
|
||||
"item": 7,
|
||||
"name": "STRESSYYGRAD",
|
||||
"value_type": "DOUBLE",
|
||||
"dimension": "Pressure/Length"
|
||||
},
|
||||
{
|
||||
"item": 8,
|
||||
"name": "STRESSZZ",
|
||||
"value_type": "DOUBLE",
|
||||
"dimension": "Pressure"
|
||||
},
|
||||
{
|
||||
"item": 8,
|
||||
"name": "STRESSZZGRAD",
|
||||
"value_type": "DOUBLE",
|
||||
"dimension": "Pressure/Length"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1147,6 +1147,7 @@ set( keywords
|
||||
900_OPM/S/SOXYG
|
||||
900_OPM/S/SPIDER
|
||||
900_OPM/S/SPOLYMW
|
||||
900_OPM/S/STREQUIL
|
||||
900_OPM/S/SUREA
|
||||
900_OPM/S/SWOFLET
|
||||
900_OPM/T/TLPMIXPA
|
||||
|
||||
@@ -185,6 +185,25 @@ const std::string& deckWithEquil =
|
||||
"SCHEDULE\n"
|
||||
"SKIPREST \n";
|
||||
|
||||
const std::string& deckWithStrEquil =
|
||||
"RUNSPEC\n"
|
||||
"DIMENS\n"
|
||||
" 10 10 10 /\n"
|
||||
"EQLDIMS\n"
|
||||
"1 100 20 1 1 /\n"
|
||||
"SOLUTION\n"
|
||||
"RESTART\n"
|
||||
"BASE 5\n"
|
||||
"/\n"
|
||||
"STREQUIL\n"
|
||||
"1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 /\n"
|
||||
"/\n"
|
||||
"GRID\n"
|
||||
"START -- 0 \n"
|
||||
"19 JUN 2007 / \n"
|
||||
"SCHEDULE\n"
|
||||
"SKIPREST \n";
|
||||
|
||||
static Deck createDeck(const std::string& input) {
|
||||
Opm::Parser parser;
|
||||
auto deck = parser.parseString(input);
|
||||
@@ -247,6 +266,14 @@ BOOST_AUTO_TEST_CASE( InitConfigWithEquil ) {
|
||||
BOOST_CHECK_NO_THROW( config.getEquil() );
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE( InitConfigWithStrEquil ) {
|
||||
auto deck = createDeck( deckWithStrEquil );
|
||||
InitConfig config( deck );
|
||||
|
||||
BOOST_CHECK( config.hasStressEquil() );
|
||||
BOOST_CHECK_NO_THROW( config.getStressEquil() );
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE( EquilOperations ) {
|
||||
auto deck = createDeck( deckWithEquil );
|
||||
InitConfig config( deck );
|
||||
@@ -271,6 +298,30 @@ BOOST_AUTO_TEST_CASE( EquilOperations ) {
|
||||
BOOST_CHECK_EQUAL( 20, record.initializationTargetAccuracy() );
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE( StrEquilOperations ) {
|
||||
auto deck = createDeck( deckWithStrEquil );
|
||||
InitConfig config( deck );
|
||||
|
||||
const auto& equil = config.getStressEquil();
|
||||
|
||||
BOOST_CHECK( !equil.empty() );
|
||||
BOOST_CHECK_EQUAL( 1U, equil.size() );
|
||||
|
||||
BOOST_CHECK_NO_THROW( equil.getRecord( 0 ) );
|
||||
BOOST_CHECK_THROW( equil.getRecord( 1 ), std::out_of_range );
|
||||
|
||||
const auto& record = equil.getRecord( 0 );
|
||||
BOOST_CHECK_CLOSE(1.0, record.datumDepth(), 1.0 );
|
||||
BOOST_CHECK_CLOSE(2.0, record.datumPosX(), 1e-12 );
|
||||
BOOST_CHECK_CLOSE(3.0, record.datumPosY(), 1e-12 );
|
||||
BOOST_CHECK_CLOSE(4.0 * unit::barsa, record.stressXX(), 1e-12 );
|
||||
BOOST_CHECK_CLOSE(5.0 * unit::barsa, record.stressXX_grad(), 1e-12 );
|
||||
BOOST_CHECK_CLOSE(6.0 * unit::barsa, record.stressYY(), 1e-12 );
|
||||
BOOST_CHECK_CLOSE(7.0 * unit::barsa, record.stressYY_grad(), 1e-12 );
|
||||
BOOST_CHECK_CLOSE(8.0 * unit::barsa, record.stressZZ(), 1e-12 );
|
||||
BOOST_CHECK_CLOSE(9.0 * unit::barsa, record.stressZZ_grad(), 1e-12 );
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(RestartCWD) {
|
||||
WorkArea output_area;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user