Skip to content

Commit

Permalink
Merge branch 'master' into adding-thermomechanical-solver-substepping
Browse files Browse the repository at this point in the history
  • Loading branch information
AlejandroCornejo committed Mar 6, 2024
2 parents 3af3aea + 245da2c commit e29549e
Show file tree
Hide file tree
Showing 21 changed files with 927 additions and 543 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<p align=center><img height="72.125%" width="72.125%" src="https://raw.githubusercontent.com/KratosMultiphysics/Documentation/master/Wiki_files/Home/kratos.png"></p>

[![License][license-image]][license] [![C++][c++-image]][c++standard] [![Github CI][Nightly-Build]][Nightly-link] [![DOI][DOI-image]][DOI] [![GitHub stars][stars-image]][stars] [![Twitter][twitter-image]][twitter]
[![License][license-image]][license] [![C++][c++-image]][c++standard] [![Github CI][Nightly-Build]][Nightly-link] [![DOI][DOI-image]][DOI] [![GitHub stars][stars-image]][stars] [![Twitter][twitter-image]][twitter] [![Youtube][youtube-image]][youtube]

[![Release][release-image]][releases]
<a href="https://github.com/KratosMultiphysics/Kratos/releases/latest"><img src="https://img.shields.io/github/release-date/KratosMultiphysics/Kratos?label="></a>
Expand All @@ -10,7 +10,7 @@
[![PyPI pyversions](https://img.shields.io/pypi/pyversions/KratosMultiphysics.svg)](https://pypi.org/project/KratosMultiphysics/)
[![Downloads](https://pepy.tech/badge/KratosMultiphysics/month)](https://pepy.tech/project/KratosMultiphysics)

[release-image]: https://img.shields.io/badge/release-9.3-green.svg?style=flat
[release-image]: https://img.shields.io/badge/release-9.4-green.svg?style=flat
[releases]: https://github.com/KratosMultiphysics/Kratos/releases

[license-image]: https://img.shields.io/badge/license-BSD-green.svg?style=flat
Expand All @@ -31,6 +31,9 @@
[twitter-image]: https://img.shields.io/twitter/follow/kratosmultiphys.svg?label=Follow&style=social
[twitter]: https://twitter.com/kratosmultiphys

[youtube-image]: https://badges.aleen42.com/src/youtube.svg
[youtube]:https://www.youtube.com/@kratosmultiphysics3578

_KRATOS Multiphysics_ ("Kratos") is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface. More in [Overview](https://github.com/KratosMultiphysics/Kratos/wiki/Overview)

**Kratos** is **free** under BSD-4 [license](https://github.com/KratosMultiphysics/Kratos/wiki/Licence) and can be used even in comercial softwares as it is. Many of its main applications are also free and BSD-4 licensed but each derived application can have its own propietary license.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#import kratos core and applications
import KratosMultiphysics
import KratosMultiphysics.EigenSolversApplication as KratosEigen
import KratosMultiphysics.StructuralMechanicsApplication as KratosStructural
import KratosMultiphysics.DamApplication as KratosDam
import KratosMultiphysics.PoromechanicsApplication as KratosPoro
Expand Down Expand Up @@ -69,7 +68,7 @@ def AddVariables(self):


def GetMinimumBufferSize(self):
return 2;
return 2


def AddDofs(self):
Expand Down
6 changes: 0 additions & 6 deletions applications/EigenSolversApplication/CMakeLists.txt

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ def test_benchmark1_3(self):
reaction_force = [(cauchy_stress_at_load[0][3]+cauchy_stress_at_load[1][3]+cauchy_stress_at_load[2][3])/3*step_size for cauchy_stress_at_load in cauchy_stresses_at_load]
cauchy_stress_tensor[min_distance_idxs]

@KratosUnittest.skip("Test skipped, because it is unreliable. To be enabled after investigation of the root cause.")
def test_benchmark1_4(self):
"""
test 1D consolidation on elastic soil.
Expand Down
5 changes: 2 additions & 3 deletions docs/pages/Kratos/For_Users/How_To_Get_Kratos/Binaries.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
title: Getting Kratos Binaries for Linux
keywords:
keywords:
tags: [Getting-Kratos-Binaries-for-Linux.md]
sidebar: kratos_for_users
summary:
summary:
---

# Pip Install
Expand Down Expand Up @@ -35,7 +35,6 @@ The following Kratos Pakcages ara avaialable
- KratosPoromechanicsApplication;
- KratosFSIApplication;
- KratosSwimmingDEMApplication;
- KratosEigenSolversApplication;
- KratosLinearSolversApplication;
- KratosConstitutiveLawsApplication;
- KratosDelaunayMeshingApplication;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ summary:
**Warning**: This process does not follow the standard Process interface.

This process takes a volume model part (with tetrahedra mesh) and a skin model part (with triangle mesh) and
and calcualtes the distance to the skin for all the elements and nodes of the volume model part using elemental discontinuous distances..
and calculates the distance to the skin for all the elements and nodes of the volume model part using elemental discontinuous distances..

## Parameters & Defaults

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,67 @@ title: Compute Nodal Gradient
keywords: process core
tags: [compute nodal gradient process]
sidebar: kratos_core_processes
summary:
summary: This process is specifically designed for computing nodal gradients based on given input variables.
---

# Compute Nodal Gradient

![](figures/compute_nodal_gradient_process.png)

## Description

## Parameters & Defaults
This process is specifically designed for computing nodal gradients based on given input variables. Calculating gradients at nodes are fundamental in numerous physics simulations such as fluid dynamics, solid mechanics, and more.

Some key factors:

- **Historical vs. Non-Historical Data**: In Kratos, variables can be stored either as "historical," meaning they are associated with a time step, or "non-historical," which are not tied to a specific time step. This process supports both types, making it versatile for various simulation needs.
- **Parallelism**: The code makes extensive use of Kratos's parallel utilities, ensuring that the gradient computation is efficient and scalable across multiple cores or nodes in a **MPI** environment.

### The `ComputeNodalGradientProcess` constructors

- The `ComputeNodalGradientProcess` class is templated on a boolean `TOutputHistorical` to dictate whether the output variables are stored as historical or non-historical data in Kratos. This flexibility allows the process to be used in different contexts where either storage method is preferred.
- The class constructors offer multiple ways to initialize the process, either by passing a `Model` and `Parameters` object or by directly specifying the `ModelPart`, variables for origin, gradient, area, and a flag for non-historical variables.

### Member functions

- `PrepareMemberVariablesFromSettings`: Prepares member variables based on the input parameters.
- `CheckOriginAndAreaVariables`: Checks the existence of the origin and area variables in the model part.
- `ClearGradient`: Initializes or clears the gradient and area values at the start of the computation process.
- `Execute`: The main method that orchestrates the gradient computation by clearing existing gradients, computing elemental contributions, synchronizing the gradients across the model, and finally ponderating the gradient values based on the computed areas.
- `ComputeElementalContributionsAndVolume`: Calculates the contributions to the nodal gradients from each element and the associated nodal volumes.
- `SynchronizeGradientAndVolume`: Ensures that gradient and volume values are correctly synchronized across different parts of the model in a parallel computing context.
- `PonderateGradient`: Normalizes the computed gradients by the nodal areas to finalize the gradient computation.
- `GetDefaultParameters`: Provides a default set of parameters for the process, facilitating user customization and ensuring robust parameter handling.

Only common `Process` methods are available thought python, like `Execute` and `GetDefaultParameters`.

### Utility structures

- `VariableVectorRetriever`: A utility structure to abstract the retrieval of variable values in a manner consistent with whether they are stored historically or non-historically.

## Parameters & Defaults

```json
{
"model_part_name" : "PLEASE_DEFINE_A_MODEL_PART_NAME",
"origin_variable" : "PLEASE_DEFINE_A_VARIABLE",
"gradient_variable" : "PLEASE_DEFINE_A_VARIABLE",
"area_variable" : "NODAL_AREA",
"non_historical_origin_variable" : false
}
```

##### `model_part_name`
Specifies the model part for the process. Absence of a value results in failure due to the default empty string.

##### `origin_variable`
Denotes the variable for applying the process. Variable must be a `double` one.

##### `gradient_variable`
Denotes the variable destination of the process. Variable must be a a 3 components (`array_1d<double, 3>`) one.

##### `area_variable`
Denotes the averaging variable for applying the process, with `NODAL_AREA` set as the default value. Variable must be a `double` one.

##### `non_historical_origin_variable`
Denotes if the input variable is historical or non-historical. Being by default historical, aka `false`.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions kratos/mpi/tests/test_KratosMPICore.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import test_combine_model_part_modeler
from test_model_part_operation_utilities import TestModelPartOperationUtilities
import test_stl_io
import test_compute_nodal_gradient_process

def AssembleTestSuites():
''' Populates the test suites to run.
Expand Down Expand Up @@ -84,6 +85,7 @@ def AssembleTestSuites():
smallSuite.addTest(TestModelPartOperationUtilities("test_Sum"))
smallSuite.addTests(KratosUnittest.TestLoader().loadTestsFromTestCases([test_combine_model_part_modeler.TestCombineModelPartModeler]))
smallSuite.addTests(KratosUnittest.TestLoader().loadTestsFromTestCases([test_stl_io.TestStlIO]))
smallSuite.addTests(KratosUnittest.TestLoader().loadTestsFromTestCases([test_compute_nodal_gradient_process.TestComputeNodalGradientProcessCoarseSphere]))

# Create a test suite with the selected tests plus all small tests
nightSuite = suites['mpi_nightly']
Expand Down
Loading

0 comments on commit e29549e

Please sign in to comment.