Skip to content

Commit

Permalink
Work in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
jonjenssen committed Dec 11, 2023
1 parent 61a0b86 commit 7eba8ab
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 8 deletions.
26 changes: 26 additions & 0 deletions ApplicationLibCode/GeoMech/OdbReader/RifInpIncludeReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,29 @@
/////////////////////////////////////////////////////////////////////////////////

#pragma once

#include <fstream>
#include <string>
#include <vector>

//==================================================================================================
//
//==================================================================================================
class RifInpReader
{
public:
RifInpIncludeReader();
~RifInpIncludeReader() override;

bool openFile( const std::string& fileName, std::string* errorMessage );
bool isOpen() const;

bool


private:
void close();

private:
std::ifstream m_stream;
};
16 changes: 16 additions & 0 deletions ApplicationLibCode/GeoMech/OdbReader/RifInpReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -643,3 +643,19 @@ void RifInpReader::readIntegrationPointField( const std::string&
{
CVF_ASSERT( resultValues );
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
const std::vector<double> RifInpReader::propertyData( std::string propertyName, int partId ) const
{
if ( m_propertyPartData.count( propertyName ) > 0 )
{
if ( m_propertyPartData.at( propertyName ).count( partId ) > 0 )
{
return m_propertyPartData.at( propertyName ).at( partId );
}
}

return {};
}
17 changes: 9 additions & 8 deletions ApplicationLibCode/GeoMech/OdbReader/RifInpReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ struct RifInpIncludeEntry

//==================================================================================================
//
// Data interface base class
//
//==================================================================================================
class RifInpReader : public RifGeoMechReaderInterface
{
Expand Down Expand Up @@ -94,6 +92,8 @@ class RifInpReader : public RifGeoMechReaderInterface
int frameIndex,
std::vector<std::vector<float>*>* resultValues ) override;

const std::vector<double> propertyData( std::string propertyName, int partId ) const;

private:
void close();

Expand All @@ -115,10 +115,11 @@ class RifInpReader : public RifGeoMechReaderInterface
std::vector<RifInpIncludeEntry>& includeEntries );

private:
bool m_enableIncludes;
std::map<int, std::vector<std::string>> m_partElementSetNames;
std::vector<std::string> m_stepNames;
std::vector<RifInpIncludeEntry> m_includeEntries;
std::ifstream m_stream;
std::filesystem::path m_inputPath;
bool m_enableIncludes;
std::map<int, std::vector<std::string>> m_partElementSetNames;
std::vector<std::string> m_stepNames;
std::vector<RifInpIncludeEntry> m_includeEntries;
std::ifstream m_stream;
std::filesystem::path m_inputPath;
std::map<std::string, std::map<int, std::vector<double>>> m_propertyPartData;
};

0 comments on commit 7eba8ab

Please sign in to comment.