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
Nektar
Nektar
Commits
e13d71ae
Commit
e13d71ae
authored
Feb 07, 2016
by
Chris Cantwell
Committed by
Spencer Sherwin
Mar 04, 2016
Browse files
Fix logic for reading time fn in body forcing.
parent
f8aaa379
Changes
1
Hide whitespace changes
Inline
Side-by-side
library/SolverUtils/Forcing/ForcingBody.cpp
View file @
e13d71ae
...
@@ -70,7 +70,7 @@ namespace SolverUtils
...
@@ -70,7 +70,7 @@ namespace SolverUtils
{
{
funcNameElmt
=
pForce
->
FirstChildElement
(
"FIELDFORCE"
);
funcNameElmt
=
pForce
->
FirstChildElement
(
"FIELDFORCE"
);
ASSERTL0
(
funcNameElmt
,
"Requires BODYFORCE o
f
FIELDFORCE tag "
ASSERTL0
(
funcNameElmt
,
"Requires BODYFORCE o
r
FIELDFORCE tag "
"specifying function name which prescribes body force."
);
"specifying function name which prescribes body force."
);
}
}
...
@@ -78,25 +78,27 @@ namespace SolverUtils
...
@@ -78,25 +78,27 @@ namespace SolverUtils
ASSERTL0
(
m_session
->
DefinesFunction
(
funcName
),
ASSERTL0
(
m_session
->
DefinesFunction
(
funcName
),
"Function '"
+
funcName
+
"' not defined."
);
"Function '"
+
funcName
+
"' not defined."
);
// Time function is optional
funcNameElmt
=
pForce
->
FirstChildElement
(
"BODYFORCETIMEFCN"
);
funcNameElmt
=
pForce
->
FirstChildElement
(
"BODYFORCETIMEFCN"
);
if
(
!
funcNameElmt
)
if
(
!
funcNameElmt
)
{
{
funcNameElmt
=
pForce
->
FirstChildElement
(
"FIELDFORCETIMEFCN"
);
funcNameElmt
=
pForce
->
FirstChildElement
(
"FIELDFORCETIMEFCN"
);
}
if
(
funcNameElmt
)
// Load time function if specified
{
if
(
funcNameElmt
)
std
::
string
funcNameTime
=
funcNameElmt
->
GetText
();
{
std
::
string
funcNameTime
=
funcNameElmt
->
GetText
();
ASSERTL0
(
!
funcNameTime
.
empty
(),
ASSERTL0
(
!
funcNameTime
.
empty
(),
"Expression must be given in BODYFORCETIMEFCN or "
"Expression must be given in BODYFORCETIMEFCN or "
"FIELDFORCETIMEFCN."
);
"FIELDFORCETIMEFCN."
);
m_session
->
SubstituteExpressions
(
funcNameTime
);
m_session
->
SubstituteExpressions
(
funcNameTime
);
m_timeFcnEqn
=
MemoryManager
<
LibUtilities
::
Equation
>
m_timeFcnEqn
=
MemoryManager
<
LibUtilities
::
Equation
>
::
AllocateSharedPtr
(
m_session
,
funcNameTime
);
::
AllocateSharedPtr
(
m_session
,
funcNameTime
);
m_hasTimeFcnScaling
=
true
;
m_hasTimeFcnScaling
=
true
;
}
}
}
m_Forcing
=
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
(
m_NumVariable
);
m_Forcing
=
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
(
m_NumVariable
);
...
@@ -126,7 +128,7 @@ namespace SolverUtils
...
@@ -126,7 +128,7 @@ namespace SolverUtils
for
(
int
i
=
0
;
i
<
m_NumVariable
;
++
i
)
for
(
int
i
=
0
;
i
<
m_NumVariable
;
++
i
)
{
{
pFields
[
0
]
->
HomogeneousFwdTrans
(
m_Forcing
[
i
],
m_Forcing
[
i
]);
pFields
[
0
]
->
HomogeneousFwdTrans
(
m_Forcing
[
i
],
m_Forcing
[
i
]);
}
}
}
}
}
}
...
...
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