Skip to content
Snippets Groups Projects
Commit a4b6f6f9 authored by wenqing's avatar wenqing
Browse files

[Coupling] Added a flag in StaggeredCouplingTerm to check the existing of coupling

parent 0d637835
No related branches found
No related tags found
No related merge requests found
/**
* \copyright
* Copyright (c) 2012-2016, OpenGeoSys Community (http://www.opengeosys.org)
* Copyright (c) 2012-2017, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
......@@ -19,14 +19,8 @@ const StaggeredCouplingTerm createVoidStaggeredCouplingTerm()
{
std::map<ProcessType, Process const&> coupled_pcsss;
std::map<ProcessType, GlobalVector const*> coupled_xs;
return StaggeredCouplingTerm(coupled_pcsss, coupled_xs);
}
const LocalCouplingTerm createVoidLocalCouplingTerm()
{
std::map<ProcessType, Process const&> coupled_pcsss;
std::map<ProcessType, const std::vector<double>> local_coupled_xs;
return LocalCouplingTerm(coupled_pcsss, std::move(local_coupled_xs));
const bool empty = true;
return StaggeredCouplingTerm(coupled_pcsss, coupled_xs, empty);
}
} // end of ProcessLib
......
/**
* \copyright
* Copyright (c) 2012-2016, OpenGeoSys Community (http://www.opengeosys.org)
* Copyright (c) 2012-2017, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
......@@ -10,8 +10,7 @@
* Created on November 7, 2016, 12:14 PM
*/
#ifndef OGS_STAGGERED_COUPLING_TERM_H
#define OGS_STAGGERED_COUPLING_TERM_H
#pragma once
#include <map>
......@@ -26,13 +25,16 @@ struct StaggeredCouplingTerm
{
StaggeredCouplingTerm(
std::map<ProcessType, Process const&> const& coupled_processes_,
std::map<ProcessType, GlobalVector const*> const& coupled_xs_)
: coupled_processes(coupled_processes_), coupled_xs(coupled_xs_)
std::map<ProcessType, GlobalVector const*> const& coupled_xs_,
const bool empty_ = false)
: coupled_processes(coupled_processes_), coupled_xs(coupled_xs_),
empty(empty_)
{
}
std::map<ProcessType, Process const&> const& coupled_processes;
std::map<ProcessType, GlobalVector const*> const& coupled_xs;
const bool empty;
};
struct LocalCouplingTerm
......@@ -50,8 +52,6 @@ struct LocalCouplingTerm
};
const StaggeredCouplingTerm createVoidStaggeredCouplingTerm();
const LocalCouplingTerm createVoidLocalCouplingTerm();
} // end of ProcessLib
#endif /* OGS_STAGGERED_COUPLING_TERM_H */
......@@ -38,7 +38,7 @@ void VectorMatrixAssembler::assemble(
_local_K_data.clear();
_local_b_data.clear();
if (coupled_term.coupled_processes.empty())
if (coupled_term.empty)
{
local_assembler.assemble(t, local_x, _local_M_data, _local_K_data,
_local_b_data);
......@@ -103,7 +103,7 @@ void VectorMatrixAssembler::assembleWithJacobian(
_local_b_data.clear();
_local_Jac_data.clear();
if (coupled_term.coupled_processes.empty())
if (coupled_term.empty)
{
_jacobian_assembler->assembleWithJacobian(
local_assembler, t, local_x, local_xdot, dxdot_dx, dx_dx,
......
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