Hi, all.
I'd like ask a question implementing periodic boundary condition.
Modifying step-22 tutorial code, I want to solve a stokes flow at Couette
configuration
I plan to solve it at (x,y) in [0,5] x [0,1], rectangular domain
with boundary condition
\vec{u} (x,1)= (1,0) (moving dragging plate)
\vec{u} (x,0)= (0,0) (stationary bottom plate)
and periodic boundary condition at both inlet and outlet
\vec{u}(0,y)=\vec{u}(5,y)
I think in deal.ii, this can be implemented as
{
constraints.clear ();
FEValuesExtractors::Vector velocities(0);
DoFTools::make_hanging_node_constraints (dof_handler,
constraints);
// PERIODIC boundary condition
std::vector::cell_iterator> > make_pair;
GridTools::collect_periodic_faces(dof_handler,1,3
/*direction*/,0
,make_pair);
VectorTools::interpolate_boundary_values (dof_handler,
4,
BoundaryValues(),
constraints,
fe.component_mask(velocities));
VectorTools::interpolate_boundary_values (dof_handler,
2,
ZeroFunction(dim+1),
constraints,
fe.component_mask(velocities));
}
However, as I run code, I get error message that
An error occurred in line <3751> of file
in
function
void dealii::GridTools::collect_periodic_faces(const MeshType &, const
types::boundary_id, const types::boundary_id, const int,
std::vector > &, const
Tensor<1, MeshType::space_dimension> &, const FullMatrix &)
[MeshType = dealii::DoFHandler<2, 2>]
The violated condition was:
pairs1.size() == pairs2.size()
Additional information:
Unmatched faces on periodic boundaries
Stacktrace:
---
when it tried to compile following part
* GridTools::collect_periodic_faces(dof_handler,1,3*
* /*direction*/,0*
* ,make_pair);*
I would appreciate any comments or thoughts for possible reason of the
problem.
I attach minimalized problem that has same problem.
Thanks
--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see
https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to the Google Groups
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to dealii+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include //For the periodic boundary condition
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
namespace Step22
{
using namespace dealii;
template
struct InnerPreconditioner;
template <>
struct InnerPreconditioner<2>
{
typedef SparseDirectUMFPACK type;
};
template <>
struct InnerPreconditioner<3>
{
typedef SparseILU type;
};
template
class StokesProblem
{
public:
StokesProblem (const unsigned int degree);
void run ();
private:
void define_mesh ();
void setup_dofs ();
void assemble_system ();
void solve ();
void output_results ();
const unsigned int degree;
Triangulation triangulation;
FESystemfe;
DoFHandler dof_handler;
ConstraintMatrix constraints;
BlockSparsityPattern sparsity_pattern;
BlockSparseMatrix system_matrix;
BlockVector solution;
BlockVector system_rhs;
std_cxx11::shared_ptr::type> A_preconditioner;
};
template
class BoundaryValues : public Function
{
public:
BoundaryValues () : Function(dim+1) {}
virtual double value (const Point &p,
const unsigned int component = 0) const;
virtual void vector_value (const Point &p,
Vector &value) const;
};
template
double
BoundaryValues::value (const Point &p,
const unsigned int component) const
{
Assert (component < this->n_components,
ExcIndexRange (component, 0, this->n_components));
if (component == 0)
return 1;
return 0;
}
template
void
BoundaryValues::vector_value (const Point &p,