Sorry if it is not clear. Sure I will explain it a bit more.
In step-26 of tutorials, the (temperature application) Dirchlet BC is 
already implemented. I want to apply the heat flux BC on one of the edge 
instead i.e. *dU(t, x, y=1)/dy* at top. For this so far I could only find a 
method to make a heat source using the already present function as follows:

  template<int dim>
  class RightHandSide : public Function<dim>
  {
  public:
    RightHandSide ()
      :
      Function<dim>(),
      period (0.2)
    {}

    virtual double value (const Point<dim> &p,
                          const unsigned int component = 0) const;

  private:
    const double period;
  };



  template<int dim>
  double RightHandSide<dim>::value (const Point<dim> &p,
                                    const unsigned int component) const
  {
    (void) component;
    Assert (component == 0, ExcIndexRange(component, 0, 1));
    Assert (dim == 2, ExcNotImplemented());

    const double time = this->get_time();
    const double point_within_period = (time/period - 
std::floor(time/period));

    if ((point_within_period >= 0.0) && (point_within_period <= 0.2))
      {
        if ((p[0] > 0.5) && (p[1] > -0.5))
          return 2;
        else
          return 0;
      }
    else if ((point_within_period >= 0.5) && (point_within_period <= 0.7))
      {
        if ((p[0] > -0.5) && (p[1] > 0.5))
          return 2;
        else
          return 0;
      }
    else
      return 0;
///////////////////////////////////////////////////////////////////////////////////
    // Applying the Neumann BC in the form of flux producing source or sink 
at top boundary
///////////////////////////////////////////////////////////////////////////////////

    if ((point_within_period >= 0.0) && (point_within_period <= 0.2))
      {

    if (p[1] > 0.99)
          return 100;
        else
          return 0;

      }

  }

So the question is that is it valid Idea or there can be other idea to 
apply heat flux on the boundary edge in deal.ii step-26 code? Thank you!

On Tuesday, April 9, 2019 at 5:23:04 PM UTC+2, Wolfgang Bangerth wrote:
>
> On 4/9/19 3:44 AM, Muhammad Mashhood wrote: 
> > Thank you very much Prof. Bangerth. The Neuman condition is now 
> implemented 
> > successfully on the face elements in relatively simpler way (which you 
> > proposed for me). Now I have moved ahead to implement the flux BC on the 
> top 
> > edge of square plate and I am taking help of your tutorial step-26. But 
> in 
> > this code the structure is a bit different than the step-8 i.e. the 
> *cell_rhs 
> > *looks like being formed now in *create_right_hand_side* function. 
> > So my question is that can I simply use the heat source code of 
> following 
> > function: 
> > *template<int dim> 
> >    double RightHandSide<dim>::value (const Point<dim> &p, 
> >                                      const unsigned int component) 
> const* 
> > 
> > to select the points of top edge of the domain to declare the flux input 
> or 
> > Neuman BC (i.e. in other words moving source on top and source now 
> putting 
> > heat inside the domain) or there is other valid way for that? Thank you 
> in 
> > advance for your suggestion! 
>
> I don't think I fully understand what you want to do. Can you state in 
> formulas what you want to implement? How does your boundary conditions 
> look like? 
>
> Best 
>   WB 
>
> -- 
> ------------------------------------------------------------------------ 
> Wolfgang Bangerth          email:                 [email protected] 
> <javascript:> 
>                             www: http://www.math.colostate.edu/~bangerth/ 
>
>

-- 
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