OGS 6.1.0-1721-g6382411ad
LocalAssemblerInterface.cpp
Go to the documentation of this file.
1 
11 #include <cassert>
13 
15 
16 namespace ProcessLib
17 {
18 void LocalAssemblerInterface::assemble(double const /*t*/,
19  std::vector<double> const& /*local_x*/,
20  std::vector<double>& /*local_M_data*/,
21  std::vector<double>& /*local_K_data*/,
22  std::vector<double>& /*local_b_data*/)
23 {
24  OGS_FATAL(
25  "The assemble() function is not implemented in the local assembler.");
26 }
27 
29  double const /*t*/,
30  std::vector<double>& /*local_M_data*/,
31  std::vector<double>& /*local_K_data*/,
32  std::vector<double>& /*local_b_data*/,
33  LocalCoupledSolutions const& /*coupled_solutions*/)
34 {
35  OGS_FATAL(
36  "The assembleForStaggeredScheme() function is not implemented in the "
37  "local assembler.");
38 }
39 
41  double const /*t*/, std::vector<double> const& /*local_x*/,
42  std::vector<double> const& /*local_xdot*/, const double /*dxdot_dx*/,
43  const double /*dx_dx*/, std::vector<double>& /*local_M_data*/,
44  std::vector<double>& /*local_K_data*/,
45  std::vector<double>& /*local_b_data*/,
46  std::vector<double>& /*local_Jac_data*/)
47 {
48  OGS_FATAL(
49  "The assembleWithJacobian() function is not implemented in the local "
50  "assembler.");
51 }
52 
54  double const /*t*/, std::vector<double> const& /*local_xdot*/,
55  const double /*dxdot_dx*/, const double /*dx_dx*/,
56  std::vector<double>& /*local_M_data*/,
57  std::vector<double>& /*local_K_data*/,
58  std::vector<double>& /*local_b_data*/,
59  std::vector<double>& /*local_Jac_data*/,
60  LocalCoupledSolutions const& /*local_coupled_solutions*/)
61 {
62  OGS_FATAL(
63  "The assembleWithJacobianForStaggeredScheme() function is not implemented in"
64  " the local assembler.");
65 }
66 
68  std::size_t const mesh_item_id,
69  NumLib::LocalToGlobalIndexMap const& dof_table, double const t,
70  GlobalVector const& x, CoupledSolutionsForStaggeredScheme const* coupled_xs)
71 {
72  auto const indices = NumLib::getIndices(mesh_item_id, dof_table);
73 
74  if (coupled_xs != nullptr)
75  return;
76 
77  auto const local_x = x.get(indices);
79 }
80 
82  std::size_t const mesh_item_id,
83  NumLib::LocalToGlobalIndexMap const& dof_table, GlobalVector const& x,
84  double const t)
85 {
86  auto const indices = NumLib::getIndices(mesh_item_id, dof_table);
87  auto const local_x = x.get(indices);
88 
89  setInitialConditionsConcrete(local_x, t);
90 }
91 
93  std::size_t const mesh_item_id,
94  NumLib::LocalToGlobalIndexMap const& dof_table, GlobalVector const& x,
95  double const t, double const delta_t)
96 {
97  auto const indices = NumLib::getIndices(mesh_item_id, dof_table);
98  auto const local_x = x.get(indices);
99 
100  preTimestepConcrete(local_x, t, delta_t);
101 }
102 
104  std::size_t const mesh_item_id,
105  NumLib::LocalToGlobalIndexMap const& dof_table,
106  GlobalVector const& x)
107 {
108  auto const indices = NumLib::getIndices(mesh_item_id, dof_table);
109  auto const local_x = x.get(indices);
110 
111  postTimestepConcrete(local_x);
112 }
113 
115  std::size_t const mesh_item_id,
116  NumLib::LocalToGlobalIndexMap const& dof_table,
117  GlobalVector const& x, double const t, bool const use_monolithic_scheme)
118 {
119  auto const indices = NumLib::getIndices(mesh_item_id, dof_table);
120  auto const local_x = x.get(indices);
121 
122  postNonLinearSolverConcrete(local_x, t, use_monolithic_scheme);
123 }
124 
125 } // namespace ProcessLib
virtual void assembleForStaggeredScheme(double const t, std::vector< double > &local_M_data, std::vector< double > &local_K_data, std::vector< double > &local_b_data, LocalCoupledSolutions const &coupled_solutions)
virtual void assembleWithJacobian(double const t, std::vector< double > const &local_x, std::vector< double > const &local_xdot, const double dxdot_dx, const double dx_dx, std::vector< double > &local_M_data, std::vector< double > &local_K_data, std::vector< double > &local_b_data, std::vector< double > &local_Jac_data)
virtual void computeSecondaryVariable(std::size_t const mesh_item_id, NumLib::LocalToGlobalIndexMap const &dof_table, const double t, GlobalVector const &x, CoupledSolutionsForStaggeredScheme const *coupled_xs)
void postNonLinearSolver(std::size_t const mesh_item_id, NumLib::LocalToGlobalIndexMap const &dof_table, GlobalVector const &x, double const t, bool const use_monolithic_scheme)
virtual void postTimestepConcrete(std::vector< double > const &)
virtual void assembleWithJacobianForStaggeredScheme(double const t, std::vector< double > const &local_xdot, const double dxdot_dx, const double dx_dx, std::vector< double > &local_M_data, std::vector< double > &local_K_data, std::vector< double > &local_b_data, std::vector< double > &local_Jac_data, LocalCoupledSolutions const &local_coupled_solutions)
virtual void setInitialConditionsConcrete(std::vector< double > const &, double const)
std::vector< GlobalIndexType > getIndices(std::size_t const mesh_item_id, NumLib::LocalToGlobalIndexMap const &dof_table)
virtual void preTimestep(std::size_t const mesh_item_id, NumLib::LocalToGlobalIndexMap const &dof_table, GlobalVector const &x, double const t, double const delta_t)
virtual void setInitialConditions(std::size_t const mesh_item_id, NumLib::LocalToGlobalIndexMap const &dof_table, GlobalVector const &x, double const t)
virtual void postNonLinearSolverConcrete(std::vector< double > const &, double const, bool const)
virtual void computeSecondaryVariableConcrete(double const, std::vector< double > const &)
virtual void preTimestepConcrete(std::vector< double > const &, double const, double const)
virtual void postTimestep(std::size_t const mesh_item_id, NumLib::LocalToGlobalIndexMap const &dof_table, GlobalVector const &x)
#define OGS_FATAL(fmt,...)
Definition: Error.h:71
virtual void assemble(double const t, std::vector< double > const &local_x, std::vector< double > &local_M_data, std::vector< double > &local_K_data, std::vector< double > &local_b_data)