Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FluidHyd] FluidDynamicsHydraulicsApplication new application #11894

Merged
merged 3 commits into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/configure.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ set KRATOS_APPLICATIONS=%KRATOS_APPLICATIONS%%KRATOS_APP_DIR%\CableNetApplicatio
set KRATOS_APPLICATIONS=%KRATOS_APPLICATIONS%%KRATOS_APP_DIR%\ConvectionDiffusionApplication;
set KRATOS_APPLICATIONS=%KRATOS_APPLICATIONS%%KRATOS_APP_DIR%\FluidDynamicsApplication;
set KRATOS_APPLICATIONS=%KRATOS_APPLICATIONS%%KRATOS_APP_DIR%\FluidDynamicsBiomedicalApplication;
set KRATOS_APPLICATIONS=%KRATOS_APPLICATIONS%%KRATOS_APP_DIR%\FluidDynamicsHydraulicsApplication;
set KRATOS_APPLICATIONS=%KRATOS_APPLICATIONS%%KRATOS_APP_DIR%\FSIApplication;
set KRATOS_APPLICATIONS=%KRATOS_APPLICATIONS%%KRATOS_APP_DIR%\MeshingApplication;
set KRATOS_APPLICATIONS=%KRATOS_APPLICATIONS%%KRATOS_APP_DIR%\MeshMovingApplication;
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ add_app ${KRATOS_APP_DIR}/LinearSolversApplication;
add_app ${KRATOS_APP_DIR}/StructuralMechanicsApplication;
add_app ${KRATOS_APP_DIR}/FluidDynamicsApplication;
add_app ${KRATOS_APP_DIR}/FluidDynamicsBiomedicalApplication;
add_app ${KRATOS_APP_DIR}/FluidDynamicsHydraulicsApplication;
add_app ${KRATOS_APP_DIR}/MeshMovingApplication;
add_app ${KRATOS_APP_DIR}/DEMApplication;
add_app ${KRATOS_APP_DIR}/CSharpWrapperApplication;
Expand Down
87 changes: 87 additions & 0 deletions applications/FluidDynamicsHydraulicsApplication/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
set(CMAKE_INCLUDE_CURRENT_DIR ON)

message("**** configuring KratosFluidDynamicsHydraulicsApplication ****")

################### PYBIND11
include(pybind11Tools)

include_directories( ${KRATOS_SOURCE_DIR}/kratos )
include_directories( ${KRATOS_SOURCE_DIR}/kratos/applications/FluidDynamicsApplication )

## FluidDynamicsHydraulics Core sources
file( GLOB_RECURSE KRATOS_FLUID_DYNAMICS_HYDRAULICS_APPLICATION_CORE_SOURCES

# application class and variables
${CMAKE_CURRENT_SOURCE_DIR}/fluid_dynamics_hydraulics_application.cpp
${CMAKE_CURRENT_SOURCE_DIR}/fluid_dynamics_hydraulics_application_variables.cpp

# utilities
${CMAKE_CURRENT_SOURCE_DIR}/custom_utilities/*.cpp

)

## FluidDynamicsHydraulics python interface sources
file( GLOB_RECURSE KRATOS_FLUID_DYNAMICS_HYDRAULICS_APPLICATION_PYTHON_INTERFACE
${CMAKE_CURRENT_SOURCE_DIR}/custom_python/*.cpp
)

## FluidDynamicsHydraulics testing sources
if(${KRATOS_BUILD_TESTING} MATCHES ON)
file(GLOB_RECURSE KRATOS_FLUID_DYNAMICS_HYDRAULICS_APPLICATION_TESTING_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/tests/*.cpp)
endif(${KRATOS_BUILD_TESTING} MATCHES ON)

###############################################################################
## FluidDynamicsBiomedicalApplication core library (C++ parts)
add_library(KratosFluidDynamicsHydraulicsCore SHARED ${KRATOS_FLUID_DYNAMICS_HYDRAULICS_APPLICATION_CORE_SOURCES} ${KRATOS_FLUID_DYNAMICS_HYDRAULICS_APPLICATION_TESTING_SOURCES})
target_link_libraries(KratosFluidDynamicsHydraulicsCore PUBLIC KratosCore KratosFluidDynamicsCore)
set_target_properties(KratosFluidDynamicsHydraulicsCore PROPERTIES COMPILE_DEFINITIONS "FLUID_DYNAMICS_HYDRAULICS_APPLICATION=EXPORT,API")

## define library Kratos which defines the basic python interface
pybind11_add_module(KratosFluidDynamicsHydraulicsApplication MODULE THIN_LTO ${KRATOS_FLUID_DYNAMICS_HYDRAULICS_APPLICATION_PYTHON_INTERFACE})
target_link_libraries(KratosFluidDynamicsHydraulicsApplication PRIVATE KratosFluidDynamicsHydraulicsCore)
set_target_properties(KratosFluidDynamicsHydraulicsApplication PROPERTIES PREFIX "")

# Set batch size in the unity build
IF(CMAKE_UNITY_BUILD MATCHES ON)
set_target_properties(KratosFluidDynamicsHydraulicsCore PROPERTIES UNITY_BUILD_BATCH_SIZE ${KRATOS_UNITY_BUILD_BATCH_SIZE})
set_target_properties(KratosFluidDynamicsHydraulicsApplication PROPERTIES UNITY_BUILD_BATCH_SIZE ${KRATOS_UNITY_BUILD_BATCH_SIZE})
ENDIF(CMAKE_UNITY_BUILD MATCHES ON)

###############################################################################
# changing the .dll suffix to .pyd (Windows)
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set_target_properties(KratosFluidDynamicsHydraulicsApplication PROPERTIES SUFFIX .pyd)
endif(${CMAKE_SYSTEM_NAME} MATCHES "Windows")

# changing the .dylib suffix to .so (OS X)
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set_target_properties(KratosFluidDynamicsHydraulicsApplication PROPERTIES SUFFIX .so)
endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")

# Add to the KratosMultiphisics Python module
kratos_python_install(${INSTALL_PYTHON_USING_LINKS} ${CMAKE_CURRENT_SOURCE_DIR}/FluidDynamicsHydraulicsApplication.py KratosMultiphysics/FluidDynamicsHydraulicsApplication/__init__.py )
kratos_python_install(${INSTALL_PYTHON_USING_LINKS} ${CMAKE_CURRENT_SOURCE_DIR}/python_registry_lists.py KratosMultiphysics/FluidDynamicsHydraulicsApplication/python_registry_lists.py )

# Install python files
get_filename_component (CURRENT_DIR_NAME ${CMAKE_CURRENT_SOURCE_DIR} NAME)
kratos_python_install_directory(${INSTALL_PYTHON_USING_LINKS} ${CMAKE_CURRENT_SOURCE_DIR}/python_scripts KratosMultiphysics/${CURRENT_DIR_NAME} )

# Kratos Testing. Install everything except sources to ensure that reference and configuration files are copied.
if(${INSTALL_TESTING_FILES} MATCHES ON )
get_filename_component (CURRENT_DIR_NAME ${CMAKE_CURRENT_SOURCE_DIR} NAME)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tests DESTINATION applications/${CURRENT_DIR_NAME}
PATTERN "*.git" EXCLUDE
PATTERN "*.c" EXCLUDE
PATTERN "*.h" EXCLUDE
PATTERN "*.cpp" EXCLUDE
PATTERN "*.hpp" EXCLUDE
)
endif(${INSTALL_TESTING_FILES} MATCHES ON)

# Install targets
install(TARGETS KratosFluidDynamicsHydraulicsCore DESTINATION libs )
install(TARGETS KratosFluidDynamicsHydraulicsApplication DESTINATION libs )

# Define custom targets
set(KRATOS_KERNEL "${KRATOS_KERNEL};KratosFluidDynamicsHydraulicsCore" PARENT_SCOPE)
set(KRATOS_PYTHON_INTERFACE "${KRATOS_PYTHON_INTERFACE};KratosFluidDynamicsHydraulicsApplication" PARENT_SCOPE)
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Application dependent names and paths
from KratosMultiphysics import _ImportApplication, python_registry_utilities
from KratosFluidDynamicsHydraulicsApplication import *

application = KratosFluidDynamicsHydraulicsApplication()
application_name = "KratosFluidDynamicsHydraulicsApplication"

_ImportApplication(application, application_name)

from . import python_registry_lists
python_registry_utilities.RegisterModelersList("KratosMultiphysics.FluidDynamicsHydraulicsApplication", python_registry_lists)
python_registry_utilities.RegisterOperationsList("KratosMultiphysics.FluidDynamicsHydraulicsApplication", python_registry_lists)
python_registry_utilities.RegisterProcessesList("KratosMultiphysics.FluidDynamicsHydraulicsApplication", python_registry_lists)
9 changes: 9 additions & 0 deletions applications/FluidDynamicsHydraulicsApplication/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
## Fluid Dynamics Hydraulics Application

The Fluid Dynamics Hydraulics Application contains the Computational Fluid Dynamics (CFD) developments within Kratos Multiphysics to be applied to hydraulic problems.

### Features:

- This application derives from the base Fluid Dynamics Application

- (to be added soon...)
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// | / |
// ' / __| _` | __| _ \ __|
// . \ | ( | | ( |\__ `
// _|\_\_| \__,_|\__|\___/ ____/
// Multi-Physics
//
// License: BSD License
// Kratos default license: kratos/license.txt
//
// Main authors: Ruben Zorrilla
//


// System includes

// External includes

// Project includes
#include "includes/define.h"
#include "custom_python/add_custom_utilities_to_python.h"


namespace Kratos::Python {

void AddCustomUtilitiesToPython(pybind11::module& m)
{
namespace py = pybind11;

}

} // namespace Kratos::Python
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// | / |
// ' / __| _` | __| _ \ __|
// . \ | ( | | ( |\__ `
// _|\_\_| \__,_|\__|\___/ ____/
// Multi-Physics
//
// License: BSD License
// Kratos default license: kratos/license.txt
//
// Main authors: Ruben Zorrilla
//

#pragma once

// System includes


// External includes


// Project includes
#include "includes/define_python.h"


namespace Kratos::Python {

void AddCustomUtilitiesToPython(pybind11::module& m);

} // namespace Kratos::Python
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// | / |
// ' / __| _` | __| _ \ __|
// . \ | ( | | ( |\__ `
// _|\_\_| \__,_|\__|\___/ ____/
// Multi-Physics
//
// License: BSD License
// Kratos default license: kratos/license.txt
//
// Main authors: Ruben Zorrilla
//


// System includes

// External includes

// Project includes
#include "includes/define_python.h"
#include "fluid_dynamics_hydraulics_application.h"
#include "fluid_dynamics_hydraulics_application_variables.h"
#include "custom_python/add_custom_utilities_to_python.h"


namespace Kratos::Python {

PYBIND11_MODULE(KratosFluidDynamicsHydraulicsApplication,m)
{
namespace py = pybind11;

py::class_<KratosFluidDynamicsHydraulicsApplication,
KratosFluidDynamicsHydraulicsApplication::Pointer,
KratosApplication>(m, "KratosFluidDynamicsHydraulicsApplication")
.def(py::init<>())
;

AddCustomUtilitiesToPython(m);

//registering variables in python

// KRATOS_REGISTER_IN_PYTHON_VARIABLE(NODAL_AREA);

}

} // namespace Kratos::Python
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// | / |
// ' / __| _` | __| _ \ __|
// . \ | ( | | ( |\__ `
// _|\_\_| \__,_|\__|\___/ ____/
// Multi-Physics
//
// License: BSD License
// Kratos default license: kratos/license.txt
//
// Main authors: Ruben Zorrilla
//


// System includes


// External includes


// Project includes
#include "fluid_dynamics_hydraulics_application.h"
#include "fluid_dynamics_hydraulics_application_variables.h"


namespace Kratos {

KratosFluidDynamicsHydraulicsApplication::KratosFluidDynamicsHydraulicsApplication():
KratosApplication("FluidDynamicsHydraulicsApplication")
{}

void KratosFluidDynamicsHydraulicsApplication::Register()
{
KRATOS_INFO("") << "Initializing KratosFluidDynamicsHydraulicsApplication..." << std::endl;


}

} // namespace Kratos.
Loading
Loading