7 #ifndef PORTAGE_SEARCH_SEARCH_SWEPT_FACE_H_ 8 #define PORTAGE_SEARCH_SEARCH_SWEPT_FACE_H_ 26 template <
int D, Entity_kind on_what,
27 typename SourceMeshType,
typename TargetMeshType>
46 const TargetMeshType & target_mesh)
47 : sourceMesh_(source_mesh), targetMesh_(target_mesh) {
49 int numSourceCells = sourceMesh_.num_owned_cells() +
50 sourceMesh_.num_ghost_cells();
51 int numTargetCells = targetMesh_.num_owned_cells() +
52 targetMesh_.num_ghost_cells();
53 assert(numSourceCells == numTargetCells);
76 std::vector<int> candidates;
77 std::cerr <<
"Swept face search is not implemented for a generic entity kind" << std::endl;
82 const SourceMeshType &sourceMesh_;
83 const TargetMeshType &targetMesh_;
93 template <
int D,
typename SourceMeshType,
typename TargetMeshType>
113 const TargetMeshType & target_mesh)
114 : sourceMesh_(source_mesh), targetMesh_(target_mesh) {
116 int numSourceCells = sourceMesh_.num_owned_cells() +
117 sourceMesh_.num_ghost_cells();
118 int numTargetCells = targetMesh_.num_owned_cells() +
119 targetMesh_.num_ghost_cells();
120 assert(numSourceCells == numTargetCells);
141 std::vector<int> candidates;
142 std::cerr <<
"Swept face search is not implemented for nodal control volumes" << std::endl;
147 const SourceMeshType &sourceMesh_;
148 const TargetMeshType &targetMesh_;
158 template <
int D,
typename SourceMeshType,
typename TargetMeshType>
177 const TargetMeshType & target_mesh)
178 : sourceMesh_(source_mesh), targetMesh_(target_mesh) {
180 int numSourceCells = sourceMesh_.num_owned_cells() +
181 sourceMesh_.num_ghost_cells();
182 int numTargetCells = targetMesh_.num_owned_cells() +
183 targetMesh_.num_ghost_cells();
184 assert(numSourceCells == numTargetCells);
204 std::vector<int> candidates;
205 sourceMesh_.cell_get_face_adj_cells(entityId, Entity_type::ALL, &candidates);
207 std::vector<int> alt_candidates;
208 targetMesh_.cell_get_face_adj_cells(entityId, Entity_type::ALL, &alt_candidates);
209 assert(candidates.size() == alt_candidates.size());
210 int const num_candidates = candidates.size();
211 for (
int icc = 0; icc < num_candidates; icc++)
212 assert(candidates[icc] == alt_candidates[icc]);
219 const SourceMeshType &sourceMesh_;
220 const TargetMeshType &targetMesh_;
225 #endif // PORTAGE_SEARCH_SEARCH_SWEPT_FACE_H_ SearchSweptFace & operator=(const SearchSweptFace &)=delete
Assignment operator (disabled)
SearchSweptFace(const SourceMeshType &source_mesh, const TargetMeshType &target_mesh)
Builds the search structure for the swept face algorithm.
Definition: search_swept_face.h:112
std::vector< int > operator()(const int entityId) const
Find the source mesh entities that are adjacent to the given target mesh entity through the faces...
Definition: search_swept_face.h:75
~SearchSweptFace()=default
Destructor.
SearchSweptFace()=delete
Default constructor (disabled)
The search algorithm that is used for the swept face remap.
Definition: search_swept_face.h:28
SearchSweptFace(const SourceMeshType &source_mesh, const TargetMeshType &target_mesh)
Builds the search structure for the swept face algorithm.
Definition: search_swept_face.h:45
Definition: coredriver.h:42
SearchSweptFace(const SourceMeshType &source_mesh, const TargetMeshType &target_mesh)
Builds the search structure for the swept face algorithm.
Definition: search_swept_face.h:176