Commit 3aa6c6bf authored by DIAZ Jerome's avatar DIAZ Jerome Committed by GILLES Sebastien

#1418 Aggregate several commits together... to get one that actually compile!...

#1418 Aggregate several commits together... to get one that actually compile! There was an issue of includes not put properly at the right time in the repository, and also the fact I moved from Seldon to Xtensor but Jerome worked (rightfully) on top of previous master. Most of the content of the resulting commit is Jerome's, except the ppart related to Xtensor.

Below I put the text of the original commits:

1 - PartialSpecialization for the new Microsphere model used for the InternalVariablePolicy.
2 - Moved MicrospherePolicy dependencies into the CoreLibrary.
3 - Parameter description updated.
4 - Update XCode project: during rebasing with main branch, there were conflicts that were solved by keeping this main branch project; new files have been properly added in this commit.
parent 7f574e3a
......@@ -103,8 +103,8 @@ if __name__ == "__main__":
Configuration("fedora", "gcc", "release", "static", False),
Configuration("fedora", "clang", "debug", "shared", False),
Configuration("fedora", "clang", "release", "static", True),
Configuration("macos", "clang", "debug", "static", False),
Configuration("macos", "clang", "release", "static", True),
# Configuration("macos", "clang", "debug", "static", True),
# Configuration("macos", "clang", "release", "shared", False),
)
for config in configuration_list:
......
This diff is collapsed.
......@@ -40,7 +40,7 @@
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
buildConfiguration = "Release"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
......
/*!
//
// \file
//
//
// Created by Jérôme Diaz <jerome.diaz@inria.fr> on the Tue, 7 May 2019 17:05:14 +0100
// Copyright (c) Inria. All rights reserved.
//
// \ingroup CoreGroup
// \addtogroup CoreGroup
// \{
*/
# include "Utilities/String/EmptyString.hpp"
# include "Core/InputData/Instances/Parameter/Microsphere/Microsphere.hpp"
namespace MoReFEM
{
namespace InputDataNS
{
const std::string& Microsphere::GetName()
{
static std::string ret("Microsphere");
return ret;
}
const std::string& Microsphere::InPlaneFiberDispersionI4::GetName()
{
static std::string ret("InPlaneFiberDispersionI4");
return ret;
}
const std::string& Microsphere::OutOfPlaneFiberDispersionI4::GetName()
{
static std::string ret("OutOfPlaneFiberDispersionI4");
return ret;
}
const std::string& Microsphere::FiberStiffnessDensityI4::GetName()
{
static std::string ret("FiberStiffnessDensityI4");
return ret;
}
const std::string& Microsphere::InPlaneFiberDispersionI6::GetName()
{
static std::string ret("InPlaneFiberDispersionI6");
return ret;
}
const std::string& Microsphere::OutOfPlaneFiberDispersionI6::GetName()
{
static std::string ret("OutOfPlaneFiberDispersionI6");
return ret;
}
const std::string& Microsphere::FiberStiffnessDensityI6::GetName()
{
static std::string ret("FiberStiffnessDensityI6");
return ret;
}
} // namespace InputDataNS
} // namespace MoReFEM
/// @} // addtogroup CoreGroup
/*!
//
// \file
//
//
// Created by Jérôme Diaz <jerome.diaz@inria.fr> on the Tue, 7 May 2019 17:05:14 +0100
// Copyright (c) Inria. All rights reserved.
//
// \ingroup CoreGroup
// \addtogroup CoreGroup
// \{
*/
#ifndef MOREFEM_x_CORE_x_INPUT_DATA_x_INSTANCES_x_PARAMETER_x_MICROSPHERE_x_MICROSPHERE_HXX_
# define MOREFEM_x_CORE_x_INPUT_DATA_x_INSTANCES_x_PARAMETER_x_MICROSPHERE_x_MICROSPHERE_HXX_
namespace MoReFEM
{
namespace InputDataNS
{
} // namespace InputDataNS
} // namespace MoReFEM
/// @} // addtogroup CoreGroup
#endif // MOREFEM_x_CORE_x_INPUT_DATA_x_INSTANCES_x_PARAMETER_x_MICROSPHERE_x_MICROSPHERE_HXX_
### ===================================================================================
### This file is generated automatically by Scripts/generate_cmake_source_list.py.
### Do not edit it manually!
### Convention is that:
### - When a CMake file is manually managed, it is named canonically CMakeLists.txt.
###. - When it is generated automatically, it is named SourceList.cmake.
### ===================================================================================
target_sources(${MOREFEM_CORE}
PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/Microsphere.cpp"
PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/Microsphere.hpp"
"${CMAKE_CURRENT_LIST_DIR}/Microsphere.hxx"
)
......@@ -18,6 +18,7 @@ target_sources(${MOREFEM_CORE}
)
include(${CMAKE_CURRENT_LIST_DIR}/Advanced/SourceList.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/Microsphere/SourceList.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/Heart/SourceList.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/Source/SourceList.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/AnalyticalPrestress/SourceList.cmake)
......
......@@ -22,7 +22,7 @@
# include "OperatorInstances/VariationalOperator/NonlinearForm/Local/SecondPiolaKirchhoffStressTensor/InternalVariablePolicy/None.hpp"
# include "OperatorInstances/VariationalOperator/NonlinearForm/Local/SecondPiolaKirchhoffStressTensor/ViscoelasticityPolicy/None.hpp"
# include "OperatorInstances/VariationalOperator/NonlinearForm/Local/SecondPiolaKirchhoffStressTensor/InternalVariablePolicy/AnalyticalPrestress.hpp"
# include "OperatorInstances/VariationalOperator/NonlinearForm/Local/SecondPiolaKirchhoffStressTensor/InternalVariablePolicy/Microsphere.hpp"
namespace MoReFEM
{
......@@ -206,6 +206,32 @@ namespace MoReFEM
};
/*!
* \brief Helper struct used to call SecondPiolaKirchhoffStressTensor::CorrectRHSWithActiveSchurComplement() if the
* InternalVariablePolicyT is InternalVariablePolicyT::Microsphere.
*
* \internal <b><tt>[internal]</tt></b> Using this struct allows not to define the method for
* InternalVariablePolicyT::Microsphere policy.
*
*/
template <unsigned int FiberIndexI4T, unsigned int FiberIndexI6T>
struct CorrectRHSWithActiveSchurComplement<InternalVariablePolicyNS::Microsphere<FiberIndexI4T, FiberIndexI6T>>
{
/*!
* \brief Gets rid of the active schur complement to RHS (explicit formulation is used instead).
*
* \param[in,out] internal_variable Object that manages internal variable data.
* \param[in,out] rhs Rhs being modified.
*/
static void Perform(InternalVariablePolicyNS::Microsphere<FiberIndexI4T, FiberIndexI6T>& internal_variable,
LocalVector& rhs);
};
/*!
* \brief Helper struct used to call SecondPiolaKirchhoffStressTensor::ComputeWDerivates() if the
......
......@@ -131,7 +131,17 @@ namespace MoReFEM
static_cast<void>(internal_variable);
}
template <unsigned int FiberIndexI4T, unsigned int FiberIndexI6T>
inline void CorrectRHSWithActiveSchurComplement<SecondPiolaKirchhoffStressTensorNS::InternalVariablePolicyNS::Microsphere<FiberIndexI4T, FiberIndexI6T>>
::Perform(SecondPiolaKirchhoffStressTensorNS::InternalVariablePolicyNS::Microsphere<FiberIndexI4T, FiberIndexI6T>& internal_variable,
LocalVector& rhs)
{
static_cast<void>(rhs);
static_cast<void>(internal_variable);
}
inline void CorrectRHSWithActiveSchurComplement<SecondPiolaKirchhoffStressTensorNS::InternalVariablePolicyNS::None>
::Perform(SecondPiolaKirchhoffStressTensorNS::InternalVariablePolicyNS::None& internal_variable,
LocalVector& rhs)
......
......@@ -18,6 +18,8 @@ target_sources(${MOREFEM_OP_INSTANCES}
"${CMAKE_CURRENT_LIST_DIR}/InputAnalyticalPrestress.hpp"
"${CMAKE_CURRENT_LIST_DIR}/InputAnalyticalPrestress.hxx"
"${CMAKE_CURRENT_LIST_DIR}/InputNone.hpp"
"${CMAKE_CURRENT_LIST_DIR}/Microsphere.hpp"
"${CMAKE_CURRENT_LIST_DIR}/Microsphere.hxx"
"${CMAKE_CURRENT_LIST_DIR}/None.hpp"
)
/*!
//
// \file
//
//
// Created by Jérôme Diaz <jerome.diaz@inria.fr> on the Tue, 7 May 2019 16:35:18 +0100
// Copyright (c) Inria. All rights reserved.
//
// \ingroup OperatorInstancesGroup
// \addtogroup OperatorInstancesGroup
// \{
*/
#ifndef MOREFEM_x_OPERATOR_INSTANCES_x_VARIATIONAL_OPERATOR_x_NONLINEAR_FORM_x_SECOND_PIOLA_KIRCHHOFF_STRESS_TENSOR_x_INTERNAL_VARIABLE_POLICY_x_MICROSPHERE_HPP_
# define MOREFEM_x_OPERATOR_INSTANCES_x_VARIATIONAL_OPERATOR_x_NONLINEAR_FORM_x_SECOND_PIOLA_KIRCHHOFF_STRESS_TENSOR_x_INTERNAL_VARIABLE_POLICY_x_MICROSPHERE_HPP_
# include <memory>
# include <vector>
# include "ParameterInstances/Fiber/FiberList.hpp"
# include "ParameterInstances/Fiber/Internal/FiberListManager.hpp"
# include "Parameters/Parameter.hpp"
# include "Parameters/InitParameterFromInputData/InitParameterFromInputData.hpp"
# include "Parameters/ParameterAtQuadraturePoint.hpp"
# include "OperatorInstances/VariationalOperator/NonlinearForm/Local/SecondPiolaKirchhoffStressTensor/InternalVariablePolicy/Microsphere.hpp"
namespace MoReFEM
{
namespace GlobalVariationalOperatorNS
{
namespace SecondPiolaKirchhoffStressTensorNS
{
namespace InternalVariablePolicyNS
{
//! Implements a microsphere model for the two families of fibers with in and out plane dispersions.
template <unsigned int FiberIndexI4T, unsigned int FiberIndexI6T>
class Microsphere
{
public:
//! \copydoc doxygen_hide_gvo_local_policy_alias
using local_policy =
::MoReFEM::Advanced::LocalVariationalOperatorNS::SecondPiolaKirchhoffStressTensorNS
::InternalVariablePolicyNS::Microsphere<FiberIndexI4T, FiberIndexI6T>;
//! Alias to the type of the input.
using input_internal_variable_policy_type = typename local_policy::input_internal_variable_policy_type;
// using input_internal_variable_policy_type = typename ::MoReFEM::InputMicrosphere;
public:
//! \copydoc doxygen_hide_alias_self
using self = Microsphere<FiberIndexI4T, FiberIndexI6T>;
//! Alias to unique pointer.
using unique_ptr = std::unique_ptr<self>;
//! Alias to vector of unique pointers.
using vector_unique_ptr = std::vector<unique_ptr>;
public:
/// \name Special members.
///@{
//! Constructor.
explicit Microsphere() = default;
//! Destructor.
~Microsphere() = default;
//! \copydoc doxygen_hide_copy_constructor
Microsphere(const Microsphere& rhs) = delete;
//! \copydoc doxygen_hide_move_constructor
Microsphere(Microsphere&& rhs) = delete;
//! \copydoc doxygen_hide_copy_affectation
Microsphere& operator=(const Microsphere& rhs) = delete;
//! \copydoc doxygen_hide_move_affectation
Microsphere& operator=(Microsphere&& rhs) = delete;
///@}
public:
/*!
* \brief Initialize Sigma_c.
*
* \param[in] domain \a Domain.
* \copydoc doxygen_hide_quadrature_rule_per_topology_arg
* \param[in] time_manager \a TimeManager of the model.
* \param[in] local_operator_storage Tuple with all local operators considered.
* \param[in] input_internal_variable_policy Object with relevant input data.
*/
template<class LocalOperatorStorageT>
void InitializeInternalVariablePolicy(const Domain& domain,
const QuadratureRulePerTopology& quadrature_rule_per_topology,
const TimeManager& time_manager,
const LocalOperatorStorageT& local_operator_storage,
input_internal_variable_policy_type* input_internal_variable_policy);
private:
//! Accessor.
const input_internal_variable_policy_type& GetInputMicrosphere() const noexcept;
//! Accessor.
input_internal_variable_policy_type& GetNonCstInputMicrosphere() noexcept;
private:
//! Object with relevant data for internal variable.
input_internal_variable_policy_type* input_internal_variable_policy_ = nullptr;
};
} // namespace InternalVariablePolicyNS
} // namespace SecondPiolaKirchhoffStressTensorNS
} // namespace GlobalVariationalOperatorNS
} // namespace MoReFEM
/// @} // addtogroup OperatorInstancesGroup
# include "OperatorInstances/VariationalOperator/NonlinearForm/SecondPiolaKirchhoffStressTensor/InternalVariablePolicy/Microsphere.hxx"
#endif // MOREFEM_x_OPERATOR_INSTANCES_x_VARIATIONAL_OPERATOR_x_NONLINEAR_FORM_x_SECOND_PIOLA_KIRCHHOFF_STRESS_TENSOR_x_INTERNAL_VARIABLE_POLICY_x_MICROSPHERE_HPP_
/*!
//
// \file
//
//
// Created by Jérôme Diaz <jerome.diaz@inria.fr> on the Tue, 7 May 2019 16:35:18 +0100
// Copyright (c) Inria. All rights reserved.
//
// \ingroup OperatorInstancesGroup
// \addtogroup OperatorInstancesGroup
// \{
*/
#ifndef MOREFEM_x_OPERATOR_INSTANCES_x_VARIATIONAL_OPERATOR_x_NONLINEAR_FORM_x_SECOND_PIOLA_KIRCHHOFF_STRESS_TENSOR_x_INTERNAL_VARIABLE_POLICY_x_MICROSPHERE_HXX_
# define MOREFEM_x_OPERATOR_INSTANCES_x_VARIATIONAL_OPERATOR_x_NONLINEAR_FORM_x_SECOND_PIOLA_KIRCHHOFF_STRESS_TENSOR_x_INTERNAL_VARIABLE_POLICY_x_MICROSPHERE_HXX_
namespace MoReFEM
{
namespace GlobalVariationalOperatorNS
{
namespace SecondPiolaKirchhoffStressTensorNS
{
namespace InternalVariablePolicyNS
{
template <unsigned int FiberIndexI4T, unsigned int FiberIndexI6T>
template<class LocalOperatorStorageT>
void Microsphere<FiberIndexI4T, FiberIndexI6T>
::InitializeInternalVariablePolicy(const Domain& domain,
const QuadratureRulePerTopology& quadrature_rule_per_topology,
const TimeManager& time_manager,
const LocalOperatorStorageT& local_operator_storage,
input_internal_variable_policy_type* input_internal_variable_policy)
{
assert(!(!input_internal_variable_policy));
input_internal_variable_policy_ = input_internal_variable_policy;
}
template <unsigned int FiberIndexI4T, unsigned int FiberIndexI6T>
inline const typename Microsphere<FiberIndexI4T, FiberIndexI6T>::input_internal_variable_policy_type&
Microsphere<FiberIndexI4T, FiberIndexI6T>::GetInputMicrosphere() const noexcept
{
assert(!(!input_internal_variable_policy_));
return *input_internal_variable_policy_;
}
template <unsigned int FiberIndexI4T, unsigned int FiberIndexI6T>
inline typename Microsphere<FiberIndexI4T, FiberIndexI6T>::input_internal_variable_policy_type&
Microsphere<FiberIndexI4T, FiberIndexI6T>::GetNonCstInputMicrosphere() noexcept
{
return const_cast<input_internal_variable_policy_type&>(GetInputMicrosphere());
}
} // namespace InternalVariablePolicyNS
} // namespace SecondPiolaKirchhoffStressTensorNS
} // namespace GlobalVariationalOperatorNS
} // namespace MoReFEM
/// @} // addtogroup OperatorInstancesGroup
#endif // MOREFEM_x_OPERATOR_INSTANCES_x_VARIATIONAL_OPERATOR_x_NONLINEAR_FORM_x_SECOND_PIOLA_KIRCHHOFF_STRESS_TENSOR_x_INTERNAL_VARIABLE_POLICY_x_MICROSPHERE_HXX_
......@@ -12,6 +12,8 @@ target_sources(${MOREFEM_OP_INSTANCES}
PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/AnalyticalPrestress.hpp"
"${CMAKE_CURRENT_LIST_DIR}/AnalyticalPrestress.hxx"
"${CMAKE_CURRENT_LIST_DIR}/Microsphere.hpp"
"${CMAKE_CURRENT_LIST_DIR}/Microsphere.hxx"
"${CMAKE_CURRENT_LIST_DIR}/None.hpp"
)
......
/*!
//
// \file
//
//
// Created by Jérôme Diaz <jerome.diaz@inria.fr> on the Mon, 27 May 2019 17:35:05 +0100
// Copyright (c) Inria. All rights reserved.
//
// \ingroup ParameterInstancesGroup
// \addtogroup ParameterInstancesGroup
// \{
*/
#include <sstream>
#include "ParameterInstances/Compound/Microsphere/Exceptions/InputMicrosphere.hpp"
namespace // anonymous
{
std::string UndefinedDataMsg(const std::string& data_name);
} // namespace anonymous
namespace MoReFEM
{
namespace InputMicrosphereNS
{
UndefinedData::UndefinedData(const std::string& data, const char* invoking_file, int invoking_line)
: ::MoReFEM::Exception(UndefinedDataMsg(data), invoking_file, invoking_line)
{ }
UndefinedData::~UndefinedData() = default;
} // namespace SolidNS
} // namespace MoReFEM
namespace // anonymous
{
std::string UndefinedDataMsg(const std::string& data_name)
{
std::ostringstream oconv;
oconv << "Data '" << data_name << "' is undefined: in all likelihood either the model is ill-formed and the "
"data is not in the InputData, or it is but in the Lua file the chosen nature was 'ignore'.";
std::string ret = oconv.str();
return ret;
}
} // namespace anonymous
// @} // addtogroup ParameterInstancesGroup
/*!
//
// \file
//
//
// Created by Jérôme Diaz <jerome.diaz@inria.fr> on the Mon, 27 May 2019 17:35:05 +0100
// Copyright (c) Inria. All rights reserved.
//
// \ingroup ParameterInstancesGroup
// \addtogroup ParameterInstancesGroup
// \{
*/
#ifndef MOREFEM_x_PARAMETER_INSTANCES_x_COMPOUND_x_MICROSPHERE_x_EXCEPTIONS_x_INPUT_MICROSPHERE_HPP_
# define MOREFEM_x_PARAMETER_INSTANCES_x_COMPOUND_x_MICROSPHERE_x_EXCEPTIONS_x_INPUT_MICROSPHERE_HPP_
# include <string>
# include "Utilities/Exceptions/Exception.hpp"
namespace MoReFEM
{
namespace InputMicrosphereNS
{
//! Exception thrown when access to an undefined data is attempted.
class UndefinedData : public ::MoReFEM::Exception
{
public:
/*!
* \brief Constructor with simple message
*
* \param[in] data Name of the data concerned, e.g. 'volumic mass'.
* \param[in] invoking_file File that invoked the function or class; usually __FILE__.
* \param[in] invoking_line File that invoked the function or class; usually __LINE__.
*/
explicit UndefinedData(const std::string& data, const char* invoking_file, int invoking_line);
//! Destructor
virtual ~UndefinedData() override;
//! \copydoc doxygen_hide_copy_constructor
UndefinedData(const UndefinedData& rhs) = default;
//! \copydoc doxygen_hide_move_constructor
UndefinedData(UndefinedData&& rhs) = default;