https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ElementPairLocator.h
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
10#pragma once
11
12#include <list>
13
14// MOOSE includes
15#include "Moose.h"
16#include "DataIO.h"
17#include "ElementPairInfo.h"
18
19#include "libmesh/vector_value.h"
20#include "libmesh/point.h"
21
22// libMesh forward declarations
23namespace libMesh
24{
25class Node;
26class Elem;
27}
28
35{
36public:
37 ElementPairLocator(unsigned int interface_id) : _elem_pairs(NULL)
38 {
39 _interface_id = interface_id;
40 }
41
43
44 typedef std::list<std::pair<const Elem *, const Elem *>> ElementPairList;
45
46 virtual void reinit() {}
47
48 virtual void update() {}
49
51 {
52 if (_elem_pairs == NULL)
53 mooseError("_elem_pairs has not yet been initialized and it needs to be initialized by a "
54 "derived class");
55 return *_elem_pairs;
56 }
57
58 const ElementPairInfo & getElemPairInfo(std::pair<const Elem *, const Elem *> elem_pair) const
59 {
60 std::map<std::pair<const Elem *, const Elem *>, ElementPairInfo>::const_iterator it =
61 _element_pair_info.find(elem_pair);
62 if (it == _element_pair_info.end())
63 mooseError("Could not find ElemenPairInfo for specified element pair");
64 return it->second;
65 }
66
67protected:
69 std::map<std::pair<const Elem *, const Elem *>, ElementPairInfo> _element_pair_info;
70 unsigned int _interface_id;
71};
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
Definition MooseError.h:311
This is the ElementPairInfo class.
This is the ElementPairLocator class.
const ElementPairList & getElemPairs() const
const ElementPairList * _elem_pairs
ElementPairLocator(unsigned int interface_id)
std::list< std::pair< const Elem *, const Elem * > > ElementPairList
const ElementPairInfo & getElemPairInfo(std::pair< const Elem *, const Elem * > elem_pair) const
std::map< std::pair< const Elem *, const Elem * >, ElementPairInfo > _element_pair_info
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...