Using create_point_source_vector() function with hp::DoFHandler

38 views
Skip to first unread message

Deepak Gupta

unread,
Jul 28, 2016, 7:26:17 AM7/28/16
to dea...@googlegroups.com
Dear All,

I had been using create_point_source_vector() function with DoFHandler and it had been working fine. Recently, I modified my code for hp-version and am now using hp::DoFHandler. With p=1, the code works fine. However, with p>1, the program breaks during runtime at create_point_source_vector() function with no error. I checked and my system_rhs vector looks OK.
The parameters const Point< spacedim > &p and const Point< dim > &direction look correct as well. Thus, I have no idea what is really going wrong here.

Does someone has a similar experience and can point out what I might be doing wrong here.

Best regards
Deepak
--
Deepak K. Gupta

Daniel Arndt

unread,
Jul 28, 2016, 8:45:31 AM7/28/16
to deal.II User Group
Deepak,

could you provide us with a minimal example that shows your problem?
Are you running in debug mode? What exactly does the program tell you when aborting?

Best,
Daniel

Deepak Gupta

unread,
Jul 28, 2016, 9:32:15 AM7/28/16
to dea...@googlegroups.com
Dear Daniel,

I will try to come up with a minimal example. In the meantime, below is the piece of code and I will try to explain using this. I tried running in Debug mode as well but not able to figure out the error.  For the code below in combination with the rest of the code, the last line of output on the console is Checkpoint 1.

Note: I am using dealii as an external library and am writing another small library for my own purpose. Objects such as mesh in the piece of code below refer to my library.

This is a vector valued problem with 2 dofs per support point. *dof_handler is a pointer for the dof_handler object of hp::DoFHandler<dim> type for a rectangular triangulation with 8X4 elements of Q2 type and using Q1 mapping. system_rhs is a vector of size 17 * 9 * 2 = 306.

template <int dim>
void FEM<dim>::add_point_source_to_rhs(){
    deallog.depth_console (2);  


    unsigned int no_sources = (mesh->point_source_vector).size();
    for(unsigned int s = 0; s < no_sources; ++s){
        std::vector<double> load_point = mesh->point_source_vector[s].first;
        std::vector<double> load = mesh->point_source_vector[s].second;
        Assert (load_point.size() == dim,
                ExcDimensionMismatch(load_point.size(), dim));
        Assert (load.size() == dim,
                ExcDimensionMismatch(load.size(), dim));

        //defining the load and the load point
        Point<dim> ldp, ld;
        for(unsigned int i = 0; i < dim; ++i){
            ldp(i) = load_point[i];
            ld(i) = load[i];
        }
       

         std::cout<<"Checkpoint 1"<<std::endl;
         VectorTools::create_point_source_vector(*dof_handler, ldp, ld, system_rhs);
         std::cout<<"Checkpoint 2"<<std::endl;

    }
}

Are you able to figure out any bug with this information?

Thanks!

Best
Deepak

--
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+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Daniel Arndt

unread,
Jul 28, 2016, 12:08:46 PM7/28/16
to deal.II User Group, m...@deepakgupta.net.in
Deepak,

without a working example I can run, I don't see an obvious error.
Note that there are two tests, namely "numerics/create_point_source_hp" and "hp/vectors_point_source_hp_01"
that test `VectorTools::create_point_source` for hp. Maybe this helpful for debugging.

Best,
Daniel
Reply all
Reply to author
Forward
0 new messages