Skip to content

Commit

Permalink
renaming data layout for stress/strain and unifying a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
ryar9534 committed Aug 13, 2024
1 parent 593c275 commit d377570
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
10 changes: 5 additions & 5 deletions src/coreComponents/common/DataLayouts.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,24 +155,24 @@ namespace cells
/// Cell node map permutation when using cuda.
using NODE_MAP_PERMUTATION = RAJA::PERM_JI;

/// Cell strain permutation when using cuda
using STRAIN_PERM = RAJA::PERM_JI;
/// Cell tensor (i.e. average stress and strain) permutation when using cuda
using RANK2_TENSOR_PERM = RAJA::PERM_JI;

#else

/// Cell node map permutation when not using cuda.
using NODE_MAP_PERMUTATION = RAJA::PERM_IJ;

/// Cell strain permutation when not using cuda
using STRAIN_PERM = RAJA::PERM_IJ;
/// Cell tensor (i.e. average stress and strain) permutation when not using cuda
using RANK2_TENSOR_PERM = RAJA::PERM_IJ;

#endif

/// Cell node map unit stride dimension.
static constexpr int NODE_MAP_USD = LvArray::typeManipulation::getStrideOneDimension( NODE_MAP_PERMUTATION {} );

/// Cell strain unit stride dimension
static constexpr int STRAIN_USD = LvArray::typeManipulation::getStrideOneDimension( STRAIN_PERM {} );
static constexpr int RANK2_TENSOR_USD = LvArray::typeManipulation::getStrideOneDimension( RANK2_TENSOR_PERM {} );

} // namespace cells

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ using array2dLayoutIncrDisplacement = array2d< real64, nodes::INCR_DISPLACEMENT_
using arrayView2dLayoutIncrDisplacement = arrayView2d< real64, nodes::INCR_DISPLACEMENT_USD >;
using arrayViewConst2dLayoutIncrDisplacement = arrayView2d< real64 const, nodes::INCR_DISPLACEMENT_USD >;

using array2dLayoutStrain = array2d< real64, cells::STRAIN_PERM >;
using arrayView2dLayoutStrain = arrayView2d< real64, cells::STRAIN_USD >;
using arrayViewConst2dLayoutStrain = arrayView2d< real64 const, cells::STRAIN_USD >;
using array2dLayoutStrain = array2d< real64, cells::RANK2_TENSOR_PERM >;
using arrayView2dLayoutStrain = arrayView2d< real64, cells::RANK2_TENSOR_USD >;
using arrayViewConst2dLayoutStrain = arrayView2d< real64 const, cells::RANK2_TENSOR_USD >;

using array2dLayoutAvgStress = array2d< real64, cells::STRAIN_PERM >;
using arrayView2dLayoutAvgStress = arrayView2d< real64, cells::STRAIN_USD >;
using arrayViewConst2dLayoutAvgStress = arrayView2d< real64 const, cells::STRAIN_USD >;
using array2dLayoutAvgStress = array2d< real64, cells::RANK2_TENSOR_PERM >;
using arrayView2dLayoutAvgStress = arrayView2d< real64, cells::RANK2_TENSOR_USD >;
using arrayViewConst2dLayoutAvgStress = arrayView2d< real64 const, cells::RANK2_TENSOR_USD >;

using array2dLayoutVelocity = array2d< real64, nodes::VELOCITY_PERM >;
using arrayView2dLayoutVelocity = arrayView2d< real64, nodes::VELOCITY_USD >;
Expand Down Expand Up @@ -83,13 +83,13 @@ DECLARE_FIELD( incrementalDisplacement,
WRITE_AND_READ,
"Incremental displacements for the current time step on the nodes" );

DECLARE_FIELD( strain,
"strain",
DECLARE_FIELD( averageStrain,
"averageStrain",
array2dLayoutStrain,
0,
LEVEL_0,
WRITE_AND_READ,
"Average strain in cell" );
"Quadrature averaged strain components in cell" );

DECLARE_FIELD( averageStress,
"averageStress",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ void SolidMechanicsLagrangianFEM::registerDataOnMesh( Group & meshBodies )
{
setConstitutiveNamesCallSuper( subRegion );

subRegion.registerField< solidMechanics::strain >( getName() ).reference().resizeDimension< 1 >( 6 );
subRegion.registerField< solidMechanics::averageStrain >( getName() ).reference().resizeDimension< 1 >( 6 );
subRegion.registerField< solidMechanics::averageStress >( getName() ).reference().resizeDimension< 1 >( 6 );
} );

Expand Down Expand Up @@ -947,7 +947,7 @@ void SolidMechanicsLagrangianFEM::implicitStepComplete( real64 const & GEOS_UNUS

arrayView3d < real64 const, solid::STRESS_USD > const stress = constitutiveRelation.getStress();

solidMechanics::arrayView2dLayoutStrain strain = subRegion.getField< solidMechanics::strain >();
solidMechanics::arrayView2dLayoutStrain avgStrain = subRegion.getField< solidMechanics::averageStrain >();
solidMechanics::arrayView2dLayoutAvgStress avgStress = subRegion.getField< solidMechanics::averageStress >();

finiteElement::FiniteElementBase & subRegionFE = subRegion.template getReference< finiteElement::FiniteElementBase >( this->getDiscretizationName());
Expand All @@ -960,7 +960,7 @@ void SolidMechanicsLagrangianFEM::implicitStepComplete( real64 const & GEOS_UNUS
subRegion,
finiteElement,
disp,
strain );
avgStrain );


AverageStressOverQuadraturePointsKernelFactory::createAndLaunch< CellElementSubRegion, FE_TYPE, parallelDevicePolicy<> >( nodeManager,
Expand Down

0 comments on commit d377570

Please sign in to comment.