22 else { level_set_index += 1; }
28 auto outside_of_domain = [&](
real_t value)
33 return (value - eps < 0.0);
38 return (value + eps < 0.0);
52 if (outside_of_domain(vals(j))) { count++; }
62 " One element cut by multiple level-sets.");
83 for (
int j = 0; j < nip; j++)
86 vals(j) = ls_func.
GetValue(tr->Elem2No, ip);
87 if (outside_of_domain(vals(j))) { count++; }
93 "An element cannot be excluded by more than 1 level-set.");
99 "An element cannot be cut by multiple level-sets.");
125 int te1 = elem_marker[tr->Elem1No], te2 = elem_marker[tr->Elem2No];
130 sface_dof_list.
Append(dofs);
136 sface_dof_list.
Append(dofs);
142 sface_dof_list.
Append(dofs);
148 sface_dof_list.
Append(dofs);
164 sface_dof_list.
Append(dofs);
176 int ne1 = tr->Elem1No;
177 int te1 = elem_marker[ne1];
186 sface_dof_list.
Append(dofs);
192 sface_dof_list.
Append(dofs);
209 int pmesh_bdr_attr_max = 0;
215 bool sbm_at_true_boundary =
false;
226 sbm_at_true_boundary =
true;
231 bool sbm_at_true_boundary_global =
false;
232 MPI_Allreduce(&sbm_at_true_boundary, &sbm_at_true_boundary_global, 1,
233 MPI_C_BOOL, MPI_LOR, MPI_COMM_WORLD);
234 if (sbm_at_true_boundary_global)
244 for (
int i = 0; i < ess_bdr.
Size(); i++)
246 ess_shift_bdr[i] = 1 - ess_bdr[i];
263 for (
int i = 0; i < dofs.
Size(); i++)
265 ess_vdofs[dofs[i]] = -1;
272 for (
int i = 0; i < dofs.
Size(); i++)
274 ess_vdofs[dofs[i]] = -1;
280 for (
int i = 0; i < ess_vdofs.Size(); i++)
282 if (ess_vdofs_bdr[i] == -1) { ess_vdofs[i] = -1; }
286 for (
int i = 0; i < sface_dof_list.
Size(); i++)
288 if (ess_vdofs_bdr[sface_dof_list[i]] != -1)
290 ess_vdofs[sface_dof_list[i]] = 0;
295 for (
int i = 0; i < ess_vdofs.Size() ; i++) { ess_vdofs[i] += 1; }
297 for (
int i = 0; i < ess_vdofs.Size() ; i++) { ess_vdofs[i] -= 1; }
327 for (
int j = 0; j < marker_gf.
Size(); j++)
329 if (marker_gf(j) > 0.1 && marker_gf(j) < 0.9)
347 sface_dof_list.
Append(dofs);
T Max() const
Find the maximal element in the array, using the comparison operator < for class T.
void SetSize(int nsize)
Change the logical size of the array, keep existing entries.
int Size() const
Return the logical size of the array.
void DeleteAll()
Delete the whole array.
int Append(const T &el)
Append element 'el' to array, resize if necessary.
DofTransformation * GetElementVDofs(int i, Array< int > &vdofs) const
Returns indices of degrees of freedom for the i'th element. The returned indices are offsets into an ...
static void MarkerToList(const Array< int > &marker, Array< int > &list)
Convert a Boolean marker array to a list containing all marked indices.
const IntegrationRule & GetNodes() const
Get a const reference to the nodes of the element.
Coefficient defined by a GridFunction. This coefficient is mesh dependent.
void GetValues(int i, const IntegrationRule &ir, Vector &vals, int vdim=1) const
Class for integration point with weight.
Class for an integration rule - an Array of IntegrationPoint.
int GetNPoints() const
Returns the number of the points in the integration rule.
IntegrationPoint & IntPoint(int i)
Returns a reference to the i-th integration point.
Container class for integration rules.
Arbitrary order "L2-conforming" discontinuous finite elements.
Array< int > bdr_attributes
A list of all unique boundary attributes used by the Mesh.
int GetNumFaces() const
Return the number of faces (3D), edges (2D) or vertices (1D).
int GetBdrElementFaceIndex(int be_idx) const
Return the local face (codimension-1) index for the given boundary element index.
int GetNE() const
Returns number of elements.
int Dimension() const
Dimension of the reference space used within the elements.
FaceElementTransformations * GetBdrFaceTransformations(int BdrElemNo)
Builds the transformation defining the given boundary face.
int GetNBE() const
Returns number of boundary elements.
FaceElementTransformations * GetInteriorFaceTransformations(int FaceNo)
See GetFaceElementTransformations().
Geometry::Type GetElementBaseGeometry(int i) const
void SetBdrAttribute(int i, int attr)
Set the attribute of boundary element i.
Abstract parallel finite element space.
void Synchronize(Array< int > &ldof_marker) const
Given an integer array on the local degrees of freedom, perform a bitwise OR between the shared dofs.
void GetEssentialVDofs(const Array< int > &bdr_attr_is_ess, Array< int > &ess_dofs, int component=-1) const override
Determine the boundary degrees of freedom.
int GetFaceDofs(int i, Array< int > &dofs, int variant=0) const override
const SparseMatrix * GetRestrictionMatrix() const override
Get the R matrix which restricts a local dof vector to true dof vector.
const FiniteElement * GetFE(int i) const override
Class for parallel grid function.
void ProjectDiscCoefficient(VectorCoefficient &coeff) override
Project a discontinuous vector coefficient as a grid function on a continuous finite element space....
real_t GetValue(int i, const IntegrationPoint &ip, int vdim=1) const override
ElementTransformation * GetFaceNbrElementTransformation(int FaceNo)
Returns a pointer to the transformation defining the i-th face neighbor.
int GetNSharedFaces() const
Return the number of shared faces (3D), edges (2D), vertices (1D)
void SetAttributes() override
Determine the sets of unique attribute values in domain and boundary elements.
int GetSharedFace(int sface) const
Return the local face index for the given shared face.
FaceElementTransformations * GetSharedFaceTransformations(int sf, bool fill2=true)
Get the FaceElementTransformations for the given shared face (edge 2D) using the shared face index sf...
bool initial_marking_done
void ListShiftedFaceDofs(const Array< int > &elem_marker, Array< int > &sface_dof_list) const
void MarkElements(const ParGridFunction &ls_func, Array< int > &elem_marker)
void ListShiftedFaceDofs2(const Array< int > &elem_marker, Array< int > &sface_dof_list) const
ParFiniteElementSpace * pfes_sltn
const bool func_dof_marking
const bool include_cut_cell
void ListEssentialTDofs(const Array< int > &elem_marker, const Array< int > &sface_dof_list, Array< int > &ess_tdof_list, Array< int > &ess_shift_bdr) const
void BooleanMult(const Array< int > &x, Array< int > &y) const
y = A * x, treating all entries as booleans (zero=false, nonzero=true).
int Size() const
Returns the size of the vector.
void SetSize(int s)
Resize the vector to size s.
IntegrationRules IntRulesLo(0, Quadrature1D::GaussLobatto)
std::function< real_t(const Vector &)> f(real_t mass_coeff)