mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
GeoMech data model and reader unit test framework.
This commit is contained in:
17
ApplicationCode/GeoMech/GeoMechDataModel/CMakeLists.txt
Normal file
17
ApplicationCode/GeoMech/GeoMechDataModel/CMakeLists.txt
Normal file
@@ -0,0 +1,17 @@
|
||||
cmake_minimum_required (VERSION 2.8)
|
||||
|
||||
project (RigGeoMechDataModel)
|
||||
|
||||
include_directories(
|
||||
${LibCore_SOURCE_DIR}
|
||||
)
|
||||
|
||||
|
||||
add_library( ${PROJECT_NAME}
|
||||
RigFemPart.h
|
||||
RigFemPart.cpp
|
||||
RigFemTypes.h
|
||||
RigGeoMechCaseData.cpp
|
||||
RigGeoMechCaseData.h
|
||||
|
||||
)
|
||||
37
ApplicationCode/GeoMech/GeoMechDataModel/RigFemPart.cpp
Normal file
37
ApplicationCode/GeoMech/GeoMechDataModel/RigFemPart.cpp
Normal file
@@ -0,0 +1,37 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2015- Statoil ASA
|
||||
// Copyright (C) 2015- Ceetron Solutions AS
|
||||
//
|
||||
// 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 <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RigFemPart.h"
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigFemPart::RigFemPart()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigFemPart::~RigFemPart()
|
||||
{
|
||||
|
||||
}
|
||||
60
ApplicationCode/GeoMech/GeoMechDataModel/RigFemPart.h
Normal file
60
ApplicationCode/GeoMech/GeoMechDataModel/RigFemPart.h
Normal file
@@ -0,0 +1,60 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2015- Statoil ASA
|
||||
// Copyright (C) 2015- Ceetron Solutions AS
|
||||
//
|
||||
// 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 <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RigFemTypes.h"
|
||||
#include "cvfObject.h"
|
||||
#include "cvfAssert.h"
|
||||
|
||||
#include "cvfVector3.h"
|
||||
#include <vector>
|
||||
|
||||
class RigFemPartNodes
|
||||
{
|
||||
public:
|
||||
std::vector<int> nodeIds;
|
||||
std::vector<cvf::Vec3f> coordinates;
|
||||
};
|
||||
|
||||
class RigFemPart : public cvf::Object
|
||||
{
|
||||
public:
|
||||
RigFemPart();
|
||||
virtual ~RigFemPart();
|
||||
|
||||
int appendElement(RigElementType elmType, int id, const int* connectivities);
|
||||
|
||||
size_t elementCount() const { return m_elementId.size(); }
|
||||
|
||||
int elmId(size_t index) const { return m_elementId[index]; }
|
||||
RigElementType elmentType(size_t index) const { return m_elementTypes[index]; }
|
||||
const int* connectivities(size_t index) const { return &m_allAlementConnectivities[m_elementConnectivityStartIndices[index]];}
|
||||
|
||||
RigFemPartNodes& nodes() {return m_nodes;}
|
||||
|
||||
private:
|
||||
std::vector<int> m_elementId;
|
||||
std::vector<RigElementType> m_elementTypes;
|
||||
std::vector<size_t> m_elementConnectivityStartIndices;
|
||||
std::vector<int> m_allAlementConnectivities;
|
||||
|
||||
RigFemPartNodes m_nodes;
|
||||
|
||||
};
|
||||
57
ApplicationCode/GeoMech/GeoMechDataModel/RigFemTypes.h
Normal file
57
ApplicationCode/GeoMech/GeoMechDataModel/RigFemTypes.h
Normal file
@@ -0,0 +1,57 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2015- Statoil ASA
|
||||
// Copyright (C) 2015- Ceetron Solutions AS
|
||||
//
|
||||
// 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 <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
enum RigElementType
|
||||
{
|
||||
HEX8
|
||||
};
|
||||
|
||||
static const int elmentNodeCount(RigElementType elmType)
|
||||
{
|
||||
static int elementTypeCounts[1] = {8};
|
||||
|
||||
return elementTypeCounts[elmType];
|
||||
}
|
||||
|
||||
static const int elmentFaceCount(RigElementType elmType)
|
||||
{
|
||||
const static int elementFaceCounts[1] = {6};
|
||||
|
||||
return elementFaceCounts[elmType];
|
||||
}
|
||||
|
||||
// HEX8
|
||||
// 7---------6
|
||||
// /| /| |k
|
||||
// / | / | | /j
|
||||
// 4---------5 | |/
|
||||
// | 3------|--2 *---i
|
||||
// | / | /
|
||||
// |/ |/
|
||||
// 0---------1
|
||||
|
||||
static const int* elementLocalFaceIndices(RigElementType elmType, int faceIdx, int* faceNodeCount)
|
||||
{
|
||||
static const int HEX8_Faces[6][4] = { {1, 2, 6, 5 }, {0,4,7,3}, {3,7,6,2}, {0,1,5,4}, {4,5,6,7} ,{0,3,2,1} };
|
||||
|
||||
(*faceNodeCount) = 4;
|
||||
return HEX8_Faces[faceIdx];
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2015- Statoil ASA
|
||||
// Copyright (C) 2015- Ceetron Solutions AS
|
||||
//
|
||||
// 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 <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RigGeoMechCaseData.h"
|
||||
#include "RigFemPart.h"
|
||||
|
||||
#include <math.h>
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigGeoMechCaseData::RigGeoMechCaseData()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigGeoMechCaseData::~RigGeoMechCaseData()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigGeoMechCaseData::addFemPart(RigFemPart* part)
|
||||
{
|
||||
m_femParts.push_back(part);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigFemPart* RigGeoMechCaseData::part(size_t index)
|
||||
{
|
||||
return m_femParts[index].p();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
size_t RigGeoMechCaseData::partCount()
|
||||
{
|
||||
return m_femParts.size();
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2015- Statoil ASA
|
||||
// Copyright (C) 2015- Ceetron Solutions AS
|
||||
//
|
||||
// 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 <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RigFemPart.h"
|
||||
#include "cvfCollection.h"
|
||||
|
||||
class RigGeoMechCaseData: public cvf::Object
|
||||
{
|
||||
public:
|
||||
RigGeoMechCaseData();
|
||||
~RigGeoMechCaseData();
|
||||
|
||||
void addFemPart(RigFemPart* part);
|
||||
RigFemPart* part(size_t index);
|
||||
size_t partCount();
|
||||
|
||||
private:
|
||||
cvf::Collection<RigFemPart> m_femParts;
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user