deal2lkit: A ToolKit library for Deal.II
parsed_finite_element.h
Go to the documentation of this file.
1 //-----------------------------------------------------------
2 //
3 // Copyright (C) 2015 by the deal2lkit authors
4 //
5 // This file is part of the deal2lkit library.
6 //
7 // The deal2lkit library is free software; you can use it, redistribute
8 // it, and/or modify it under the terms of the GNU Lesser General
9 // Public License as published by the Free Software Foundation; either
10 // version 2.1 of the License, or (at your option) any later version.
11 // The full text of the license can be found in the file LICENSE at
12 // the top level of the deal2lkit distribution.
13 //
14 //-----------------------------------------------------------
15 
16 #ifndef _d2k_parsed_finite_element_h
17 #define _d2k_parsed_finite_element_h
18 
19 #include <deal2lkit/config.h>
21 #include <deal.II/dofs/dof_tools.h>
22 #include <deal.II/fe/fe.h>
23 
25 #include <deal2lkit/utilities.h>
26 
27 using namespace dealii;
28 
29 D2K_NAMESPACE_OPEN
30 
61 template <int dim, int spacedim=dim>
63 {
64 public:
83  ParsedFiniteElement (const std::string &name="",
84  const std::string &default_fe="FE_Q(1)",
85  const std::string &default_component_names="u",
86  const unsigned int n_components=0);
87 
130  virtual void declare_parameters(ParameterHandler &prm);
131 
139  FiniteElement<dim, spacedim> *operator() () const;
140 
144  virtual void parse_parameters_call_back();
145 
149  std::string get_component_names() const;
150 
156  std::vector<unsigned int> get_component_blocks() const;
157 
158 
164  std::string get_block_names() const;
165 
169  unsigned int n_components() const;
170 
176  unsigned int n_blocks() const;
177 
182  unsigned int get_first_occurence(const std::string &var) const;
183 
187  bool is_vector(const std::string &var) const;
188 
189 protected:
194  const unsigned int _n_components;
195 
199  std::string fe_name;
200 
205 
216  std::vector<std::string> component_names;
217 
222  std::vector<unsigned int> component_blocks;
223 
224 
229  std::vector<std::string> block_names;
230 };
231 
232 D2K_NAMESPACE_CLOSE
233 
234 #endif
235 
A parameter acceptor base class.
Parsed FiniteElement.
std::string default_component_names
Default component names.
std::vector< std::string > block_names
The subdivision, in terms of block names.
const unsigned int _n_components
Number of components of this FiniteElement.
std::vector< unsigned int > component_blocks
The subdivision, in terms of component indices.
std::string fe_name
Finite Element Name.
std::vector< std::string > component_names
Block names.