Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Nektar
Nektar
Commits
53ca2126
Commit
53ca2126
authored
Feb 21, 2017
by
Julian Marcon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made adjust options accessible to the user.
parent
e1c76f08
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
18 deletions
+47
-18
library/NekMeshUtils/2DGenerator/2DGenerator.cpp
library/NekMeshUtils/2DGenerator/2DGenerator.cpp
+16
-10
utilities/NekMesh/InputModules/InputMCF.cpp
utilities/NekMesh/InputModules/InputMCF.cpp
+29
-6
utilities/NekMesh/InputModules/InputMCF.h
utilities/NekMesh/InputModules/InputMCF.h
+2
-2
No files found.
library/NekMeshUtils/2DGenerator/2DGenerator.cpp
View file @
53ca2126
...
...
@@ -56,6 +56,10 @@ Generator2D::Generator2D(MeshSharedPtr m) : ProcessModule(m)
ConfigOption
(
false
,
"0"
,
"Generate parallelograms on these curves"
);
m_config
[
"blthick"
]
=
ConfigOption
(
false
,
"0.0"
,
"Parallelogram layer thickness"
);
m_config
[
"bltadjust"
]
=
ConfigOption
(
false
,
"2.0"
,
"Boundary layer thickness adjustment"
);
m_config
[
"adjustblteverywhere"
]
=
ConfigOption
(
true
,
"0"
,
"Adjust thickness everywhere"
);
}
Generator2D
::~
Generator2D
()
...
...
@@ -252,6 +256,10 @@ void Generator2D::MakeBL(int faceid, vector<EdgeLoopSharedPtr> e)
}
}
bool
adjust
=
m_config
[
"bltadjust"
].
beenSet
;
NekDouble
divider
=
m_config
[
"bltadjust"
].
as
<
NekDouble
>
();
bool
adjustEverywhere
=
m_config
[
"adjustblteverywhere"
].
beenSet
;
map
<
NodeSharedPtr
,
NodeSharedPtr
>
nodeNormals
;
map
<
NodeSharedPtr
,
vector
<
EdgeSharedPtr
>
>::
iterator
it
;
for
(
it
=
m_nodesToEdge
.
begin
();
it
!=
m_nodesToEdge
.
end
();
it
++
)
...
...
@@ -271,17 +279,15 @@ void Generator2D::MakeBL(int faceid, vector<EdgeLoopSharedPtr> e)
NekDouble
t
=
m_thickness
.
Evaluate
(
m_thickness_ID
,
it
->
first
->
m_x
,
it
->
first
->
m_y
,
0.0
,
0.0
);
bool
adjustVertTOnly
=
false
;
// Adjust thickness according to anlge between normals
if
(
!
adjustVertTOnly
||
it
->
first
->
GetNumCadCurve
()
>
1
)
// Adjust thickness according to angle between normals
if
(
adjust
)
{
NekDouble
angle
=
acos
(
n1
[
0
]
*
n2
[
0
]
+
n1
[
1
]
*
n2
[
1
]);
angle
=
(
angle
>
M_PI
)
?
2
*
M_PI
-
angle
:
angle
;
NekDouble
divider
=
2.0
;
// Exact solution with 2.0; Higher values will
// smooth the thickness at sharp angles.
t
/=
cos
(
angle
/
divider
);
if
(
adjustEverywhere
||
it
->
first
->
GetNumCadCurve
()
>
1
)
{
NekDouble
angle
=
acos
(
n1
[
0
]
*
n2
[
0
]
+
n1
[
1
]
*
n2
[
1
]);
angle
=
(
angle
>
M_PI
)
?
2
*
M_PI
-
angle
:
angle
;
t
/=
cos
(
angle
/
divider
);
}
}
n
[
0
]
=
n
[
0
]
*
t
+
it
->
first
->
m_x
;
...
...
utilities/NekMesh/InputModules/InputMCF.cpp
View file @
53ca2126
...
...
@@ -206,6 +206,17 @@ void InputMCF::ParseFile(string nm)
it
=
parameters
.
find
(
"BndLayerProgression"
);
m_blprog
=
it
!=
parameters
.
end
()
?
it
->
second
:
"2.0"
;
}
it
=
parameters
.
find
(
"BndLayerAdjustment"
);
if
(
it
!=
parameters
.
end
())
{
m_adjust
=
true
;
m_adjustment
=
it
->
second
;
}
else
{
m_adjust
=
false
;
}
}
m_naca
=
false
;
...
...
@@ -234,12 +245,14 @@ void InputMCF::ParseFile(string nm)
}
set
<
string
>::
iterator
sit
;
sit
=
boolparameters
.
find
(
"SurfaceOptimiser"
);
m_surfopti
=
sit
!=
boolparameters
.
end
();
sit
=
boolparameters
.
find
(
"WriteOctree"
);
m_woct
=
sit
!=
boolparameters
.
end
();
sit
=
boolparameters
.
find
(
"VariationalOptimiser"
);
m_varopti
=
sit
!=
boolparameters
.
end
();
sit
=
boolparameters
.
find
(
"SurfaceOptimiser"
);
m_surfopti
=
sit
!=
boolparameters
.
end
();
sit
=
boolparameters
.
find
(
"WriteOctree"
);
m_woct
=
sit
!=
boolparameters
.
end
();
sit
=
boolparameters
.
find
(
"VariationalOptimiser"
);
m_varopti
=
sit
!=
boolparameters
.
end
();
sit
=
boolparameters
.
find
(
"BndLayerAdjustEverywhere"
);
m_adjustall
=
sit
!=
boolparameters
.
end
();
m_refine
=
refinement
.
size
()
>
0
;
if
(
m_refine
)
...
...
@@ -304,6 +317,16 @@ void InputMCF::Process()
{
mods
.
back
()
->
RegisterConfig
(
"blcurves"
,
m_blsurfs
);
mods
.
back
()
->
RegisterConfig
(
"blthick"
,
m_blthick
);
if
(
m_adjust
)
{
mods
.
back
()
->
RegisterConfig
(
"bltadjust"
,
m_adjustment
);
if
(
m_adjustall
)
{
mods
.
back
()
->
RegisterConfig
(
"adjustblteverywhere"
,
""
);
}
}
}
}
else
...
...
utilities/NekMesh/InputModules/InputMCF.h
View file @
53ca2126
...
...
@@ -63,9 +63,9 @@ public:
private:
std
::
string
m_minDelta
,
m_maxDelta
,
m_eps
,
m_cadfile
,
m_order
,
m_blsurfs
,
m_blthick
,
m_blprog
,
m_bllayers
,
m_refinement
,
m_nacadomain
;
m_nacadomain
,
m_adjustment
;
bool
m_makeBL
,
m_surfopti
,
m_varopti
,
m_refine
,
m_woct
,
m_2D
,
m_splitBL
,
m_naca
;
m_naca
,
m_adjust
,
m_adjustall
;
};
}
...
...
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