Forked from
ogs / ogs
902 commits behind the upstream repository.
-
Dmitri Naumov authored
The matrices are not in use by any process.
Dmitri Naumov authoredThe matrices are not in use by any process.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
SteadyStateDiffusion.cpp 3.41 KiB
/**
* \file
* \copyright
* Copyright (c) 2012-2024, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
*
*/
#include "SteadyStateDiffusion.h"
#include <cassert>
#include "ProcessLib/Utils/CreateLocalAssemblers.h"
namespace ProcessLib
{
namespace SteadyStateDiffusion
{
SteadyStateDiffusion::SteadyStateDiffusion(
std::string name,
MeshLib::Mesh& mesh,
std::unique_ptr<ProcessLib::AbstractJacobianAssembler>&& jacobian_assembler,
std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& parameters,
unsigned const integration_order,
std::vector<std::vector<std::reference_wrapper<ProcessVariable>>>&&
process_variables,
SteadyStateDiffusionData&& process_data,
SecondaryVariableCollection&& secondary_variables,
std::unique_ptr<ProcessLib::SurfaceFluxData>&& surfaceflux)
: Process(std::move(name), mesh, std::move(jacobian_assembler), parameters,
integration_order, std::move(process_variables),
std::move(secondary_variables)),
_process_data(std::move(process_data)),
_surfaceflux(std::move(surfaceflux))
{
}
void SteadyStateDiffusion::initializeConcreteProcess(
NumLib::LocalToGlobalIndexMap const& dof_table,
MeshLib::Mesh const& mesh,
unsigned const integration_order)
{
ProcessLib::createLocalAssemblers<LocalAssemblerData>(
mesh.getDimension(), mesh.getElements(), dof_table, _local_assemblers,
NumLib::IntegrationOrder{integration_order}, mesh.isAxiallySymmetric(),
_process_data);
_secondary_variables.addSecondaryVariable(
"darcy_velocity",
makeExtrapolator(mesh.getDimension(), getExtrapolator(),
_local_assemblers,
&SteadyStateDiffusionLocalAssemblerInterface::
getIntPtDarcyVelocity));
}
void SteadyStateDiffusion::assembleConcreteProcess(
const double t, double const dt, std::vector<GlobalVector*> const& x,
std::vector<GlobalVector*> const& x_prev, int const process_id,
GlobalMatrix& M, GlobalMatrix& K, GlobalVector& b)
{
DBUG("Assemble SteadyStateDiffusion.");
std::vector<NumLib::LocalToGlobalIndexMap const*> dof_table = {
_local_to_global_index_map.get()};
// Call global assembler for each local assembly item.
GlobalExecutor::executeSelectedMemberDereferenced(
_global_assembler, &VectorMatrixAssembler::assemble, _local_assemblers,
getActiveElementIDs(), dof_table, t, dt, x, x_prev, process_id, &M, &K,
&b);
}
void SteadyStateDiffusion::assembleWithJacobianConcreteProcess(
const double t, double const dt, std::vector<GlobalVector*> const& x,
std::vector<GlobalVector*> const& x_prev, int const process_id,
GlobalVector& b, GlobalMatrix& Jac)
{
DBUG("AssembleWithJacobian SteadyStateDiffusion.");
std::vector<NumLib::LocalToGlobalIndexMap const*> dof_table = {
_local_to_global_index_map.get()};
// Call global assembler for each local assembly item.
GlobalExecutor::executeSelectedMemberDereferenced(
_global_assembler, &VectorMatrixAssembler::assembleWithJacobian,
_local_assemblers, getActiveElementIDs(), dof_table, t, dt, x, x_prev,
process_id, &b, &Jac);
}
} // namespace SteadyStateDiffusion
} // namespace ProcessLib