///////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2023- Equinor ASA // // ResInsight is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY // WARRANTY; without even the implied warranty of MERCHANTABILITY or // FITNESS FOR A PARTICULAR PURPOSE. // // See the GNU General Public License at // for more details. // ///////////////////////////////////////////////////////////////////////////////// #pragma once #include "RigFaultReactivationModel.h" #include "RigGriddedPart3d.h" #include "RimFaultReactivationDataAccess.h" #include "RimFaultReactivationModel.h" #include #include #include #include //================================================================================================== /// //================================================================================================== class RifFaultReactivationModelExporter { public: static std::pair exportToStream( std::ostream& stream, const RimFaultReactivationModel& model ); static std::pair exportToFile( const RimFaultReactivationModel& model ); private: static std::pair printHeading( std::ostream& stream, const std::string& applicationNameAndVersion ); static std::pair printParts( std::ostream& stream, const RigFaultReactivationModel& model, const std::map& partNames, const std::vector>& borders, const std::map, int>& faces, const std::map& boundaries, const std::map& materialNames ); static std::pair printAssembly( std::ostream& stream, const RigFaultReactivationModel& model, const std::map& partNames, bool includeTransform, const std::pair& transform ); static std::pair printMaterials( std::ostream& stream, const RimFaultReactivationModel& rimModel, const std::map& materialNames, const RimFaultReactivationDataAccess& dataAccess, const std::string& exportDirectory, const std::map& partNames, bool densityFromGrid, bool elasticPropertiesFromGrid ); static std::pair printInteractionProperties( std::ostream& stream, double faultFriction ); static std::pair printBoundaryConditions( std::ostream& stream, const RigFaultReactivationModel& model, const std::map& partNames, const std::map& boundaries ); static std::pair printPredefinedFields( std::ostream& stream, const RigFaultReactivationModel& model, const RimFaultReactivationDataAccess& dataAccess, const std::string& exportDirectory, const std::map& partNames, bool useGridVoidRatio ); static std::pair printSteps( std::ostream& stream, const RigFaultReactivationModel& model, const RimFaultReactivationDataAccess& dataAccess, const std::map& partNames, const std::vector& timeSteps, const std::string& exportDirectory, bool useGridPorePressure, bool useGridTemperature, double seaWaterLoad ); static std::pair printInteractions( std::ostream& stream, const std::map& partNames, const std::vector>& borders ); static bool writePropertyToFile( const RigFaultReactivationModel& model, const RimFaultReactivationDataAccess& dataAccess, RimFaultReactivation::Property property, size_t outputTimeStep, const std::string& filePath, const std::map& partNames, const std::string& additionalData ); static bool writePropertiesToFile( const RigFaultReactivationModel& model, const RimFaultReactivationDataAccess& dataAccess, const std::vector& properties, const std::vector& propertyNames, size_t outputTimeStep, const std::string& filePath, const std::map& partNames, const std::string& tableName, const std::string& heading ); static std::string createFilePostfix( const std::string& title, const std::string& stepName ); static bool exportModelSettings( const RimFaultReactivationModel& model ); static std::shared_ptr extractAndExportModelData( const RimFaultReactivationModel& model ); };