Skip to content

Commit

Permalink
Merge pull request #146 from arcaneframework/dev/mab/shorter-test-names
Browse files Browse the repository at this point in the history
Reorg
  • Loading branch information
mohd-afeef-badri authored Jul 23, 2024
2 parents 4ba25b2 + b8d9dfc commit 149a4f3
Show file tree
Hide file tree
Showing 44 changed files with 421 additions and 107 deletions.
8 changes: 4 additions & 4 deletions bilaplacian/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ arcane_generate_axl(Fem)
arcane_add_arcane_libraries_to_target(Bilaplacian)
target_include_directories(Bilaplacian PUBLIC . ../fem ${CMAKE_CURRENT_BINARY_DIR})
configure_file(Bilaplacian.config ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
configure_file(Test.Bilaplacian.internal_pcg.arc ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
configure_file(Test.Bilaplacian.direct.arc ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
configure_file(Test.internal_pcg.arc ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
configure_file(Test.direct.arc ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
configure_file(${MSH_DIR}/bilap.msh ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)

target_link_libraries(Bilaplacian PUBLIC FemUtils)

enable_testing()

add_test(NAME [bilaplacian]direct_solver COMMAND Bilaplacian Test.Bilaplacian.direct.arc)
add_test(NAME [bilaplacian]internal_PCG_solver COMMAND Bilaplacian Test.Bilaplacian.internal_pcg.arc)
add_test(NAME [bilaplacian]direct_solver COMMAND Bilaplacian Test.direct.arc)
#add_test(NAME [bilaplacian]internal_PCG_solver COMMAND Bilaplacian Test.internal_pcg.arc)
51 changes: 50 additions & 1 deletion bilaplacian/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,57 @@ $\int_{\Omega^h}f v_1^h=1\times10^5$

## The code ##

This XML configuration file (e.g `Test.direct.arc`) is used for setting up a Finite Element Method (FEM) simulation in ArcaneFEM. Below is a detailed breakdown of each section in the configuration.

##### Mesh Configuration ######

The mesh configuration section specifies the mesh file to be used in the simulation:

```xml
<meshes>
<mesh>
<filename>bilap.msh</filename>
</mesh>
</meshes>
```

- Defines the mesh file (`bilap.msh`) to be used in the simulation. Note that this file should be compatible with version 4.1 `.msh` format from `Gmsh`.

###### FEM Configuration

```xml
<fem>
<f>-1.0</f>
<enforce-Dirichlet-method>WeakPenalty</enforce-Dirichlet-method>
<penalty>1.e30</penalty>
<dirichlet-boundary-condition>
<surface>boundary</surface>
<value>0.05</value>
</dirichlet-boundary-condition>
<linear-system name="SequentialBasicLinearSystem">
<solver-method>direct</solver-method>
</linear-system>
</fem>
```

- **Source Term (f):** The source term in the partial differential equation (PDE) is set to `-1.0`.
- **Dirichlet Method:** Specifies the method (`WeakPenalty`) for enforcing Dirichlet boundary conditions. And we set the penalty parameter (`1.e30`) for weak enforcement of boundary conditions.
- **Dirichlet Boundary Condition:** Defines the boundary condition on the specified surface (`boundary`) with a given value (`0.05`).
- **Linear System Configuration:** Specifies the linear system settings, including the solver method (`direct`) to be used for solving the FEM problem.



#### Post Process ####

For post processing the `ensight.case` file is outputted, which can be read by PARAVIS. The output is of the $\mathbb{P}_1$ FE order (on nodes).
For post processing the `Mesh0.hdf` file is outputted (in `output/depouillement/vtkhdfv2` folder), which can be read by PARAVIS. The output is of the $\mathbb{P}_1$ FE order (on nodes).

#### Tests available in this module ####

The tests are present in the form of `.arc` files with a prefix `Test.`:

| Name | Dimension | Boundary Condition | Solver | Comment |
| ------------ | --------- | -------------------------------------- | -------------------- | --------------------------------- |
| direct | 2D | Dirichlet only<br />Homogeneous Source | Sequential Direct LU | - Test Weak Penalty method for BC |
| internal_pcg | 2D | Dirichlet only<br />Homogeneous Source | Arcane's PCG solver | |
| | | | | |

File renamed without changes.
File renamed without changes.
26 changes: 13 additions & 13 deletions elasticity/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ arcane_generate_axl(Fem)
arcane_add_arcane_libraries_to_target(Elasticity)
target_include_directories(Elasticity PUBLIC . ../fem ${CMAKE_CURRENT_BINARY_DIR})
configure_file(Elasticity.config ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
configure_file(Test.Elasticity.arc ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
configure_file(Test.Elasticity.traction.arc ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
configure_file(Test.Elasticity.PointDirichlet.arc ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
configure_file(Test.Elasticity.DirichletViaRowElimination.arc ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
configure_file(Test.Elasticity.DirichletViaRowColumnElimination.arc ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
configure_file(Test.bar.arc ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
configure_file(Test.bar.traction.arc ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
configure_file(Test.bar.PointDirichlet.arc ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
configure_file(Test.bar.DirichletViaRowElimination.arc ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
configure_file(Test.bar.DirichletViaRowColumnElimination.arc ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
configure_file(${MSH_DIR}/bar.msh ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)

target_link_libraries(Elasticity PUBLIC FemUtils)
Expand All @@ -25,17 +25,17 @@ enable_testing()
file(COPY "tests/" DESTINATION ${CMAKE_CURRENT_BINARY_DIR})

if(FEMUTILS_HAS_SOLVER_BACKEND_PETSC)
add_test(NAME [elasticity] COMMAND Elasticity Test.Elasticity.arc)
add_test(NAME [elasticity]Dirichlet_traction COMMAND Elasticity Test.Elasticity.traction.arc)
add_test(NAME [elasticity]Dirichlet_pointBC COMMAND Elasticity Test.Elasticity.PointDirichlet.arc)
add_test(NAME [elasticity]Dirichlet_via_RowElimination COMMAND Elasticity Test.Elasticity.DirichletViaRowElimination.arc)
add_test(NAME [elasticity]Dirichlet_via_RowColElimination COMMAND Elasticity Test.Elasticity.DirichletViaRowColumnElimination.arc)
add_test(NAME [elasticity] COMMAND Elasticity Test.bar.arc)
add_test(NAME [elasticity]Dirichlet_traction COMMAND Elasticity Test.bar.traction.arc)
add_test(NAME [elasticity]Dirichlet_pointBC COMMAND Elasticity Test.bar.PointDirichlet.arc)
add_test(NAME [elasticity]Dirichlet_via_RowElimination COMMAND Elasticity Test.bar.DirichletViaRowElimination.arc)
add_test(NAME [elasticity]Dirichlet_via_RowColElimination COMMAND Elasticity Test.bar.DirichletViaRowColumnElimination.arc)
endif()

# If parallel part is available, add some tests
if(FEMUTILS_HAS_PARALLEL_SOLVER AND MPIEXEC_EXECUTABLE)
# Temporarely remove this test because there is a difference on node 37
add_test(NAME [elasticity]parallel_2pe COMMAND ${MPIEXEC_EXECUTABLE} -n 2 ./Elasticity Test.Elasticity.arc)
add_test(NAME [elasticity]parallel_Dirichlet_RowElimination_2pe COMMAND ${MPIEXEC_EXECUTABLE} -n 2 ./Elasticity Test.Elasticity.DirichletViaRowElimination.arc)
add_test(NAME [elasticity]parallel_Dirichlet_RowColElimination_2pe COMMAND ${MPIEXEC_EXECUTABLE} -n 2 ./Elasticity Test.Elasticity.DirichletViaRowColumnElimination.arc)
add_test(NAME [elasticity]parallel_2pe COMMAND ${MPIEXEC_EXECUTABLE} -n 2 ./Elasticity Test.bar.arc)
add_test(NAME [elasticity]parallel_Dirichlet_RowElimination_2pe COMMAND ${MPIEXEC_EXECUTABLE} -n 2 ./Elasticity Test.bar.DirichletViaRowElimination.arc)
add_test(NAME [elasticity]parallel_Dirichlet_RowColElimination_2pe COMMAND ${MPIEXEC_EXECUTABLE} -n 2 ./Elasticity Test.bar.DirichletViaRowColumnElimination.arc)
endif()
102 changes: 101 additions & 1 deletion elasticity/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,108 @@ $$\varepsilon_{ij}(\mathbf{u}) = \frac{1}{2}(\frac{\partial{u}_i}{\partial{x}_j}

## The code ##

This XML configuration file is used for setting up an Elasticity problem simulation in ArcaneFEM. Below is a detailed explanation of each section in the configuration for one of the tests `Test.bar.arc`.

###### Mesh Configuration

The mesh configuration section specifies the mesh file to be used in the simulation:

```xml
<meshes>
<mesh>
<filename>bar.msh</filename>
</mesh>
</meshes>

```

- **Mesh File:** Defines the mesh file (`bar.msh`) to be used in the simulation. Note that this file should be compatible with version 4.1 `.msh` format from `Gmsh`.

###### FEM Configuration

The Finite Element Method (FEM) configuration is provided in the `Test.bar.arc`.

```xml
<fem>
<result-file>test_elasticity_results.txt</result-file>
<E>21.0e5</E>
<nu>0.28</nu>
<f2>-1.0</f2>
<enforce-Dirichlet-method>Penalty</enforce-Dirichlet-method>
<dirichlet-boundary-condition>
<surface>left</surface>
<u1>0.0</u1>
<u2>0.0</u2>
</dirichlet-boundary-condition>
</fem>
```

Let us explain this point wise

- **Result File:** Specifies the file for validation test (OPTIONAL). Use only if you want to compare solutions

```xml
<result-file>test_elasticity_results.txt</result-file>
```

- **Material Properties:** The Young's Modulus (E) for the material, defined as `21.0e5`. The Poisson's Ratio (nu) for the material, defined as `0.28`.

```xml
<E>21.0e5</E>
<nu>0.28</nu>
```

- **Source Term (f2):** The source term in Y direction hence (f2) in the PDE, set to `-1.0`.

```xml
<f2>-1.0</f2>
```

- **Dirichlet Method:** Specifies the method (`Penalty`) for enforcing Dirichlet boundary conditions. And the boundary condition on the specified surface (`left`) with given values for `u1` and `u2`, which we set to 0 since the end is clamped.

```xml
<enforce-Dirichlet-method>Penalty</enforce-Dirichlet-method>
<dirichlet-boundary-condition>
<surface>left</surface>
<u1>0.0</u1>
<u2>0.0</u2>
</dirichlet-boundary-condition>
```

###### Post-Processing Configuration

The post-processing configuration is specified to control how and when results are saved:

```xml
<arcane-post-processing>
<output-period>1</output-period>
<format name="VtkHdfV2PostProcessor" />
<output>
<variable>U</variable>
</output>
</arcane-post-processing>
```

- **Output Period:** Sets the interval at which results are saved.

- **Format:** Specifies the format for the output files (`VtkHdfV2PostProcessor`).

- **Output Variables:** Lists the variables (`U`) which is the displacement vector to be included in the output.



#### Post Process ####

For post processing the `ensight.case` file is output, which can be read by PARAVIS. The output is of the $\mathbb{P}_1$ FE order (on nodes).
For post processing the `Mesh0.hdf` file is outputted (in `output/depouillement/vtkhdfv2` folder), which can be read by PARAVIS. The output is of the $\mathbb{P}_1$ FE order (on nodes).

#### Tests available in this module ####

The tests are present in the form of `.arc` files with a prefix `Test.`:

| Name | Dimension | Boundary Condition | Solver | Comment |
| ------------------------------------ | --------- | ----------------------------------------------------------- | --------------- | ------------------------------------------------------------ |
| bar | 2D | Clamped Dirichlet + Null flux<br />Body force (Source Term) | Default (PETSc) | - Serves as validation test |
| bar.DirichletViaRowElimination | 2D | Clamped Dirichlet + Null flux<br />Body force (Source Term) | PETSc | - Row Elimination for BC<br />- GMRES with ILU(0) Solver |
| bar.DirichletViaRowColumnElimination | 2D | Clamped Dirichlet + Null flux<br />Body force (Source Term) | PETSc | - Row and Column Elimination for BC<br />- CG with AMG Solver |
| bar.traction | 2D | Clamped Dirichlet<br />Traction (Neumann) | Default (PETSc) | |
| | | | | |
File renamed without changes.
File renamed without changes.
File renamed without changes.
24 changes: 12 additions & 12 deletions elastodynamics/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ arcane_generate_axl(Fem)
arcane_add_arcane_libraries_to_target(Elastodynamics)
target_include_directories(Elastodynamics PUBLIC . ../fem ${CMAKE_CURRENT_BINARY_DIR})
configure_file(Elastodynamics.config ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
configure_file(Test.Elastodynamics.arc ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
configure_file(Test.Elastodynamics.pointBC.arc ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
configure_file(Test.Elastodynamics.damping.arc ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
configure_file(Test.Elastodynamics.dirichlet.traction.bodyforce.arc ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
configure_file(Test.Elastodynamics.Galpha.arc ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
configure_file(Test.Elastodynamics.transient-traction.arc ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
configure_file(Test.bar.arc ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
configure_file(Test.semi-circle.pointBC.arc ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
configure_file(Test.bar.damping.arc ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
configure_file(Test.bar.dirichlet.traction.bodyforce.arc ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
configure_file(Test.bar.Galpha.arc ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
configure_file(Test.bar.transient-traction.arc ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
configure_file(traction_bar_test_1.txt ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
configure_file(${MSH_DIR}/bar_dynamic.msh ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
configure_file(${MSH_DIR}/semi-circle.msh ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
Expand All @@ -23,13 +23,13 @@ target_link_libraries(Elastodynamics PUBLIC FemUtils)
enable_testing()

if(FEMUTILS_HAS_SOLVER_BACKEND_PETSC)
add_test(NAME [elastodynamics] COMMAND Elastodynamics Test.Elastodynamics.arc)
add_test(NAME [elastodynamics]transient_traction COMMAND Elastodynamics Test.Elastodynamics.transient-traction.arc)
add_test(NAME [elastodynamics]Dirichlet_pointBc COMMAND Elastodynamics Test.Elastodynamics.pointBC.arc)
add_test(NAME [elastodynamics]constant_traction_and_damping COMMAND Elastodynamics Test.Elastodynamics.damping.arc)
add_test(NAME [elastodynamics]time-discretization_Galpha COMMAND Elastodynamics Test.Elastodynamics.Galpha.arc)
add_test(NAME [elastodynamics] COMMAND Elastodynamics Test.bar.arc)
add_test(NAME [elastodynamics]transient_traction COMMAND Elastodynamics Test.bar.transient-traction.arc)
add_test(NAME [elastodynamics]Dirichlet_pointBc COMMAND Elastodynamics Test.semi-circle.pointBC.arc)
add_test(NAME [elastodynamics]constant_traction_and_damping COMMAND Elastodynamics Test.bar.damping.arc)
add_test(NAME [elastodynamics]time-discretization_Galpha COMMAND Elastodynamics Test.bar.Galpha.arc)
endif()

if(FEMUTILS_HAS_SOLVER_BACKEND_HYPRE)
add_test(NAME [elastodynamics]Dirichlet_traction_bodyforce COMMAND Elastodynamics Test.Elastodynamics.dirichlet.traction.bodyforce.arc)
add_test(NAME [elastodynamics]Dirichlet_traction_bodyforce COMMAND Elastodynamics Test.bar.dirichlet.traction.bodyforce.arc)
endif()
Loading

0 comments on commit 149a4f3

Please sign in to comment.