feat(field-support): added field support system, mid migration
currently the barotope and the pressure force operator are migrated to the new support system
This commit is contained in:
@@ -10,18 +10,14 @@ namespace mean_field::utils {
|
||||
DOMAINS lhs,
|
||||
DOMAINS rhs
|
||||
) {
|
||||
return static_cast<DOMAINS>(
|
||||
static_cast<uint8_t>(lhs) | static_cast<uint8_t>(rhs)
|
||||
);
|
||||
return static_cast<DOMAINS>(static_cast<uint8_t>(lhs) | static_cast<uint8_t>(rhs));
|
||||
}
|
||||
|
||||
DOMAINS operator&(
|
||||
DOMAINS lhs,
|
||||
DOMAINS rhs
|
||||
) {
|
||||
return static_cast<DOMAINS>(
|
||||
static_cast<uint8_t>(lhs) & static_cast<uint8_t>(rhs)
|
||||
);
|
||||
return static_cast<DOMAINS>(static_cast<uint8_t>(lhs) & static_cast<uint8_t>(rhs));
|
||||
}
|
||||
|
||||
void populate_element_mask(
|
||||
@@ -37,8 +33,7 @@ namespace mean_field::utils {
|
||||
mask[0] = 1;
|
||||
}
|
||||
|
||||
if ((domain & DOMAINS::ENVELOPE) == DOMAINS::ENVELOPE &&
|
||||
max_attr >= 2) {
|
||||
if ((domain & DOMAINS::ENVELOPE) == DOMAINS::ENVELOPE && max_attr >= 2) {
|
||||
mask[1] = 1;
|
||||
}
|
||||
|
||||
@@ -92,10 +87,7 @@ namespace mean_field::utils {
|
||||
mesh->GetElementVertices(i, vertices);
|
||||
for (const int v : vertices) {
|
||||
const double *coords = mesh->GetVertex(v);
|
||||
double r = std::sqrt(
|
||||
coords[0] * coords[0] + coords[1] * coords[1] +
|
||||
coords[2] * coords[2]
|
||||
);
|
||||
double r = std::sqrt(coords[0] * coords[0] + coords[1] * coords[1] + coords[2] * coords[2]);
|
||||
local_min_r = std::min(local_min_r, r);
|
||||
local_max_r = std::max(local_max_r, r);
|
||||
}
|
||||
@@ -111,15 +103,9 @@ namespace mean_field::utils {
|
||||
comm = pmesh->GetComm();
|
||||
}
|
||||
|
||||
MPI_Allreduce(
|
||||
&local_min_r, &global_min_r, 1, MPI_DOUBLE, MPI_MIN, comm
|
||||
);
|
||||
MPI_Allreduce(
|
||||
&local_max_r, &global_max_r, 1, MPI_DOUBLE, MPI_MAX, comm
|
||||
);
|
||||
MPI_Allreduce(
|
||||
&l_found, &global_found_vacuum, 1, MPI_INT, MPI_MAX, comm
|
||||
);
|
||||
MPI_Allreduce(&local_min_r, &global_min_r, 1, MPI_DOUBLE, MPI_MIN, comm);
|
||||
MPI_Allreduce(&local_max_r, &global_max_r, 1, MPI_DOUBLE, MPI_MAX, comm);
|
||||
MPI_Allreduce(&l_found, &global_found_vacuum, 1, MPI_INT, MPI_MAX, comm);
|
||||
|
||||
if (global_found_vacuum) {
|
||||
return boundary::Bounds(global_min_r, global_max_r);
|
||||
|
||||
Reference in New Issue
Block a user