Skip to content

Commit 5ebe48a

Browse files
Merge pull request #14369 from KratosMultiphysics/trilinos/minor-clean-up
[TrilinosApplication] Minor clean-up
2 parents f9341de + 89ec5ea commit 5ebe48a

5 files changed

Lines changed: 40 additions & 15 deletions

File tree

applications/TrilinosApplication/CMakeLists.txt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,32 @@ file(GLOB_RECURSE KRATOS_TRILINOS_PYTHON_INTERFACE_SOURCES
6262
${CMAKE_CURRENT_SOURCE_DIR}/custom_python/*.cpp
6363
)
6464

65+
# Adding Tpetra definitions
66+
if(HAVE_TPETRA)
67+
add_definitions(-DHAVE_TPETRA)
68+
endif()
69+
6570
## Kratos tests sources. Enabled by default
6671
if(${KRATOS_BUILD_TESTING} MATCHES ON)
6772
file(GLOB_RECURSE KRATOS_TRILINOS_TEST_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/tests/cpp_tests/*.cpp)
6873
kratos_add_gtests(TARGET KratosTrilinosCore SOURCES "${KRATOS_TRILINOS_TEST_SOURCES}" USE_MPI)
6974
endif(${KRATOS_BUILD_TESTING} MATCHES ON)
7075

76+
## Kratos benchmark sources. Disabled by default
77+
if(${KRATOS_BUILD_BENCHMARK} MATCHES ON)
78+
file(GLOB_RECURSE KRATOS_BENCHMARK_SOURCES
79+
${CMAKE_CURRENT_SOURCE_DIR}/benchmarks/*.cpp
80+
)
81+
82+
foreach(file ${KRATOS_BENCHMARK_SOURCES})
83+
get_filename_component(filename ${file} NAME_WE)
84+
add_executable(${filename} ${file})
85+
target_link_libraries(${filename} PUBLIC KratosTrilinosCore benchmark::benchmark)
86+
set_target_properties(${filename} PROPERTIES COMPILE_DEFINITIONS "KRATOS_BENCHMARK=IMPORT,API")
87+
install(TARGETS ${filename} DESTINATION benchmark)
88+
endforeach(file ${KRATOS_BENCHMARK_SOURCES})
89+
endif(${KRATOS_BUILD_BENCHMARK} MATCHES ON)
90+
7191
# ###############################################################
7292
## TrilinosApplication core library (C++ parts)
7393
set(TRILINOS_LINK_LIBS KratosCore KratosMPICore ${TRILINOS_LIBRARIES})

applications/TrilinosApplication/tests/cpp_tests/trilinos_cpp_test_utilities.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ class TrilinosCPPTestUtilities
4646
using TrilinosSparseSpaceType = TrilinosSpace<Epetra_FECrsMatrix, Epetra_FEVector>;
4747
using TrilinosLocalSpaceType = UblasSpace<double, Matrix, Vector>;
4848

49+
/// Trilinos definitions
4950
using TrilinosSparseMatrixType = TrilinosSparseSpaceType::MatrixType;
5051
using TrilinosVectorType = TrilinosSparseSpaceType::VectorType;
5152

applications/TrilinosApplication/trilinos_application.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
// | || | | | | | | | | (_) \__
55
// |_||_| |_|_|_|_| |_|\___/|___/ APPLICATION
66
//
7-
// License: BSD License
8-
// Kratos default license: kratos/license.txt
7+
// License: BSD License
8+
// Kratos default license: kratos/license.txt
99
//
1010
// Main authors: Riccardo Rossi
1111
//

applications/TrilinosApplication/trilinos_application.h

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@
44
// | || | | | | | | | | (_) \__
55
// |_||_| |_|_|_|_| |_|\___/|___/ APPLICATION
66
//
7-
// License: BSD License
8-
// Kratos default license: kratos/license.txt
7+
// License: BSD License
8+
// Kratos default license: kratos/license.txt
99
//
1010
// Main authors: Riccardo Rossi
1111
//
1212

13-
#if !defined(KRATOS_TRILINOS_APPLICATION_H_INCLUDED)
14-
#define KRATOS_TRILINOS_APPLICATION_H_INCLUDED
13+
#pragma once
1514

1615
// System includes
1716

@@ -44,8 +43,11 @@ namespace Kratos {
4443
///@name Kratos Classes
4544
///@{
4645

47-
/// Short class definition.
48-
/** Detail class definition.
46+
/**
47+
* @class KratosTrilinosApplication
48+
* @ingroup TrilinosApplication
49+
* @brief This Application is used to interface with Trilinos
50+
* @details The TrilinosApplication is the application used to interface with Trilinos. It is used to create the linear solvers and preconditioners that are available in Trilinos. The application is designed to be as general as possible, so that it can be used with any of the Trilinos packages. The application is designed to be used with the TrilinosApplicationFactory, which is used to create the linear solvers and preconditioners that are available in Trilinos. The application is designed to be used with the TrilinosApplicationFactory, which is used to create the linear solvers and preconditioners that are available in Trilinos. The application is designed to be used with the TrilinosApplicationFactory, which is used to create the linear solvers and preconditioners that are available in Trilinos. The application is designed to be used with the TrilinosApplicationFactory, which is used to create the linear solvers and preconditioners that are available in Trilinos.
4951
*/
5052
class KRATOS_API(TRILINOS_APPLICATION) KratosTrilinosApplication : public KratosApplication {
5153
public:
@@ -73,6 +75,10 @@ class KRATOS_API(TRILINOS_APPLICATION) KratosTrilinosApplication : public Kratos
7375
///@name Operations
7476
///@{
7577

78+
/**
79+
* @brief This method is used to register specific application components.
80+
* @details This method is used to register the Trilinos linear solvers.
81+
*/
7682
void Register() override;
7783

7884
///@}
@@ -199,5 +205,3 @@ class KRATOS_API(TRILINOS_APPLICATION) KratosTrilinosApplication : public Kratos
199205
///@}
200206

201207
} // namespace Kratos.
202-
203-
#endif // KRATOS_TRILINOS_APPLICATION_H_INCLUDED defined

applications/TrilinosApplication/trilinos_space.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
// | / |
2-
// ' / __| _` | __| _ \ __|
3-
// . \ | ( | | ( |\__ `
4-
// _|\_\_| \__,_|\__|\___/ ____/
5-
// Multi-Physics
1+
// KRATOS _____ _ _ _
2+
// |_ _| __(_) (_)_ __ ___ ___
3+
// | || '__| | | | '_ \ / _ \/ __|
4+
// | || | | | | | | | | (_) \__
5+
// |_||_| |_|_|_|_| |_|\___/|___/ APPLICATION
66
//
77
// License: BSD License
88
// Kratos default license: kratos/license.txt

0 commit comments

Comments
 (0)