23 template <
int dim,
int spacedim>
26 const unsigned int &n_components,
27 const std::string &parsed_component_names,
28 const std::string &parsed_components,
29 const std::string &parsed_boundary_components):
32 str_components (parsed_components),
33 str_boundary_components (parsed_boundary_components),
34 str_component_names (parsed_component_names),
35 mask(n_components, false),
36 boundary_mask(n_components, false),
37 n_components(n_components)
40 template <
int dim,
int spacedim>
43 for (
unsigned int c=0; c<
components.size(); ++c)
56 catch (std::exception &exc)
78 catch (std::exception &exc)
88 template <
int dim,
int spacedim>
95 template <
int dim,
int spacedim>
102 template <
int dim,
int spacedim>
108 "These variables can be used to set the corrisponding component mask, " 109 "instead of specifying each component number");
116 "These variables can be used to set the corrisponding component mask, " 117 "instead of specifying each component number");
122 "Pattern to be used: " 124 "You can specify the components either by numbers " 125 "or by the corrisponding variable name, which are parsed at " 126 "construction time. ");
130 "Pattern to be used: " 132 "You can specify the components either by numbers " 133 "or by the corrisponding variable name, which are parsed at " 134 "construction time. ");
169 template <
int dim,
int spacedim>
173 const bool at_boundary,
176 std::vector<bool> constrained_dofs (dof_handler.
n_dofs(),
false);
188 const unsigned int first_dof
189 = std::distance (constrained_dofs.begin(),
190 std::find (constrained_dofs.begin(),
191 constrained_dofs.end(),
195 for (
unsigned int i=first_dof+1; i<dof_handler.
n_dofs(); ++i)
196 if (constrained_dofs[i] ==
true)
201 template <
int dim,
int spacedim>
208 std::vector<bool> m(n_components,
false);
209 std::vector<bool> m_boundary(n_components,
false);
213 m_boundary[i] =
true;
234 template class deal2lkit::ParsedZeroAverageConstraints<1,1>;
235 template class deal2lkit::ParsedZeroAverageConstraints<1,2>;
236 template class deal2lkit::ParsedZeroAverageConstraints<1,3>;
237 template class deal2lkit::ParsedZeroAverageConstraints<2,2>;
238 template class deal2lkit::ParsedZeroAverageConstraints<2,3>;
239 template class deal2lkit::ParsedZeroAverageConstraints<3,3>;
virtual void parse_parameters_call_back()
parse_parameters_call_back is inherithed by ParameterAcceptor
virtual void declare_parameters(ParameterHandler &prm)
declare_parameters is inherithed by ParameterAcceptor
A parameter acceptor base class.
std::string str_boundary_components
static ParameterHandler prm
Static parameter.
ComponentMask get_mask() const
return the ComponentMask
#define AssertThrow(cond, exc)
std::string str_component_names
const unsigned int n_components
void add_line(const size_type line)
std::vector< std::string > _component_names
static::ExceptionBase & ExcImpossibleInDim(int arg1)
void add_entry(const size_type line, const size_type column, const double value)
void apply_zero_average_constraints(const DoFHandler< dim, spacedim > &dof_handler, ConstraintMatrix &constraints) const
Compute the zero average constraints and apply them on the given constraint matrix.
types::global_dof_index n_dofs() const
void internal_zero_average_constraints(const DoFHandler< dim, spacedim > &dof_handler, const ComponentMask mask, const bool at_boundary, ConstraintMatrix &constraints) const
std::vector< std::string > boundary_components
std::string str_components
std::vector< std::string > components
std::string print(const std::vector< Type > &list, const std::string sep=",")
Return a string containing the content of the vector, with elements separated by the @ sep parameter...
int string_to_int(const std::string &s)
void add_parameter(ParameterHandler &prm, T *parameter, const std::string &entry, const std::string &default_value, const Patterns::PatternBase &pattern=Patterns::Anything(), const std::string &documentation=std::string())
Add a parameter the given parameter list.
ComponentMask get_boundary_mask() const
return the ComponentMask at boundary
std::vector< bool > boundary_mask
ParsedZeroAverageConstraints(const std::string &name, const unsigned int &n_components=1, const std::string &component_names="", const std::string &default_components="", const std::string &default_boundary_components="")
Constructor.