1 #ifndef _pidomus_base_interface_h_
2 #define _pidomus_base_interface_h_
12 #include <deal2lkit/parsed_finite_element.h>
13 #include <deal2lkit/parsed_function.h>
14 #include <deal2lkit/parsed_mapped_functions.h>
15 #include <deal2lkit/parsed_dirichlet_bcs.h>
69 template <
int dim,
int spacedim=dim,
typename LAC=LATrilinos>
70 class BaseInterface :
public ParameterAcceptor
78 virtual ~BaseInterface() {};
87 BaseInterface(
const std::string &name=
"",
88 const unsigned int &n_comp=0,
89 const unsigned int &n_matrices=0,
90 const std::string &default_fe=
"FE_Q(1)",
91 const std::string &default_component_names=
"u",
92 const std::string &default_differential_components=
"");
102 const std::vector<unsigned int> get_differential_blocks()
const;
120 const double alpha)
const;
129 FEValuesCache<dim,spacedim> &,
130 std::vector<Sdouble> &energies,
131 std::vector<std::vector<double> > &local_residuals,
132 bool compute_only_system_terms)
const;
140 FEValuesCache<dim,spacedim> &,
141 std::vector<SSdouble> &energies,
142 std::vector<std::vector<Sdouble> > &local_residuals,
143 bool compute_only_system_terms)
const;
152 FEValuesCache<dim,spacedim> &scratch,
161 FEValuesCache<dim,spacedim> &scratch,
171 const std::vector<shared_ptr<typename LATrilinos::BlockMatrix> >,
180 const std::vector<shared_ptr<typename LADealII::BlockMatrix> >,
192 void fix_solution_dot_derivative(FEValuesCache<dim,spacedim> &,
double)
const;
194 void fix_solution_dot_derivative(FEValuesCache<dim,spacedim> &fe_cache, Sdouble alpha)
const;
197 void fix_solution_dot_derivative(FEValuesCache<dim,spacedim> &fe_cache, SSdouble alpha)
const;
199 template<
typename Number>
200 void reinit(
const Number &alpha,
202 FEValuesCache<dim,spacedim> &fe_cache)
const;
205 template<
typename Number>
206 void reinit(
const Number &alpha,
208 const unsigned int face_no,
209 FEValuesCache<dim,spacedim> &fe_cache)
const;
215 const unsigned int n_components;
216 const unsigned int n_matrices;
218 ParsedFiniteElement<dim,spacedim> pfe;
223 std::string get_component_names()
const;
228 void build_couplings();
244 virtual void set_matrix_couplings(std::vector<std::string> &couplings)
const;
246 void convert_string_to_int(
const std::string &str_coupling,
247 std::vector<std::vector<unsigned int> > &int_coupling)
const;
254 std::string str_diff_comp;
256 std::vector<unsigned int> _diff_comp;
277 mutable double alpha;
278 unsigned int dofs_per_cell;
279 unsigned int n_q_points;
280 unsigned int n_face_q_points;
282 std::vector<Table<2,DoFTools::Coupling> > matrix_couplings;
287 template <
int dim,
int spacedim,
typename LAC>
288 template<
typename Number>
290 BaseInterface<dim,spacedim,LAC>::reinit(
const Number &,
292 FEValuesCache<dim,spacedim> &fe_cache)
const
295 Number alpha = this->alpha;
297 fe_cache.cache_local_solution_vector(
"explicit_solution", *this->explicit_solution, dummy);
298 fe_cache.cache_local_solution_vector(
"solution", *this->solution, alpha);
299 fe_cache.cache_local_solution_vector(
"solution_dot", *this->solution_dot, alpha);
300 this->fix_solution_dot_derivative(fe_cache, alpha);
304 template <
int dim,
int spacedim,
typename LAC>
305 template<
typename Number>
307 BaseInterface<dim,spacedim,LAC>::reinit(
const Number &,
309 const unsigned int face_no,
310 FEValuesCache<dim,spacedim> &fe_cache)
const
313 Number alpha = this->alpha;
314 fe_cache.reinit(cell, face_no);
315 fe_cache.cache_local_solution_vector(
"explicit_solution", *this->explicit_solution, dummy);
316 fe_cache.cache_local_solution_vector(
"solution", *this->solution, alpha);
317 fe_cache.cache_local_solution_vector(
"solution_dot", *this->solution_dot, alpha);
318 this->fix_solution_dot_derivative(fe_cache, alpha);
ActiveSelector::active_cell_iterator active_cell_iterator
void reinit(const unsigned int n_blocks, const size_type block_size=0, const bool omit_zeroing_entries=false)
Definition: copy_data.h:18
Definition: copy_data.h:20