OGS 6.2.1-97-g73d1aeda3
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  {
76  return;
77  }
78 
79  auto const local_x = x.get(indices);
81 }
82 
84  std::size_t const mesh_item_id,
85  NumLib::LocalToGlobalIndexMap const& dof_table, GlobalVector const& x,
86  double const t)
87 {
88  auto const indices = NumLib::getIndices(mesh_item_id, dof_table);
89  auto const local_x = x.get(indices);
90 
91  setInitialConditionsConcrete(local_x, t);
92 }
93 
95  std::size_t const /*mesh_item_id*/,
96  NumLib::LocalToGlobalIndexMap const& /*dof_table*/)
97 {
99 }
100 
102  std::size_t const mesh_item_id,
103  NumLib::LocalToGlobalIndexMap const& dof_table, GlobalVector const& x,
104  double const t, double const delta_t)
105 {
106  auto const indices = NumLib::getIndices(mesh_item_id, dof_table);
107  auto const local_x = x.get(indices);
108 
109  preTimestepConcrete(local_x, t, delta_t);
110 }
111 
113  std::size_t const mesh_item_id,
114  NumLib::LocalToGlobalIndexMap const& dof_table,
115  GlobalVector const& x)
116 {
117  auto const indices = NumLib::getIndices(mesh_item_id, dof_table);
118  auto const local_x = x.get(indices);
119 
120  postTimestepConcrete(local_x);
121 }
122 
124  std::size_t const mesh_item_id,
125  NumLib::LocalToGlobalIndexMap const& dof_table,
126  GlobalVector const& x, double const t, bool const use_monolithic_scheme)
127 {
128  auto const indices = NumLib::getIndices(mesh_item_id, dof_table);
129  auto const local_x = x.get(indices);
130 
131  postNonLinearSolverConcrete(local_x, t, use_monolithic_scheme);
132 }
133 
134 } // 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 initialize(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:63
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)