Skip to content
Snippets Groups Projects
Commit aed9ac38 authored by Anna Wellmann's avatar Anna Wellmann
Browse files

add geometry BC in Gridgenerator (again)

(cherry picked from commit 4d49e04593989485e1c3710fe497fb45ae41d588)
parent a360fb39
No related branches found
No related tags found
4 merge requests!88add geometry BC in Gridgenerator (again),!82Fix bug in LBCalcMacCompSP27,!78Fix bugs in GridGenerator after merging GridGenerator from OpenSource into develop,!77Fix bugs in GridGenerator after merging GridGenerator from OpenSource into develop
......@@ -130,6 +130,47 @@ uint Side::getIndex(SPtr<Grid> grid, std::string coord, real constant, real v1,
}
void Geometry::addIndices(std::vector<SPtr<Grid> > grids, uint level, SPtr<BoundaryCondition> boundaryCondition)
{
auto geometryBoundaryCondition = std::dynamic_pointer_cast<GeometryBoundaryCondition>(boundaryCondition);
std::vector<real> qNode(grids[level]->getEndDirection() + 1);
for (uint index = 0; index < grids[level]->getSize(); index++)
{
if (grids[level]->getFieldEntry(index) != vf::gpu::BC_SOLID)
continue;
for (int dir = 0; dir <= grids[level]->getEndDirection(); dir++)
{
const real q = grids[level]->getQValue(index, dir);
qNode[dir] = q;
// also the neighbor if any Qs are required
real x,y,z;
grids[level]->transIndexToCoords( index, x, y, z );
x += grids[level]->getDirection()[dir * DIMENSION + 0] * grids[level]->getDelta();
y += grids[level]->getDirection()[dir * DIMENSION + 1] * grids[level]->getDelta();
z += grids[level]->getDirection()[dir * DIMENSION + 2] * grids[level]->getDelta();
uint neighborIndex = grids[level]->transCoordToIndex( x, y, z );
if( qNode[dir] < -0.5 && ( grids[level]->getFieldEntry(neighborIndex) == vf::gpu::STOPPER_OUT_OF_GRID_BOUNDARY ||
grids[level]->getFieldEntry(neighborIndex) == vf::gpu::STOPPER_OUT_OF_GRID ||
grids[level]->getFieldEntry(neighborIndex) == vf::gpu::STOPPER_SOLID ) )
qNode[dir] = 0.5;
}
geometryBoundaryCondition->indices.push_back(index);
geometryBoundaryCondition->qs.push_back(qNode);
geometryBoundaryCondition->patches.push_back( grids[level]->getQPatch(index) );
}
}
void MX::addIndices(std::vector<SPtr<Grid> > grid, uint level, SPtr<BoundaryCondition> boundaryCondition)
{
real startInner = grid[level]->getStartY();
......
......@@ -84,6 +84,27 @@ private:
static uint getIndex(SPtr<Grid> grid, std::string coord, real constant, real v1, real v2);
};
class Geometry : public Side
{
public:
void addIndices(std::vector<SPtr<Grid> > grid, uint level, SPtr<gg::BoundaryCondition> boundaryCondition) override;
int getCoordinate() const override
{
return X_INDEX;
}
int getDirection() const override
{
return NEGATIVE_DIR;
}
SideType whoAmI() const override
{
return SideType::GEOMETRY;
}
};
class MX : public Side
{
public:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment