Commit 77c828a9 authored by GILLES Sebastien's avatar GILLES Sebastien
Browse files

#762 Operators/interpolators: introduce the skeleton of the class that will...

#762 Operators/interpolators: introduce the skeleton of the class that will handle the matching from vertex file at the dof level.
parent 93b6392e
......@@ -1081,6 +1081,9 @@
BEA79C571C1EC487003EA761 /* VertexMatching.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BEA79C541C1EC487003EA761 /* VertexMatching.hpp */; };
BEA79C581C1EC487003EA761 /* VertexMatching.hxx in Headers */ = {isa = PBXBuildFile; fileRef = BEA79C551C1EC487003EA761 /* VertexMatching.hxx */; };
BEA79C5B1C1EC5E6003EA761 /* libGeometry.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BE05B4DD16D23573000E248D /* libGeometry.a */; };
BEA79C601C1ED83F003EA761 /* FromVertexMatching.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BEA79C5D1C1ED83F003EA761 /* FromVertexMatching.cpp */; };
BEA79C611C1ED83F003EA761 /* FromVertexMatching.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BEA79C5E1C1ED83F003EA761 /* FromVertexMatching.hpp */; };
BEA79C621C1ED83F003EA761 /* FromVertexMatching.hxx in Headers */ = {isa = PBXBuildFile; fileRef = BEA79C5F1C1ED83F003EA761 /* FromVertexMatching.hxx */; };
BEA9CB9F1A1E26A8003A6276 /* libCore.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BE05B52916D238FE000E248D /* libCore.a */; };
BEA9CBA01A1E26A8003A6276 /* libGeometry.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BE05B4DD16D23573000E248D /* libGeometry.a */; };
BEA9CBA11A1E26A8003A6276 /* libUtilities.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEA8A379177AD4FE009436C9 /* libUtilities.a */; };
......@@ -4467,6 +4470,9 @@
BEA79C531C1EC487003EA761 /* VertexMatching.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = VertexMatching.cpp; path = Interpolator/VertexMatching.cpp; sourceTree = "<group>"; };
BEA79C541C1EC487003EA761 /* VertexMatching.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = VertexMatching.hpp; path = Interpolator/VertexMatching.hpp; sourceTree = "<group>"; };
BEA79C551C1EC487003EA761 /* VertexMatching.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = VertexMatching.hxx; path = Interpolator/VertexMatching.hxx; sourceTree = "<group>"; };
BEA79C5D1C1ED83F003EA761 /* FromVertexMatching.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FromVertexMatching.cpp; path = Sources/Operators/NonConformInterpolator/FromVertexMatching.cpp; sourceTree = "<group>"; };
BEA79C5E1C1ED83F003EA761 /* FromVertexMatching.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = FromVertexMatching.hpp; path = Sources/Operators/NonConformInterpolator/FromVertexMatching.hpp; sourceTree = "<group>"; };
BEA79C5F1C1ED83F003EA761 /* FromVertexMatching.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = FromVertexMatching.hxx; path = Sources/Operators/NonConformInterpolator/FromVertexMatching.hxx; sourceTree = "<group>"; };
BEA8A379177AD4FE009436C9 /* libUtilities.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libUtilities.a; sourceTree = BUILT_PRODUCTS_DIR; };
BEA8B83C1A6CF91700EDA883 /* SConscript */ = {isa = PBXFileReference; explicitFileType = text.script.python; fileEncoding = 4; path = SConscript; sourceTree = "<group>"; };
BEA9CB891A1E2532003A6276 /* GeometricMeshRegion_Connectivity.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GeometricMeshRegion_Connectivity.cpp; sourceTree = "<group>"; };
......@@ -7418,6 +7424,16 @@
name = Interpolator;
sourceTree = "<group>";
};
BEA79C5C1C1ED7CF003EA761 /* NonConformInterpolator */ = {
isa = PBXGroup;
children = (
BEA79C5D1C1ED83F003EA761 /* FromVertexMatching.cpp */,
BEA79C5E1C1ED83F003EA761 /* FromVertexMatching.hpp */,
BEA79C5F1C1ED83F003EA761 /* FromVertexMatching.hxx */,
);
name = NonConformInterpolator;
sourceTree = "<group>";
};
BEABCD4A17AA906000EDE896 /* Private */ = {
isa = PBXGroup;
children = (
......@@ -8140,6 +8156,7 @@
BECA4D0D1B1758B800DC7265 /* LocalVariationalOperatorInstances */,
BE1ABAEA1B9DC9C500A7DBD8 /* ConformInterpolator */,
BE1ABAEF1B9DCE3300A7DBD8 /* ConformInterpolatorInstances */,
BEA79C5C1C1ED7CF003EA761 /* NonConformInterpolator */,
BECA4CEB1B1758B800DC7265 /* InterpolationOperatorInstances */,
BECA4CC51B1758B700DC7265 /* Crtp */,
);
......@@ -9338,6 +9355,7 @@
BECA4D821B1758B800DC7265 /* Mass.hpp in Headers */,
BECA4D451B1758B800DC7265 /* GlobalVariationalOperator.hxx in Headers */,
BECA4DA21B1758B800DC7265 /* Helper.hxx in Headers */,
BEA79C611C1ED83F003EA761 /* FromVertexMatching.hpp in Headers */,
BECA4D6A1B1758B800DC7265 /* SubMatrixForNumberingSubsetPair.hpp in Headers */,
BECA4D741B1758B800DC7265 /* ElementaryDataStorage.hxx in Headers */,
BECA4D591B1758B800DC7265 /* Stokes.hxx in Headers */,
......@@ -9349,6 +9367,7 @@
BECA4D7F1B1758B800DC7265 /* GradPhiGradPhi.hpp in Headers */,
BECA4D661B1758B800DC7265 /* BilinearLocalVariationalOperator.hxx in Headers */,
BECA4D9E1B1758B800DC7265 /* Component.hpp in Headers */,
BEA79C621C1ED83F003EA761 /* FromVertexMatching.hxx in Headers */,
BECA4D5B1B1758B800DC7265 /* TransientSource.hpp in Headers */,
BECA4D5C1B1758B800DC7265 /* TransientSource.hxx in Headers */,
BECA4D951B1758B800DC7265 /* CiarletGeymonat.hxx in Headers */,
......@@ -11153,6 +11172,7 @@
BE206F0A1B31B504001B7813 /* DetermineDefaultQuadratureRule.cpp in Sources */,
BECA4D931B1758B800DC7265 /* CiarletGeymonat.cpp in Sources */,
138CF7A11BD53DB500B4E1CB /* SurfacicBidomain.cpp in Sources */,
BEA79C601C1ED83F003EA761 /* FromVertexMatching.cpp in Sources */,
BE6805C01BA306D000ED40DF /* P2_to_P1.cpp in Sources */,
BE6805D91BA3112400ED40DF /* LocalLagrangianInterpolator.cpp in Sources */,
BECA4D781B1758B800DC7265 /* LocalVariationalOperator.cpp in Sources */,
......
......@@ -78,8 +78,6 @@ namespace HappyHeart
} // namespace ConformInterpolatorNS
namespace Private
{
......@@ -215,11 +213,12 @@ namespace HappyHeart
private:
/*!
* \brief Compute the local2global array required by a given global variational operator.
* \brief Compute the local2global array required by a given global variational operator (or in sone cases
* an interpolator).
*
* \a InitLocal2Global() must have been called beforehand.
*
* This method is expected to be called only from a GlobalVariationalOperator.
* This method is expected to be called only from a GlobalVariationalOperator or an interpolator.
*
* \param[in] unknown_list List of unknowns handled by the global variational operator which called the present
* method. This list is splitted per numbering subset, and for each of them a local2global array is computed.
......
......@@ -21,6 +21,26 @@ namespace HappyHeart
{
// ============================
// Forward declarations.
// ============================
namespace NonConformInterpolatorNS
{
class FromVertexMatching;
} // namespace NonConformInterpolatorNS
// ============================
// End of forward declarations.
// ============================
namespace GeometryNS
{
......@@ -42,6 +62,9 @@ namespace HappyHeart
//! Alias to self.
using self = VertexMatching;
//! Frienship to the class that actually requires vertex matching informations.
friend class NonConformInterpolatorNS::FromVertexMatching;
public:
/// \name Special members.
......@@ -71,7 +94,10 @@ namespace HappyHeart
private:
//! Method that does the bulk of constructor job.
//! Get the relationship.
const std::vector<std::pair<unsigned int, unsigned int>>& GetRelationship() const noexcept;
//! Method that does the bulk of constructor job. Should not be called out of constructor.
void Read(const std::string& filename);
private:
......
......@@ -32,6 +32,13 @@ namespace HappyHeart
}
inline const std::vector<std::pair<unsigned int, unsigned int>>& VertexMatching
::GetRelationship() const noexcept
{
return relationship_;
}
} // namespace InterpolationNS
......
......@@ -16,6 +16,8 @@
# include "ThirdParty/Wrappers/Petsc/Matrix/ShellMatrix.hpp"
# include "Geometry/Interpolator/VertexMatching.hpp"
# include "Operators/ConformInterpolatorInstances/P1_to_P2.hpp"
# include "Operators/ConformInterpolatorInstances/SubsetOrSuperset.hpp"
......
......@@ -166,38 +166,15 @@ namespace HappyHeart
}
}
# ifdef HH_P2
{
GeometryNS::InterpolationNS::VertexMatching vertex_matching(input_parameter_data);
const auto& fsi_felt_space = god_of_dof.GetFEltSpace(EnumUnderlyingType(FEltSpaceIndex::fsi));
const auto& solid_velocity = unknown_manager.GetUnknownPtr(EnumUnderlyingType(UnknownIndex::solid_velocity));
const auto& fluid_velocity = unknown_manager.GetUnknownPtr(EnumUnderlyingType(UnknownIndex::fluid_velocity));
ConformInterpolatorNS::pairing_type&& pairing
{
{ solid_velocity, fluid_velocity }
};
const auto& fsi_solid_numbering_subset =
god_of_dof.GetNumberingSubset(EnumUnderlyingType(NumberingSubsetIndex::solid_velocity_on_interface));
const auto& fsi_fluid_numbering_subset =
god_of_dof.GetNumberingSubset(EnumUnderlyingType(NumberingSubsetIndex::fluid_on_interface));
solid_to_fluid_velocity_on_fsi_interpolator_ =
std::make_unique<ConformInterpolatorNS::P1_to_P2>(fsi_felt_space,
fsi_solid_numbering_subset,
fsi_felt_space,
fsi_fluid_numbering_subset,
std::move(pairing));
solid_to_fluid_velocity_on_fsi_interpolator_->Init();
}
# endif // HH_P2
{
......
......@@ -35,9 +35,9 @@ namespace HappyHeart
&& source_felt_space.GetGodOfDofPtr() == target_felt_space.GetGodOfDofPtr());
auto&& source_data = std::make_unique<Private::SourceOrTargetData>(source_felt_space,
source_numbering_subset,
pairing_,
Private::SourceOrTargetDataType::source);
source_numbering_subset,
pairing_,
Private::SourceOrTargetDataType::source);
auto&& target_data = std::make_unique<Private::SourceOrTargetData>(target_felt_space,
target_numbering_subset,
......
//
// FromVertexMatching.cpp
// HappyHeart
//
// Created by Sebastien Gilles on 14/12/15.
// Copyright © 2015 Inria. All rights reserved.
//
#include "Operators/NonConformInterpolator/FromVertexMatching.hpp"
namespace HappyHeart
{
namespace NonConformInterpolatorNS
{
void FromVertexMatching::Construct(const GeometryNS::InterpolationNS::VertexMatching& vertex_matching,
const FEltSpace& source_felt_space,
const NumberingSubset& source_numbering_subset,
const FEltSpace& target_felt_space,
const NumberingSubset& target_numbering_subset,
pairing_type&& pairing)
{
}
} // namespace NonConformInterpolatorNS
} // namespace HappyHeart
//
// FromVertexMatching.hpp
// HappyHeart
//
// Created by Sebastien Gilles on 14/12/15.
// Copyright © 2015 Inria. All rights reserved.
//
#ifndef HAPPY_HEART_x_OPERATORS_x_NON_CONFORM_INTERPOLATOR_x_FROM_VERTEX_MATCHING_HPP_
# define HAPPY_HEART_x_OPERATORS_x_NON_CONFORM_INTERPOLATOR_x_FROM_VERTEX_MATCHING_HPP_
# include <memory>
# include <vector>
# include "Geometry/Interpolator/VertexMatching.hpp"
# include "Operators/ConformInterpolator/Private/SourceOrTargetData.hpp" // \todo #762 Not very clean...
namespace HappyHeart
{
// ============================
// Forward declarations.
// ============================
class FEltSpace;
class NumberingSubset;
// ============================
// End of forward declarations.
// ============================
namespace NonConformInterpolatorNS
{
using pairing_type = ConformInterpolatorNS::pairing_type;
class FromVertexMatching
{
public:
//! Alias to self.
using self = FromVertexMatching;
//! Alias to unique pointer.
using unique_ptr = std::unique_ptr<self>;
public:
/// \name Special members.
///@{
/*! Constructor.
*
* \param[in] source_felt_space Finite element space of the source.
* \param[in] source_numbering_subset Numbering subset of the source. First arguments of \a pairing
* pairs must belong to it, and \a source_felt_space must encompass it.
* \param[in] target_felt_space Finite element space of the target.
* \param[in] target_numbering_subset Numbering subset of the target. Second arguments of \a pairing
* pairs must belong to it, and \a target_felt_space must encompass it.
*
* \param[in] pairing A vector of pair in which each pair is an association between an unknown of the
* source and one from the target. For instance if we consider a fluid with (vf, pf) and a solid with
* (vs, ds) and want to interpolate from the former to the latter, (vf, vs) must be specified to indicate
* ds and pf are ignored and vf is associated with vs.
*
*/
template<class InputParameterDataT>
explicit FromVertexMatching(const InputParameterDataT& input_parameter_data,
const FEltSpace& source_felt_space,
const NumberingSubset& source_numbering_subset,
const FEltSpace& target_felt_space,
const NumberingSubset& target_numbering_subset,
pairing_type&& pairing);
//! Destructor.
~FromVertexMatching() = default;
//! Copy constructor.
FromVertexMatching(const FromVertexMatching&) = delete;
//! Move constructor.
FromVertexMatching(FromVertexMatching&&) = delete;
//! Copy affectation.
FromVertexMatching& operator=(const FromVertexMatching&) = delete;
//! Move affectation.
FromVertexMatching& operator=(FromVertexMatching&&) = delete;
///@}
private:
//! Construct the object. Should not be called outside of constructor.
void Construct(const GeometryNS::InterpolationNS::VertexMatching& vertex_matching,
const FEltSpace& source_felt_space,
const NumberingSubset& source_numbering_subset,
const FEltSpace& target_felt_space,
const NumberingSubset& target_numbering_subset,
pairing_type&& pairing);
};
} // namespace NonConformInterpolatorNS
} // namespace HappyHeart
# include "Operators/NonConformInterpolator/FromVertexMatching.hxx"
#endif // HAPPY_HEART_x_OPERATORS_x_NON_CONFORM_INTERPOLATOR_x_FROM_VERTEX_MATCHING_HPP_
//
// FromVertexMatching.hxx
// HappyHeart
//
// Created by Sebastien Gilles on 14/12/15.
// Copyright © 2015 Inria. All rights reserved.
//
#ifndef HAPPY_HEART_x_OPERATORS_x_NON_CONFORM_INTERPOLATOR_x_FROM_VERTEX_MATCHING_HXX_
# define HAPPY_HEART_x_OPERATORS_x_NON_CONFORM_INTERPOLATOR_x_FROM_VERTEX_MATCHING_HXX_
namespace HappyHeart
{
namespace NonConformInterpolatorNS
{
template<class InputParameterDataT>
FromVertexMatching::FromVertexMatching(const InputParameterDataT& input_parameter_data,
const FEltSpace& source_felt_space,
const NumberingSubset& source_numbering_subset,
const FEltSpace& target_felt_space,
const NumberingSubset& target_numbering_subset,
pairing_type&& pairing)
{
GeometryNS::InterpolationNS::VertexMatching vertex_matching(input_parameter_data);
Construct(vertex_matching,
source_felt_space,
source_numbering_subset,
target_felt_space,
target_numbering_subset,
std::move(pairing));
}
} // namespace NonConformInterpolatorNS
} // namespace HappyHeart
#endif // HAPPY_HEART_x_OPERATORS_x_NON_CONFORM_INTERPOLATOR_x_FROM_VERTEX_MATCHING_HXX_
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment