Dear All,

I am solving a mechanics problem based on the finite strain problem in Step 
44.
I need to apply non-zero Dirichlet boundary condition for displacement in
one of the outer boundary of a square 2D domain. I have considered a class 
called
'IncrementalBoundaryValues' (a part of the code given in the below in 
blue)  to define the 
boundary conditions and added a few lines in the function 'make_constraint' 
(also given 
below in green).  Whenever I consider 'values(0)'  (defined in class 
'IncrementalBoundaryValues')
to be some non-zero value I get the error massage as given below (in red).  
The rest of the
 code related to the Constraint_Matrix is similar to step 44.

I shall be thankful if someone could tell me what is going wrong here.

Thanks and regards,
Anup.

void 
PhaseField::Material_Compressible_Neo_Hook_Three_Field<dim>::update_material_data(const
 
dealii::Tensor<2, dim>&, const dealii::Tensor<2, dim>&, double, double, 
double, double, double, double, double, double) [with int dim = 2]
The violated condition was: 
    det_F > 0
The name and call sequence of the exception was:
    ExcInternalError()



template <int dim>
                  class IncrementalBoundaryValues :  public Function<dim>
                  {
                  public:
                    IncrementalBoundaryValues (const double length, const 
double applied_strain);
                    virtual
                    void
                    vector_value (const Point<dim> &p,
                                  Vector<double>   &values) const;
                    virtual
                    void
                    vector_value_list (const std::vector<Point<dim> > 
&points,
                                       std::vector<Vector<double> >   
&value_list) const;
                  private:
                    const double length;
                    const double applied_strain;

                  };
                  template <int dim>
                  IncrementalBoundaryValues<dim>::
                  IncrementalBoundaryValues (const double length, const 
double applied_strain)
                    :
                    Function<dim> (dim),
                    length (length),
                    applied_strain (applied_strain)
                  {}

                  template <int dim>
                  void
                  IncrementalBoundaryValues<dim>::
                  vector_value (const Point<dim> &/*p*/,
                                Vector<double>   &values) const
                  {
                    Assert (values.size() == dim,
                            ExcDimensionMismatch (values.size(), dim));
                    values = 0;
                    values(0) = length * applied_strain;
                  }
                  template <int dim>
                  void
                  IncrementalBoundaryValues<dim>::
                  vector_value_list (const std::vector<Point<dim> > &points,
                                     std::vector<Vector<double> >   
&value_list) const
                  {
                    const unsigned int n_points = points.size();
                    Assert (value_list.size() == n_points,
                            ExcDimensionMismatch (value_list.size(), 
n_points));
                    for (unsigned int p=0; p<n_points; ++p)
                      IncrementalBoundaryValues<dim>::vector_value 
(points[p],
                                                                    
value_list[p]);
                  }



template <int dim>
  void Solid<dim>::make_constraints(const int &it_nr)
  {
    std::cout << " CST " << std::flush;

    if (it_nr > 1)
      return;
    constraints.clear();
    const bool apply_dirichlet_bc = (it_nr == 0);
    const FEValuesExtractors::Scalar x_displacement(0);
    const FEValuesExtractors::Scalar y_displacement(1);

    if (dim == 3)
    const FEValuesExtractors::Scalar z_displacement(2);
    {
      const int boundary_id = 1;

      if (apply_dirichlet_bc == true)
        VectorTools::interpolate_boundary_values(dof_handler_ref,
                                                 boundary_id,
                                                 
ZeroFunction<dim>(n_components),
                                                 constraints,
                                                 
fe.component_mask(x_displacement)|
                                                 
fe.component_mask(y_displacement));
      else
        VectorTools::interpolate_boundary_values(dof_handler_ref,
                                                 boundary_id,
                                                 
ZeroFunction<dim>(n_components),
                                                 constraints,
                                                 
fe.component_mask(x_displacement)|
                                                 
fe.component_mask(y_displacement));
    }
    
















*{      const int boundary_id = 11;      if (apply_dirichlet_bc == 
true)          VectorTools::interpolate_boundary_values 
(dof_handler_ref,                                       
boundary_id,                                       
IncrementalBoundaryValues<dim>(parameters.length,                               
                                       
parameters.applied_strain),                                       
constraints,                                       
fe.component_mask(x_displacement));      else          
VectorTools::interpolate_boundary_values 
(dof_handler_ref,                                       
boundary_id,                                       
IncrementalBoundaryValues<dim>(parameters.length,                               
                                       
parameters.applied_strain),                                       
constraints,                                       
fe.component_mask(x_displacement));    }*
 
               constraints.close();
  }

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to