From 966176f244068ecfe1e62729ea350383280bce06 Mon Sep 17 00:00:00 2001 From: Gautier Bureau Date: Thu, 22 Feb 2018 11:57:42 +0100 Subject: [PATCH 1/3] #1219 MatchDof is not used anymore in PK2. --- .../InputAnalyticalPrestress.hpp | 12 +- .../InputAnalyticalPrestress.hxx | 13 +- .../SecondPiolaKirchhoffStressTensor.hxx | 111 ++++++------------ .../AnalyticalPrestress.hpp | 3 - .../AnalyticalPrestress.hxx | 7 -- .../ActiveStressPolicy/Internal/Helper.hpp | 10 -- .../ActiveStressPolicy/Internal/Helper.hxx | 19 --- 7 files changed, 40 insertions(+), 135 deletions(-) diff --git a/Sources/OperatorInstances/VariationalOperator/NonlinearForm/Local/SecondPiolaKirchhoffStressTensor/ActiveStressPolicy/InputAnalyticalPrestress.hpp b/Sources/OperatorInstances/VariationalOperator/NonlinearForm/Local/SecondPiolaKirchhoffStressTensor/ActiveStressPolicy/InputAnalyticalPrestress.hpp index 8037393011..b098385a72 100644 --- a/Sources/OperatorInstances/VariationalOperator/NonlinearForm/Local/SecondPiolaKirchhoffStressTensor/ActiveStressPolicy/InputAnalyticalPrestress.hpp +++ b/Sources/OperatorInstances/VariationalOperator/NonlinearForm/Local/SecondPiolaKirchhoffStressTensor/ActiveStressPolicy/InputAnalyticalPrestress.hpp @@ -22,8 +22,6 @@ # include "Parameters/Parameter.hpp" # include "Parameters/InitParameterFromInputData/InitParameterFromInputData.hpp" -# include "Operators/Miscellaneous/MatchDofInNumberingSubset.hpp" - namespace MoReFEM { @@ -64,19 +62,14 @@ namespace MoReFEM * \brief Constructor. * * \copydoc doxygen_hide_input_parameter_data_arg - * \copydoc doxygen_hide_MatchDofInNumberingSubset_arg * \param[in] domain Domain upon which the operator is defined. */ template explicit InputAnalyticalPrestress(const InputParameterDataT& input_parameter_data, - const Domain& domain, - const MatchDofInNumberingSubset* match_dof_in_numbering_subset_operator); + const Domain& domain); public: - //! Constant accessor on a raw pointer on MatchDofInNumberingSubset. - const MatchDofInNumberingSubset* GetMatchDofInNumberingSubsetOperatorRawPtr() const noexcept; - //! Constant accessor on contractility. const ScalarParameter<>& GetContractility() const noexcept; @@ -85,9 +78,6 @@ namespace MoReFEM private: - //! MatchDofInNumberingSubset. - const MatchDofInNumberingSubset* match_dof_in_numbering_subset_operator_; - //! Contracitility. ScalarParameter<>::unique_ptr contractility_ = nullptr; diff --git a/Sources/OperatorInstances/VariationalOperator/NonlinearForm/Local/SecondPiolaKirchhoffStressTensor/ActiveStressPolicy/InputAnalyticalPrestress.hxx b/Sources/OperatorInstances/VariationalOperator/NonlinearForm/Local/SecondPiolaKirchhoffStressTensor/ActiveStressPolicy/InputAnalyticalPrestress.hxx index cc1b5d7199..7da144c395 100644 --- a/Sources/OperatorInstances/VariationalOperator/NonlinearForm/Local/SecondPiolaKirchhoffStressTensor/ActiveStressPolicy/InputAnalyticalPrestress.hxx +++ b/Sources/OperatorInstances/VariationalOperator/NonlinearForm/Local/SecondPiolaKirchhoffStressTensor/ActiveStressPolicy/InputAnalyticalPrestress.hxx @@ -35,10 +35,8 @@ namespace MoReFEM template InputAnalyticalPrestress::InputAnalyticalPrestress(const InputParameterDataT& input_parameter_data, - const Domain& domain, - const MatchDofInNumberingSubset* match_dof_in_numbering_subset_operator) - : match_dof_in_numbering_subset_operator_(match_dof_in_numbering_subset_operator), - initial_value_active_stress_(Utilities::InputParameterListNS::Extract::Value(input_parameter_data)) + const Domain& domain) + : initial_value_active_stress_(Utilities::InputParameterListNS::Extract::Value(input_parameter_data)) { contractility_ = InitScalarParameterFromInputData("Contractility", @@ -47,13 +45,6 @@ namespace MoReFEM }; - inline const MatchDofInNumberingSubset* InputAnalyticalPrestress::GetMatchDofInNumberingSubsetOperatorRawPtr() const noexcept - { - assert(!(!match_dof_in_numbering_subset_operator_)); - return match_dof_in_numbering_subset_operator_; - }; - - inline const ScalarParameter<>& InputAnalyticalPrestress::GetContractility() const noexcept { assert(!(!contractility_)); diff --git a/Sources/OperatorInstances/VariationalOperator/NonlinearForm/SecondPiolaKirchhoffStressTensor.hxx b/Sources/OperatorInstances/VariationalOperator/NonlinearForm/SecondPiolaKirchhoffStressTensor.hxx index 0ac3892a81..c2d0f7f02c 100644 --- a/Sources/OperatorInstances/VariationalOperator/NonlinearForm/SecondPiolaKirchhoffStressTensor.hxx +++ b/Sources/OperatorInstances/VariationalOperator/NonlinearForm/SecondPiolaKirchhoffStressTensor.hxx @@ -12,7 +12,6 @@ #ifndef MOREFEM_x_OPERATOR_INSTANCES_x_VARIATIONAL_OPERATOR_x_NONLINEAR_FORM_x_SECOND_PIOLA_KIRCHHOFF_STRESS_TENSOR_HXX_ # define MOREFEM_x_OPERATOR_INSTANCES_x_VARIATIONAL_OPERATOR_x_NONLINEAR_FORM_x_SECOND_PIOLA_KIRCHHOFF_STRESS_TENSOR_HXX_ - namespace MoReFEM { @@ -165,7 +164,7 @@ namespace MoReFEM const Domain& domain) const { GetCauchyGreenTensorOperator().Update(displacement_previous_iteration); - + return parent::template AssembleImpl<>(std::move(linear_algebra_tuple), domain, displacement_previous_iteration, @@ -281,7 +280,6 @@ namespace MoReFEM void SetComputeEltArrayArgumentsActivePolicy(LocalVariationalOperatorT& local_operator, const LocalFEltSpace& local_felt_space, const ExtendedUnknown& nth_unknown, - const MatchDofInNumberingSubset& match_dof_in_numbering_subset_operator, const GlobalVector& a_electrical_activation_previous_time, const GlobalVector& a_electrical_activation_at_time, const bool do_update); @@ -291,7 +289,6 @@ namespace MoReFEM void SetComputeEltArrayArgumentsActivePolicy(LocalVariationalOperatorT& local_operator, const LocalFEltSpace& local_felt_space, const ExtendedUnknown& nth_unknown, - const MatchDofInNumberingSubset& match_dof_in_numbering_subset_operator, const GlobalVector& a_electrical_activation_previous_time, const GlobalVector& a_electrical_activation_at_time); @@ -319,15 +316,9 @@ namespace MoReFEM const auto& active_stress_ptr = static_cast(this); auto& active_stress = *active_stress_ptr; - const MatchDofInNumberingSubset* raw_match_dof_numbering_subset = - Internal::GlobalVariationalOperatorNS::SecondPiolaKirchhoffStressTensorNS::ActiveStressHelper::GetMatchDof(active_stress); - - assert(!(!raw_match_dof_numbering_subset)); - SetComputeEltArrayArgumentsActivePolicy(local_operator, local_felt_space, this->GetNthUnknown(), - *raw_match_dof_numbering_subset, std::get<2>(additional_arguments), std::get<3>(additional_arguments), std::get<4>(additional_arguments)); @@ -350,19 +341,10 @@ namespace MoReFEM this->GetNthUnknown(), std::get<1>(additional_arguments), local_operator.GetNonCstLocalVelocity()); - - const auto& active_stress_ptr = static_cast(this); - auto& active_stress = *active_stress_ptr; - - const MatchDofInNumberingSubset* raw_match_dof_numbering_subset = - Internal::GlobalVariationalOperatorNS::SecondPiolaKirchhoffStressTensorNS::ActiveStressHelper::GetMatchDof(active_stress); - - assert(!(!raw_match_dof_numbering_subset)); - + SetComputeEltArrayArgumentsActivePolicy(local_operator, local_felt_space, this->GetNthUnknown(), - *raw_match_dof_numbering_subset, std::get<2>(additional_arguments), std::get<3>(additional_arguments)); } @@ -382,16 +364,10 @@ namespace MoReFEM const auto& active_stress_ptr = static_cast(this); auto& active_stress = *active_stress_ptr; - - const MatchDofInNumberingSubset* raw_match_dof_numbering_subset = - Internal::GlobalVariationalOperatorNS::SecondPiolaKirchhoffStressTensorNS::ActiveStressHelper::GetMatchDof(active_stress); - - assert(!(!raw_match_dof_numbering_subset)); - + SetComputeEltArrayArgumentsActivePolicy(local_operator, local_felt_space, this->GetNthUnknown(), - *raw_match_dof_numbering_subset, std::get<1>(additional_arguments), std::get<2>(additional_arguments), std::get<3>(additional_arguments)); @@ -413,15 +389,9 @@ namespace MoReFEM const auto& active_stress_ptr = static_cast(this); auto& active_stress = *active_stress_ptr; - const MatchDofInNumberingSubset* raw_match_dof_numbering_subset = - Internal::GlobalVariationalOperatorNS::SecondPiolaKirchhoffStressTensorNS::ActiveStressHelper::GetMatchDof(active_stress); - - assert(!(!raw_match_dof_numbering_subset)); - SetComputeEltArrayArgumentsActivePolicy(local_operator, local_felt_space, this->GetNthUnknown(), - *raw_match_dof_numbering_subset, std::get<1>(additional_arguments), std::get<2>(additional_arguments)); } @@ -435,7 +405,6 @@ namespace MoReFEM void SetComputeEltArrayArgumentsActivePolicy(LocalVariationalOperatorT& local_operator, const LocalFEltSpace& local_felt_space, const ExtendedUnknown& nth_unknown, - const MatchDofInNumberingSubset& match_dof_in_numbering_subset_operator, const GlobalVector& a_electrical_activation_previous_time, const GlobalVector& a_electrical_activation_at_time, const bool do_update_sigma_c) @@ -443,7 +412,6 @@ namespace MoReFEM SetComputeEltArrayArgumentsActivePolicy(local_operator, local_felt_space, nth_unknown, - match_dof_in_numbering_subset_operator, a_electrical_activation_previous_time, a_electrical_activation_at_time); @@ -455,63 +423,58 @@ namespace MoReFEM void SetComputeEltArrayArgumentsActivePolicy(LocalVariationalOperatorT& local_operator, const LocalFEltSpace& local_felt_space, const ExtendedUnknown& nth_unknown, - const MatchDofInNumberingSubset& match_dof_in_numbering_subset_operator, const GlobalVector& a_electrical_activation_previous_time, const GlobalVector& a_electrical_activation_at_time) { - const auto& extended_unknown = local_operator.GetElementaryData().GetRefFElt(nth_unknown).GetExtendedUnknown(); - - const auto& local_2_global = - local_felt_space.GetLocal2Global(extended_unknown); - auto& u0 = local_operator.GetNonCstLocalElectricalActivationPreviousTime(); auto& u1 = local_operator.GetNonCstLocalElectricalActivationAtTime(); - + { Wrappers::Petsc::AccessGhostContent ghost_vector_u0(a_electrical_activation_previous_time, __FILE__, __LINE__); Wrappers::Petsc::AccessGhostContent ghost_vector_u1(a_electrical_activation_at_time, __FILE__, __LINE__); - + const auto& vector_with_ghost_u0 = ghost_vector_u0.GetVectorWithGhost(); const auto& vector_with_ghost_u1 = ghost_vector_u1.GetVectorWithGhost(); - + Wrappers::Petsc::AccessVectorContent ghost_vector_content_u0(vector_with_ghost_u0, __FILE__, __LINE__); Wrappers::Petsc::AccessVectorContent ghost_vector_content_u1(vector_with_ghost_u1, __FILE__, __LINE__); - - decltype(auto) match = match_dof_in_numbering_subset_operator.GetData(); - - std::set buf_global_index_scalar; - - unsigned int local_scalar_counter = static_cast(-1); - - const unsigned int local_2_global_size = static_cast(local_2_global.size()); - - for (auto i = 0ul ; i < local_2_global_size ; ++i) + + const auto& electrical_activation_numbering_subset = a_electrical_activation_previous_time.GetNumberingSubset(); + + const auto& node_bearer_list = local_felt_space.GetNodeBearerList(); + + const auto node_bearer_list_size = node_bearer_list.size(); + + assert(u0.size() == node_bearer_list_size); + assert(u1.size() == node_bearer_list_size); + + for (unsigned int i = 0 ; i < node_bearer_list_size ; ++i) { - const auto global_index_vectorial = static_cast(local_2_global[i]); - - const auto& global_index_scalar_container = match[global_index_vectorial]; - - const auto global_index_scalar = global_index_scalar_container.back(); - - assert(global_index_scalar_container.size() == 1 && "In current example target is scalar..."); - - const auto it = buf_global_index_scalar.find(global_index_scalar); - - if (it == buf_global_index_scalar.cend()) + const auto& node_bearer_ptr = node_bearer_list[i]; + assert(!(!node_bearer_ptr)); + const auto& node_bearer = *node_bearer_ptr; + + const auto& node_list = node_bearer.GetNodeList(); + + for (const auto& node_ptr : node_list) { - buf_global_index_scalar.insert(global_index_scalar); - ++local_scalar_counter; - assert(local_scalar_counter < u0.size()); - assert(local_scalar_counter < u1.size()); - u0[local_scalar_counter] = ghost_vector_content_u0.GetValue(static_cast(global_index_scalar)); - u1[local_scalar_counter] = ghost_vector_content_u1.GetValue(static_cast(global_index_scalar)); + assert(!(!node_ptr)); + + if (node_ptr->DoBelongToNumberingSubset(electrical_activation_numbering_subset)) + { + const auto& dof_list = node_ptr->GetDofList(); + + assert(dof_list.size() == 1 && "The node should contain a single dof of a scalar unknown."); + + const auto& dof = *dof_list[0]; + + u0[i] = ghost_vector_content_u0.GetValue(dof.GetProcessorWiseOrGhostIndex(electrical_activation_numbering_subset)); + u1[i] = ghost_vector_content_u1.GetValue(dof.GetProcessorWiseOrGhostIndex(electrical_activation_numbering_subset)); + } } } - - assert(buf_global_index_scalar.size() == u0.size()); - assert(buf_global_index_scalar.size() == u1.size()); } } diff --git a/Sources/OperatorInstances/VariationalOperator/NonlinearForm/SecondPiolaKirchhoffStressTensor/ActiveStressPolicy/AnalyticalPrestress.hpp b/Sources/OperatorInstances/VariationalOperator/NonlinearForm/SecondPiolaKirchhoffStressTensor/ActiveStressPolicy/AnalyticalPrestress.hpp index 0cc0f981ef..1c903c3f68 100644 --- a/Sources/OperatorInstances/VariationalOperator/NonlinearForm/SecondPiolaKirchhoffStressTensor/ActiveStressPolicy/AnalyticalPrestress.hpp +++ b/Sources/OperatorInstances/VariationalOperator/NonlinearForm/SecondPiolaKirchhoffStressTensor/ActiveStressPolicy/AnalyticalPrestress.hpp @@ -99,9 +99,6 @@ namespace MoReFEM const LocalOperatorStorageT& local_operator_storage, input_active_stress_policy_type* input_active_stress_policy); - //! Tmp #9 Complete! - const MatchDofInNumberingSubset* GetMatchDofInNumberingSubsetOperatorPtr() const noexcept; - private: //! Tmp #9 Complete! diff --git a/Sources/OperatorInstances/VariationalOperator/NonlinearForm/SecondPiolaKirchhoffStressTensor/ActiveStressPolicy/AnalyticalPrestress.hxx b/Sources/OperatorInstances/VariationalOperator/NonlinearForm/SecondPiolaKirchhoffStressTensor/ActiveStressPolicy/AnalyticalPrestress.hxx index 754623a92d..2b82378266 100644 --- a/Sources/OperatorInstances/VariationalOperator/NonlinearForm/SecondPiolaKirchhoffStressTensor/ActiveStressPolicy/AnalyticalPrestress.hxx +++ b/Sources/OperatorInstances/VariationalOperator/NonlinearForm/SecondPiolaKirchhoffStressTensor/ActiveStressPolicy/AnalyticalPrestress.hxx @@ -58,13 +58,6 @@ namespace MoReFEM } - template - const MatchDofInNumberingSubset* AnalyticalPrestress::GetMatchDofInNumberingSubsetOperatorPtr() const noexcept - { - return GetInputActiveStressPolicy().GetMatchDofInNumberingSubsetOperatorRawPtr(); - } - - template inline const typename AnalyticalPrestress::input_active_stress_policy_type& AnalyticalPrestress::GetInputActiveStressPolicy() const noexcept diff --git a/Sources/OperatorInstances/VariationalOperator/NonlinearForm/SecondPiolaKirchhoffStressTensor/ActiveStressPolicy/Internal/Helper.hpp b/Sources/OperatorInstances/VariationalOperator/NonlinearForm/SecondPiolaKirchhoffStressTensor/ActiveStressPolicy/Internal/Helper.hpp index 5409866647..4331e978a2 100644 --- a/Sources/OperatorInstances/VariationalOperator/NonlinearForm/SecondPiolaKirchhoffStressTensor/ActiveStressPolicy/Internal/Helper.hpp +++ b/Sources/OperatorInstances/VariationalOperator/NonlinearForm/SecondPiolaKirchhoffStressTensor/ActiveStressPolicy/Internal/Helper.hpp @@ -16,7 +16,6 @@ # include # include "OperatorInstances/VariationalOperator/NonlinearForm/SecondPiolaKirchhoffStressTensor/ActiveStressPolicy/None.hpp" -# include "Operators/Miscellaneous/MatchDofInNumberingSubset.hpp" namespace MoReFEM @@ -81,11 +80,6 @@ namespace MoReFEM const LocalOperatorStorageT& local_operator_storage, typename ActiveStressPolicyT::input_active_stress_policy_type* input_active_stress_policy, ActiveStressPolicyT& active_stress); - - - //! \copydoc doxygen_hide_active_stress_helper_match_dof_function - static const MatchDofInNumberingSubset* GetMatchDof(const ActiveStressPolicyT& active_stress); - }; @@ -114,10 +108,6 @@ namespace MoReFEM const LocalOperatorStorageT& local_operator_storage, typename none_type::input_active_stress_policy_type* input_active_stress_policy, none_type& active_stress); - - //! \copydoc doxygen_hide_active_stress_helper_match_dof_function - static const MatchDofInNumberingSubset* GetMatchDof(const none_type& active_stress); - }; diff --git a/Sources/OperatorInstances/VariationalOperator/NonlinearForm/SecondPiolaKirchhoffStressTensor/ActiveStressPolicy/Internal/Helper.hxx b/Sources/OperatorInstances/VariationalOperator/NonlinearForm/SecondPiolaKirchhoffStressTensor/ActiveStressPolicy/Internal/Helper.hxx index 38c69c2ac2..966d07c445 100644 --- a/Sources/OperatorInstances/VariationalOperator/NonlinearForm/SecondPiolaKirchhoffStressTensor/ActiveStressPolicy/Internal/Helper.hxx +++ b/Sources/OperatorInstances/VariationalOperator/NonlinearForm/SecondPiolaKirchhoffStressTensor/ActiveStressPolicy/Internal/Helper.hxx @@ -65,25 +65,6 @@ namespace MoReFEM } - template - const MatchDofInNumberingSubset* - ActiveStressHelper - ::GetMatchDof(const ActiveStressPolicyT& active_stress) - { - return active_stress.GetMatchDofInNumberingSubsetOperatorPtr(); - }; - - - inline const MatchDofInNumberingSubset* - ActiveStressHelper<::MoReFEM::GlobalVariationalOperatorNS::SecondPiolaKirchhoffStressTensorNS::ActiveStressPolicyNS::None> - ::GetMatchDof(const none_type& active_stress) - { - static_cast(active_stress); - - return nullptr; - }; - - template < class LocalOperatorTupleT, -- GitLab From 5f055590ed5481202b5a8a91a18d94b7e43b0c40 Mon Sep 17 00:00:00 2001 From: Gautier Bureau Date: Thu, 22 Feb 2018 11:58:25 +0100 Subject: [PATCH 2/3] #1219 Deleted MatchDof. --- MoReFEM.xcodeproj/project.pbxproj | 12 -- .../MatchDofInNumberingSubset.cpp | 108 ------------ .../MatchDofInNumberingSubset.hpp | 163 ------------------ .../MatchDofInNumberingSubset.hxx | 32 ---- 4 files changed, 315 deletions(-) delete mode 100644 Sources/Operators/Miscellaneous/MatchDofInNumberingSubset.cpp delete mode 100644 Sources/Operators/Miscellaneous/MatchDofInNumberingSubset.hpp delete mode 100644 Sources/Operators/Miscellaneous/MatchDofInNumberingSubset.hxx diff --git a/MoReFEM.xcodeproj/project.pbxproj b/MoReFEM.xcodeproj/project.pbxproj index d4c04b293b..65a90a4096 100644 --- a/MoReFEM.xcodeproj/project.pbxproj +++ b/MoReFEM.xcodeproj/project.pbxproj @@ -309,9 +309,6 @@ BE01DAFE1E854E2500F3EAF7 /* FindCoordsOfGlobalVector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 135F21A71E7ADBC000B9E633 /* FindCoordsOfGlobalVector.cpp */; }; BE01DAFF1E854E2500F3EAF7 /* FindCoordsOfGlobalVector.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 135F21A81E7ADBC000B9E633 /* FindCoordsOfGlobalVector.hpp */; }; BE01DB001E854E2500F3EAF7 /* FindCoordsOfGlobalVector.hxx in Headers */ = {isa = PBXBuildFile; fileRef = 135F21A91E7ADBC000B9E633 /* FindCoordsOfGlobalVector.hxx */; }; - BE01DB011E854E2500F3EAF7 /* MatchDofInNumberingSubset.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 135F21AA1E7ADBC000B9E633 /* MatchDofInNumberingSubset.cpp */; }; - BE01DB021E854E2500F3EAF7 /* MatchDofInNumberingSubset.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 135F21AB1E7ADBC000B9E633 /* MatchDofInNumberingSubset.hpp */; }; - BE01DB031E854E2500F3EAF7 /* MatchDofInNumberingSubset.hxx in Headers */ = {isa = PBXBuildFile; fileRef = 135F21AC1E7ADBC000B9E633 /* MatchDofInNumberingSubset.hxx */; }; BE01DB041E854EB400F3EAF7 /* ExtractLocalDofValues.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 135F21671E7ADBC000B9E633 /* ExtractLocalDofValues.cpp */; }; BE01FA241BC66FB10080AD73 /* libCore.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BE05B52916D238FE000E248D /* libCore.a */; }; BE01FA251BC66FB10080AD73 /* libFiniteElement.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BE9C4D121807F5DC005B94BC /* libFiniteElement.a */; }; @@ -3780,9 +3777,6 @@ 135F21A71E7ADBC000B9E633 /* FindCoordsOfGlobalVector.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = FindCoordsOfGlobalVector.cpp; sourceTree = ""; }; 135F21A81E7ADBC000B9E633 /* FindCoordsOfGlobalVector.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = FindCoordsOfGlobalVector.hpp; sourceTree = ""; }; 135F21A91E7ADBC000B9E633 /* FindCoordsOfGlobalVector.hxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = FindCoordsOfGlobalVector.hxx; sourceTree = ""; }; - 135F21AA1E7ADBC000B9E633 /* MatchDofInNumberingSubset.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = MatchDofInNumberingSubset.cpp; sourceTree = ""; }; - 135F21AB1E7ADBC000B9E633 /* MatchDofInNumberingSubset.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = MatchDofInNumberingSubset.hpp; sourceTree = ""; }; - 135F21AC1E7ADBC000B9E633 /* MatchDofInNumberingSubset.hxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = MatchDofInNumberingSubset.hxx; sourceTree = ""; }; 135F21AD1E7ADBC000B9E633 /* Operator.doxygen */ = {isa = PBXFileReference; lastKnownFileType = text; path = Operator.doxygen; sourceTree = ""; }; 135F21B01E7ADBC000B9E633 /* GlobalParameterOperator.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = GlobalParameterOperator.hpp; sourceTree = ""; }; 135F21B11E7ADBC000B9E633 /* GlobalParameterOperator.hxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = GlobalParameterOperator.hxx; sourceTree = ""; }; @@ -6882,9 +6876,6 @@ 135F21A71E7ADBC000B9E633 /* FindCoordsOfGlobalVector.cpp */, 135F21A81E7ADBC000B9E633 /* FindCoordsOfGlobalVector.hpp */, 135F21A91E7ADBC000B9E633 /* FindCoordsOfGlobalVector.hxx */, - 135F21AA1E7ADBC000B9E633 /* MatchDofInNumberingSubset.cpp */, - 135F21AB1E7ADBC000B9E633 /* MatchDofInNumberingSubset.hpp */, - 135F21AC1E7ADBC000B9E633 /* MatchDofInNumberingSubset.hxx */, ); path = Miscellaneous; sourceTree = ""; @@ -12597,7 +12588,6 @@ BE5B6F701C3C1602004A0284 /* VertexMatching.hpp in Headers */, BE01DAC31E854DC600F3EAF7 /* LinearLocalVariationalOperator.hxx in Headers */, BE01DAEE1E854E0100F3EAF7 /* SourceOrTargetData.hpp in Headers */, - BE01DB021E854E2500F3EAF7 /* MatchDofInNumberingSubset.hpp in Headers */, BE01DAE91E854DF700F3EAF7 /* LocalVariationalOperator.hxx in Headers */, BE01DADC1E854DEC00F3EAF7 /* ElementaryDataStorage.hpp in Headers */, BE5301471E774418004CA0BA /* ApplySetCauchyGreenTensor.hpp in Headers */, @@ -12621,7 +12611,6 @@ BE7A388C1E8D3167009DFFC3 /* GreenLagrangeTensor.hpp in Headers */, BE01DAC51E854DC600F3EAF7 /* NonlinearLocalVariationalOperator.hxx in Headers */, BE01DACA1E854DD600F3EAF7 /* ExtractGradientBasedBlock.hxx in Headers */, - BE01DB031E854E2500F3EAF7 /* MatchDofInNumberingSubset.hxx in Headers */, BE01DADA1E854DE300F3EAF7 /* InvariantHolder.hpp in Headers */, BE01DABB1E854DB300F3EAF7 /* Helper.hxx in Headers */, BE01DAE41E854DF100F3EAF7 /* SubMatrixForNumberingSubsetPair.hxx in Headers */, @@ -14609,7 +14598,6 @@ BE01DAC81E854DD600F3EAF7 /* ExtractGradientBasedBlock.cpp in Sources */, BE01DAEA1E854E0100F3EAF7 /* InterpolationData.cpp in Sources */, BE01DAD31E854DDD00F3EAF7 /* ExtractBlockFromGlobalVector.cpp in Sources */, - BE01DB011E854E2500F3EAF7 /* MatchDofInNumberingSubset.cpp in Sources */, BE01DAED1E854E0100F3EAF7 /* SourceOrTargetData.cpp in Sources */, BE01DACE1E854DD600F3EAF7 /* InformationsAtQuadraturePoint.cpp in Sources */, 13B511031FCD96980080E6F6 /* DetermineExtendedUnknownList.cpp in Sources */, diff --git a/Sources/Operators/Miscellaneous/MatchDofInNumberingSubset.cpp b/Sources/Operators/Miscellaneous/MatchDofInNumberingSubset.cpp deleted file mode 100644 index 320314e672..0000000000 --- a/Sources/Operators/Miscellaneous/MatchDofInNumberingSubset.cpp +++ /dev/null @@ -1,108 +0,0 @@ -/// -////// \file -/// -/// -/// Created by Sebastien Gilles on the Fri, 22 Jan 2016 10:15:26 +0100 -/// Copyright (c) Inria. All rights reserved. -/// -/// \ingroup OperatorsGroup -/// \addtogroup OperatorsGroup -/// \{ - -#include "Core/NumberingSubset/NumberingSubset.hpp" - -#include "FiniteElement/FiniteElementSpace/FEltSpace.hpp" - -#include "Operators/Miscellaneous/MatchDofInNumberingSubset.hpp" - - -namespace MoReFEM -{ - - - namespace // anonymous - { - - - void MatchDofInNumberingSubsetHelper(const Dof::vector_shared_ptr& dof_list, - const NumberingSubset& source_numbering_subset, - const NumberingSubset& target_numbering_subset, - std::vector>& match); - - - - - } // namespace anonymous - - - MatchDofInNumberingSubset::MatchDofInNumberingSubset(const FEltSpace& felt_space, - const NumberingSubset& source_numbering_subset, - const NumberingSubset& target_numbering_subset) - { - MatchDofInNumberingSubsetHelper(felt_space.GetProcessorWiseDofList(), - source_numbering_subset, - target_numbering_subset, - match_); - - MatchDofInNumberingSubsetHelper(felt_space.GetGhostedDofList(), - source_numbering_subset, - target_numbering_subset, - match_); - } - - - namespace // anonymous - { - - - void MatchDofInNumberingSubsetHelper(const Dof::vector_shared_ptr& dof_list, - const NumberingSubset& source_numbering_subset, - const NumberingSubset& target_numbering_subset, - std::vector>& match) - { - for (const auto& dof_ptr : dof_list) - { - assert(!(!dof_ptr)); - const auto& dof = *dof_ptr; - - if (dof.IsInNumberingSubset(source_numbering_subset)) - { - const auto node_bearer_ptr = dof.GetNodeBearerFromWeakPtr(); - const auto& node_bearer_content = node_bearer_ptr->GetNodeList(); - - std::vector target_processor_wise_dof_index_list; - - unsigned int counter_relevant_node = 0u; - - // Look in the node bearer for the dofs that belongs to the TARGET numbering subset. - for (const auto& node_ptr : node_bearer_content) - { - if (node_ptr->DoBelongToNumberingSubset(target_numbering_subset)) - { - ++counter_relevant_node; - - const auto& internal_dof_list = node_ptr->GetDofList(); - - for (const auto& internal_dof_ptr : internal_dof_list) - target_processor_wise_dof_index_list.push_back(internal_dof_ptr->GetProcessorWiseOrGhostIndex(target_numbering_subset)); - } - } - - assert(counter_relevant_node == 1 && "This operator assumes only one unknown in the considered numbering subset!"); - - assert(!target_processor_wise_dof_index_list.empty() && "At the moment this class is restricted to " - "the case in which there is a complete match between nodes of both numbering subsets."); - - match.emplace_back(std::move(target_processor_wise_dof_index_list)); - } - } - } - - - } // namespace anonymous - - -} // namespace MoReFEM - - -/// @} // addtogroup OperatorsGroup diff --git a/Sources/Operators/Miscellaneous/MatchDofInNumberingSubset.hpp b/Sources/Operators/Miscellaneous/MatchDofInNumberingSubset.hpp deleted file mode 100644 index 79d7542cfc..0000000000 --- a/Sources/Operators/Miscellaneous/MatchDofInNumberingSubset.hpp +++ /dev/null @@ -1,163 +0,0 @@ -/// -////// \file -/// -/// -/// Created by Sebastien Gilles on the Fri, 22 Jan 2016 10:15:26 +0100 -/// Copyright (c) Inria. All rights reserved. -/// -/// \ingroup OperatorsGroup -/// \addtogroup OperatorsGroup -/// \{ - -#ifndef MOREFEM_x_OPERATORS_x_MISCELLANEOUS_x_MATCH_DOF_IN_NUMBERING_SUBSET_HPP_ -# define MOREFEM_x_OPERATORS_x_MISCELLANEOUS_x_MATCH_DOF_IN_NUMBERING_SUBSET_HPP_ - -# include -# include - - -namespace MoReFEM -{ - - - // ============================ - //! \cond IGNORE_BLOCK_IN_DOXYGEN - // Forward declarations. - // ============================ - - - class FEltSpace; - class NumberingSubset; - - - // ============================ - // End of forward declarations. - //! \endcond IGNORE_BLOCK_IN_DOXYGEN - // ============================ - - /*! - * \class doxygen_hide_MatchDofInNumberingSubset_arg - * - * \param[in] match_dof_in_numbering_subset_operator This operator is there to match the dofs between two different - * \a GlobalVector. See a much more detailed description in \a MatchDofInNumberingSubset. - */ - - - /*! - * \brief This operator is used for instance if you need to match the content of two global vectors. - * - * For instance let's consider the following case: - * . A global vector which contains the displacement on a given finite element space. - * . Another global vector which contains a scalar quantity on the same finite element space. - * - * The new operator matches them, i.e. is able to tell which dof(s) on the second vector are on the same location - * as the dofs in the first one. - * - * It is actually the numbering subsets that are conveyed in the constructor; hence the same operator may be used - * for two different global vectors in the same numbering subset (it is obtained from GlobalVector::GetNumberingSubset() - * method). - * - * Contrary to what I usually do in MoReFEM, indexes are manipulated directly here, for efficiency reasons. - * - * Here is how to use it - * \code - * GlobalVector displacement(...); // defined earlier on FEltSpace felt_space. - * GlobalVector scalar_unknown(...); // defined earlier on same FEltSpace felt_space. - * - * MatchDofInNumberingSubset match_dof(felt_space, - * displacement.GetNumberingSubset(), - * scalar_unknown.GetNumberingSubset()); - * - * Wrappers::Petsc::AccessVectorContent disp_content(displacement, __FILE__, __LINE__); - * Wrappers::Petsc::AccessVectorContent scalar_content(displacement, __FILE__, __LINE__); - * - * decltype(auto) match = match_dof.GetData(); - * - * const auto Ndof_in_source = disp_content.GetSize(__FILE__, __LINE__); - * for (auto i = 0; i < Ndof_in_source; ++i) - * { - * const auto& dof_list_in_target = match[i]; - * assert(dof_list_in_target.size() == 1 && "In current example target is scalar..."); - * const auto scalar_value = scalar_content.GetValue(dof_list_in_target.back(), __FILE__, __LINE__); - * ... - * } - * \endcode - * - * \attention This operator is at the moment somewhat limited: it expects that both numbering subsets cover - * exactly the same node bearers in the finite element space and that the numbering subsets cover exactly one - * unknown in the finite element space. - * - */ - class MatchDofInNumberingSubset final - { - - public: - - //! \copydoc doxygen_hide_alias_self - using self = MatchDofInNumberingSubset; - - //! Alias to unique pointer. - using const_unique_ptr = std::unique_ptr; - - //! Alias to unique pointer. - using unique_ptr = std::unique_ptr; - - public: - - /// \name Special members. - ///@{ - - //! Constructor. - explicit MatchDofInNumberingSubset(const FEltSpace& felt_space, - const NumberingSubset& source_numbering_subset, - const NumberingSubset& target_numbering_subset); - - //! Destructor. - ~MatchDofInNumberingSubset() = default; - - //! Copy constructor. - MatchDofInNumberingSubset(const MatchDofInNumberingSubset&) = delete; - - //! Move constructor. - MatchDofInNumberingSubset(MatchDofInNumberingSubset&&) = delete; - - //! Copy affectation. - MatchDofInNumberingSubset& operator=(const MatchDofInNumberingSubset&) = delete; - - //! Move affectation. - MatchDofInNumberingSubset& operator=(MatchDofInNumberingSubset&&) = delete; - - ///@} - - /*! - * \brief Accessor to the matching data. - * - * See explanation in the class documentation to see how to use it. - * - * \return Matching data. - */ - const std::vector>& GetData() const noexcept; - - private: - - /*! - * \brief Store the match of processor-wise dof indexes. - * - * . The index of the vector stands for the processor-wise index of the source. - * . The inner vector gives away all the processor-wise index(es) in the target numbering subset. - */ - std::vector> match_; - - }; - - -} // namespace MoReFEM - - -/// @} // addtogroup OperatorsGroup - - -# include "Operators/Miscellaneous/MatchDofInNumberingSubset.hxx" - - -#endif // MOREFEM_x_OPERATORS_x_MISCELLANEOUS_x_MATCH_DOF_IN_NUMBERING_SUBSET_HPP_ diff --git a/Sources/Operators/Miscellaneous/MatchDofInNumberingSubset.hxx b/Sources/Operators/Miscellaneous/MatchDofInNumberingSubset.hxx deleted file mode 100644 index fa5a90a030..0000000000 --- a/Sources/Operators/Miscellaneous/MatchDofInNumberingSubset.hxx +++ /dev/null @@ -1,32 +0,0 @@ -/// -////// \file -/// -/// -/// Created by Sebastien Gilles on the Fri, 22 Jan 2016 10:15:26 +0100 -/// Copyright (c) Inria. All rights reserved. -/// -/// \ingroup OperatorsGroup -/// \addtogroup OperatorsGroup -/// \{ - -#ifndef MOREFEM_x_OPERATORS_x_MISCELLANEOUS_x_MATCH_DOF_IN_NUMBERING_SUBSET_HXX_ -# define MOREFEM_x_OPERATORS_x_MISCELLANEOUS_x_MATCH_DOF_IN_NUMBERING_SUBSET_HXX_ - - -namespace MoReFEM -{ - - - inline const std::vector>& MatchDofInNumberingSubset::GetData() const noexcept - { - return match_; - } - - -} // namespace MoReFEM - - -/// @} // addtogroup OperatorsGroup - - -#endif // MOREFEM_x_OPERATORS_x_MISCELLANEOUS_x_MATCH_DOF_IN_NUMBERING_SUBSET_HXX_ -- GitLab From 4f6ab24dbad80a68f6a5a75ea3492ac3f0b01541 Mon Sep 17 00:00:00 2001 From: Gautier Bureau Date: Tue, 27 Feb 2018 16:55:12 +0100 Subject: [PATCH 3/3] #1219 Deleted MatchDof in Sconscript. --- Sources/Operators/Miscellaneous/SourceList.cmake | 3 --- Sources/Operators/SConscript | 1 - 2 files changed, 4 deletions(-) diff --git a/Sources/Operators/Miscellaneous/SourceList.cmake b/Sources/Operators/Miscellaneous/SourceList.cmake index 65a90f5e07..a6d24bffc4 100644 --- a/Sources/Operators/Miscellaneous/SourceList.cmake +++ b/Sources/Operators/Miscellaneous/SourceList.cmake @@ -2,12 +2,9 @@ target_sources(${MOREFEM_OP} PRIVATE "${CMAKE_CURRENT_LIST_DIR}/FindCoordsOfGlobalVector.cpp" - "${CMAKE_CURRENT_LIST_DIR}/MatchDofInNumberingSubset.cpp" PRIVATE "${CMAKE_CURRENT_LIST_DIR}/FindCoordsOfGlobalVector.hpp" "${CMAKE_CURRENT_LIST_DIR}/FindCoordsOfGlobalVector.hxx" - "${CMAKE_CURRENT_LIST_DIR}/MatchDofInNumberingSubset.hpp" - "${CMAKE_CURRENT_LIST_DIR}/MatchDofInNumberingSubset.hxx" ) diff --git a/Sources/Operators/SConscript b/Sources/Operators/SConscript index a71eaa872a..3ef749f22c 100644 --- a/Sources/Operators/SConscript +++ b/Sources/Operators/SConscript @@ -22,7 +22,6 @@ src = Split(''' ./LocalVariationalOperator/Crtp/NumberingSubsetSubMatrix/SubMatrixForNumberingSubsetPair.cpp ./LocalVariationalOperator/Internal/ElementaryDataImpl.cpp ./Miscellaneous/FindCoordsOfGlobalVector.cpp - ./Miscellaneous/MatchDofInNumberingSubset.cpp ''') lib = custom.MoReFEMLibrary(env, 'MoReFEM_operators', src) -- GitLab