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
nek5000
giraffe
Commits
e30b0b3b
Commit
e30b0b3b
authored
Oct 19, 2016
by
Cody Permann
Browse files
Transfer from Nek probably working
parent
b2b78c46
Changes
3
Hide whitespace changes
Inline
Side-by-side
examples/integration_example/coefficient_integration.i
View file @
e30b0b3b
...
...
@@ -51,7 +51,7 @@
[
Kernels
]
[
.
/
HeatSource
]
type
=
HeatSource
function
=
'
1.0
'
function
=
'
1
00
.0
'
variable
=
temp
[
..
/
]
[
.
/
HeatDiff
]
...
...
@@ -294,6 +294,7 @@
[
Outputs
]
exodus
=
true
csv
=
true
print_perf_log
=
true
[]
...
...
@@ -308,11 +309,19 @@
[]
[
Transfers
]
[
.
/
u_
to_
sub
]
[
.
/
to_
nek
]
type
=
MultiAppPolynomialToNek
direction
=
to_multiapp
multi_app
=
sub
source_variable
=
'
heat_flux_scalar_f_0_l
heat_flux_scalar_f_1_l
'
to_aux_scalar
=
'
foo
'
[
..
/
]
[
.
/
from_nek
]
type
=
MultiAppPolynomialToNek
direction
=
from_multiapp
multi_app
=
sub
source_variable
=
'
foo
'
to_aux_scalar
=
'
temp_bc_scalar_f_0_l
temp_bc_scalar_f_1_l
'
[
..
/
]
[]
include/base/NekInterface.h
View file @
e30b0b3b
...
...
@@ -65,6 +65,7 @@ namespace Nek5000
void
FORTRAN_CALL
(
nek_init_step
)();
void
FORTRAN_CALL
(
nek_step
)();
void
FORTRAN_CALL
(
nek_finalize_step
)();
void
FORTRAN_CALL
(
nek_expansion
)();
}
}
...
...
src/transfers/MultiAppPolynomialToNek.C
View file @
e30b0b3b
...
...
@@ -58,7 +58,7 @@ MultiAppPolynomialToNek::execute()
_console
<<
_source_variable_names
[
i
]
<<
'\n'
;
auto
&
solution_values
=
source_variables
[
i
]
->
sln
();
for
(
auto
j
=
beginIndex
(
solution_values
);
j
<
solution_values
.
size
();
++
j
)
for
(
auto
j
=
beginIndex
(
solution_values
);
j
<
solution_values
.
size
();
++
j
)
{
_console
<<
solution_values
[
j
]
<<
' '
;
Nek5000
::
expansion_fcoef_
.
coeff_fij
[
i
*
100
+
j
]
=
solution_values
[
j
];
...
...
@@ -73,29 +73,38 @@ MultiAppPolynomialToNek::execute()
// SubApp -> MasterApp
case
FROM_MULTIAPP
:
{
FORTRAN_CALL
(
Nek5000
::
nek_expansion
)();
// The number of sub applications
unsigned
int
num_apps
=
_multi_app
->
numGlobalApps
();
// // The AuxVariable for storing the postprocessor values from the sub app
// MooseVariableScalar & scalar = _multi_app->problem().getScalarVariable(_tid, _to_aux_name);
//
// // Ensure that the variable is up to date
// scalar.reinit();
//
// // The dof indices for the scalar variable of interest
// std::vector<dof_id_type> & dof = scalar.dofIndices();
//
std
::
vector
<
MooseVariableScalar
*>
to_variables
(
_to_aux_names
.
size
());
for
(
auto
i
=
beginIndex
(
_to_aux_names
);
i
<
_to_aux_names
.
size
();
++
i
)
{
to_variables
[
i
]
=
&
_multi_app
->
problem
().
getScalarVariable
(
_tid
,
_to_aux_names
[
i
]);
to_variables
[
i
]
->
reinit
();
}
for
(
auto
i
=
beginIndex
(
_to_aux_names
);
i
<
_to_aux_names
.
size
();
++
i
)
{
// The dof indices for the scalar variable of interest
std
::
vector
<
dof_id_type
>
&
dof
=
to_variables
[
i
]
->
dofIndices
();
// // Error if there is a size mismatch between the scalar AuxVariable and the number of sub apps
// if (num_apps != scalar.sln().size())
// mooseError("The number of sub apps (" << num_apps << ") must be equal to the order of the scalar AuxVariable (" << scalar.order() << ")");
//
// // Loop over each sub-app and populate the AuxVariable values from the postprocessors
// for (unsigned int i=0; i<_multi_app->numGlobalApps(); i++)
// Loop over each sub-app and populate the AuxVariable values from the postprocessors
// for (unsigned int i=0; i<_multi_app->numGlobalApps(); i++)
// if (_multi_app->hasLocalApp(i) && _multi_app->isRootProcessor())
// // Note: This can't be done using MooseScalarVariable::insert() because different processors will be setting dofs separately.
// scalar.sys().solution().set(dof[i], _multi_app->appProblem(i).getPostprocessorValue(_from_pp_name));
//
// scalar.sys().solution().close();
// Note: This can't be done using MooseScalarVariable::insert() because different processors will be setting dofs separately.
auto
&
solution_values
=
to_variables
[
i
]
->
sln
();
for
(
auto
j
=
beginIndex
(
solution_values
);
j
<
solution_values
.
size
();
++
j
)
{
to_variables
[
i
]
->
sys
().
solution
().
set
(
dof
[
j
],
Nek5000
::
expansion_tcoef_
.
coeff_tij
[
i
*
100
+
j
]);
to_variables
[
i
]
->
sys
().
solution
().
close
();
}
}
break
;
}
...
...
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