Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sanne potential master #23

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
740 changes: 740 additions & 0 deletions scripts/util/conv_rates_immersed.lua

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions scripts/util/domain_disc_util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ function NavierStokesInflow(spMaster)

local discType = spMaster:disc_type();
if discType == "fv1" then return NavierStokesInflowFV1(spMaster)
elseif discType == "fv1_cutElem" then return NavierStokesInflowFV1_cutElem(spMaster)
elseif discType == "fv" then return NavierStokesInflowFV(spMaster)
elseif discType == "fvcr" then return NavierStokesInflowFVCR(spMaster)
elseif discType == "fe" then return NavierStokesInflowFE(spMaster)
Expand Down
1 change: 1 addition & 0 deletions ugbase/bridge/disc_bridges/integrate_bridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ static void DomainAlgebra(Registry& reg, string grp)
reg.add_function("L2Error",static_cast<number (*)(SmartPtr<TFct>, const char*, SmartPtr<TFct>, const char*, int)>(&L2Error<TFct>), grp);
reg.add_function("L2Error",static_cast<number (*)(SmartPtr<UserData<number, dim> >, SmartPtr<TFct>, const char*, number, int, const char*)>(&L2Error<TFct>), grp);
reg.add_function("L2Error",static_cast<number (*)(SmartPtr<UserData<number, dim> >, SmartPtr<TFct>, const char*, number, int)>(&L2Error<TFct>), grp);
reg.add_function("L2ErrorInside",static_cast<number (*)(SmartPtr<TFct>, const char*, SmartPtr<TFct>, const char*, int)>(&L2ErrorInside<TFct>), grp);
#ifdef UG_FOR_LUA
reg.add_function("L2Error",static_cast<number (*)(const char*, SmartPtr<TFct>, const char*, number, int, const char*)>(&L2Error<TFct>), grp);
reg.add_function("L2Error",static_cast<number (*)(const char*, SmartPtr<TFct>, const char*, number, int)>(&L2Error<TFct>), grp);
Expand Down
2 changes: 2 additions & 0 deletions ugbase/lib_disc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ set(srcDiscretization domain.cpp
spatial_disc/disc_util/fe_geom.cpp
spatial_disc/disc_util/fvho_geom.cpp
spatial_disc/disc_util/fv1_geom.cpp
spatial_disc/disc_util/fv1FT_geom.cpp
spatial_disc/disc_util/fv1Cut_geom.cpp
spatial_disc/disc_util/fvcr_geom.cpp
spatial_disc/disc_util/hfv1_geom.cpp
spatial_disc/disc_util/hfvcr_geom.cpp
Expand Down
44 changes: 42 additions & 2 deletions ugbase/lib_disc/common/geometry_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,7 @@ struct ElementSideRayIntersectionWrapper<TRefElem, 3, 3>
// find side
for(sideOut = 0; sideOut < rRefElem.num(dim-1); ++sideOut)
{
// get corners
// A1. get corners
p0 = rRefElem.id(dim-1, sideOut, 0, 0);
p1 = rRefElem.id(dim-1, sideOut, 0, 1);
p2 = rRefElem.id(dim-1, sideOut, 0, 2);
Expand All @@ -819,7 +819,11 @@ struct ElementSideRayIntersectionWrapper<TRefElem, 3, 3>
// second triangle (only if 4 corners)
if(rRefElem.num(dim-1, sideOut, 0) == 3) continue;

// get corner number 4
// B1. get corner number 4 as p2 and replace p1 by p2
// (In case of a quadrilateral whose corners are numbered counterclockwise by (1,2,3,4),
// we decompose it into the triangle with corners (1,2,3) and the triangle (1,3,4).)

p1 = rRefElem.id(dim-1, sideOut, 0, 2); // added in order to create disjunct triangles filling the quadrilateral completely
p2 = rRefElem.id(dim-1, sideOut, 0, 3);

// if match: break
Expand All @@ -830,6 +834,42 @@ struct ElementSideRayIntersectionWrapper<TRefElem, 3, 3>
if(bPositiv && t >= 0.0) break;
else if(!bPositiv && t <= 0.0) break;
}

// repeat the procedures A. and B. but by cutting the quadrilateral
// along the other diagonal into 2 triangles
// (necessary for cases, where the 4 corners do not form a flat
// quadrilateral. In such cases it can happen, that the intersection
// point found lies outside the element formed by the two triangles.)

// A2. get corners
p0 = rRefElem.id(dim-1, sideOut, 0, 1);
p1 = rRefElem.id(dim-1, sideOut, 0, 2);
p2 = rRefElem.id(dim-1, sideOut, 0, 3);

// if match: break
if(RayTriangleIntersection( GlobalIntersectionPointOut, bc0, bc1, t,
vCornerCoords[p0], vCornerCoords[p1], vCornerCoords[p2],
From, Direction))
{
if(bPositiv && t >= 0.0) break;
else if(!bPositiv && t <= 0.0) break;
}

// second triangle (only if 4 corners)
if(rRefElem.num(dim-1, sideOut, 0) == 3) continue;

// B2. get corner number 1 as p2 and replace p1 by p2
p1 = rRefElem.id(dim-1, sideOut, 0, 3); // added in order to create dijunct triangles filling the quadrilateral completely
p2 = rRefElem.id(dim-1, sideOut, 0, 0);

// if match: break
if(RayTriangleIntersection( GlobalIntersectionPointOut, bc0, bc1, t,
vCornerCoords[p0], vCornerCoords[p1], vCornerCoords[p2],
From, Direction))
{
if(bPositiv && t >= 0.0) break;
else if(!bPositiv && t <= 0.0) break;
}
}

// if not found
Expand Down
Loading