Skip to content
Snippets Groups Projects
Unverified Commit 1ea8c449 authored by Dmitri Naumov's avatar Dmitri Naumov Committed by GitHub
Browse files

Merge pull request #2418 from endJunction/NodalThermalForcesForTM

[PL] TM: Add NodalForces and HeatFlux.
parents a725ace5 c129ac5e
No related branches found
No related tags found
No related merge requests found
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include <cassert> #include <cassert>
#include "BaseLib/Functional.h" #include "BaseLib/Functional.h"
#include "NumLib/DOF/DOFTableUtil.h"
#include "ProcessLib/SmallDeformation/CreateLocalAssemblers.h" #include "ProcessLib/SmallDeformation/CreateLocalAssemblers.h"
#include "ThermoMechanicsFEM.h" #include "ThermoMechanicsFEM.h"
...@@ -38,6 +39,12 @@ ThermoMechanicsProcess<DisplacementDim>::ThermoMechanicsProcess( ...@@ -38,6 +39,12 @@ ThermoMechanicsProcess<DisplacementDim>::ThermoMechanicsProcess(
use_monolithic_scheme), use_monolithic_scheme),
_process_data(std::move(process_data)) _process_data(std::move(process_data))
{ {
_nodal_forces = MeshLib::getOrCreateMeshProperty<double>(
mesh, "NodalForces", MeshLib::MeshItemType::Node, DisplacementDim);
_heat_flux = MeshLib::getOrCreateMeshProperty<double>(
mesh, "HeatFlux", MeshLib::MeshItemType::Node, 1);
_integration_point_writer.emplace_back( _integration_point_writer.emplace_back(
std::make_unique<KelvinVectorIntegrationPointWriter>( std::make_unique<KelvinVectorIntegrationPointWriter>(
"sigma_ip", "sigma_ip",
...@@ -235,6 +242,30 @@ void ThermoMechanicsProcess<DisplacementDim>:: ...@@ -235,6 +242,30 @@ void ThermoMechanicsProcess<DisplacementDim>::
_global_assembler, &VectorMatrixAssembler::assembleWithJacobian, _global_assembler, &VectorMatrixAssembler::assembleWithJacobian,
_local_assemblers, pv.getActiveElementIDs(), dof_table, t, x, _local_assemblers, pv.getActiveElementIDs(), dof_table, t, x,
xdot, dxdot_dx, dx_dx, M, K, b, Jac, _coupled_solutions); xdot, dxdot_dx, dx_dx, M, K, b, Jac, _coupled_solutions);
// TODO (naumov): Refactor the copy rhs part. This is copy from HM.
auto copyRhs = [&](int const variable_id, auto& output_vector) {
if (_use_monolithic_scheme)
{
transformVariableFromGlobalVector(b, variable_id, dof_table[0],
output_vector,
std::negate<double>());
}
else
{
transformVariableFromGlobalVector(
b, 0, dof_table[_coupled_solutions->process_id], output_vector,
std::negate<double>());
}
};
if (_use_monolithic_scheme || _coupled_solutions->process_id == 0)
{
copyRhs(0, *_heat_flux);
}
if (_use_monolithic_scheme || _coupled_solutions->process_id == 1)
{
copyRhs(1, *_nodal_forces);
}
} }
template <int DisplacementDim> template <int DisplacementDim>
......
...@@ -114,6 +114,9 @@ private: ...@@ -114,6 +114,9 @@ private:
std::unique_ptr<NumLib::LocalToGlobalIndexMap> std::unique_ptr<NumLib::LocalToGlobalIndexMap>
_local_to_global_index_map_single_component; _local_to_global_index_map_single_component;
MeshLib::PropertyVector<double>* _nodal_forces = nullptr;
MeshLib::PropertyVector<double>* _heat_flux = nullptr;
}; };
extern template class ThermoMechanicsProcess<2>; extern template class ThermoMechanicsProcess<2>;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment