Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
dg
dg
Commits
d1593341
Commit
d1593341
authored
Oct 07, 2016
by
philippe@leech
Committed by
Valentin Vallaeys
Oct 12, 2016
Browse files
slim3d Forcing Zero at Bnd now availabl on slim3d
It is forced on both 2D and 3D variables
parent
e4a7f8df
Changes
4
Hide whitespace changes
Inline
Side-by-side
modules/slim3d/slim3dSolver.cpp
View file @
d1593341
...
...
@@ -90,7 +90,11 @@ slim3dSolver::slim3dSolver(const std::string meshFile3d, std::vector<std::string
copy2d3d
=
new
dgSW3dDofCopy
(
columnInfo
);
verticalBottomRemover
=
new
dgSW3dVerticalBottomRemover
(
columnInfo
);
forceZeroUVAtBnd
=
new
slim3dForceZeroAtBnd
(
groups3d
,
physicalTags2d
);
std
::
vector
<
std
::
string
>
zeroBndTags
;
zeroBndTags
.
push_back
(
"coast"
);
zeroBndTags
.
push_back
(
"vertical_bottom"
);
forceZeroUVAtBnd
=
new
slim3dForceZeroAtBnd
(
groups3d
,
zeroBndTags
);
forceZeroUVAtBnd2d
=
new
slim3dForceZeroAtBnd
(
groups2d
,
zeroBndTags
);
}
slim3dSolver
::~
slim3dSolver
()
...
...
@@ -103,6 +107,7 @@ slim3dSolver::~slim3dSolver()
delete
_equations
;
delete
copy2d3d
;
delete
forceZeroUVAtBnd
;
delete
forceZeroUVAtBnd2d
;
if
(
wSolver
)
delete
wSolver
;
//if ( depthIntSolver ) delete depthIntSolver;
if
(
rSolver
)
delete
rSolver
;
...
...
modules/slim3d/slim3dSolver.h
View file @
d1593341
...
...
@@ -78,6 +78,7 @@ public:
dgCGMeanFilter
*
dgCG3d
,
*
dgCG2d
;
// dgCGStructure *dgCG3d, *dgCG2d;
slim3dForceZeroAtBnd
*
forceZeroUVAtBnd
;
slim3dForceZeroAtBnd
*
forceZeroUVAtBnd2d
;
/** Create a solver instance and load 3d and 2d mesh */
slim3dSolver
(
const
std
::
string
meshFile3d
,
std
::
vector
<
std
::
string
>
bottomBndTags
=
std
::
vector
<
std
::
string
>
(),
std
::
vector
<
std
::
string
>
topBndTags
=
std
::
vector
<
std
::
string
>
(),
std
::
string
periodicMapFile
=
""
);
...
...
modules/slim3d/slim3dTimeIntegrator.cpp
View file @
d1593341
...
...
@@ -1128,6 +1128,8 @@ void slim3dTimeIntegratorPC::advanceOneTimeStep()
// uvAvDof2d_old->copy(*d->uvAvDof2d);
e
->
uv2dEq
->
computeAllTerms
(
time2d
,
*
d
->
uvAvDof2d
,
*
uvAvDof2d_K
,
false
);
uvAvDof2d_K
->
multiplyByInvMassMatrix
();
if
(
s
->
getForceZeroUVAtBnd
()
)
s
->
forceZeroUVAtBnd2d
->
forceZeroAtBnd
(
uvAvDof2d_K
);
if
(
iterAB
==
0
)
{
// Euler step to begin with !
d
->
uvAvDof2d
->
axpy
(
*
uvAvDof2d_K
,
_dt
);
...
...
modules/slim3d/slim3dUtils.cpp
View file @
d1593341
...
...
@@ -1185,25 +1185,34 @@ void slim3dForceZeroAtBnd::forceZeroAtBnd(dgDofContainer* dof)
{
dgFullMatrix
<
double
>
data
;
fullMatrix
<
double
>
normals
;
functorCache
cacheMap
(
functorCache
::
NODE_MODE
,
_groups
);
for
(
int
iFaceGroup
=
0
;
iFaceGroup
<
_groups
->
getNbFaceGroups
();
++
iFaceGroup
){
dgGroupOfFaces
*
faceGroup
=
_groups
->
getFaceGroup
(
iFaceGroup
);
std
::
vector
<
std
::
string
>::
iterator
it
=
std
::
find
(
_physicalTags
.
begin
(),
_physicalTags
.
end
(),
faceGroup
->
physicalTag
());
std
::
vector
<
std
::
string
>::
iterator
it
=
std
::
find
(
_physicalTags
.
begin
(),
_physicalTags
.
end
(),
faceGroup
->
physicalTag
());
if
(
it
!=
_physicalTags
.
end
()
){
for
(
size_t
iFace
=
0
;
iFace
<
faceGroup
->
size
();
++
iFace
){
const
std
::
vector
<
int
>
&
cl
=
faceGroup
->
closure
(
iFace
,
0
);
size_t
iGroup
=
_groups
->
getElementGroupId
(
&
faceGroup
->
elementGroup
(
0
));
size_t
iElem
=
faceGroup
->
elementId
(
iFace
,
0
);
dof
->
getElementProxy
(
iGroup
,
iElem
,
data
);
faceGroup
->
normal
(
*
_jacobians
,
iFace
,
0
,
normals
);
//printf("%s, %d ..\n", faceGroup->physicalTag().c_str(), iFace);
//faceGroup->normal(*_jacobians, iFace, 0, normals);
const
dgGroupOfElements
*
groupIn
=
&
faceGroup
->
elementGroup
(
0
);
cacheMap
.
setGroup
(
groupIn
);
const
dgMeshJacobian
&
jacobians
=
cacheMap
.
jacobian
();
faceGroup
->
normal
(
jacobians
,
iFace
,
0
,
normals
);
for
(
int
iNode
=
0
;
iNode
<
faceGroup
->
getNbNodes
();
++
iNode
){
if
(
_alreadyForced
[
iGroup
][
iElem
][
cl
[
iNode
]]){
data
(
cl
[
iNode
],
0
)
=
0
;
data
(
cl
[
iNode
],
1
)
=
0
;
}
else
{
double
dataN
=
data
(
cl
[
iNode
],
0
)
*
normals
(
iNode
,
0
)
+
data
(
cl
[
iNode
],
1
)
*
normals
(
iNode
,
1
);
data
(
cl
[
iNode
],
0
)
=
data
(
cl
[
iNode
],
0
)
-
normals
(
iNode
,
0
)
*
dataN
;
data
(
cl
[
iNode
],
1
)
=
data
(
cl
[
iNode
],
1
)
-
normals
(
iNode
,
1
)
*
dataN
;
//double dataN = data(cl[iNode], 0) * normals(iNode, 0) + data(cl[iNode], 1) * normals(iNode, 1);
//data(cl[iNode], 0) = data(cl[iNode], 0) - normals(iNode, 0) * dataN;
//data(cl[iNode], 1) = data(cl[iNode], 1) - normals(iNode, 1) * dataN;
double
dataN
=
data
(
cl
[
iNode
],
0
)
*
normals
(
0
,
0
)
+
data
(
cl
[
iNode
],
1
)
*
normals
(
0
,
1
);
data
(
cl
[
iNode
],
0
)
=
data
(
cl
[
iNode
],
0
)
-
normals
(
0
,
0
)
*
dataN
;
data
(
cl
[
iNode
],
1
)
=
data
(
cl
[
iNode
],
1
)
-
normals
(
0
,
1
)
*
dataN
;
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment