Re: [deal.II] VectorTools::interpolate_boundary_values doesn't work for DG

2023-01-04 Thread Abbas
Thank you Daniel. 

I was using penalties before taking this route, because I had artifacts at 
the boundary faces present at a corner between a Dirichlet and a Neuman BC 
edge. A problem I didn't have with CG.  My first intuition was to apply BCs 
strongly to fix this, but I don't think it will even if I were able to 
interpolate. 

It's cool how dealii is consitent with the maths.
Maybe @Wolfgang would agree that this should have thrown an exception in 
Debug?

On Wednesday, January 4, 2023 at 9:31:34 PM UTC+2 d.arnd...@gmail.com wrote:

> Abbas,
>
> Yes, FE_DGQ only defines dofs in the interior of cells. Thus, trying to 
> interpolate the boundary has no effect. You would normally use penalty 
> terms to prescribe boundary values for DG methods.
>
> Best,
> Daniel
>
> On Wed, Jan 4, 2023 at 6:04 PM Abbas  wrote:
>
>> Hello, 
>>
>> The VectorTools::interpolate_boundary_values function works for 
>> interpolating fe_Q functions but not fe_DGQ . 
>> Was this meant to be the case? 
>> I attached a minimal code that illustrates this.
>>
>>
>> -- 
>> 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.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/dealii/0a8d1da6-e564-45de-bc3d-1f5a9d5dfad9n%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/a8f4659b-c4e8-4a3d-81fc-ed802c7bd3bcn%40googlegroups.com.


Re: [deal.II] VectorTools::interpolate_boundary_values doesn't work for DG

2023-01-04 Thread Daniel Arndt
Abbas,

Yes, FE_DGQ only defines dofs in the interior of cells. Thus, trying to
interpolate the boundary has no effect. You would normally use penalty
terms to prescribe boundary values for DG methods.

Best,
Daniel

On Wed, Jan 4, 2023 at 6:04 PM Abbas  wrote:

> Hello,
>
> The VectorTools::interpolate_boundary_values function works for
> interpolating fe_Q functions but not fe_DGQ .
> Was this meant to be the case?
> I attached a minimal code that illustrates this.
>
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/dealii/0a8d1da6-e564-45de-bc3d-1f5a9d5dfad9n%40googlegroups.com
> 
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/CAOYDWbKhorQ25J5C0YJgHLbo2qq%3Dtrb6MzdPMi%2B_n4wrfh4nOg%40mail.gmail.com.


[deal.II] VectorTools::interpolate_boundary_values doesn't work for DG

2023-01-04 Thread Abbas
Hello, 

The VectorTools::interpolate_boundary_values function works for 
interpolating fe_Q functions but not fe_DGQ . 
Was this meant to be the case? 
I attached a minimal code that illustrates this.
   

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/0a8d1da6-e564-45de-bc3d-1f5a9d5dfad9n%40googlegroups.com.
#include 
#include 

#include 
#include 

#include 
#include 

#include 
#include 
#include 

#include 
using namespace dealii;
int main()

{
// create an feq obkect and interpolate a value of 1 at boundary 0
{
Triangulation<2> tria;
GridGenerator::hyper_cube(tria, 0, 1, true);
tria.refine_global(4);
FE_Q<2> fe(1);
DoFHandler<2> dof(tria);

Vector solution;

dof.distribute_dofs(fe);
solution.reinit(dof.n_dofs());

std::map boundary_values;
VectorTools::interpolate_boundary_values(dof,
 0,
 Functions::ConstantFunction<2>(1),
 boundary_values);
for (auto _value : boundary_values)
solution(boundary_value.first) = boundary_value.second;

DataOut<2> data_out;

data_out.attach_dof_handler(dof);
data_out.add_data_vector(solution, "solution");
data_out.build_patches();

const std::string filename = "solution-feq.vtu";
std::ofstream output(filename);
data_out.write_vtu(output);
}

// Same as above but
// we create an feGQq obkect and interpolate
{
Triangulation<2> tria;
GridGenerator::hyper_cube(tria, 0, 1, true);
tria.refine_global(4);
FE_DGQ<2> fe(1); // only difference between this and the above code 
DoFHandler<2> dof(tria);

Vector solution;

dof.distribute_dofs(fe);
solution.reinit(dof.n_dofs());

std::map boundary_values;
VectorTools::interpolate_boundary_values(dof,
 0,
 Functions::ConstantFunction<2>(1),
 boundary_values);
for (auto _value : boundary_values)
solution(boundary_value.first) = boundary_value.second;

DataOut<2> data_out;

data_out.attach_dof_handler(dof);
data_out.add_data_vector(solution, "solution");
data_out.build_patches();

const std::string filename = "solution-fedgq.vtu";
std::ofstream output(filename);
data_out.write_vtu(output);
}
}


Re: [deal.II] collect2 linking error when executing make

2023-01-04 Thread Simon Wiesheier
I called cmake as follows
$ cmake -DDEAL_II_WITH_HDF5=OFF .

and get the additional lines

//No help, variable specified on the command line.
DEAL_II_WITH_HDF5:UNINITIALIZED=OFF

in my CMakeCache.txt file.

However, after
$ make

the error message is unchanged.
Best
Simon


Am Di., 3. Jan. 2023 um 20:55 Uhr schrieb Simon Wiesheier <
simon.wieshe...@gmail.com>:

> I started from an empty source directory with only a CMakeLists.txt file.
>
> I do not need hdf5.
> At least I was not aware that I had it on my old computer.
>
> Is there a way to work around the issue?
>
> Best
> Simon
>
>
> Timo Heister  schrieb am Di., 3. Jan. 2023, 20:19:
>
>> Simon,
>>
>> Make sure that you do not transfer any temporary files
>> (CMakeCache.txt, CMakeFiles/ etc.) but that you start from a fresh
>> source directory. The error message hints at the fact that your new
>> system does not have hdf5 installed.
>>
>> On Mon, Jan 2, 2023 at 4:21 AM Simon  wrote:
>> >
>> > Dear all, First of all, I wish you a happy and prosperous new year
>> 2023! I transferred my dealii project to a different computer and encounter
>> an linking error (command make) after setting up the project (command cmake
>> .). ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍
>> > ZjQcmQRYFpfptBannerStart
>> > This Message Is From an External Sender
>> > Use caution when opening links or attachments if you do not recognize
>> the sender.
>> >
>> > ZjQcmQRYFpfptBannerEnd
>> > Dear all,
>> >
>> > First of all, I wish you a happy and prosperous new year 2023!
>> >
>> > I transferred my dealii project to a different computer and
>> > encounter an linking error (command make) after setting up
>> > the project (command cmake .).
>> > The error message is attached.
>> >
>> > What is the problem?
>> >
>> > Best
>> > Simon
>> >
>> > --
>> > 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.
>> > To view this discussion on the web visit
>> https://groups.google.com/d/msgid/dealii/ca0ce1f2-cba0-42e1-8ee4-2178806540ebn%40googlegroups.com
>> .
>>
>>
>>
>> --
>> Timo Heister
>> http://www.math.clemson.edu/~heister/
>>
>> --
>> 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.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/dealii/CAMRj59HYLvENRpM7%3Dwy4v%3D8pvbkm7viGjMa4Apr3ytoZKX%3DktQ%40mail.gmail.com
>> .
>>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/CAM50jEsJVDPE-6Y1tuviCXU%2BmgPD55%3D1pX%3DyW8JTP5eghM7ZWA%40mail.gmail.com.