Commit 0365ad3d authored by DIAZ Jerome's avatar DIAZ Jerome Committed by GILLES Sebastien

#1520 Added a test on each topology for the coordinates of the quadrature...

#1520 Added a test on each topology for the coordinates of the quadrature points computed using reference elements for the mesh inputs.
parent 16a1820a
Geometry file
Geometry file
node id assign
element id assign
coordinates
2
0.00000e+00 0.00000e+00 0.00000e+00
1.00000e+00 0.00000e+00 0.00000e+00
part 1
MeshLabel_1
bar2
1
1 2
MeshVersionFormatted 2
Dimension
2
Vertices
3
0 0 100
1 0 101
0 1 102
Edges
3
1 2 2
2 3 3
3 1 4
Triangles
1
1 2 3 1
End
......@@ -12,8 +12,8 @@
*/
#ifndef MOREFEM_x_OPERATOR_INSTANCES_x_PARAMETER_OPERATOR_x_WRITE_AT_QUAD_POINT_HPP_
# define MOREFEM_x_OPERATOR_INSTANCES_x_PARAMETER_OPERATOR_x_WRITE_AT_QUAD_POINT_HPP_
#ifndef MOREFEM_x_OPERATOR_INSTANCES_x_PARAMETER_OPERATOR_x_GLOBAL_COORDS_QUAD_POINTS_HPP_
# define MOREFEM_x_OPERATOR_INSTANCES_x_PARAMETER_OPERATOR_x_GLOBAL_COORDS_QUAD_POINTS_HPP_
# include "Parameters/Parameter.hpp"
# include "Parameters/InitParameterFromInputData/InitParameterFromInputData.hpp"
......@@ -118,7 +118,7 @@ namespace MoReFEM
/*!
* \brief Only defined to respect the generic interface expected by the parent, it is not used as there is
* no extraction of data from a global to a local level needed for this class.
*
*
* \param[in] local_operator Local operator in charge of the elementary computation. A mutable work
* variable is actually set in this call.
* \param[in] local_felt_space List of finite elements being considered; all those related to the
......@@ -146,4 +146,4 @@ namespace MoReFEM
# include "OperatorInstances/ParameterOperator//GlobalCoordsQuadPoints.hxx"
#endif // MOREFEM_x_OPERATOR_INSTANCES_x_PARAMETER_OPERATOR_x_WRITE_AT_QUAD_POINT_HPP_
#endif // MOREFEM_x_OPERATOR_INSTANCES_x_PARAMETER_OPERATOR_x_GLOBAL_COORDS_QUAD_POINTS_HPP_
......@@ -12,8 +12,8 @@
*/
#ifndef MOREFEM_x_OPERATOR_INSTANCES_x_PARAMETER_OPERATOR_x_WRITE_AT_QUAD_POINT_HXX_
# define MOREFEM_x_OPERATOR_INSTANCES_x_PARAMETER_OPERATOR_x_WRITE_AT_QUAD_POINT_HXX_
#ifndef MOREFEM_x_OPERATOR_INSTANCES_x_PARAMETER_OPERATOR_x_GLOBAL_COORDS_QUAD_POINTS_HXX_
# define MOREFEM_x_OPERATOR_INSTANCES_x_PARAMETER_OPERATOR_x_GLOBAL_COORDS_QUAD_POINTS_HXX_
namespace MoReFEM
......@@ -49,4 +49,4 @@ namespace MoReFEM
/// @} // addtogroup OperatorInstancesGroup
#endif // MOREFEM_x_OPERATOR_INSTANCES_x_PARAMETER_OPERATOR_x_WRITE_AT_QUAD_POINT_HXX_
#endif // MOREFEM_x_OPERATOR_INSTANCES_x_PARAMETER_OPERATOR_x_GLOBAL_COORDS_QUAD_POINTS_HXX_
......@@ -12,8 +12,8 @@
*/
#ifndef MOREFEM_x_OPERATOR_INSTANCES_x_PARAMETER_OPERATOR_x_LOCAL_x_WRITE_AT_QUAD_POINT_HPP_
# define MOREFEM_x_OPERATOR_INSTANCES_x_PARAMETER_OPERATOR_x_LOCAL_x_WRITE_AT_QUAD_POINT_HPP_
#ifndef MOREFEM_x_OPERATOR_INSTANCES_x_PARAMETER_OPERATOR_x_LOCAL_x_GLOBAL_COORDS_QUAD_POINTS_HPP_
# define MOREFEM_x_OPERATOR_INSTANCES_x_PARAMETER_OPERATOR_x_LOCAL_x_GLOBAL_COORDS_QUAD_POINTS_HPP_
# include "Utilities/LinearAlgebra/Storage/Local/LocalMatrixStorage.hpp"
# include "Utilities/LinearAlgebra/Storage/Local/LocalVectorStorage.hpp"
......@@ -33,7 +33,7 @@ namespace MoReFEM
/*!
* \brief Implementation of local \a GlobalCoordsQuadPoints operator.
* \brief Implementation of local \a GlobalCoordsQuadPoints operator.
* This local operator is in charge of computing the global coordinates of each quadrature point.
*/
class GlobalCoordsQuadPoints final
......@@ -116,4 +116,4 @@ namespace MoReFEM
# include "OperatorInstances/ParameterOperator/Local/GlobalCoordsQuadPoints.hxx"
#endif // MOREFEM_x_OPERATOR_INSTANCES_x_PARAMETER_OPERATOR_x_LOCAL_x_WRITE_AT_QUAD_POINT_HPP_
#endif // MOREFEM_x_OPERATOR_INSTANCES_x_PARAMETER_OPERATOR_x_LOCAL_x_GLOBAL_COORDS_QUAD_POINTS_HPP_
......@@ -12,8 +12,8 @@
*/
#ifndef MOREFEM_x_OPERATOR_INSTANCES_x_PARAMETER_OPERATOR_x_LOCAL_x_WRITE_AT_QUAD_POINT_HXX_
# define MOREFEM_x_OPERATOR_INSTANCES_x_PARAMETER_OPERATOR_x_LOCAL_x_WRITE_AT_QUAD_POINT_HXX_
#ifndef MOREFEM_x_OPERATOR_INSTANCES_x_PARAMETER_OPERATOR_x_LOCAL_x_GLOBAL_COORDS_QUAD_POINTS_HXX_
# define MOREFEM_x_OPERATOR_INSTANCES_x_PARAMETER_OPERATOR_x_LOCAL_x_GLOBAL_COORDS_QUAD_POINTS_HXX_
namespace MoReFEM
......@@ -33,4 +33,4 @@ namespace MoReFEM
/// @} // addtogroup OperatorInstancesGroup
#endif // MOREFEM_x_OPERATOR_INSTANCES_x_PARAMETER_OPERATOR_x_LOCAL_x_WRITE_AT_QUAD_POINT_HXX_
#endif // MOREFEM_x_OPERATOR_INSTANCES_x_PARAMETER_OPERATOR_x_LOCAL_x_GLOBAL_COORDS_QUAD_POINTS_HXX_
......@@ -235,7 +235,7 @@ namespace MoReFEM
for (unsigned int i = 0u; i < Nquadrature_point; ++i)
{
out << geom_elt_index << ';' << quadrature_rule_name << '_'
<< i << ';' << value_per_quad_pt[i].last_update_index << ';';
<< i << ';' << value_per_quad_pt[i].last_update_index << ';';
if constexpr (TypeT == ParameterNS::Type::scalar)
out << std::setw(12) << std::scientific << std::setprecision(5) << value_per_quad_pt[i].value;
......@@ -243,11 +243,9 @@ namespace MoReFEM
// To get rid of the braces "{ }" of the xtensor output and have more control over the precision.
if constexpr (TypeT == ParameterNS::Type::vector)
{
auto separator = Utilities::EmptyString();
for (const auto vector_value : value_per_quad_pt[i].value)
{
out << separator << std::setw(12) << std::scientific << std::setprecision(5) << vector_value;
separator = ',';
out << std::setw(12) << std::scientific << std::setprecision(5) << vector_value;
}
}
......
This diff is collapsed.
This diff is collapsed.
......@@ -3,3 +3,4 @@ include(${CMAKE_CURRENT_LIST_DIR}/NonConformInterpolator/CMakeLists.txt)
include(${CMAKE_CURRENT_LIST_DIR}/P1_to_HigherOrder/CMakeLists.txt)
include(${CMAKE_CURRENT_LIST_DIR}/TestFunctions/CMakeLists.txt)
include(${CMAKE_CURRENT_LIST_DIR}/VariationalInstances/CMakeLists.txt)
include(${CMAKE_CURRENT_LIST_DIR}/ParameterOperator/CMakeLists.txt)
include(${CMAKE_CURRENT_LIST_DIR}/GlobalCoordsQuadPts/CMakeLists.txt)
\ No newline at end of file
add_library(MoReFEMTestGlobalCoordsQuadPts_lib ${LIBRARY_TYPE} "")
target_sources(MoReFEMTestGlobalCoordsQuadPts_lib
PRIVATE
${CMAKE_CURRENT_LIST_DIR}/InputData.hpp
${CMAKE_CURRENT_LIST_DIR}/Model.cpp
${CMAKE_CURRENT_LIST_DIR}/Model.hpp
${CMAKE_CURRENT_LIST_DIR}/Model.hxx
)
target_link_libraries(MoReFEMTestGlobalCoordsQuadPts_lib
${MOREFEM_TEST_TOOLS})
add_executable(MoReFEMTestGlobalCoordsQuadPts3DTetra ${CMAKE_CURRENT_LIST_DIR}/main_3D_tetra.cpp)
target_link_libraries(MoReFEMTestGlobalCoordsQuadPts3DTetra MoReFEMTestGlobalCoordsQuadPts_lib)
add_executable(MoReFEMTestGlobalCoordsQuadPts3DHexa ${CMAKE_CURRENT_LIST_DIR}/main_3D_hexa.cpp)
target_link_libraries(MoReFEMTestGlobalCoordsQuadPts3DHexa MoReFEMTestGlobalCoordsQuadPts_lib)
add_executable(MoReFEMTestGlobalCoordsQuadPts2DTriangle ${CMAKE_CURRENT_LIST_DIR}/main_2D_triangle.cpp)
target_link_libraries(MoReFEMTestGlobalCoordsQuadPts2DTriangle MoReFEMTestGlobalCoordsQuadPts_lib)
add_executable(MoReFEMTestGlobalCoordsQuadPts2DQuad ${CMAKE_CURRENT_LIST_DIR}/main_2D_quad.cpp)
target_link_libraries(MoReFEMTestGlobalCoordsQuadPts2DQuad MoReFEMTestGlobalCoordsQuadPts_lib)
add_executable(MoReFEMTestGlobalCoordsQuadPts1D ${CMAKE_CURRENT_LIST_DIR}/main_1D.cpp)
target_link_libraries(MoReFEMTestGlobalCoordsQuadPts1D MoReFEMTestGlobalCoordsQuadPts_lib)
add_test(GlobalCoordsQuadPts3DTetra
MoReFEMTestGlobalCoordsQuadPts3DTetra
--
${MOREFEM_ROOT}
${MOREFEM_TEST_OUTPUT_DIR})
set_tests_properties(GlobalCoordsQuadPts3DTetra PROPERTIES TIMEOUT 20)
add_test(GlobalCoordsQuadPts3DHexa
MoReFEMTestGlobalCoordsQuadPts3DHexa
--
${MOREFEM_ROOT}
${MOREFEM_TEST_OUTPUT_DIR})
set_tests_properties(GlobalCoordsQuadPts3DHexa PROPERTIES TIMEOUT 20)
add_test(GlobalCoordsQuadPts2DTriangle
MoReFEMTestGlobalCoordsQuadPts2DTriangle
--
${MOREFEM_ROOT}
${MOREFEM_TEST_OUTPUT_DIR})
set_tests_properties(GlobalCoordsQuadPts2DTriangle PROPERTIES TIMEOUT 20)
add_test(GlobalCoordsQuadPts2DQuad
MoReFEMTestGlobalCoordsQuadPts2DQuad
--
${MOREFEM_ROOT}
${MOREFEM_TEST_OUTPUT_DIR})
set_tests_properties(GlobalCoordsQuadPts2DQuad PROPERTIES TIMEOUT 20)
add_test(GlobalCoordsQuadPts1D
MoReFEMTestGlobalCoordsQuadPts1D
--
${MOREFEM_ROOT}
${MOREFEM_TEST_OUTPUT_DIR})
set_tests_properties(GlobalCoordsQuadPts1D PROPERTIES TIMEOUT 20)
/*!
// \file
//
//
// Created by Jérôme Diaz <jerome.diaz@inria.fr> on the Wed, 6 June 2020 +0100
// Copyright (c) Inria. All rights reserved.
//
*/
#ifndef MOREFEM_x_TEST_x_OPERATORS_x_PARAMETER_OPERATOR_x_GLOBAL_COORDS_QUAD_PTS_x_INPUT_DATA_HPP_
# define MOREFEM_x_TEST_x_OPERATORS_x_PARAMETER_OPERATOR_x_GLOBAL_COORDS_QUAD_PTS_x_INPUT_DATA_HPP_
# include "Utilities/Containers/EnumClass.hpp"
# include "Core/MoReFEMData/MoReFEMData.hpp"
# include "Core/InputData/Instances/Geometry/Domain.hpp"
# include "Core/InputData/Instances/FElt/FEltSpace.hpp"
# include "Core/InputData/Instances/FElt/Unknown.hpp"
# include "Core/InputData/Instances/FElt/NumberingSubset.hpp"
# include "Core/InputData/Instances/Parameter/Fiber/Fiber.hpp"
# include "Core/InputData/Instances/Parameter/Source/ScalarTransientSource.hpp"
# include "Core/InputData/Instances/Parameter/Solid/Solid.hpp"
# include "Core/InputData/Instances/Parameter/Fluid/Fluid.hpp"
# include "Core/InputData/Instances/Reaction/MitchellSchaeffer.hpp"
# include "Core/InputData/Instances/InitialConditionGate.hpp"
namespace MoReFEM
{
namespace TestNS::GlobalCoordsQuadPt
{
//! \copydoc doxygen_hide_mesh_enum
enum class MeshIndex
{
mesh = 1
};
//! \copydoc doxygen_hide_domain_enum
enum class DomainIndex
{
domain = 1u
};
//! \copydoc doxygen_hide_felt_space_enum
enum class FEltSpaceIndex
{
felt_space = 1u
};
//! \copydoc doxygen_hide_unknown_enum
enum class UnknownIndex
{
generic_unknown = 1u
};
//! \copydoc doxygen_hide_numbering_subset_enum
enum class NumberingSubsetIndex
{
generic_numbering_subset = 1u
};
//! \copydoc doxygen_hide_solver_enum
enum class SolverIndex
{
solver = 1u
};
//! \copydoc doxygen_hide_input_data_tuple
using InputDataTuple = std::tuple
<
InputDataNS::TimeManager,
InputDataNS::NumberingSubset<EnumUnderlyingType(NumberingSubsetIndex::generic_numbering_subset)>,
InputDataNS::Unknown<EnumUnderlyingType(UnknownIndex::generic_unknown)>,
InputDataNS::Mesh<EnumUnderlyingType(MeshIndex::mesh)>,
InputDataNS::Domain<EnumUnderlyingType(DomainIndex::domain)>,
InputDataNS::FEltSpace<EnumUnderlyingType(FEltSpaceIndex::felt_space)>,
InputDataNS::Petsc<EnumUnderlyingType(SolverIndex::solver)>,
InputDataNS::Result
>;
//! \copydoc doxygen_hide_model_specific_input_data
using InputData = InputData<InputDataTuple>;
//! \copydoc doxygen_hide_morefem_data_type
using morefem_data_type = MoReFEMData<InputData, program_type::test>;
} // namespace TestNS::GlobalCoordsQuadPt
} // namespace MoReFEM
#endif // MOREFEM_x_TEST_x_OPERATORS_x_PARAMETER_OPERATOR_x_GLOBAL_COORDS_QUAD_PTS_x_INPUT_DATA_HPP_
/*!
// \file
//
//
// Created by Jérôme Diaz <jerome.diaz@inria.fr> on the Wed, 6 June 2020 16:00:22 +0100
// Copyright (c) Inria. All rights reserved.
//
*/
#ifndef MOREFEM_x_TEST_x_OPERATORS_x_PARAMETER_OPERATOR_x_GLOBAL_COORDS_QUAD_PTS_x_MODEL_HPP_
# define MOREFEM_x_TEST_x_OPERATORS_x_PARAMETER_OPERATOR_x_GLOBAL_COORDS_QUAD_PTS_x_MODEL_HPP_
# include <memory>
# include <vector>
# include "Utilities/TimeKeep/TimeKeep.hpp"
# include "OperatorInstances/ParameterOperator/GlobalCoordsQuadPoints.hpp"
# include "Model/Model.hpp"
# include "Test/Operators/ParameterOperator/GlobalCoordsQuadPts/InputData.hpp"
namespace MoReFEM::TestNS::GlobalCoordsQuadPt
{
//! \copydoc doxygen_hide_model_4_test
class Model
: public MoReFEM::Model
<
Model,
morefem_data_type,
DoConsiderProcessorWiseLocal2Global::yes
>
{
private:
//! \copydoc doxygen_hide_alias_self
using self = Model;
//! Convenient alias.
using parent = MoReFEM::Model<Model, morefem_data_type, DoConsiderProcessorWiseLocal2Global::yes>;
public:
//! Return the name of the model.
static const std::string& ClassName();
//! Friendship granted to the base class so this one can manipulates private methods.
friend parent;
public:
/// \name Special members.
///@{
/*!
* \brief Constructor.
*
* \copydoc doxygen_hide_morefem_data_param
*/
Model(const morefem_data_type& morefem_data);
//! Destructor.
~Model() = default;
//! \copydoc doxygen_hide_copy_constructor
Model(const Model& rhs) = delete;
//! \copydoc doxygen_hide_move_constructor
Model(Model&& rhs) = delete;
//! \copydoc doxygen_hide_copy_affectation
Model& operator=(const Model& rhs) = delete;
//! \copydoc doxygen_hide_move_affectation
Model& operator=(Model&& rhs) = delete;
///@}
/// \name Crtp-required methods.
///@{
/*!
* \brief Initialise the problem.
*
* This initialisation includes the resolution of the static problem.
*/
void SupplInitialize();
//! Manage time iteration.
void Forward();
/*!
* \brief Additional operations to finalize a dynamic step.
*
* Base class already update the time for next time iterations.
*/
void SupplFinalizeStep();
/*!
* \brief Initialise a dynamic step.
*
*/
void SupplFinalize();
public:
/*!
* \brief Checks that the global coordinates for low order quadrature are the expected ones.
*
*/
void CheckLowOrderQuadrature() const;
/*!
* \brief Checks that the global coordinates for "medium" order quadrature are the expected ones.
*
*/
void CheckMediumOrderQuadrature() const;
/*!
* \brief Checks that the global coordinates for high order quadrature are the expected ones.
*
*/
void CheckHighOrderQuadrature() const;
private:
//! \copydoc doxygen_hide_model_SupplHasFinishedConditions_always_true
bool SupplHasFinishedConditions() const;
/*!
* \brief Part of InitializedStep() specific to Elastic model.
*
* As there are none, the body of this method is empty.
*/
void SupplInitializeStep();
///@}
private:
//! Quadrature rule topology used for low degree integration.
QuadratureRulePerTopology::const_unique_ptr quadrature_rule_per_topology_low_degree_ = nullptr;
//! Quadrature rule topology used for "medium" degree integration.
QuadratureRulePerTopology::const_unique_ptr quadrature_rule_per_topology_medium_degree_ = nullptr;
//! Quadrature rule topology used for high degree integration.
QuadratureRulePerTopology::const_unique_ptr quadrature_rule_per_topology_high_degree_ = nullptr;
private:
//! Operator used to compute the global coordinates of the quadrature points.
GlobalParameterOperatorNS::GlobalCoordsQuadPoints::const_unique_ptr write_at_quad_pt_operator_low_degree_ = nullptr;
//! Parameter which will be updated by the operator to hold the global coordinates of the quadrature points.
ParameterAtQuadraturePoint<ParameterNS::Type::vector>::unique_ptr global_coords_quad_pt_low_degree_ = nullptr;
//! Operator used to compute the global coordinates of the quadrature points.
GlobalParameterOperatorNS::GlobalCoordsQuadPoints::const_unique_ptr write_at_quad_pt_operator_medium_degree_ = nullptr;
//! Parameter which will be updated by the operator to hold the global coordinates of the quadrature points.
ParameterAtQuadraturePoint<ParameterNS::Type::vector>::unique_ptr global_coords_quad_pt_medium_degree_ = nullptr;
//! Operator used to compute the global coordinates of the quadrature points.
GlobalParameterOperatorNS::GlobalCoordsQuadPoints::const_unique_ptr write_at_quad_pt_operator_high_degree_ = nullptr;
//! Parameter which will be updated by the operator to hold the global coordinates of the quadrature points.
ParameterAtQuadraturePoint<ParameterNS::Type::vector>::unique_ptr global_coords_quad_pt_high_degree_ = nullptr;
};
} // namespace MoReFEM::TestNS::GlobalCoordsQuadPt
# include "Test/Operators/ParameterOperator/GlobalCoordsQuadPts/Model.hxx"
#endif // MOREFEM_x_TEST_x_OPERATORS_x_PARAMETER_OPERATOR_x_GLOBAL_COORDS_QUAD_PTS_x_MODEL_HPP_
/*!
// \file
//
//
// Created by Jérôme Diaz <jerome.diaz@inria.fr> on the Wed, 6 June 2020 +0100
// Copyright (c) Inria. All rights reserved.
//
*/
#ifndef MOREFEM_x_TEST_x_OPERATORS_x_PARAMETER_OPERATOR_x_GLOBAL_COORDS_QUAD_PTS_x_MODEL_HXX_
# define MOREFEM_x_TEST_x_OPERATORS_x_PARAMETER_OPERATOR_x_GLOBAL_COORDS_QUAD_PTS_x_MODEL_HXX_
namespace MoReFEM::TestNS::GlobalCoordsQuadPt
{
inline const std::string& Model::ClassName()
{
static std::string name("Test GlobalCoordsQuadPts operator");
return name;
}
inline bool Model::SupplHasFinishedConditions() const
{
return false; // ie no additional condition
}
inline void Model::SupplInitializeStep()
{ }
} // namespace MoReFEM::TestNS::GlobalCoordsQuadPt
#endif // MOREFEM_x_TEST_x_OPERATORS_x_PARAMETER_OPERATOR_x_GLOBAL_COORDS_QUAD_PTS_x_MODEL_HXX_
-- Comment lines are introduced by "--".
-- In a section (i.e. within braces), all entries must be separated by a comma.
transient = {
-- Time at the beginning of the code (in seconds).
-- Expected format: VALUE
-- Constraint: v >= 0.
init_time = 0.,
-- Time step between two iterations, in seconds.
-- Expected format: VALUE
-- Constraint: v > 0.
timeStep = 0.1,
-- Maximum time, if set to zero run a static case.
-- Expected format: VALUE
-- Constraint: v >= 0.
timeMax = 0.
} -- transient
NumberingSubset1 = {
-- Name of the numbering subset (not really used; at the moment I just need one input parameter to ground
-- the possible values to choose elsewhere).
-- Expected format: "VALUE"
name = "generic_numbering_subset",
-- Whether a vector defined on this numbering subset might be used to compute a movemesh. If true, a
-- FEltSpace featuring this numbering subset will compute additional quantities to enable fast computation.
-- This should be false for most numbering subsets, and when it's true the sole unknown involved should be a
-- displacement.
-- Expected format: 'true' or 'false' (without the quote)
do_move_mesh = false
} -- NumberingSubset1
Unknown1 = {