-
Notifications
You must be signed in to change notification settings - Fork 239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Balance for HT process #2132
Balance for HT process #2132
Changes from 1 commit
81d275e
d8b55d5
744ddd4
38413ee
7546ae2
f608621
2689f06
1d9aa9a
0be9c2b
75fa95f
fdeafde
3f11cb8
dd8c5ca
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -273,25 +273,24 @@ void HTProcess::postTimestepConcreteProcess(GlobalVector const& x, | |
} | ||
if (_balance_mesh) // computing the balance is optional | ||
{ | ||
std::vector<double> init_values(_balance_mesh->getNumberOfElements(), | ||
0.0); | ||
MeshLib::addPropertyToMesh(*_balance_mesh, _balance_pv_name, | ||
MeshLib::MeshItemType::Cell, 1, init_values); | ||
auto* const balance_pv = MeshLib::getOrCreateMeshProperty<double>( | ||
*_balance_mesh, _balance_pv_name, MeshLib::MeshItemType::Cell, 1); | ||
// initialise the PropertyVector pv with zero values | ||
std::fill(balance_pv->begin(), balance_pv->end(), 0.0); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure here; There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The properties are '+='-ed. |
||
auto balance = ProcessLib::CalculateSurfaceFlux( | ||
*_balance_mesh, | ||
getProcessVariables(process_id)[0].get().getNumberOfComponents(), | ||
_integration_order); | ||
|
||
auto* const balance_pv = | ||
_balance_mesh->getProperties().template getPropertyVector<double>( | ||
_balance_pv_name); | ||
|
||
balance.integrate(x, *balance_pv, *this); | ||
// post: surface_mesh has vectorial element property | ||
// post: surface_mesh has scalar element property | ||
|
||
// TODO output, if output classes are ready this has to be | ||
// changed | ||
MeshLib::IO::writeMeshToFile(*_balance_mesh, _balance_out_fname); | ||
std::string const fname = | ||
BaseLib::dropFileExtension(_balance_out_fname) + "_t_" + | ||
std::to_string(t) + ".vtu"; | ||
MeshLib::IO::writeMeshToFile(*_balance_mesh, fname); | ||
} | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.