Skip to content

Commit

Permalink
Added a readme for the test
Browse files Browse the repository at this point in the history
  • Loading branch information
rfaasse committed Feb 20, 2025
1 parent 06e0790 commit 18ea4ea
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Deactivation workflow test with a structural element

This test consists of a single square UPwSmallStrainElement2D4N element with a LinearTrussElement2D2N from the StructuralMechanicsApplication directly attached to the right nodes of the square (no interfaces). It checks the deactivation/activation workflow of the structural element, combined with the `"input_type" : "rest"` option in the second stage.

## Setup

The test is performed in two stages, with the following common conditions for both stages:

- Constraints:
- Displacements in the X-direction are all fixed.
- Displacements in the X- and Y-direction of the bottom nodes are fixed
- The water pressures are fixed to a hydrostatic gradient.

- Material:
- The soil material is elastic according to the GeoLinearElasticPlaneStrain2DLaw.
- The truss material is described by the TrussConstitutiveLaw.

The following staged analysis is performed:
- Stage 1: the truss element is deactivated, meaning the water-pressure induced displacement is the same for both top nodes.
- Stage 2: the truss element is activated and a normal load is applied to the top of the cube. The characteristics of the truss are chosen in such a way that the truss doubles the 'stiffness' of the right side of the cube, yielding half the displacement of the left side.


## Assertions

In the first stage, the truss is deactivated, so the expected y displacements are the same for nodes 3 and 4. In the second stage, the truss is activated and since it's only connected to node 4, the displacement of node 4 is half that of node 3 (the stiffness is doubled due to the truss). Therefore, the expected Y displacements for node 3 (left) are 0.05 and -0.1, and for node 4 (right) 0.05 and -0.05 in stage 1 and 2 respectively.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Begin Elements LinearTrussElement2D2N// GUI group identifier: truss
End Elements

Begin Conditions UPwNormalFaceLoadCondition2D2N// GUI group identifier: NormalLoad
1 0 4 3
1 0 4 3
End Conditions

Begin SubModelPart BottomFixed // Group BottomFixed // Subtree DISPLACEMENT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,15 @@
import glob

import KratosMultiphysics.GeoMechanicsApplication

from KratosMultiphysics.GeoMechanicsApplication.geomechanics_analysis import GeoMechanicsAnalysis

class KratosGeoMechanicsDeactivationWithStructuralTest(KratosUnittest.TestCase):
"""
This class contains a test for a multistage computation with deactivation of structural elements in the first stage
and the use of 'rest' as input type for the second stage.
"""

def test_deactivation_with_structural_element(self):
"""
"""
test_name = 'deactivation_with_structural_element'
project_path = test_helper.get_file_path(test_name)

Expand Down

0 comments on commit 18ea4ea

Please sign in to comment.