mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Fault Reactivation Model: include local coord rotation in INP export.
This commit is contained in:
@@ -48,7 +48,7 @@ void RicExportInpFileFeature::onActionTriggered( bool isChecked )
|
||||
if ( faultReactivationModel )
|
||||
{
|
||||
QString exportFile = faultReactivationModel->baseDir() + "/faultreactivation.inp";
|
||||
RifFaultReactivationModelExporter::exportToFile( exportFile.toStdString(), *faultReactivationModel->model() );
|
||||
RifFaultReactivationModelExporter::exportToFile( exportFile.toStdString(), *faultReactivationModel );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ void RicRunFaultReactModelingFeature::onActionTriggered( bool isChecked )
|
||||
}
|
||||
|
||||
QString exportFile = model->inputFilename();
|
||||
auto [result, errText] = RifFaultReactivationModelExporter::exportToFile( exportFile.toStdString(), *model->model() );
|
||||
auto [result, errText] = RifFaultReactivationModelExporter::exportToFile( exportFile.toStdString(), *model );
|
||||
|
||||
if ( !result )
|
||||
{
|
||||
|
||||
@@ -56,7 +56,7 @@ void RicShowFaultReactModelFeature::onActionTriggered( bool isChecked )
|
||||
const QString frmTitle( "Fault Reactivation Modeling" );
|
||||
const QString exportFile = model->inputFilename();
|
||||
|
||||
auto [result, errText] = RifFaultReactivationModelExporter::exportToFile( exportFile.toStdString(), *model->model() );
|
||||
auto [result, errText] = RifFaultReactivationModelExporter::exportToFile( exportFile.toStdString(), *model );
|
||||
if ( !result )
|
||||
{
|
||||
QString outErrorText =
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::pair<bool, std::string> RifFaultReactivationModelExporter::exportToStream( std::ostream& stream, const RigFaultReactivationModel& model )
|
||||
std::pair<bool, std::string> RifFaultReactivationModelExporter::exportToStream( std::ostream& stream, const RimFaultReactivationModel& rimModel )
|
||||
{
|
||||
std::string applicationNameAndVersion = std::string( RI_APPLICATION_NAME ) + " " + std::string( STRPRODUCTVER );
|
||||
|
||||
@@ -64,12 +64,14 @@ std::pair<bool, std::string> RifFaultReactivationModelExporter::exportToStream(
|
||||
|
||||
double faultFriction = 0.0;
|
||||
|
||||
auto model = rimModel.model();
|
||||
CAF_ASSERT( !model.isNull() );
|
||||
printHeading( stream, applicationNameAndVersion );
|
||||
printParts( stream, model, partNames, borders, faces, boundaries );
|
||||
printAssembly( stream, model, partNames );
|
||||
printParts( stream, *model, partNames, borders, faces, boundaries, rimModel.localCoordSysNormalsXY() );
|
||||
printAssembly( stream, *model, partNames );
|
||||
printMaterials( stream );
|
||||
printInteractionProperties( stream, faultFriction );
|
||||
printBoundaryConditions( stream, model, partNames, boundaries );
|
||||
printBoundaryConditions( stream, *model, partNames, boundaries );
|
||||
printPredefinedFields( stream, partNames );
|
||||
printInteractions( stream, partNames, borders );
|
||||
printSteps( stream, partNames );
|
||||
@@ -82,7 +84,7 @@ std::pair<bool, std::string> RifFaultReactivationModelExporter::exportToStream(
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::pair<bool, std::string> RifFaultReactivationModelExporter::exportToFile( const std::string& filePath,
|
||||
const RigFaultReactivationModel& model )
|
||||
const RimFaultReactivationModel& model )
|
||||
{
|
||||
std::ofstream stream( filePath );
|
||||
return exportToStream( stream, model );
|
||||
@@ -112,9 +114,8 @@ std::pair<bool, std::string> RifFaultReactivationModelExporter::printParts(
|
||||
const std::map<RigFaultReactivationModel::GridPart, std::string>& partNames,
|
||||
const std::vector<std::pair<RigGriddedPart3d::BorderSurface, std::string>>& borders,
|
||||
const std::map<std::pair<RigFaultReactivationModel::GridPart, RigGriddedPart3d::BorderSurface>, int>& faces,
|
||||
const std::map<RigGriddedPart3d::Boundary, std::string>& boundaries
|
||||
|
||||
)
|
||||
const std::map<RigGriddedPart3d::Boundary, std::string>& boundaries,
|
||||
const std::pair<cvf::Vec3d, cvf::Vec3d>& orientation )
|
||||
{
|
||||
RifInpExportTools::printSectionComment( stream, "PARTS" );
|
||||
|
||||
@@ -171,8 +172,15 @@ std::pair<bool, std::string> RifFaultReactivationModelExporter::printParts(
|
||||
}
|
||||
}
|
||||
|
||||
// Print local orientation
|
||||
std::string orientationName = "ori";
|
||||
RifInpExportTools::printHeading( stream, "Orientation, name=" + orientationName );
|
||||
auto [dir1, dir2] = orientation;
|
||||
RifInpExportTools::printNumbers( stream, { dir1.x(), dir1.y(), dir1.z(), dir2.x(), dir2.y(), dir2.z() } );
|
||||
RifInpExportTools::printLine( stream, "3, 0.0" );
|
||||
|
||||
RifInpExportTools::printComment( stream, "Section: sand" );
|
||||
RifInpExportTools::printHeading( stream, "Solid Section, elset=" + partName + ", material=sand" );
|
||||
RifInpExportTools::printHeading( stream, "Solid Section, elset=" + partName + ", orientation=" + orientationName + ", material=sand" );
|
||||
|
||||
RifInpExportTools::printLine( stream, "," );
|
||||
RifInpExportTools::printHeading( stream, "End Part" );
|
||||
|
||||
@@ -19,24 +19,23 @@
|
||||
#pragma once
|
||||
|
||||
#include "RigFaultReactivationModel.h"
|
||||
|
||||
#include "RigGriddedPart3d.h"
|
||||
|
||||
#include "RimFaultReactivationModel.h"
|
||||
|
||||
#include <map>
|
||||
#include <ostream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
class RigFaultReactivationModel;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RifFaultReactivationModelExporter
|
||||
{
|
||||
public:
|
||||
static std::pair<bool, std::string> exportToStream( std::ostream& stream, const RigFaultReactivationModel& model );
|
||||
static std::pair<bool, std::string> exportToFile( const std::string& filePath, const RigFaultReactivationModel& model );
|
||||
static std::pair<bool, std::string> exportToStream( std::ostream& stream, const RimFaultReactivationModel& model );
|
||||
static std::pair<bool, std::string> exportToFile( const std::string& filePath, const RimFaultReactivationModel& model );
|
||||
|
||||
private:
|
||||
static std::pair<bool, std::string> printHeading( std::ostream& stream, const std::string& applicationNameAndVersion );
|
||||
@@ -46,7 +45,8 @@ private:
|
||||
const std::map<RigFaultReactivationModel::GridPart, std::string>& partNames,
|
||||
const std::vector<std::pair<RigGriddedPart3d::BorderSurface, std::string>>& borders,
|
||||
const std::map<std::pair<RigFaultReactivationModel::GridPart, RigGriddedPart3d::BorderSurface>, int>& faces,
|
||||
const std::map<RigGriddedPart3d::Boundary, std::string>& boundaries );
|
||||
const std::map<RigGriddedPart3d::Boundary, std::string>& boundaries,
|
||||
const std::pair<cvf::Vec3d, cvf::Vec3d>& orientation );
|
||||
|
||||
static std::pair<bool, std::string> printAssembly( std::ostream& stream,
|
||||
const RigFaultReactivationModel& model,
|
||||
@@ -55,11 +55,11 @@ private:
|
||||
static std::pair<bool, std::string> printMaterials( std::ostream& stream );
|
||||
|
||||
static std::pair<bool, std::string> printInteractionProperties( std::ostream& stream, double faultFriction );
|
||||
static std::pair<bool, std::string> printBoundaryConditions( std::ostream& stream,
|
||||
const RigFaultReactivationModel& model,
|
||||
static std::pair<bool, std::string> printBoundaryConditions( std::ostream& stream,
|
||||
const RigFaultReactivationModel& model,
|
||||
const std::map<RigFaultReactivationModel::GridPart, std::string>& partNames,
|
||||
const std::map<RigGriddedPart3d::Boundary, std::string>& boundaries );
|
||||
static std::pair<bool, std::string> printPredefinedFields( std::ostream& stream,
|
||||
static std::pair<bool, std::string> printPredefinedFields( std::ostream& stream,
|
||||
const std::map<RigFaultReactivationModel::GridPart, std::string>& partNames );
|
||||
static std::pair<bool, std::string> printSteps( std::ostream& stream,
|
||||
const std::map<RigFaultReactivationModel::GridPart, std::string>& partNames );
|
||||
|
||||
Reference in New Issue
Block a user