OGS 6.2.0-97-g4a610c866
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, GlobalVector const& x,
97  double const t, double const delta_t)
98 {
99  auto const indices = NumLib::getIndices(mesh_item_id, dof_table);
100  auto const local_x = x.get(indices);
101 
102  preTimestepConcrete(local_x, t, delta_t);
103 }
104 
106  std::size_t const mesh_item_id,
107  NumLib::LocalToGlobalIndexMap const& dof_table,
108  GlobalVector const& x)
109 {
110  auto const indices = NumLib::getIndices(mesh_item_id, dof_table);
111  auto const local_x = x.get(indices);
112 
113  postTimestepConcrete(local_x);
114 }
115 
117  std::size_t const mesh_item_id,
118  NumLib::LocalToGlobalIndexMap const& dof_table,
119  GlobalVector const& x, double const t, bool const use_monolithic_scheme)
120 {
121  auto const indices = NumLib::getIndices(mesh_item_id, dof_table);
122  auto const local_x = x.get(indices);
123 
124  postNonLinearSolverConcrete(local_x, t, use_monolithic_scheme);
125 }
126 
127 } // 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: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)