Re: [deal.II] Making a pair of extracted data and cast into a set

2020-10-13 Thread Behrooz Karami
Dear Jean-Paul,

Thanks very much for your explanations.
I managed to achieve my objective. You were right, one of the crucial 
points I had to take into account was the compatibility of data structures. 
Defining a new operator was another to the point advice, as some of the 
errors were laid on this ground. Thanks again.

Best, 
Behrooz



On Friday, October 9, 2020 at 11:56:36 PM UTC+2 Jean-Paul Pelteret wrote:

> Hi Behrooz,
>
> I must admit that I’ve not been able to follow why you want to store 
> Points when you’re interested in global vertex indices, but I’ll try to 
> give a little help where I can.
> In case its of any help to you, I believe that you should be able to get 
> the coordinate of the vertex with a known global index with the help of the 
> Triangulation::get_vertices() 
> 
>  function.
>
> By the way,  to be more specific, a simple command like the following :
> std::pair , Point> mypair (vertices[v], vertices[v]);
> (in conjunction with vertices[v] = cell->face(f)->vertex(v);)
> makes a pair of coordinates of vertices.
>
>
> In terms of the question “can I do this?”, what you’ve written here is 
> reasonable. If vertices[v] stores a Point, which is exactly what is 
> returned by cell->face(f)->vertex(v) ...
>
> However, when I modify it towards vertex_index(v), it doesn't work:
> vertices[v] = cell->face(f)->vertex_index(v);
> std::pair , Point> mypair (vertices[v], vertices[v]);
> Perhaps something according to Point needs be modified.
>
>
> … but this doesn’t make sense. Specifically, this:
>
> vertices[v] = cell->face(f)->vertex_index(v);
>
> A call to cell->face(f)->vertex_index(v) returns the global index of a 
> vertex (so, effectively an integer) and unless the data type stored by 
> “vertices” has changed, you’re trying to assign an integer to a Point. This 
> cannot work.
>
> std::set > set1;
>
>
> This cannot work without a little work from your side. The problem is that 
> std::set  orders its 
> entries, and to do this it requires a comparator. One way to do this is to 
> define operator < in the class that is to be stored in the set, but we do 
> not provide such an operator. Thankfully, you can create a custom 
> comparator for Points and declare that comparator as the one to be used by 
> the std::set to order the entries. There’s a somewhat comprehensive post on 
> the subject at this link . I wonder 
> though if you rather want to make this a vector of Points, because the 
> order in which you enter them into the set would not be preserved. That 
> means that if you somehow extract and store the global index at the same 
> time, then the entries in the containers are not stores in the same order.
>
> By the way could anyone kindly enlighten me about the Point and 
 required steps to make a pair of and cast intended data into a set? 
 Specially why Point is a preferred type (in the case of 
 vertices) to other data types? 
>>>
>>>
> I guess that I answered half of this question, but to answer your question 
> on the relation of Points and vertices: Well, we choose to use the Point 
> class to describe the physical coordinates points in space, and the vector 
> that defines the coordinate has an end-point at the origin. The Tensor 
> class looks similar in structure (and has an overlap of functionality), but 
> represents other mathematical constructs such as a vector with both its 
> end-points being allowed to be anywhere in space. You can read more about 
> the conceptual difference in the introduction to the Point class 
> documentation 
> .
>
> I hope that this helps at least a bit, and that you manage to implement 
> what you’re trying to do here.
>
> Best,
> Jean-Paul
>
>
>
>
>
> On Friday, October 9, 2020 at 6:11:11 AM UTC+2 Behrooz Karami wrote:
>
>> Dear Daniel,
>>
>> Thanks very much for your reply. Actually what I want to do is very 
>> simple.
>>
>> Consider that the above code gives me 3 nodal indices as: 1, 4 and 5.
>> First, I need to be able to cast them into a set or vector. We can call 
>> it set1.
>> Then assume that I have another set, e.g. set2, which is composed of 
>> those nodes (same coordinates), however consecutively renumbered to 101, 
>> 102 and 103.
>>
>> Second step I am trying to achieve is to create a pair between the 
>> components of those two sets (set1 and set2).  The new set, e.g. set3, 
>> would be in fact a set of pairs which includes just three pairs namely 
>> (1,101) , (4, 102) and (5, 103). Pairs should be constructed in a 
>> one-to-one manner, for example we do not want to have something like (1, 
>> 102).
>>
>> So basically to me it seems that I need first to make a set of points, 
>> very roughly like:
>> std::set > set1;
>> std::set > set2;
>>
>> and then making 

[deal.II] Adaptive Time Increment Algorithm

2020-10-13 Thread James Gorman
deal.ii users,

I'm learning deal.ii with the goal of using it to non-linear solid 
mechanics problems. In many of these problems (such as Step-44), a time 
step is used to move a calculation from the initial condition to the final 
loaded state.

Step-44 uses a uniform time-step, but there are instances where an adaptive 
time step would be helpful. Using the initial parameter settings in 2-D, I 
found that a time-step of 0.7 was too large (the residual was on the order 
of 10^3) for the calculation to converge. 

I modified Step-44 to allow the time increment to increase the time 
increment when the number of Newton-Raphson iterations for two consecutive 
increments is small enough. I used global variables to make this happen.

I am, however, at a loss for how to efficiently make it so that Step-44 (or 
any other script) will automatically decrease a time-step. The only idea I 
had at the moment was to use a ``for'' loop and run a certain number of 
iterations, and each time the solution did not converge would be to 
multiply the time-step by some fraction. However, I am not sure this 
solution would work well with my previous solution 

Has anyone done this before, or have thoughts on how one might modify 
Step-44 to automatically increase and decrease based on the number of 
iterations required for Newton-Raphson convergence or divergence? Thank you 
for your help.

James

-- 
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/e0ec0522-510f-475c-bb9a-a615bd9b0800n%40googlegroups.com.


Re: [deal.II] Re: APPLY BOUNDARY CONDTION ON INTERNAL FACE

2020-10-13 Thread 孙翔
Hi, Daniel,

I see. Thank you very much. So, I think our method may be available as long 
as it can separate the face.  

Best,

Xiang 

On Tuesday, 13 October 2020 at 14:38:29 UTC-7 d.arnd...@gmail.com wrote:

> Xiang,
>
> deal.II doesn't have functionality to create separate cells sharing a face 
> but only to join them. Hence, whatever input you provide to 
> Triangulation::create_triangulation() must have these faces already. GridIn 
> should work for that if the faces are disjoint in the input file.
>
> Best,
> Daniel
>
> Am Di., 13. Okt. 2020 um 11:20 Uhr schrieb 孙翔 :
>
>> Hi, Daniel,
>>
>> Thank you very much. So, if I want to disjoint the faces, how should I do 
>> using dealII or I need to disjoint them manually? If I manually disjoint 
>> them, should I duplicate the joint nodes and assign them with the new 
>> number, then assemble the adjacent element with the duplicated nodes? 
>> Please see the attached figure. I am not sure if Grid_in can read it. 
>>
>> Best,
>>
>> Xiang
>>
>> On Monday, 12 October 2020 at 11:09:31 UTC-7 d.arnd...@gmail.com wrote:
>>
>>> Xiang,
>>>
>>> Adding to Bruno's response: If the interface you want to apply Dirichlet 
>>> boundary conditions to stays the same through the whole simulation, then 
>>> treating the corresponding faces as disjoint while creating your mesh might 
>>> be a better option.
>>> Setting constraints yourself requires you to know how the degrees of 
>>> freedom map to function values (which depends on the finite element you are 
>>> using). FE_Q elements are nodal, though, so you can simply constrain the 
>>> degrees of freedom to the desired function value at the corresponding 
>>> support points.
>>>
>>> Best,
>>> Daniel
>>>
>>>
>>> Am Mo., 12. Okt. 2020 um 09:21 Uhr schrieb Bruno Turcksin <
>>> bruno.t...@gmail.com>:
>>>
 Xiang,

 You cannot apply a boundary condition on an internal face. You need to 
 use the AffineConstraint 
  
 class to impose the constraints yourself. This is what we use internally 
 to 
 apply Dirichlet boundary condition.

 Best,

 Bruno



 On Monday, October 12, 2020 at 2:10:15 AM UTC-4 shya...@gmail.com 
 wrote:

> Hi, I want to model injecting heat fluid into a tiny fracture which is 
> inside a block. The fracture is modeled as an interface which is an 
> internal face shared by two hex elements. Is it possible for us to apply 
> the Dirichlet boundary condition on the interface? If not, how should I 
> do 
> it?  
>
> Best,
>
> Xiang
>
 -- 
 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/3840f39f-e3ae-4d76-886b-c3658bcade13n%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+un...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/dealii/a837e332-a242-45b9-b79b-a23a8f37deb0n%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/ea86e520-6fd6-4c8c-bd26-0e7b42b45768n%40googlegroups.com.


Re: [deal.II] Re: APPLY BOUNDARY CONDTION ON INTERNAL FACE

2020-10-13 Thread 孙翔
Hi, Bruno,

Thanks a lot. We will have a try based on the example you gave us. 

Best,

Xiang

On Tuesday, 13 October 2020 at 10:49:08 UTC-7 bruno.t...@gmail.com wrote:

> Xiang,
>
> Here is an example on how to do it:
>
> https://github.com/geodynamics/aspect/blob/master/cookbooks/prescribed_velocity/prescribed_velocity.cc#L297-L303
> As you can see, you need to know which dof you need to constrain
>
> Best,
>
> Bruno
>
> Le mar. 13 oct. 2020 à 11:02, 孙翔  a écrit :
> >
> >
> > Hi, Bruno,
> >
> > Thank you very much. Does the AffineConstraint force the value at the 
> specified DOF? I need to how the node numbers map to the DOF, right?
> >
> > Best,
> >
> > Xiang
> > On Monday, 12 October 2020 at 06:21:03 UTC-7 bruno.t...@gmail.com wrote:
> >>
> >> Xiang,
> >>
> >> You cannot apply a boundary condition on an internal face. You need to 
> use the AffineConstraint class to impose the constraints yourself. This is 
> what we use internally to apply Dirichlet boundary condition.
> >>
> >> Best,
> >>
> >> Bruno
> >>
> >>
> >>
> >> On Monday, October 12, 2020 at 2:10:15 AM UTC-4 shya...@gmail.com 
> wrote:
> >>>
> >>> Hi, I want to model injecting heat fluid into a tiny fracture which is 
> inside a block. The fracture is modeled as an interface which is an 
> internal face shared by two hex elements. Is it possible for us to apply 
> the Dirichlet boundary condition on the interface? If not, how should I do 
> it?
> >>>
> >>> Best,
> >>>
> >>> Xiang
> >
> > --
> > 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 a topic in the 
> Google Groups "deal.II User Group" group.
> > To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/dealii/hv0QjbGuxls/unsubscribe.
> > To unsubscribe from this group and all its topics, send an email to 
> dealii+un...@googlegroups.com.
> > To view this discussion on the web visit 
> https://groups.google.com/d/msgid/dealii/dc0e5cab-64c7-4af7-b957-2a51f83ee5f4n%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/c6ceef9b-a1db-4aad-9dfa-3561be8e0534n%40googlegroups.com.


Re: [deal.II] Re: APPLY BOUNDARY CONDTION ON INTERNAL FACE

2020-10-13 Thread Daniel Arndt
Xiang,

deal.II doesn't have functionality to create separate cells sharing a face
but only to join them. Hence, whatever input you provide to
Triangulation::create_triangulation() must have these faces already. GridIn
should work for that if the faces are disjoint in the input file.

Best,
Daniel

Am Di., 13. Okt. 2020 um 11:20 Uhr schrieb 孙翔 :

> Hi, Daniel,
>
> Thank you very much. So, if I want to disjoint the faces, how should I do
> using dealII or I need to disjoint them manually? If I manually disjoint
> them, should I duplicate the joint nodes and assign them with the new
> number, then assemble the adjacent element with the duplicated nodes?
> Please see the attached figure. I am not sure if Grid_in can read it.
>
> Best,
>
> Xiang
>
> On Monday, 12 October 2020 at 11:09:31 UTC-7 d.arnd...@gmail.com wrote:
>
>> Xiang,
>>
>> Adding to Bruno's response: If the interface you want to apply Dirichlet
>> boundary conditions to stays the same through the whole simulation, then
>> treating the corresponding faces as disjoint while creating your mesh might
>> be a better option.
>> Setting constraints yourself requires you to know how the degrees of
>> freedom map to function values (which depends on the finite element you are
>> using). FE_Q elements are nodal, though, so you can simply constrain the
>> degrees of freedom to the desired function value at the corresponding
>> support points.
>>
>> Best,
>> Daniel
>>
>>
>> Am Mo., 12. Okt. 2020 um 09:21 Uhr schrieb Bruno Turcksin <
>> bruno.t...@gmail.com>:
>>
>>> Xiang,
>>>
>>> You cannot apply a boundary condition on an internal face. You need to
>>> use the AffineConstraint
>>> 
>>> class to impose the constraints yourself. This is what we use internally to
>>> apply Dirichlet boundary condition.
>>>
>>> Best,
>>>
>>> Bruno
>>>
>>>
>>>
>>> On Monday, October 12, 2020 at 2:10:15 AM UTC-4 shya...@gmail.com wrote:
>>>
 Hi, I want to model injecting heat fluid into a tiny fracture which is
 inside a block. The fracture is modeled as an interface which is an
 internal face shared by two hex elements. Is it possible for us to apply
 the Dirichlet boundary condition on the interface? If not, how should I do
 it?

 Best,

 Xiang

>>> --
>>> 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/3840f39f-e3ae-4d76-886b-c3658bcade13n%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/a837e332-a242-45b9-b79b-a23a8f37deb0n%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/CAOYDWb%2BVWhJtqWZ86T229jo0aUMnZgNqZDE9FDDCs5J_9dCj-A%40mail.gmail.com.


Re: [deal.II] FullMatrix to SparseMatrix

2020-10-13 Thread Wolfgang Bangerth

On 10/13/20 10:28 AM, Nikki Holtzer wrote:
The issue that I have when  all matrices are FullMatrix matrices is I can't 
seem to get the .add function to result in anything other than error. If I 
keep ONLY both nonlinear_part and linear_part as FullMatrix

I receive:

error: no matching function for call to 
‘dealii::FullMatrix::add(double, const dealii::SparseMatrix&)’


    linear_part.add((1. - theta) * kappa, S_c);


Which leads me to believe that I cannot add a SparseMatrix (S_c) to a 
FullMatrix (linear_part).


Correct -- there is no such function.


I tried to back track and change S_c to be a 
FullMatrix instead of a SparseMatrix


For instance:


FullMatrix mass_matrix_unconstrainted;
mass_matrix_unconstrained = 0;
FullMatrix cell_mass_matrix(dofs_per_cell, dofs_per_cell);
cell_mass_matrix = 0;


Then I fill cell_mass_matrix.

mass_matrix_unconstrained.add(local_dof_indices, cell_mass_matrix);

error: no matching function for call to 
‘dealii::FullMatrix::add(std::vector&, 
dealii::FullMatrix&)’


      mass_matrix_unconstrained.add(local_dof_indices, cell_mass_matrix);


Right, that function also doesn't exist, but you could do
  for (unsigned int i=0; i
Alternatively if I try:

mass_matrix_unconstrained = mass_matrix_unconstrained  + 
local_dof_indices*cell_mass_matrix;



I receive.

error: no match for ‘operator*’ (operand types are ‘std::vector’ 
and ‘dealii::FullMatrix’)


Right. There is also no operator* for vector and 
FullMatrix. It's also unclear to me what exactly that would actually 
supposed to do.


Writing the double-loop above is the way to go.

Best
 W.


--

Wolfgang Bangerth  email: bange...@colostate.edu
   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 dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/16ea2df7-2751-b926-7323-2dc208f3587a%40colostate.edu.


Re: [deal.II] Re: APPLY BOUNDARY CONDTION ON INTERNAL FACE

2020-10-13 Thread Bruno Turcksin
Xiang,

Here is an example on how to do it:
https://github.com/geodynamics/aspect/blob/master/cookbooks/prescribed_velocity/prescribed_velocity.cc#L297-L303
As you can see, you need to know which dof you need to constrain

Best,

Bruno

Le mar. 13 oct. 2020 à 11:02, 孙翔  a écrit :
>
>
> Hi, Bruno,
>
> Thank you very much. Does the AffineConstraint force the value at the 
> specified DOF? I need to how the node numbers map to the DOF, right?
>
> Best,
>
> Xiang
> On Monday, 12 October 2020 at 06:21:03 UTC-7 bruno.t...@gmail.com wrote:
>>
>> Xiang,
>>
>> You cannot apply a boundary condition on an internal face. You need to use 
>> the AffineConstraint class to impose the constraints yourself. This is what 
>> we use internally to apply Dirichlet boundary condition.
>>
>> Best,
>>
>> Bruno
>>
>>
>>
>> On Monday, October 12, 2020 at 2:10:15 AM UTC-4 shya...@gmail.com wrote:
>>>
>>> Hi, I want to model injecting heat fluid into a tiny fracture which is 
>>> inside a block. The fracture is modeled as an interface which is an 
>>> internal face shared by two hex elements. Is it possible for us to apply 
>>> the Dirichlet boundary condition on the interface? If not, how should I do 
>>> it?
>>>
>>> Best,
>>>
>>> Xiang
>
> --
> 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 a topic in the Google 
> Groups "deal.II User Group" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/dealii/hv0QjbGuxls/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to 
> dealii+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/dealii/dc0e5cab-64c7-4af7-b957-2a51f83ee5f4n%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/CAGVt9eP-obzx1%2B0rBq5c9GkP-taGXvPo8dQCRVOM7As%2BsroANw%40mail.gmail.com.


[deal.II] Re: building with PETSc and METIS

2020-10-13 Thread Aaditya Lakshmanan
Hi,
   Although you have set  -DDEALII_WITH_MPI=ON it seems from the following 
lines in your output :

-- Found LAPACK
-- Use other than Intel MKL implementation of BLAS/LAPACK (consult 
CMakeFiles/CMakeError.log for further information).
-- DEAL_II_WITH_LAPACK successfully set up with external dependencies.
--
-- Include /home/christos/dealii-9.2.0/cmake/configure/configure_1_mpi.cmake
*-- DEAL_II_WITH_MPI is set to off.  *

that the contrary is occurring. You are missing an underscore in the 
original cmake command. It should be *-DDEAL_II_WITH_MPI=ON *in your cmake 
command. 

Best,
Aaditya  

On Tuesday, October 13, 2020 at 11:31:02 AM UTC-4 karliampa...@gmail.com 
wrote:

> Dear all, 
>
> i try to build dealii with PETSc and METIS using command,
>
> cmake  -DDEAL_II_WITH_PETSC=ON -DPETSC_DIR=/home/christos/petsc 
> -DPETSC_ARCH=x86_64 -DDEAL_II_WITH_METIS=ON 
> -DMETIS_DIR=/home/christos/metis-5.1.0 -DDEALII_WITH_MPI=ON 
> -DCMAKE_INSTALL_PREFIX=/usr/local ..
>
> having the following output on the screen
>
>
> -- This is CMake 3.10.2
> -- 
> -- Include /home/christos/dealii-9.2.0/cmake/setup_external_macros.cmake
> -- Include /home/christos/dealii-9.2.0/cmake/macros/macro_add_flags.cmake
> -- Include 
> /home/christos/dealii-9.2.0/cmake/macros/macro_check_compiler_setup.cmake
> -- Include 
> /home/christos/dealii-9.2.0/cmake/macros/macro_check_cxx_compiler_bug.cmake
> -- Include 
> /home/christos/dealii-9.2.0/cmake/macros/macro_check_mpi_interface.cmake
> -- Include 
> /home/christos/dealii-9.2.0/cmake/macros/macro_clear_cmake_required.cmake
> -- Include 
> /home/christos/dealii-9.2.0/cmake/macros/macro_configure_feature.cmake
> -- Include 
> /home/christos/dealii-9.2.0/cmake/macros/macro_deal_ii_add_definitions.cmake
> -- Include 
> /home/christos/dealii-9.2.0/cmake/macros/macro_deal_ii_add_library.cmake
> -- Include 
> /home/christos/dealii-9.2.0/cmake/macros/macro_deal_ii_add_test.cmake
> -- Include 
> /home/christos/dealii-9.2.0/cmake/macros/macro_deal_ii_find_file.cmake
> -- Include 
> /home/christos/dealii-9.2.0/cmake/macros/macro_deal_ii_find_library.cmake
> -- Include 
> /home/christos/dealii-9.2.0/cmake/macros/macro_deal_ii_find_path.cmake
> -- Include 
> /home/christos/dealii-9.2.0/cmake/macros/macro_deal_ii_find_program.cmake
> -- Include 
> /home/christos/dealii-9.2.0/cmake/macros/macro_deal_ii_initialize_cached_variables.cmake
> -- Include 
> /home/christos/dealii-9.2.0/cmake/macros/macro_deal_ii_insource_setup_target.cmake
> -- Include 
> /home/christos/dealii-9.2.0/cmake/macros/macro_deal_ii_invoke_autopilot.cmake
> -- Include 
> /home/christos/dealii-9.2.0/cmake/macros/macro_deal_ii_package_handle.cmake
> -- Include 
> /home/christos/dealii-9.2.0/cmake/macros/macro_deal_ii_pickup_tests.cmake
> -- Include 
> /home/christos/dealii-9.2.0/cmake/macros/macro_deal_ii_query_git_information.cmake
> -- Include 
> /home/christos/dealii-9.2.0/cmake/macros/macro_deal_ii_setup_target.cmake
> -- Include 
> /home/christos/dealii-9.2.0/cmake/macros/macro_decorate_with_stars.cmake
> -- Include 
> /home/christos/dealii-9.2.0/cmake/macros/macro_enable_if_links.cmake
> -- Include 
> /home/christos/dealii-9.2.0/cmake/macros/macro_enable_if_supported.cmake
> -- Include 
> /home/christos/dealii-9.2.0/cmake/macros/macro_enable_language_optional.cmake
> -- Include 
> /home/christos/dealii-9.2.0/cmake/macros/macro_evaluate_expression.cmake
> -- Include 
> /home/christos/dealii-9.2.0/cmake/macros/macro_expand_instantiations.cmake
> -- Include 
> /home/christos/dealii-9.2.0/cmake/macros/macro_filter_system_libraries.cmake
> -- Include 
> /home/christos/dealii-9.2.0/cmake/macros/macro_find_package.cmake
> -- Include 
> /home/christos/dealii-9.2.0/cmake/macros/macro_find_system_library.cmake
> -- Include 
> /home/christos/dealii-9.2.0/cmake/macros/macro_item_matches.cmake
> -- Include 
> /home/christos/dealii-9.2.0/cmake/macros/macro_purge_feature.cmake
> -- Include 
> /home/christos/dealii-9.2.0/cmake/macros/macro_register_feature.cmake
> -- Include 
> /home/christos/dealii-9.2.0/cmake/macros/macro_remove_duplicates.cmake
> -- Include 
> /home/christos/dealii-9.2.0/cmake/macros/macro_replace_flag.cmake
> -- Include 
> /home/christos/dealii-9.2.0/cmake/macros/macro_reset_cmake_required.cmake
> -- Include 
> /home/christos/dealii-9.2.0/cmake/macros/macro_set_if_empty.cmake
> -- Include 
> /home/christos/dealii-9.2.0/cmake/macros/macro_setup_source_list.cmake
> -- Include 
> /home/christos/dealii-9.2.0/cmake/macros/macro_setup_unity_target.cmake
> -- Include /home/christos/dealii-9.2.0/cmake/macros/macro_strip_flag.cmake
> -- Include 
> /home/christos/dealii-9.2.0/cmake/macros/macro_switch_library_preference.cmake
> -- Include /home/christos/dealii-9.2.0/cmake/macros/macro_to_string.cmake
> -- Include 
> /home/christos/dealii-9.2.0/cmake/macros/macro_to_string_and_add_prefix.cmake
> -- Include 
> /home/christos/dealii-9.2.0/cmake/macros/macro_unset_if_changed.cmake
> -- Include 
> 

Re: [deal.II] FullMatrix to SparseMatrix

2020-10-13 Thread Nikki Holtzer
The issue that I have when  all matrices are FullMatrix matrices is I can't 
seem to get the .add function to result in anything other than error. If I 
keep ONLY both nonlinear_part and linear_part as FullMatrix 
I receive:

error: no matching function for call to 
‘dealii::FullMatrix::add(double, const 
dealii::SparseMatrix&)’

   linear_part.add((1. - theta) * kappa, S_c);

Which leads me to believe that I cannot add a SparseMatrix (S_c) to a 
FullMatrix (linear_part). I tried to back track and change S_c to be a 
FullMatrix instead of a SparseMatrix 

For instance: 


FullMatrix mass_matrix_unconstrainted;
mass_matrix_unconstrained = 0;
FullMatrix cell_mass_matrix(dofs_per_cell, dofs_per_cell);
cell_mass_matrix = 0;


Then I fill cell_mass_matrix.

mass_matrix_unconstrained.add(local_dof_indices, cell_mass_matrix);

error: no matching function for call to 
‘dealii::FullMatrix::add(std::vector&, 
dealii::FullMatrix&)’

 mass_matrix_unconstrained.add(local_dof_indices, cell_mass_matrix);


Alternatively if I try:

mass_matrix_unconstrained = mass_matrix_unconstrained  + 
local_dof_indices*cell_mass_matrix;


I receive.

error: no match for ‘operator*’ (operand types are ‘std::vector’ and ‘dealii::FullMatrix’)

 mass_matrix_unconstrained = mass_matrix_unconstrained + 
local_dof_indices * cell_mass_matrix;


I thought maybe this is a type error, i.e. I can't multiply a vector of int 
by a matrix of double but I can't seem to be able to convert the vector 
without error either. 


Thank you,

Nikki


On Monday, October 12, 2020 at 7:27:35 PM UTC-4 Wolfgang Bangerth wrote:

> On 10/11/20 6:09 PM, Nikki Holtzer wrote:
> > I was hoping to take the outer product which is formed in a FullMatrix, 
> called 
> > Kronecker_matrix below, multiply it by a coefficient, and add a matrix 
> to it 
> > called nonlinear_part_full. This entire operation I have tried to put 
> into a 
> > Sparse matrix, called Nonlinear_part, because I need to add this term to 
> > linear_part which is Sparse. I have done this simply because it was the 
> only 
> > way I could make the addition between linear_part (Sparse) and 
> > nonlinear_part_full (FullMatrix) work all while trying to make the code 
> as 
> > efficient as possible.
>
> But if the nonlinear part is a dense matrix, you will necessarily add 
> entries 
> into the sparse matrix that are not present in the sparsity pattern. When 
> you 
> build a sparse matrix with a certain sparsity pattern, you are saying 
> "these 
> are the entries that could possibly be nonzero, please allocate memory for 
> them". So when you later add the dense matrix to the sparse one, you're 
> breaking this promise.
>
> I don't quite understand why you copy everything into a sparse matrix in 
> your 
> code. Couldn't you just keep everything in dense matrices and do the 
> linear 
> solve with that?
>
> Best
> W.
>
> -- 
> 
> Wolfgang Bangerth email: bang...@colostate.edu
> 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 dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/a9ee9a8a-6cab-47b0-9ef1-49a133a6828dn%40googlegroups.com.


[deal.II] building with PETSc and METIS

2020-10-13 Thread Christos Karliampas
Dear all, 

i try to build dealii with PETSc and METIS using command,

cmake  -DDEAL_II_WITH_PETSC=ON -DPETSC_DIR=/home/christos/petsc 
-DPETSC_ARCH=x86_64 -DDEAL_II_WITH_METIS=ON 
-DMETIS_DIR=/home/christos/metis-5.1.0 -DDEALII_WITH_MPI=ON 
-DCMAKE_INSTALL_PREFIX=/usr/local ..

having the following output on the screen


-- This is CMake 3.10.2
-- 
-- Include /home/christos/dealii-9.2.0/cmake/setup_external_macros.cmake
-- Include /home/christos/dealii-9.2.0/cmake/macros/macro_add_flags.cmake
-- Include 
/home/christos/dealii-9.2.0/cmake/macros/macro_check_compiler_setup.cmake
-- Include 
/home/christos/dealii-9.2.0/cmake/macros/macro_check_cxx_compiler_bug.cmake
-- Include 
/home/christos/dealii-9.2.0/cmake/macros/macro_check_mpi_interface.cmake
-- Include 
/home/christos/dealii-9.2.0/cmake/macros/macro_clear_cmake_required.cmake
-- Include 
/home/christos/dealii-9.2.0/cmake/macros/macro_configure_feature.cmake
-- Include 
/home/christos/dealii-9.2.0/cmake/macros/macro_deal_ii_add_definitions.cmake
-- Include 
/home/christos/dealii-9.2.0/cmake/macros/macro_deal_ii_add_library.cmake
-- Include 
/home/christos/dealii-9.2.0/cmake/macros/macro_deal_ii_add_test.cmake
-- Include 
/home/christos/dealii-9.2.0/cmake/macros/macro_deal_ii_find_file.cmake
-- Include 
/home/christos/dealii-9.2.0/cmake/macros/macro_deal_ii_find_library.cmake
-- Include 
/home/christos/dealii-9.2.0/cmake/macros/macro_deal_ii_find_path.cmake
-- Include 
/home/christos/dealii-9.2.0/cmake/macros/macro_deal_ii_find_program.cmake
-- Include 
/home/christos/dealii-9.2.0/cmake/macros/macro_deal_ii_initialize_cached_variables.cmake
-- Include 
/home/christos/dealii-9.2.0/cmake/macros/macro_deal_ii_insource_setup_target.cmake
-- Include 
/home/christos/dealii-9.2.0/cmake/macros/macro_deal_ii_invoke_autopilot.cmake
-- Include 
/home/christos/dealii-9.2.0/cmake/macros/macro_deal_ii_package_handle.cmake
-- Include 
/home/christos/dealii-9.2.0/cmake/macros/macro_deal_ii_pickup_tests.cmake
-- Include 
/home/christos/dealii-9.2.0/cmake/macros/macro_deal_ii_query_git_information.cmake
-- Include 
/home/christos/dealii-9.2.0/cmake/macros/macro_deal_ii_setup_target.cmake
-- Include 
/home/christos/dealii-9.2.0/cmake/macros/macro_decorate_with_stars.cmake
-- Include 
/home/christos/dealii-9.2.0/cmake/macros/macro_enable_if_links.cmake
-- Include 
/home/christos/dealii-9.2.0/cmake/macros/macro_enable_if_supported.cmake
-- Include 
/home/christos/dealii-9.2.0/cmake/macros/macro_enable_language_optional.cmake
-- Include 
/home/christos/dealii-9.2.0/cmake/macros/macro_evaluate_expression.cmake
-- Include 
/home/christos/dealii-9.2.0/cmake/macros/macro_expand_instantiations.cmake
-- Include 
/home/christos/dealii-9.2.0/cmake/macros/macro_filter_system_libraries.cmake
-- Include /home/christos/dealii-9.2.0/cmake/macros/macro_find_package.cmake
-- Include 
/home/christos/dealii-9.2.0/cmake/macros/macro_find_system_library.cmake
-- Include /home/christos/dealii-9.2.0/cmake/macros/macro_item_matches.cmake
-- Include 
/home/christos/dealii-9.2.0/cmake/macros/macro_purge_feature.cmake
-- Include 
/home/christos/dealii-9.2.0/cmake/macros/macro_register_feature.cmake
-- Include 
/home/christos/dealii-9.2.0/cmake/macros/macro_remove_duplicates.cmake
-- Include /home/christos/dealii-9.2.0/cmake/macros/macro_replace_flag.cmake
-- Include 
/home/christos/dealii-9.2.0/cmake/macros/macro_reset_cmake_required.cmake
-- Include /home/christos/dealii-9.2.0/cmake/macros/macro_set_if_empty.cmake
-- Include 
/home/christos/dealii-9.2.0/cmake/macros/macro_setup_source_list.cmake
-- Include 
/home/christos/dealii-9.2.0/cmake/macros/macro_setup_unity_target.cmake
-- Include /home/christos/dealii-9.2.0/cmake/macros/macro_strip_flag.cmake
-- Include 
/home/christos/dealii-9.2.0/cmake/macros/macro_switch_library_preference.cmake
-- Include /home/christos/dealii-9.2.0/cmake/macros/macro_to_string.cmake
-- Include 
/home/christos/dealii-9.2.0/cmake/macros/macro_to_string_and_add_prefix.cmake
-- Include 
/home/christos/dealii-9.2.0/cmake/macros/macro_unset_if_changed.cmake
-- Include 
/home/christos/dealii-9.2.0/cmake/macros/macro_verbose_include.cmake
-- 
-- Include /home/christos/dealii-9.2.0/cmake/setup_cached_variables.cmake
-- Prepending ${CUDA_NVCC_FLAGS} to ${DEAL_II_CUDA_FLAGS}
-- 
-- Include /home/christos/dealii-9.2.0/cmake/setup_deal_ii.cmake
-- 
-- Include /home/christos/dealii-9.2.0/cmake/setup_compiler_flags.cmake
-- 
-- Include /home/christos/dealii-9.2.0/cmake/setup_compiler_flags_gnu.cmake
-- 
-- Include /home/christos/dealii-9.2.0/bundled/setup_bundled.cmake
-- 
-- Include 
/home/christos/dealii-9.2.0/cmake/checks/check_01_cpu_features.cmake
-- 
-- Include 
/home/christos/dealii-9.2.0/cmake/checks/check_01_cxx_features.cmake
-- Using C++ version flag "-std=c++17"
-- DEAL_II_WITH_CXX14 successfully set up
-- DEAL_II_WITH_CXX17 successfully set up
-- 
-- Include 
/home/christos/dealii-9.2.0/cmake/checks/check_02_compiler_features.cmake
-- 
-- Include 

Re: [deal.II] Re: APPLY BOUNDARY CONDTION ON INTERNAL FACE

2020-10-13 Thread 孙翔
Hi, Daniel,

Thank you very much. So, if I want to disjoint the faces, how should I do 
using dealII or I need to disjoint them manually? If I manually disjoint 
them, should I duplicate the joint nodes and assign them with the new 
number, then assemble the adjacent element with the duplicated nodes? 
Please see the attached figure. I am not sure if Grid_in can read it. 

Best,

Xiang

On Monday, 12 October 2020 at 11:09:31 UTC-7 d.arnd...@gmail.com wrote:

> Xiang,
>
> Adding to Bruno's response: If the interface you want to apply Dirichlet 
> boundary conditions to stays the same through the whole simulation, then 
> treating the corresponding faces as disjoint while creating your mesh might 
> be a better option.
> Setting constraints yourself requires you to know how the degrees of 
> freedom map to function values (which depends on the finite element you are 
> using). FE_Q elements are nodal, though, so you can simply constrain the 
> degrees of freedom to the desired function value at the corresponding 
> support points.
>
> Best,
> Daniel
>
>
> Am Mo., 12. Okt. 2020 um 09:21 Uhr schrieb Bruno Turcksin <
> bruno.t...@gmail.com>:
>
>> Xiang,
>>
>> You cannot apply a boundary condition on an internal face. You need to 
>> use the AffineConstraint 
>>  
>> class to impose the constraints yourself. This is what we use internally to 
>> apply Dirichlet boundary condition.
>>
>> Best,
>>
>> Bruno
>>
>>
>>
>> On Monday, October 12, 2020 at 2:10:15 AM UTC-4 shya...@gmail.com wrote:
>>
>>> Hi, I want to model injecting heat fluid into a tiny fracture which is 
>>> inside a block. The fracture is modeled as an interface which is an 
>>> internal face shared by two hex elements. Is it possible for us to apply 
>>> the Dirichlet boundary condition on the interface? If not, how should I do 
>>> it?  
>>>
>>> Best,
>>>
>>> Xiang
>>>
>> -- 
>> 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/3840f39f-e3ae-4d76-886b-c3658bcade13n%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/a837e332-a242-45b9-b79b-a23a8f37deb0n%40googlegroups.com.


Re: [deal.II] Re: APPLY BOUNDARY CONDTION ON INTERNAL FACE

2020-10-13 Thread 孙翔
Hi, Daniel,

Thank you very much. So, if I want to disjoint the faces, how should I do 
using dealII or I need to disjoint them manually? If I manually disjoint 
them, should I duplicate the joint nodes and assign them with the new 
number, then assemble the adjacent element with the duplicated nodes? I am 
not sure if Grid_in can read it. 

Best,

Xiang



On Monday, 12 October 2020 at 11:09:31 UTC-7 d.arnd...@gmail.com wrote:

> Xiang,
>
> Adding to Bruno's response: If the interface you want to apply Dirichlet 
> boundary conditions to stays the same through the whole simulation, then 
> treating the corresponding faces as disjoint while creating your mesh might 
> be a better option.
> Setting constraints yourself requires you to know how the degrees of 
> freedom map to function values (which depends on the finite element you are 
> using). FE_Q elements are nodal, though, so you can simply constrain the 
> degrees of freedom to the desired function value at the corresponding 
> support points.
>
> Best,
> Daniel
>
>
> Am Mo., 12. Okt. 2020 um 09:21 Uhr schrieb Bruno Turcksin <
> bruno.t...@gmail.com>:
>
>> Xiang,
>>
>> You cannot apply a boundary condition on an internal face. You need to 
>> use the AffineConstraint 
>>  
>> class to impose the constraints yourself. This is what we use internally to 
>> apply Dirichlet boundary condition.
>>
>> Best,
>>
>> Bruno
>>
>>
>>
>> On Monday, October 12, 2020 at 2:10:15 AM UTC-4 shya...@gmail.com wrote:
>>
>>> Hi, I want to model injecting heat fluid into a tiny fracture which is 
>>> inside a block. The fracture is modeled as an interface which is an 
>>> internal face shared by two hex elements. Is it possible for us to apply 
>>> the Dirichlet boundary condition on the interface? If not, how should I do 
>>> it?  
>>>
>>> Best,
>>>
>>> Xiang
>>>
>> -- 
>> 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/3840f39f-e3ae-4d76-886b-c3658bcade13n%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/5cffd4a0-3c0a-4e84-977c-932a404e468an%40googlegroups.com.


[deal.II] Re: APPLY BOUNDARY CONDTION ON INTERNAL FACE

2020-10-13 Thread 孙翔

Hi, Bruno,

Thank you very much. Does the AffineConstraint force the value at the 
specified DOF? I need to how the node numbers map to the DOF, right? 

Best,

Xiang
On Monday, 12 October 2020 at 06:21:03 UTC-7 bruno.t...@gmail.com wrote:

> Xiang,
>
> You cannot apply a boundary condition on an internal face. You need to use 
> the AffineConstraint 
>  
> class to impose the constraints yourself. This is what we use internally to 
> apply Dirichlet boundary condition.
>
> Best,
>
> Bruno
>
>
>
> On Monday, October 12, 2020 at 2:10:15 AM UTC-4 shya...@gmail.com wrote:
>
>> Hi, I want to model injecting heat fluid into a tiny fracture which is 
>> inside a block. The fracture is modeled as an interface which is an 
>> internal face shared by two hex elements. Is it possible for us to apply 
>> the Dirichlet boundary condition on the interface? If not, how should I do 
>> it?  
>>
>> Best,
>>
>> Xiang
>>
>

-- 
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/dc0e5cab-64c7-4af7-b957-2a51f83ee5f4n%40googlegroups.com.