Commit 36b530bf authored by Philippe Delandmeter's avatar Philippe Delandmeter Committed by Valentin Vallaeys
Browse files

ForceUVZeroBnd. tag list is given as a parameter

parent d1593341
Pipeline #1083 passed with stage
in 32 minutes and 28 seconds
......@@ -90,11 +90,8 @@ slim3dSolver::slim3dSolver(const std::string meshFile3d, std::vector<std::string
copy2d3d = new dgSW3dDofCopy(columnInfo);
verticalBottomRemover = new dgSW3dVerticalBottomRemover(columnInfo);
std::vector<std::string> zeroBndTags;
zeroBndTags.push_back("coast");
zeroBndTags.push_back("vertical_bottom");
forceZeroUVAtBnd = new slim3dForceZeroAtBnd(groups3d, zeroBndTags);
forceZeroUVAtBnd2d = new slim3dForceZeroAtBnd(groups2d, zeroBndTags);
forceZeroUVAtBnd3d = new slim3dForceZeroAtBnd(groups3d);
forceZeroUVAtBnd2d = new slim3dForceZeroAtBnd(groups2d);
}
slim3dSolver::~slim3dSolver()
......@@ -106,7 +103,7 @@ slim3dSolver::~slim3dSolver()
delete functions;
delete _equations;
delete copy2d3d;
delete forceZeroUVAtBnd;
delete forceZeroUVAtBnd3d;
delete forceZeroUVAtBnd2d;
if ( wSolver ) delete wSolver;
//if ( depthIntSolver ) delete depthIntSolver;
......
......@@ -77,7 +77,7 @@ public:
dgJumpDiffusionTracer *jumpDiffTracerS, *jumpDiffTracerT, *jumpDiffTracerVertS, *jumpDiffTracerVertT;
dgCGMeanFilter *dgCG3d, *dgCG2d;
// dgCGStructure *dgCG3d, *dgCG2d;
slim3dForceZeroAtBnd *forceZeroUVAtBnd;
slim3dForceZeroAtBnd *forceZeroUVAtBnd3d;
slim3dForceZeroAtBnd *forceZeroUVAtBnd2d;
/** Create a solver instance and load 3d and 2d mesh */
......@@ -202,7 +202,11 @@ public:
const dgExtrusion &extrusion() const { return *columnInfo; }
void setSolve3d(bool f) {_solve3d = f;};
bool getSolve3d() {return _solve3d;};
void setForceZeroUVAtBnd(bool f) {_useForceZeroUVAtBnd = f;};
void setForceZeroUVAtBnd(std::vector<std::string> physicalTags) {
_useForceZeroUVAtBnd = true;
forceZeroUVAtBnd2d->setup(physicalTags);
forceZeroUVAtBnd3d->setup(physicalTags);
};
bool getForceZeroUVAtBnd() {return _useForceZeroUVAtBnd;};
void setUseRGradByPart(bool f) {_useRGradByPart = f;};
bool getUseRGradByPart() {return _useRGradByPart;};
......
......@@ -478,7 +478,7 @@ void slim3dTimeIntegrator::uvDependencies(dgDofContainer *uvIntTargetDof2d, bool
//s->verticalBottomRemover->removeBelowVertBottom(d->uvDof);
if ( s->getForceZeroUVAtBnd() )
s->forceZeroUVAtBnd->forceZeroAtBnd(d->uvDof);
s->forceZeroUVAtBnd3d->forceZeroAtBnd(d->uvDof);
s->newDepthIntegrator->integrate(d->uvDof,d->uvIntDof2d,false);
f->uvInt2dFunc->compute(*d->uvIntDof2d->getFunction(), dataCacheMap::NODE_GROUP_MODE);
......
......@@ -1142,12 +1142,15 @@ void slim3dZDiff1dEq::computeZStar(const dgDofContainer* errorDof3d, const dgDof
}
slim3dForceZeroAtBnd::slim3dForceZeroAtBnd(dgGroupCollection* groups, std::vector<std::string> physicalTags)
slim3dForceZeroAtBnd::slim3dForceZeroAtBnd(dgGroupCollection* groups)
{
_groups = groups;
_jacobians = &_groups->mesh().getJacobian(3); // only valid for P1
_physicalTags = physicalTags;
}
void slim3dForceZeroAtBnd::setup(std::vector<std::string> physicalTags)
{
_physicalTags = physicalTags;
// If a node is force at two boundaries, vel = 0;
// Here those points are precomputed.
// alreadyForced is at true at the beginning
......
......@@ -165,8 +165,9 @@ private:
std::vector<std::string> _physicalTags;
std::vector<std::vector<std::vector<int> > > _alreadyForced;
public:
slim3dForceZeroAtBnd(dgGroupCollection* _groups, std::vector<std::string> physicalTags);
slim3dForceZeroAtBnd(dgGroupCollection* _groups);
~slim3dForceZeroAtBnd();
void setup(std::vector<std::string> physicalTags);
void forceZeroAtBnd(dgDofContainer* dof);
};
......
......@@ -14,11 +14,12 @@ slimSolver = slim3dSolver('box_3d.msh', ['bottom_sea'], ['top_sea'])
d = slimSolver.getDofs(True)
f = slimSolver.functions
f.initializeBath()
slimSolver.setForceZeroUVAtBnd(['north', 'west'])
dof = dgDofContainer(slimSolver.groups3d,2)
dof.setAll([1,2])
forceZero = slim3dForceZeroAtBnd(slimSolver.groups3d, ['north','west'])
forceZero.forceZeroAtBnd(dof)
#forceZero = slim3dForceZeroAtBnd(slimSolver.groups3d, ['north','west'])
slimSolver.forceZeroUVAtBnd3d.forceZeroAtBnd(dof)
print('\n\n')
Msg.Info('TEST if the normal velocity is put to zero close to north and west bnd')
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment