Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements to EFEM solver. #1147

Merged
merged 38 commits into from
Dec 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
cf1f1e3
Adding cellToFrac maps and fractured cell list.
CusiniM Sep 8, 2020
05249ee
Merge remote-tracking branch 'origin/develop' into feature/cusini1/EF…
CusiniM Sep 8, 2020
59e708e
Merge remote-tracking branch 'origin/develop' into feature/cusini1/EF…
CusiniM Oct 12, 2020
a24b369
Crated AESKernel
CusiniM Oct 13, 2020
23c05c9
Using tensorOps.
CusiniM Oct 14, 2020
4baeac6
Added EFEMKernelsHelper.
CusiniM Oct 16, 2020
d37a26e
Kernel has all it needs.
CusiniM Oct 16, 2020
7efe69d
Finished up kernels. removed old assembly.
CusiniM Oct 19, 2020
a16cd99
Merge remote-tracking branch 'origin/develop' into feature/cusini1/EF…
CusiniM Oct 19, 2020
38aa58f
Fixes. Local storage of solution.
CusiniM Oct 20, 2020
830db21
Addressed most of Josh's comments + added traction.
CusiniM Oct 20, 2020
fd7efd8
It builds.
CusiniM Oct 21, 2020
9cff008
Almost working but w is full of junk.
CusiniM Oct 22, 2020
bd7cde9
Sneddon is working.
CusiniM Oct 22, 2020
6e58671
uncrustify
CusiniM Nov 3, 2020
53a68fb
Merge remote-tracking branch 'origin/develop' into feature/cusini1/EF…
CusiniM Nov 3, 2020
ccd0b17
udpate LvArray
CusiniM Nov 3, 2020
dc45a74
Merge remote-tracking branch 'origin/develop' into feature/cusini1/EF…
CusiniM Nov 25, 2020
e83ed51
Merge remote-tracking branch 'origin/develop' into feature/cusini1/EF…
CusiniM Nov 29, 2020
7466deb
update LvArray
CusiniM Nov 29, 2020
0d0d695
fix gravity vector copy.
CusiniM Nov 30, 2020
dad1e2b
fixed doxygen
CusiniM Nov 30, 2020
fe307e3
Fixed cuda errors.
CusiniM Nov 30, 2020
b449bbb
fixed bug in cuda runs.
CusiniM Dec 3, 2020
73d62f4
uncrustify
CusiniM Dec 3, 2020
43974aa
Merge remote-tracking branch 'origin/develop' into feature/cusini1/EF…
CusiniM Dec 3, 2020
1d21bd9
use unscaled symmetric outer product in tensorOps
rrsettgast Dec 8, 2020
804e255
bugfix
rrsettgast Dec 8, 2020
df4f118
update code to use new tensorOps
CusiniM Dec 9, 2020
06d51ad
uncrustify
CusiniM Dec 9, 2020
c8ee674
bugfix
CusiniM Dec 9, 2020
d95c558
Addressing last few of randy's comments.
CusiniM Dec 9, 2020
12beb4b
removed delted file from cmakeListes
CusiniM Dec 10, 2020
c43a02d
LvArray update
CusiniM Dec 11, 2020
dce3ffb
Merge branch 'feature/cusini1/EFEMSolvImprovements' of github.com:GEO…
CusiniM Dec 11, 2020
ce78689
updated integratedTests tag
CusiniM Dec 11, 2020
5fc6f57
updated LvArray and fixed compilation error in debug mode on lassen.
CusiniM Dec 14, 2020
3fb8851
update LvArray submodule hash
rrsettgast Dec 14, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions host-configs/LLNL/quartz-base.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ set(ENABLE_PAMELA ON CACHE BOOL "")
set(ENABLE_PVTPackage ON CACHE BOOL "")
set(ENABLE_GEOSX_PTP ON CACHE BOOL "" FORCE)
set(ENABLE_PETSC OFF CACHE BOOL "Enables PETSc." FORCE)

2 changes: 1 addition & 1 deletion integratedTests
Original file line number Diff line number Diff line change
Expand Up @@ -106,30 +106,6 @@ class LinearElasticIsotropicUpdates : public SolidBaseUpdates
c[5][5] = G;
}

void GetStiffness( localIndex const k, array2d< real64 > & c ) const
{
real64 const G = m_shearModulus[k];
real64 const Lame = m_bulkModulus[k] - 2.0/3.0 * G;

c[0][0] = Lame + 2 * G;
c[0][1] = Lame;
c[0][2] = Lame;

c[1][0] = Lame;
c[1][1] = Lame + 2 * G;
c[1][2] = Lame;

c[2][0] = Lame;
c[2][1] = Lame;
c[2][2] = Lame + 2 * G;

c[3][3] = G;

c[4][4] = G;

c[5][5] = G;
}

GEOSX_FORCE_INLINE
GEOSX_HOST_DEVICE
void setDiscretizationOps( localIndex const k,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Name Type Default Description
========================= ============ ======== ======================================================================================================================================================================================================================================================================================================================
cflFactor real64 0.5 Factor to apply to the `CFL condition <http://en.wikipedia.org/wiki/Courant-Friedrichs-Lewy_condition>`_ when calculating the maximum allowable time step. Values should be in the interval (0,1]
contactRelationName string required Name of contact relation to enforce constraints on fracture boundary.
fractureRegionName string required Name of the fracture region.
initialDt real64 1e+99 Initial time-step value required by the solver to the event manager.
logLevel integer 0 Log level
name string required A name is required for any non-unique nodes
Expand Down
2 changes: 2 additions & 0 deletions src/coreComponents/fileIO/schema/schema.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -1359,6 +1359,8 @@ the relative residual norm satisfies:
<xsd:attribute name="cflFactor" type="real64" default="0.5" />
<!--contactRelationName => Name of contact relation to enforce constraints on fracture boundary.-->
<xsd:attribute name="contactRelationName" type="string" use="required" />
<!--fractureRegionName => Name of the fracture region.-->
<xsd:attribute name="fractureRegionName" type="string" use="required" />
<!--initialDt => Initial time-step value required by the solver to the event manager.-->
<xsd:attribute name="initialDt" type="real64" default="1e+99" />
<!--logLevel => Log level-->
Expand Down
11 changes: 6 additions & 5 deletions src/coreComponents/linearAlgebra/DofManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1790,9 +1790,10 @@ void DofManager::makeRestrictor( std::vector< SubComponent > const & selection,
GEOSX_ERROR_IF( !m_reordered, "Cannot make restrictors before reorderByRank() has been called." );

// 1. Populate selected fields and compute some basic dimensions
array1d< FieldDescription > fieldsSelected( selection.size() );
// array1d< FieldDescription > fieldsSelected( selection.size() );
std::vector< FieldDescription > fieldsSelected( selection.size() );

for( localIndex k = 0; k < fieldsSelected.size(); ++k )
for( std::size_t k = 0; k < fieldsSelected.size(); ++k )
{
SubComponent const & dof = selection[k];
FieldDescription const & fieldOld = m_fields[getFieldIndex( dof.fieldName )];
Expand All @@ -1812,7 +1813,7 @@ void DofManager::makeRestrictor( std::vector< SubComponent > const & selection,
// 2. Compute remaining offsets (we mostly just need globalOffset, but it depends on others)

globalIndex blockOffset = 0;
for( localIndex k = 0; k < fieldsSelected.size(); ++k )
for( std::size_t k = 0; k < fieldsSelected.size(); ++k )
{
fieldsSelected[k].blockOffset = blockOffset;
blockOffset += fieldsSelected[k].numGlobalDof;
Expand All @@ -1822,7 +1823,7 @@ void DofManager::makeRestrictor( std::vector< SubComponent > const & selection,
[]( localIndex const n, FieldDescription const & f )
{ return n + f.rankOffset; } );

for( localIndex k = 0; k < fieldsSelected.size(); ++k )
for( std::size_t k = 0; k < fieldsSelected.size(); ++k )
{
fieldsSelected[k].globalOffset = globalOffset;
globalOffset += fieldsSelected[k].numLocalDof;
Expand All @@ -1840,7 +1841,7 @@ void DofManager::makeRestrictor( std::vector< SubComponent > const & selection,
restrictor.createWithLocalSize( rowSize, colSize, 1, comm );
restrictor.open();

for( localIndex k = 0; k < fieldsSelected.size(); ++k )
for( std::size_t k = 0; k < fieldsSelected.size(); ++k )
{
FieldDescription const & fieldNew = fieldsSelected[k];
FieldDescription const & fieldOld = m_fields[getFieldIndex( fieldNew.name )];
Expand Down
12 changes: 12 additions & 0 deletions src/coreComponents/mesh/CellElementSubRegion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ CellElementSubRegion::CellElementSubRegion( string const & name, Group * const p
registerWrapper( viewKeyStruct::dNdXString, &m_dNdX )->setSizedFromParent( 1 )->reference().resizeDimension< 3 >( 3 );

registerWrapper( viewKeyStruct::detJString, &m_detJ )->setSizedFromParent( 1 )->reference();

registerWrapper( viewKeyStruct::toEmbSurfString, &m_toEmbeddedSurfaces )->setSizedFromParent( 1 );
}

CellElementSubRegion::~CellElementSubRegion()
Expand Down Expand Up @@ -82,6 +84,16 @@ void CellElementSubRegion::ConstructSubRegionFromFaceSet( FaceManager const * co
this->resize( targetSet.size() );
}


void CellElementSubRegion::addFracturedElement( localIndex const cellElemIndex,
localIndex const embSurfIndex )
{
// add the connection between the element and the embedded surface to the map
m_toEmbeddedSurfaces.emplaceBack( cellElemIndex, embSurfIndex );
// add the element to the fractured elements list
m_fracturedCells.insert( cellElemIndex );
}

void CellElementSubRegion::ViewPackingExclusionList( SortedArray< localIndex > & exclusionList ) const
{
ObjectManagerBase::ViewPackingExclusionList( exclusionList );
Expand Down
42 changes: 42 additions & 0 deletions src/coreComponents/mesh/CellElementSubRegion.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ namespace geosx
class CellElementSubRegion : public CellBlock
{
public:

/// Type of map between cell blocks and embedded elements
using EmbSurfMapType = InterObjectRelation< ArrayOfArrays< localIndex > >;

/**
* @name Constructor / Destructor
*/
Expand Down Expand Up @@ -70,6 +74,14 @@ class CellElementSubRegion : public CellBlock

///@}

/**
* @brief Add fractured element to list and relative entries to the map.
* @param cellElemIndex cell element index
* @param embSurfIndex embedded surface element index
*/
void addFracturedElement( localIndex const cellElemIndex,
localIndex const embSurfIndex );

/**
* @name Overriding packing / Unpacking functions
*/
Expand Down Expand Up @@ -129,6 +141,8 @@ class CellElementSubRegion : public CellBlock
static constexpr auto constitutiveGroupingString = "ConstitutiveGrouping";
/// String key for the constitutive map
static constexpr auto constitutiveMapString = "ConstitutiveMap";
/// String key to embSurfMap
static constexpr auto toEmbSurfString = "ToEmbeddedSurfaces";

/// ViewKey for the constitutive grouping
dataRepository::ViewKey constitutiveGrouping = { constitutiveGroupingString };
Expand Down Expand Up @@ -165,6 +179,28 @@ class CellElementSubRegion : public CellBlock
arrayView2d< real64 const > detJ() const
{ return m_detJ; }

/**
* @brief @return The sorted array of fractured elements.
*/
SortedArray< localIndex > & fracturedElementsList()
{ return m_fracturedCells; }

/**
* @brief @return The sorted array view of fractured elements.
*/
SortedArrayView< localIndex const > const fracturedElementsList() const
{ return m_fracturedCells.toViewConst(); }

/**
* @brief @return The map to the embedded surfaces
*/
EmbSurfMapType & embeddedSurfacesList() { return m_toEmbeddedSurfaces; }

/**
* @brief @return The map to the embedded surfaces
*/
EmbSurfMapType const & embeddedSurfacesList() const { return m_toEmbeddedSurfaces; }

/// Map used for constitutive grouping
map< string, localIndex_array > m_constitutiveGrouping;

Expand All @@ -185,6 +221,12 @@ class CellElementSubRegion : public CellBlock
/// Map of unmapped global indices in the element-to-face map
map< localIndex, array1d< globalIndex > > m_unmappedGlobalIndicesInFacelist;

/// List of fractured elements
SortedArray< localIndex > m_fracturedCells;

/// Map from Cell Elements to Embedded Surfaces
EmbSurfMapType m_toEmbeddedSurfaces;

/**
* @brief Pack element-to-node and element-to-face maps
* @tparam the flag for the bufferOps::Pack function
Expand Down
12 changes: 0 additions & 12 deletions src/coreComponents/mesh/EmbeddedSurfaceSubRegion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,16 +241,4 @@ void EmbeddedSurfaceSubRegion::setupRelatedObjectsInRelations( MeshLevel const *
this->m_toNodesRelation.SetRelatedObject( mesh->getNodeManager() );
}

real64 EmbeddedSurfaceSubRegion::ComputeHeavisideFunction( ArraySlice< real64 const, 1, nodes::REFERENCE_POSITION_USD - 1 > const nodeCoord,
localIndex const k ) const
{
real64 heaviside, distanceVector[3];
LvArray::tensorOps::copy< 3 >( distanceVector, nodeCoord );
LvArray::tensorOps::subtract< 3 >( distanceVector, m_elementCenter[k] );

heaviside = LvArray::tensorOps::AiBi< 3 >( distanceVector, m_normalVector[k] ) > 0 ? 1 : 0;

return heaviside;
}

} /* namespace geosx */
51 changes: 49 additions & 2 deletions src/coreComponents/mesh/EmbeddedSurfaceSubRegion.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,22 @@ class EmbeddedSurfaceSubRegion : public SurfaceElementSubRegion

/// Connectivity index string
static constexpr auto connectivityIndexString = "connectivityIndex";
};

/// Displacement jump string
static constexpr auto dispJumpString = "displacementJump";

/// Delta displacement jump string
static constexpr auto deltaDispJumpString = "deltaDisplacementJump";

/// Displacement jump key
dataRepository::ViewKey dispJump = {dispJumpString};

/// Delta displacement jump key
dataRepository::ViewKey deltaDispJump = {deltaDispJumpString};

}
/// viewKey struct for the EmbeddedSurfaceSubRegion class
viewKeys;

virtual void setupRelatedObjectsInRelations( MeshLevel const * const mesh ) override;

Expand Down Expand Up @@ -259,8 +274,40 @@ class EmbeddedSurfaceSubRegion : public SurfaceElementSubRegion
*/
array1d< real64 > const & getConnectivityIndex() const { return m_connectivityIndex;}

///@}

/**
* @brief Get a mutable total displacement array.
* @return the total displacement array if it exists, or an error is thrown if it does not exist
* @note An error is thrown if the displacement jump does not exist
*/
array2d< real64 > & displacementJump()
{ return getReference< array2d< real64 > >( viewKeys.dispJump ); }

/**
* @brief Provide an immutable arrayView to the total displacement array.
* @return immutable arrayView of the total displacement array if it exists, or an error is thrown if it does not exist
* @note An error is thrown if the displacement jump does not exist
*/
arrayView2d< real64 const > displacementJump() const
{return getReference< array2d< real64 > >( viewKeys.dispJump ); }

/**
* @brief Get a mutable incremental displacement array.
* @return the incremental displacement array if it exists, or an error is thrown if it does not exist
* @note An error is thrown if the incremental displacement jump does not exist
*/
array2d< real64 > & incrementalDisplacementJump()
{ return getReference< array2d< real64 > >( viewKeys.deltaDispJump ); }

/**
* @brief Provide an immutable arrayView to the incremental displacement jump array.
* @return immutable arrayView of the incremental displacement array if it exists, or an error is thrown if it does not exist
* @note An error is thrown if the incremental displacement jump does not exist
*/
arrayView2d< real64 const > incrementalDisplacementJump() const
{ return getReference< array2d< real64 > >( viewKeys.deltaDispJump ); }
Comment on lines +283 to +308
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If these always exist in the subregion, then can just be members.

Copy link
Collaborator Author

@CusiniM CusiniM Dec 9, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, they only exist for mechanics simulations. In case of flow sim they won't be registered.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't the displacement jump akin to the aperture?

Copy link
Collaborator Author

@CusiniM CusiniM Dec 9, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is but they are two different things (separate fields). In a way the normal component of it is equal to the aperture but they are two different fields. Basically the flow solver will ask for the aperture which, in the poroelastic case is updated based on the displacement jump. It's a formality but distinguishing between them allows for a bit more flexibility, e.g., the enrichment can be done in a basis which does not use the normal to the fracture.


///@}

private:

Expand Down
2 changes: 2 additions & 0 deletions src/coreComponents/physicsSolvers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ set( physicsSolvers_headers
solidMechanics/SolidMechanicsLagrangianFEM.hpp
solidMechanics/SolidMechanicsLagrangianSSLE.hpp
solidMechanics/SolidMechanicsLagrangianFEMKernels.hpp
solidMechanics/SolidMechanicsEFEMKernels.hpp
solidMechanics/SolidMechanicsEFEMKernelsHelper.hpp
solidMechanics/SolidMechanicsPoroElasticKernel.hpp
solidMechanics/SolidMechanicsSmallStrainQuasiStaticKernel.hpp
solidMechanics/SolidMechanicsSmallStrainImplicitNewmarkKernel.hpp
Expand Down
Loading