Compare commits

...
2 changed files with 40 additions and 0 deletions
+20
View File
@@ -2750,6 +2750,26 @@ void GridFunction::ProjectBdrCoefficientNormal(
void GridFunction::ProjectBdrCoefficientTangent(
VectorCoefficient &vcoeff, const Array<int> &bdr_attr)
{
if (fes->FEColl()->GetContType() == FiniteElementCollection::TANGENTIAL)
{
const FiniteElement *fe;
ElementTransformation *T;
Array<int> vdofs;
Vector vals;
for (int i = 0; i < fes->GetNBE(); i++)
{
if (bdr_attr[fes->GetBdrAttribute(i) - 1] == 0) { continue; }
fe = fes->GetBE(i);
T = fes->GetBdrElementTransformation(i);
fes->GetBdrElementVDofs(i, vdofs);
vals.SetSize(vdofs.Size());
fe->Project(vcoeff, *T, vals);
SetSubVector(vdofs, vals);
}
return;
}
Array<int> values_counter;
AccumulateAndCountBdrTangentValues(vcoeff, bdr_attr, values_counter);
ComputeMeans(ARITHMETIC, values_counter);
+20
View File
@@ -711,6 +711,26 @@ void ParGridFunction::ProjectBdrCoefficient(
void ParGridFunction::ProjectBdrCoefficientTangent(VectorCoefficient &vcoeff,
const Array<int> &bdr_attr)
{
if (pfes->FEColl()->GetContType() == FiniteElementCollection::TANGENTIAL)
{
const FiniteElement *fe;
ElementTransformation *T;
Array<int> vdofs;
Vector vals;
for (int i = 0; i < pfes->GetNBE(); i++)
{
if (bdr_attr[pfes->GetBdrAttribute(i) - 1] == 0) { continue; }
fe = pfes->GetBE(i);
T = pfes->GetBdrElementTransformation(i);
pfes->GetBdrElementVDofs(i, vdofs);
vals.SetSize(vdofs.Size());
fe->Project(vcoeff, *T, vals);
SetSubVector(vdofs, vals);
}
return;
}
Array<int> values_counter;
AccumulateAndCountBdrTangentValues(vcoeff, bdr_attr, values_counter);