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

[Testing] migrating tests part2 #12890

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion applications/CableNetApplication/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ file(GLOB_RECURSE KRATOS_CABLE_NET_APPLICATION_CORE
## CableNet Testing sources
if(${KRATOS_BUILD_TESTING} MATCHES ON)
file(GLOB_RECURSE KRATOS_CABLE_NET_APPLICATION_TESTING_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/tests/*.cpp)
kratos_add_gtests(TARGET KratosCableNetCore SOURCES "${KRATOS_CABLE_NET_APPLICATION_TESTING_SOURCES}" USE_CUSTOM_MAIN)
kratos_add_gtests(TARGET KratosCableNetCore SOURCES "${KRATOS_CABLE_NET_APPLICATION_TESTING_SOURCES}")
endif(${KRATOS_BUILD_TESTING} MATCHES ON)

## CableNet python interface sources
Expand Down
2 changes: 1 addition & 1 deletion applications/ChimeraApplication/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ endif(${KRATOS_BUILD_TESTING} MATCHES ON)
## ChimeraApplication Testing sources
if(${KRATOS_BUILD_TESTING} MATCHES ON)
file(GLOB_RECURSE KRATOS_CHIMERA_APPLICATION_TESTING_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/tests/*.cpp)
kratos_add_gtests(TARGET KratosChimeraApplicationCore SOURCES "${KRATOS_CHIMERA_APPLICATION_TESTING_SOURCES}" USE_CUSTOM_MAIN)
kratos_add_gtests(TARGET KratosChimeraApplicationCore SOURCES "${KRATOS_CHIMERA_APPLICATION_TESTING_SOURCES}")
endif(${KRATOS_BUILD_TESTING} MATCHES ON)

## ChimeraApplication python interface sources
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ file( GLOB_RECURSE KRATOS_COMPRESSIBLE_POTENTIAL_APPLICATION_PYTHON_INTERFACE
## define compressible potential application test sources
if(${KRATOS_BUILD_TESTING} MATCHES ON)
file(GLOB_RECURSE KRATOS_COMPRESSIBLE_POTENTIAL_APPLICATION_TESTING_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/tests/cpp_tests/*.cpp)
kratos_add_gtests(TARGET KratosCompressiblePotentialFlowCore SOURCES "${KRATOS_COMPRESSIBLE_POTENTIAL_APPLICATION_TESTING_SOURCES}" USE_CUSTOM_MAIN)
kratos_add_gtests(TARGET KratosCompressiblePotentialFlowCore SOURCES "${KRATOS_COMPRESSIBLE_POTENTIAL_APPLICATION_TESTING_SOURCES}")
endif(${KRATOS_BUILD_TESTING} MATCHES ON)

add_library(KratosCompressiblePotentialFlowCore SHARED ${KRATOS_COMPRESSIBLE_POTENTIAL_APPLICATION_CORE})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,20 @@
// Kratos default license: kratos/license.txt
//
// Main authors: Richard Faasse
// Carlos A. Roig
//

// External includes
#include <gtest/gtest.h>
#include <gmock/gmock.h>

// Project includes
#include "testing/testing.h"
#include "compressible_potential_flow_application.h"
#include "compressible_potential_flow_fast_suite.h"

int main(int argc, char* argv[])
namespace Kratos::Testing
{
::testing::InitGoogleTest(&argc, argv);

Kratos::Testing::mApplicationInitializerList.push_back([](std::vector<Kratos::KratosApplication::Pointer> & rRegisteredApplications, Kratos::Kernel & rKernel) {
if (!rKernel.IsImported("CompressiblePotentialFlowApplication")) {
auto pApplication = std::make_shared<Kratos::KratosCompressiblePotentialFlowApplication>();
rKernel.ImportApplication(pApplication);
rRegisteredApplications.push_back(std::move(pApplication));
}
});

return RUN_ALL_TESTS();
CompressiblePotentialFlowApplicationFastSuite::CompressiblePotentialFlowApplicationFastSuite()
: KratosCoreFastSuite()
{
mpCompressiblePotentialFlowApp = std::make_shared<KratosCompressiblePotentialFlowApplication>();
this->ImportApplicationIntoKernel(mpCompressiblePotentialFlowApp);
}

} // namespace Kratos::Testing
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

namespace Kratos::Testing {

class KratosCompressiblePotentialFlowFastSuite : public KratosCoreFastSuite {
class CompressiblePotentialFlowApplicationFastSuite : public KratosCoreFastSuite {
public:
KratosCompressiblePotentialFlowFastSuite();
CompressiblePotentialFlowApplicationFastSuite();

private:
KratosCompressiblePotentialFlowApplication::Pointer mpCompressiblePotentialFlowApp;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

// Project includes
#include "containers/model.h"
#include "testing/testing.h"
#include "tests/cpp_tests/compressible_potential_flow_fast_suite.h"
#include "compressible_potential_flow_application_variables.h"
#include "fluid_dynamics_application_variables.h"
#include "custom_elements/compressible_perturbation_potential_flow_element.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

// Project includes
#include "containers/model.h"
#include "testing/testing.h"
#include "tests/cpp_tests/compressible_potential_flow_fast_suite.h"
#include "compressible_potential_flow_application_variables.h"
#include "fluid_dynamics_application_variables.h"
#include "custom_elements/compressible_perturbation_potential_flow_element.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

// Project includes
#include "containers/model.h"
#include "testing/testing.h"
#include "tests/cpp_tests/compressible_potential_flow_fast_suite.h"
#include "compressible_potential_flow_application_variables.h"
#include "fluid_dynamics_application_variables.h"
#include "custom_elements/compressible_potential_flow_element.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

// Project includes
#include "containers/model.h"
#include "testing/testing.h"
#include "tests/cpp_tests/compressible_potential_flow_fast_suite.h"
#include "compressible_potential_flow_application_variables.h"
#include "fluid_dynamics_application_variables.h"
#include "custom_elements/embedded_transonic_perturbation_potential_flow_element.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
//

// Project includes
#include "testing/testing.h"
#include "tests/cpp_tests/compressible_potential_flow_fast_suite.h"
#include "containers/model.h"
#include "includes/model_part.h"
#include "compressible_potential_flow_application_variables.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
//

// Project includes
#include "testing/testing.h"
#include "tests/cpp_tests/compressible_potential_flow_fast_suite.h"
#include "containers/model.h"
#include "includes/model_part.h"
#include "compressible_potential_flow_application_variables.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
//

// Project includes
#include "testing/testing.h"
#include "tests/cpp_tests/compressible_potential_flow_fast_suite.h"
#include "containers/model.h"
#include "includes/model_part.h"
#include "compressible_potential_flow_application_variables.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
//

// Project includes
#include "testing/testing.h"
#include "tests/cpp_tests/compressible_potential_flow_fast_suite.h"
#include "containers/model.h"
#include "includes/model_part.h"
#include "compressible_potential_flow_application_variables.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

// Project includes
#include "containers/model.h"
#include "testing/testing.h"
#include "tests/cpp_tests/compressible_potential_flow_fast_suite.h"
#include "fluid_dynamics_application_variables.h"
#include "compressible_potential_flow_application_variables.h"
#include "custom_operations/potential_to_compressible_navier_stokes_operation.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

// Project includes
#include "containers/model.h"
#include "testing/testing.h"
#include "tests/cpp_tests/compressible_potential_flow_fast_suite.h"
#include "custom_utilities/potential_flow_utilities.h"
#include "compressible_potential_flow_application_variables.h"
#include "fluid_dynamics_application_variables.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

// Project includes
#include "containers/model.h"
#include "testing/testing.h"
#include "tests/cpp_tests/compressible_potential_flow_fast_suite.h"
#include "compressible_potential_flow_application_variables.h"
#include "custom_processes/move_model_part_process.h"
#include "custom_processes/compute_embedded_lift_process.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

// Project includes
#include "containers/model.h"
#include "testing/testing.h"
#include "tests/cpp_tests/compressible_potential_flow_fast_suite.h"
#include "compressible_potential_flow_application_variables.h"
#include "fluid_dynamics_application_variables.h"
#include "custom_elements/transonic_perturbation_potential_flow_element.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

// Project includes
#include "containers/model.h"
#include "testing/testing.h"
#include "tests/cpp_tests/compressible_potential_flow_fast_suite.h"
#include "compressible_potential_flow_application_variables.h"
#include "fluid_dynamics_application_variables.h"
#include "custom_elements/transonic_perturbation_potential_flow_element.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,20 @@
// Kratos default license: kratos/license.txt
//
// Main authors: Richard Faasse
// Carlos A. Roig
//

// External includes
#include <gtest/gtest.h>
#include <gmock/gmock.h>

// Project includes
#include "testing/testing.h"
#include "convection_diffusion_application.h"
#include "convection_diffusion_fast_suite.h"

int main(int argc, char* argv[])
namespace Kratos::Testing
{
::testing::InitGoogleTest(&argc, argv);

Kratos::Testing::mApplicationInitializerList.push_back([](std::vector<Kratos::KratosApplication::Pointer> & rRegisteredApplications, Kratos::Kernel & rKernel) {
if (!rKernel.IsImported("ConvectionDiffusionApplication")) {
auto pApplication = std::make_shared<Kratos::KratosConvectionDiffusionApplication>();
rKernel.ImportApplication(pApplication);
rRegisteredApplications.push_back(std::move(pApplication));
}
});
KratosConvectionDiffusionFastSuite::KratosConvectionDiffusionFastSuite()
: KratosCoreFastSuite()
{
mpConvectionDiffusionApp = std::make_shared<KratosConvectionDiffusionApplication>();
this->ImportApplicationIntoKernel(mpConvectionDiffusionApp);
}

return RUN_ALL_TESTS();
}
} // namespace Kratos::Testing
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

#pragma once

#include "convection_diffusion_application.h"
#include "testing/testing.h"
#include "convection_diffusion_application.h"

namespace Kratos::Testing {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@


// Project includes
#include "testing/testing.h"
#include "tests/cpp_tests/convection_diffusion_fast_suite.h"
#include "containers/model.h"
#include "includes/convection_diffusion_settings.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// External includes

// Project includes
#include "testing/testing.h"
#include "tests/cpp_tests/convection_diffusion_fast_suite.h"
#include "containers/model.h"
#include "includes/convection_diffusion_settings.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// External includes

// Project includes
#include "testing/testing.h"
#include "tests/cpp_tests/convection_diffusion_fast_suite.h"
#include "containers/model.h"
#include "includes/convection_diffusion_settings.h"
#include "includes/variables.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// External includes

// Project includes
#include "testing/testing.h"
#include "tests/cpp_tests/convection_diffusion_fast_suite.h"
#include "containers/model.h"
#include "includes/model_part.h"
#include "includes/model_part_io.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// External includes

// Project includes
#include "testing/testing.h"
#include "tests/cpp_tests/convection_diffusion_fast_suite.h"
#include "containers/model.h"
#include "includes/convection_diffusion_settings.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// External includes

// Project includes
#include "testing/testing.h"
#include "tests/cpp_tests/convection_diffusion_fast_suite.h"
#include "containers/model.h"
#include "includes/convection_diffusion_settings.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// External includes

// Project includes
#include "testing/testing.h"
#include "tests/cpp_tests/convection_diffusion_fast_suite.h"
#include "containers/model.h"
#include "includes/convection_diffusion_settings.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// External includes

// Project includes
#include "testing/testing.h"
#include "tests/cpp_tests/convection_diffusion_fast_suite.h"
#include "containers/model.h"
#include "includes/convection_diffusion_settings.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// External includes

// Project includes
#include "testing/testing.h"
#include "tests/cpp_tests/convection_diffusion_fast_suite.h"
#include "containers/model.h"
#include "includes/convection_diffusion_settings.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// External includes

// Project includes
#include "testing/testing.h"
#include "tests/cpp_tests/convection_diffusion_fast_suite.h"
#include "containers/model.h"
#include "includes/convection_diffusion_settings.h"

Expand Down
21 changes: 12 additions & 9 deletions applications/FluidDynamicsApplication/custom_elements/dpg_vms.h
Original file line number Diff line number Diff line change
Expand Up @@ -450,16 +450,19 @@ class DPGVMS : public VMS<TDim, TNumNodes>
ElementBaseType::CalculateLocalVelocityContribution(rDampingMatrix, rRightHandSideVector, rCurrentProcessInfo);

//compute boundary term
int boundary_nodes = 0;
// int boundary_nodes = 0;
//unsigned int inside_index = -1;
for (unsigned int i = 0; i < TNumNodes; i++)
{
double nd_flag = this->GetGeometry()[i].FastGetSolutionStepValue(FLAG_VARIABLE);
if (nd_flag == 5.0)
boundary_nodes++;
//else
//inside_index = i;
}

// for (unsigned int i = 0; i < TNumNodes; i++)
// {
// double nd_flag = this->GetGeometry()[i].FastGetSolutionStepValue(FLAG_VARIABLE);

// if (nd_flag == 5.0) {
// boundary_nodes++;
// } else {
// inside_index = i;
// }
// }


/* if(boundary_nodes == TDim)
Expand Down
1 change: 0 additions & 1 deletion kratos/tests/test_utilities/test_suite.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ class KratosCoreStressSuite : public KratosCoreFastSuite {};
// This classes are temporal and should be changed. Please see: GeoMechanicsApplication, StructuralMechanicsApplication or TrilinosApplication
// TODO: Remove once every test includes its own suit
class CompressiblePotentialApplicationFastSuite : public KratosCoreFastSuite {};
class KratosConvectionDiffusionFastSuite : public KratosCoreFastSuite {};
class KratosCSharpWrapperApplicationFastSuite : public KratosCoreFastSuite {};
class ExaquteSandboxApplicationFastSuite : public KratosCoreFastSuite {};
class FSIApplicationFastSuite : public KratosCoreFastSuite {};
Expand Down
6 changes: 3 additions & 3 deletions kratos/utilities/enrichment_utilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -1238,7 +1238,7 @@ class EnrichmentUtilities
BoundedMatrix<double, 3, 2 > coord_subdomain; //used to pass arguments when we must calculate areas, shape functions, etc
BoundedMatrix<double,3,2> DN_DX_subdomain; //used to retrieve derivatives

double most_common_sign=0; //the side of the cut in which two nodes are found (same sign) will be the ones that remains unchanged when builing the discontinuity
// double most_common_sign=0; //the side of the cut in which two nodes are found (same sign) will be the ones that remains unchanged when builing the discontinuity
double Area;//area of the complete element
rGPShapeFunctionValues(0,0)=one_third;
rGPShapeFunctionValues(0,1)=one_third;
Expand Down Expand Up @@ -1392,12 +1392,12 @@ class EnrichmentUtilities
if (rDistances[i] < 0.0)
{
exact_distance[i] = -abs_distance[i];
--most_common_sign;
// --most_common_sign;
}
else
{
exact_distance[i] = abs_distance[i];
++most_common_sign;
// ++most_common_sign;
}
}

Expand Down
Loading