27 #include "petsc_utils.h" 37 log_msg(0,5,0,
"%s error: mesh of type \"%s\" not found! Aborting!",
86 for(
size_t i=0; i<from_alg_nod.
size(); i++) {
87 mesh_int_t from_idx = from_nodal_nbr[from_alg_nod[i]];
95 from_numbering[i] = from_idx;
96 to_numbering[i] = to_idx;
100 log_msg(0,5,0,
"%s error: Bad inter-domain mapping. Aborting!", __func__);
105 to_mesh.
pl.algebraic_layout(), from_numbering, to_numbering, rank, dpn);
112 SF::interval(to_numbering, nodal_layout[rank], nodal_layout[rank+1]);
115 nodal_layout, from_nodal_nbr, to_numbering, rank, dpn);
154 for(
size_t i=0; i<alg_nod.
size(); i++)
156 petsc_alg_nod[i] = petsc_nbr[alg_nod[i]];
157 canon_alg_nod[i] = canon_nbr[alg_nod[i]];
172 for(
size_t i=0; i<canon_nbr.
size(); i++)
174 petsc_nod[i] = elem_layout[rank] + i;
175 canon_nod[i] = canon_nbr[i];
198 log_msg(0,5,0,
"%s error: Unknown permutation id. Aborting!", __func__);
SF::scattering * get_permutation(const int mesh_id, const int perm_id, const int dpn)
Get the PETSC to canonical permutation scattering for a given mesh and number of dpn.
The mesh storage class. It contains both element and vertex data.
non_overlapping_layout< T > epl
element parallel layout
vector< T > & get_numbering(SF_nbr nbr_type)
Get the vector defining a certain numbering.
PETSc numbering of nodes.
#define PETSC_TO_CANONICAL
Permute algebraic data from PETSC to canonical ordering.
scattering * register_permutation(const quadruple< int > spec, const vector< T > &nbr_a, const vector< T > &nbr_b, const size_t gsize_a, const size_t gsize_b, const short dpn)
Register a permutation scattering.
scattering * get_scattering(const quadruple< int > spec)
Access an previously registered scattering.
void interval(vector< T > &vec, size_t start, size_t end)
Create an integer interval between start and end.
overlapping_layout< T > pl
nodal parallel layout
std::map< mesh_t, sf_mesh > mesh_reg
Registry for the different meshes used in a multi-physics simulation.
const char * get_mesh_type_name(mesh_t t)
get a char* to the name of a mesh type
mesh_t
The enum identifying the different meshes we might want to load.
SF_nbr
Enumeration encoding the different supported numberings.
#define ELEM_PETSC_TO_CANONICAL
Permute algebraic element data from PETSC to canonical ordering.
scattering * register_scattering(const quadruple< int > spec, const vector< T > &layout_a, const vector< T > &layout_b, const vector< T > &idx_a, const vector< T > &idx_b, const int rank, const int dpn)
Register a scattering.
SF::scattering * get_scattering(const int from, const int to, const SF::SF_nbr nbr, const int dpn)
Get a scattering from the global scatter registry.
Submesh nodal numbering: The globally ascending sorted reference indices are reindexed.
std::map< SF::quadruple< int >, SF::index_mapping< int > > map_reg
Registriy for the inter domain mappings.
sf_mesh & get_mesh(const mesh_t gt)
Get a mesh by specifying the gridID.
Submesh element numbering: The globally ascending sorted reference indices are reindexed.
SF::scattering * register_permutation(const int mesh_id, const int perm_id, const int dpn)
Register a permutation between two orderings for a mesh.
#define ALG_TO_NODAL
Scatter algebraic to nodal.
bool have_scattering(const int from, const int to, const SF::SF_nbr nbr, const int dpn)
T get_global(T in, MPI_Op OP, MPI_Comm comm=PETSC_COMM_WORLD)
Do a global reduction on a variable.
void inter_domain_mapping(const meshdata< T, S > &mesh_a, const meshdata< T, S > &mesh_b, const SF_nbr snbr, index_mapping< T > &a_to_b)
Submesh index mapping between different domains/meshes.
size_t size() const
The current size of the vector.
void log_msg(FILE_SPEC out, int level, unsigned char flag, const char *fmt,...)
bool mesh_is_registered(const mesh_t gt)
check wheter a SF mesh is set
bool have_permutation(const int mesh_id, const int perm_id, const int dpn)
size_t g_numpts
global number of points
T forward_map(T idx) const
Map one index from a to b.
size_t g_numelem
global number of elements
SF::scattering * register_scattering(const int from, const int to, const SF::SF_nbr nbr, const int dpn)
Register a scattering between to grids, or between algebraic and nodal representation of data on the ...
Simulator-level utility execution control functions.
int get_rank(MPI_Comm comm=PETSC_COMM_WORLD)
SF::scatter_registry scatter_reg
Registry for the different scatter objects.
Container for a PETSc VecScatter.