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:
@@ -29,10 +29,8 @@ namespace mean_field::utils {
|
||||
mfem::Array<mfem::IntegrationPoint> origin_ip;
|
||||
fem.mesh->FindPoints(P_origin, origin_elem, origin_ip, false);
|
||||
|
||||
if (origin_elem.Size() > 0 && origin_elem[0] >= 0 &&
|
||||
fem.mapping->HasDisplacementField()) {
|
||||
mfem::ElementTransformation *T0 =
|
||||
fem.mesh->GetElementTransformation(origin_elem[0]);
|
||||
if (origin_elem.Size() > 0 && origin_elem[0] >= 0 && fem.mapping->HasDisplacementField()) {
|
||||
mfem::ElementTransformation *T0 = fem.mesh->GetElementTransformation(origin_elem[0]);
|
||||
T0->SetIntPoint(&origin_ip[0]);
|
||||
|
||||
mfem::DenseMatrix J0(dim, dim), J0_inv(dim, dim);
|
||||
@@ -98,8 +96,7 @@ namespace mean_field::utils {
|
||||
int elemID = elem_ids[0];
|
||||
const mfem::IntegrationPoint &ip = ips[0];
|
||||
|
||||
mfem::ElementTransformation *T =
|
||||
fem.mesh->GetElementTransformation(elemID);
|
||||
mfem::ElementTransformation *T = fem.mesh->GetElementTransformation(elemID);
|
||||
T->SetIntPoint(&ip);
|
||||
|
||||
mfem::Vector current_x_phys(dim);
|
||||
@@ -160,8 +157,7 @@ namespace mean_field::utils {
|
||||
const mapping::COORDINATE_SPACE rspace
|
||||
) {
|
||||
mfem::Vector x_search;
|
||||
if (vspace == mapping::COORDINATE_SPACE::PHYSICAL &&
|
||||
fem.has_mapping()) {
|
||||
if (vspace == mapping::COORDINATE_SPACE::PHYSICAL && fem.has_mapping()) {
|
||||
GetReferencePoint(fem, x, x_search);
|
||||
} else {
|
||||
x_search = x;
|
||||
@@ -177,8 +173,7 @@ namespace mean_field::utils {
|
||||
double local_val = 0.0;
|
||||
if (elem_ids.Size() > 0 && elem_ids[0] >= 0) {
|
||||
const double val = u.GetValue(elem_ids[0], ips[0]);
|
||||
if (rspace == mapping::COORDINATE_SPACE::PHYSICAL &&
|
||||
!fem.has_mapping()) {
|
||||
if (rspace == mapping::COORDINATE_SPACE::PHYSICAL && !fem.has_mapping()) {
|
||||
MFEM_ABORT(
|
||||
"Physical evaluation mode requested but no mapping "
|
||||
"provided. Check "
|
||||
@@ -189,9 +184,7 @@ namespace mean_field::utils {
|
||||
}
|
||||
|
||||
double global_val = 0.0;
|
||||
MPI_Allreduce(
|
||||
&local_val, &global_val, 1, MPI_DOUBLE, MPI_MAX, fem.mesh->GetComm()
|
||||
);
|
||||
MPI_Allreduce(&local_val, &global_val, 1, MPI_DOUBLE, MPI_MAX, fem.mesh->GetComm());
|
||||
return global_val;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user