Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Jennifer Ryan
Nektar
Commits
abdeefd2
Commit
abdeefd2
authored
Mar 16, 2017
by
Julian Marcon
Browse files
Re-enabled automatic peralign call.
parent
ab28ef27
Changes
2
Show whitespace changes
Inline
Side-by-side
utilities/NekMesh/InputModules/InputMCF.cpp
View file @
abdeefd2
...
...
@@ -340,6 +340,7 @@ void InputMCF::Process()
if
(
m_2D
)
{
////**** 2DGenerator ****////
m_mesh
->
m_expDim
=
2
;
m_mesh
->
m_spaceDim
=
2
;
mods
.
push_back
(
GetModuleFactory
().
CreateInstance
(
...
...
@@ -416,54 +417,23 @@ void InputMCF::Process()
mods
.
back
()
->
RegisterConfig
(
"r"
,
m_blprog
);
}
for
(
int
i
=
0
;
i
<
mods
.
size
();
i
++
)
////**** Peralign ****////
if
(
m_2D
&&
m_periodic
.
size
())
{
mods
[
i
]
->
SetDefaults
();
mods
[
i
]
->
Process
();
}
// Run peralign
/*if (m_periodic.size())
{
mods.clear();
vector
<
string
>
lines
;
boost
::
split
(
lines
,
m_periodic
,
boost
::
is_any_of
(
":"
));
for
(
vector
<
string
>::
iterator
il
=
lines
.
begin
();
il
!=
lines
.
end
();
++
il
)
{
vector<string> tmp(2);
vector<unsigned> data(2);
boost::split(tmp, *il, boost::is_any_of(","));
data[0] = boost::lexical_cast<unsigned>(tmp[0]);
data[1] = boost::lexical_cast<unsigned>(tmp[1]);
mods
.
push_back
(
GetModuleFactory
().
CreateInstance
(
ModuleKey
(
eProcessModule
,
"peralign"
),
m_mesh
));
vector
<
string
>
tmp
(
2
);
boost
::
split
(
tmp
,
*
il
,
boost
::
is_any_of
(
","
));
mods
.
back
()
->
RegisterConfig
(
"surf1"
,
tmp
[
0
]);
mods
.
back
()
->
RegisterConfig
(
"surf2"
,
tmp
[
1
]);
Array<OneD, NekDouble> P11 =
m_mesh->m_cad->GetCurve(data[0])->GetVertex()[0]->GetLoc();
Array<OneD, NekDouble> P12 =
m_mesh->m_cad->GetCurve(data[0])->GetVertex()[1]->GetLoc();
Array<OneD, NekDouble> P21 =
m_mesh->m_cad->GetCurve(data[1])->GetVertex()[0]->GetLoc();
Array<OneD, NekDouble> P22 =
m_mesh->m_cad->GetCurve(data[1])->GetVertex()[1]->GetLoc();
Array<OneD, NekDouble> T(2);
T[0] = (P21[0] + P22[0] - P11[0] - P12[0]) / 2;
T[1] = (P21[1] + P22[1] - P11[1] - P12[1]) / 2;
NekDouble mag = sqrt(T[0] * T[0] + T[1] * T[1]);
stringstream ss;
ss << T[0] / mag << "," << T[1] / mag << "," << 0.0;
mods.back()->RegisterConfig("dir", ss.str());
}
}
for
(
int
i
=
0
;
i
<
mods
.
size
();
i
++
)
...
...
@@ -471,7 +441,6 @@ void InputMCF::Process()
mods
[
i
]
->
SetDefaults
();
mods
[
i
]
->
Process
();
}
}*/
}
}
}
utilities/NekMesh/ProcessModules/ProcessPerAlign.cpp
View file @
abdeefd2
...
...
@@ -112,6 +112,18 @@ void ProcessPerAlign::Process()
NekDouble
vec
[
3
];
if
(
tmp1
.
size
()
==
1
)
{
if
(
!
dir
.
size
()
&&
m_mesh
->
m_spaceDim
==
2
)
{
Array
<
OneD
,
NekDouble
>
T
=
m_mesh
->
m_cad
->
GetPeriodicTranslationVector
(
surf1
,
surf2
);
NekDouble
mag
=
sqrt
(
T
[
0
]
*
T
[
0
]
+
T
[
1
]
*
T
[
1
]);
vec
[
0
]
=
T
[
0
]
/
mag
;
vec
[
1
]
=
T
[
1
]
/
mag
;
vec
[
2
]
=
T
[
2
]
/
mag
;
}
else
{
if
(
dir
!=
"x"
&&
dir
!=
"y"
&&
dir
!=
"z"
)
{
...
...
@@ -124,6 +136,7 @@ void ProcessPerAlign::Process()
vec
[
1
]
=
dir
==
"y"
?
1.0
:
0.0
;
vec
[
2
]
=
dir
==
"z"
?
1.0
:
0.0
;
}
}
else
if
(
tmp1
.
size
()
==
3
)
{
vec
[
0
]
=
boost
::
lexical_cast
<
NekDouble
>
(
tmp1
[
0
]);
...
...
Write
Preview
Supports
Markdown
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