[deal.II] Re: How to get a vector graphic (like SVG) in dealii?

2023-12-15 Thread Masoud Ahmadi
Hi Laryssa,

Thanks for your reply.
Yes, I use Paraview for postprocessing. 
However, apparently It does not support the Vector-graphic images in the 
recent versions.

Bests,
Masoud

On Thursday 14 December 2023 at 19:08:26 UTC la.a...@gmail.com wrote:

> Hey Masoud, 
>
> You can open vtk and vtu files using Paraview and export them using 
> "Export Scene". You can find more information here: 
> https://www.paraview.org/Wiki/ParaView/Vector_Graphics_Export
>
> I hope this helps, 
> Laryssa
> On Wednesday, December 13, 2023 at 7:36:06 PM UTC-5 masou...@gmail.com 
> wrote:
>
>> @WB
>>
>> Thanks for the reply.
>> I meant the mesh with the results. Yes, GridOut works perfectly for just 
>> mesh, but I want to show the solution too.
>> Yes, I have already tried and can confirm that it is not fun work as you 
>> said.
>>
>> @Marc
>> Thanks for the links, I will give them a try.
>> I had seen the second link, but the problem was with the higher-order 
>> nodes.
>>
>> Regards,
>> Masoud
>> On Wednesday 13 December 2023 at 21:39:05 UTC mafe...@gmail.com wrote:
>>
>>> On Tuesday, December 12, 2023 at 6:39:31 AM UTC-7 masou...@gmail.com 
>>> wrote:
>>>
>>> I also tried to write a Python code for this purpose using vtk and 
>>> matplotlib libraries. It works almost fine, but when I want to plot the 
>>> mesh too, there are problems.
>>>
>>> A while ago I used matplotlib to create vector graphics out of VTK 
>>> files. As a reference I used this resource:
>>> https://perso.univ-rennes1.fr/pierre.navaro/read-vtk-with-python.html
>>>  
>>>
>>> I used Triangulation from matplotlib.tri, but it only supports triangles 
>>> mesh, while my mesh type is quadrilaterals.
>>>
>>> Workarounds exist for this, see:
>>>
>>> https://stackoverflow.com/questions/52202014/how-can-i-plot-2d-fem-results-using-matplotlib
>>>  
>>> Hope this helps!
>>> Marc
>>>
>>

-- 
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/66dc5ef9-e52a-45d0-b1b6-099c04f6926fn%40googlegroups.com.


[deal.II] Re: How to get a vector graphic (like SVG) in dealii?

2023-12-13 Thread Masoud Ahmadi
@WB

Thanks for the reply.
I meant the mesh with the results. Yes, GridOut works perfectly for just 
mesh, but I want to show the solution too.
Yes, I have already tried and can confirm that it is not fun work as you 
said.

@Marc
Thanks for the links, I will give them a try.
I had seen the second link, but the problem was with the higher-order nodes.

Regards,
Masoud
On Wednesday 13 December 2023 at 21:39:05 UTC mafe...@gmail.com wrote:

> On Tuesday, December 12, 2023 at 6:39:31 AM UTC-7 masou...@gmail.com 
> wrote:
>
> I also tried to write a Python code for this purpose using vtk and 
> matplotlib libraries. It works almost fine, but when I want to plot the 
> mesh too, there are problems.
>
> A while ago I used matplotlib to create vector graphics out of VTK files. 
> As a reference I used this resource:
> https://perso.univ-rennes1.fr/pierre.navaro/read-vtk-with-python.html
>  
>
> I used Triangulation from matplotlib.tri, but it only supports triangles 
> mesh, while my mesh type is quadrilaterals.
>
> Workarounds exist for this, see:
>
> https://stackoverflow.com/questions/52202014/how-can-i-plot-2d-fem-results-using-matplotlib
>  
> Hope this helps!
> Marc
>

-- 
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/7a0d032d-72f0-4d46-971e-aaed59fef718n%40googlegroups.com.


[deal.II] How to get a vector graphic (like SVG) in dealii?

2023-12-12 Thread Masoud Ahmadi
Hello everyone,

I save my results as VTK files using write_vtk.
I have been trying to get a vector graphic (like SVG) to display smooth and 
nice results.
I tried ParaView, but I think they do not support vector graphics in recent 
versions.
I also tried to write a Python code for this purpose using vtk and 
matplotlib libraries. It works almost fine, but when I want to plot the 
mesh too, there are problems.
I used Triangulation from matplotlib.tri, but it only supports triangles 
mesh, while my mesh type is quadrilaterals.
So, the question is, what is the best way to get SVG image of a VTK file?

Thanks,
Masoud

-- 
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/26c463b4-a41b-4f84-b313-bd3c7c39786en%40googlegroups.com.


Re: [deal.II] Using DoFTools::map_dofs_to_support_points for two-field with FE_DGPMonomial

2023-02-11 Thread Masoud Ahmadi
Thanks for the reply. 
My goal of using this function is simply to get the DoF of some specific 
nodes which I know their coordinates; so, are there any alternative options 
that I won't have to use this function? 

Bests
MA
On Tuesday, 7 February 2023 at 21:11:15 UTC Wolfgang Bangerth wrote:

>
> Masoud,
>
> > I am trying to use "DoFTools::map_dofs_to_support_points" function for a 
> > two-field problem. The components of the first (vectorial) field are 
> > approximated using "FE_Q" and the second (scalar) field with 
> > "FE_DGPMonomial". The "component_mask" parameter is used to select only 
> > the dofs associated with the first field.
> > 
> > 
> > However I get the following error message (debug mode):
> > 
> > /void dealii::DoFTools::internal::(anonymous 
> > namespace)::map_dofs_to_support_points(const hp::MappingCollection > spacedim> &, const DoFHandler &, 
> > std::map> &, const 
> > dealii::ComponentMask &) [dim = 2, spacedim = 2]/
> > 
> > /The violated condition was: /
> > 
> > /(fe_collection[fe_index].n_dofs_per_cell() == 0) || 
> > (fe_collection[fe_index].has_support_points())/
> > 
> > /Additional information: /
> > 
> > /You are trying to access the support points of a finite element that/
> > 
> > /either has no support points at all, or for which the corresponding/
> > 
> > /tables have not been implemented./
> > 
> > 
> > From inspecting the method responsible for throwing the error is 
> > appears that all fields in the collection are checked via the Assert. Is 
> > the method applicable to problems where some fields have support points 
> > and others don't but are masked? The mask appears to only be appropriate 
> > to mask fields with support points.
>
> You are correct: The DoFTools::map_dofs_to_support_points first asks the 
> finite element object for its support points, and only then applies the 
> mask. It doesn't know how to break down the element to its base/ 
> component elements if only some of the base elements have support 
> points, and the error message you see is the result.
>
> I don't have an alternative suggestion either. You'd have to implement 
> this kind of functionality (i.e., looking through the base elements of a 
> FESystem) if you really need the map from DoF indices to support points.
>
> 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/34a526eb-e9c0-4aa6-9c52-49683446b6aan%40googlegroups.com.


[deal.II] Using DoFTools::map_dofs_to_support_points for two-field with FE_DGPMonomial

2023-02-07 Thread Masoud Ahmadi


Dear dealii community,


I am trying to use "DoFTools::map_dofs_to_support_points" function for a 
two-field problem. The components of the first (vectorial) field are 
approximated using "FE_Q" and the second (scalar) field with 
"FE_DGPMonomial". The "component_mask" parameter is used to select only the 
dofs associated with the first field.


However I get the following error message (debug mode):

*void dealii::DoFTools::internal::(anonymous 
namespace)::map_dofs_to_support_points(const hp::MappingCollection &, const DoFHandler &, 
std::map> &, const 
dealii::ComponentMask &) [dim = 2, spacedim = 2]*

*The violated condition was: *

*(fe_collection[fe_index].n_dofs_per_cell() == 0) || 
(fe_collection[fe_index].has_support_points())*

*Additional information: *

*You are trying to access the support points of a finite element that*

*either has no support points at all, or for which the corresponding*

*tables have not been implemented.*


>From inspecting the method responsible for throwing the error is appears 
that all fields in the collection are checked via the Assert. Is the method 
applicable to problems where some fields have support points and others 
don't but are masked? The mask appears to only be appropriate to mask 
fields with support points.


Please find attached a minimal code for a two-field formulation that 
demonstrates the problem.

-- 
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/ef66c211-1290-43b4-9126-a9eabef00c55n%40googlegroups.com.
<>


Re: [deal.II] A problem using "make_periodicity_constraints" function

2022-12-05 Thread Masoud Ahmadi
OK, the more I think about it, the more I am confident to say: It is Wrong.

In my logic, I am not doing anything related to DoF numbering. In both 
cases, I create a square by the length of 44.72, assign the same boundary 
IDs to the sides (left: 1, right:2, down:3, up:4), then use the 
"DoFTools::make_periodicity_constraints" function to apply periodic BCs. 
Since the arguments for this function are the paired boundary IDs, and 
again, they are the same in both cases (because I marked them manually), I 
do not see a reason why we get a different result.

Regards,
Masoud
On Saturday, 3 December 2022 at 16:01:03 UTC Wolfgang Bangerth wrote:

> On 12/3/22 03:38, Masoud Ahmadi wrote:
> > My expectation stems from the fact that I am using the exact same mesh, 
> but 
> > instead of using "GridGenerator" function of dealii, this time I import 
> a mesh 
> > from Cubit. Then, I mark the boundaries in the same order: left: 1, 
> right: 2, 
> > bottom: 3, up: 4. So, I think I did the exact same thing.
> > 
> > What happens is the order of DoF numbering changes (as shown in the 
> pictures). 
> > But since my mesh is the same, and so are the boundary IDs, I expect the 
> > results to be as I described since 
> "DoFTools::make_periodicity_constraints" 
> > function gets the boundary IDs as inputs.
>
> What I'm trying to say is that just because the two meshes describe the 
> same 
> geometric region in space does not mean that they are constructed in the 
> same 
> way. GridGenerator may use a different numbering of vertices than the 
> imported 
> mesh, for example.
>
> So I'll come back to the original question: Is what happens actually 
> wrong? Or 
> is it just unexpected?
>
> 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/b8d32052-b795-4621-a9a1-c414f95ec3e3n%40googlegroups.com.


Re: [deal.II] A problem using "make_periodicity_constraints" function

2022-12-03 Thread Masoud Ahmadi
Dear Wolfgang,

Thanks for your reply.
My expectation stems from the fact that I am using the exact same mesh, but 
instead of using "GridGenerator" function of dealii, this time I import a 
mesh from Cubit. Then, I mark the boundaries in the same order: left: 1, 
right: 2, bottom: 3, up: 4. So, I think I did the exact same thing.

What happens is the order of DoF numbering changes (as shown in the 
pictures). But since my mesh is the same, and so are the boundary IDs, I 
expect the results to be as I described since 
"DoFTools::make_periodicity_constraints" 
function gets the boundary IDs as inputs.

Please let me know if I am still not clear.

Masoud

On Friday, 2 December 2022 at 23:43:08 UTC Wolfgang Bangerth wrote:

> On 12/2/22 10:20, Masoud Ahmadi wrote:
> > 
> > The problem is, when I import the mesh from Cubit (Lines 68-71 in the 
> uploaded 
> > code), I will have different numbering for the nodes (Case  in the 
> below 
> > image). While I expect the constraints to be as follows:
> > U4 = U6
> > U5 = U7
> > U0 = U2
> > U1 = U3
> > for the first function, and
> > U2 = U6
> > U3 = U7
> > they are the same as case !
>
> Masoud -- you don't say in your question, but are the constraints wrong? 
> You 
> say that you *expect* them to be different, but not where your expectation 
> stems from.
>
> 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/37a17f88-f95e-4fcc-8425-c8e2fa08ded9n%40googlegroups.com.


Re: [deal.II] Macro periodic boundary condition for a elasticity equation

2022-11-15 Thread Masoud Ahmadi
Hi Lukas and Jean-Paul,

I have the same exact question. 
Any further achievment with the issue?

Best regards,
Masoud

On Monday, 10 February 2020 at 23:59:35 UTC Lukas Schöller wrote:

> Hi Jean-Paul,
>
> thanks for you detailed answer. You described excatly what I want to do.  
> And I guess what is working for a finite deformation framework, works also 
> for the case of small strains.
> The main goal for me is still is to apply a prescribed marcoscopic stress 
> tensor.
> But it is always better to be able to choose from different boundary 
> condtions. So first I want to add the prescribed strain setting BC. And it 
> should also be much easier to implement.
>
> As I already described my first idea was also to extend/modify the 
> DoFTools::make_periodicity_constraints() functionality by adding some 
> displacement offsets to the constraints. But as I discovered today the 
> documenation is not too comprehensive about the used  parameters (eg. is 
> the matrix a general transformation matrix or only for a rotation? Or what 
> does the *first_vector_components* parameter?). And also the internal 
> implemtation is not this striaghtforward as I thought. So I would be happy 
> if you can share some working code with me. If I am able to add some 
> feature to the library in the end, I like to give something back to this 
> project by adding some functionality for other users.
>
> The the second problem, the prepresibed stress tensor, I would also solve. 
> But as I wrote, and you confimerd, this seems not to easy. As I hoped you 
> gave me some insight how to solve such a problem. But I was hoping that 
> there is a simple soulution in deal.II... 
> But from you experience I guess that a Lagrange multipler approach is 
> perhaps a more general  and robust approach, which works also with possible 
> nonlinearity added later.
>
> But first things first, so I try to add a macroscopic strain case, glady 
> with the help of your code, and have a deeper look in Miehe's work (I think 
> I had already a quick look in the referred paper, but was overwhelmed. 
> Often finite deformations look too complicated for small strains)
>
> Regards,
> Lukas
>
> Am Montag, 10. Februar 2020 22:38:50 UTC+1 schrieb Jean-Paul Pelteret:
>
>> Hi Lukas,
>>
>> If I’ve interpreted your emails correctly, you’ve mentioned two distinct 
>> things here, namely (1) the imposition of periodic displacement fluctuation 
>> field (thereby, in essence, prescribing a macroscopic average deformation 
>> gradient, with stress unknown) or (2) the imposition of a macroscopic 
>> stress condition through anti-periodic tractions (with deformation gradient 
>> unknown). It would seem to me that when you impose the one you implicitly 
>> end up imposing the other.
>>
>> I’ve got a little bit of experience with topic, but only from finite 
>> strain mechanics. So I’m going to lay out a few things coming a 
>> finite-deformation perspective. There’s a very nice set of papers by Miehe 
>> that discusses various methods to impose such conditions for the elasticity 
>> problem. The main work of interest might be this one:
>>
>> C. Miehe. Computational micro-to-macro transitions for discretized 
>> micro-structures of hetero- geneous materials at finite strains based on 
>> the minimization of averaged incremental energy. Computer Methods in 
>> Applied Mechanics and Engineering, 192(5–6):559–591, January 2003. DOI: 
>> 10.1016/s0045- 7825(02)00564- 9. 
>> I’ve implemented a set of functions that, as Miehe describes, sets up a 
>> periodicity frame and defines a set of constraints to satisfy (1) by 
>> imposing that [[u]] = \bar{\Grad u} [[X]] where \bar{\Grad u} is the 
>> macroscopic displacement gradient, and u and X are the microscopic 
>> displacement and position vectors, respectively. I’d be happy to share this 
>> with you if you’d like. To be honest though, although I rigorously followed 
>> Miehe’s approach for this as an educational exercise, one could simply 
>> amend our existing DoFTools::make_periodicity_constraints() function to 
>> include the necessary inhomogeneity (specifically, \bar{\Grad u} [[X]]) and 
>> an additional set of constraints to remove the rigid body motions. Its on 
>> my to-do list to add this to the library, but if its something that you’d 
>> like to try to add to the library yourself, then I’d be happy to try to 
>> help you with that.
>>
>> As for option (2), I’m afraid that I’ve not been able to give much 
>> thought to the details that you laid out in your original email and how it 
>> all fits together. I’m sure that it’s possible to do in the way that you’ve 
>> expressed (since the stress and strain are linearly related), but it seems 
>> like a real pain to have to deal with the additional tensor-valued DoFs. 
>> What I can tell you is two methods that myself and one of my colleagues 
>> have used to impose such conditions (for non-linear problems, where there 
>> are not necessarily such nice ways to express and

Re: [deal.II] Arpack and block systems !

2022-08-30 Thread Masoud Ahmadi
Dear all,

I'm facing the same problem and found this topic.
Is there any update on this issue or it is still the same as 7 years ago?

Thanks

On Friday, 3 May 2019 at 01:08:04 UTC+1 Wolfgang Bangerth wrote:

> On 5/2/19 5:09 PM, Mert Can Simsek wrote:
> > 
> > I'm facing the same problem and since this post is 4 years old, I wonder 
> > if Arpack and SparseDirectUMFPACK still do not support 
> > TrilinosWrappers::BlockSparseMatrix.
> > 
> > In my case, I need to calculate the minimum 10 eigenvalues of a large 
> > TrilinosWrappers::BlockSparseMatrix and since Arpack has the shifted 
> > eigenvalue method it would be very efficient to use it.
> > 
> > If you have any other suggestions to solve this problem using other 
> > packages, I'd be glad to hear them.
>
> I don't think we have new suggestions other than the ones I have in the 
> email you quote. Either do everything within Trilinos, or don't use 
> Trilinos at all if you want to hand your matrix to some other package. 
> Mixing and matching is always difficult...
>
> 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/ecfe3889-ced0-42f1-aff2-e26e448f6f18n%40googlegroups.com.


Re: [deal.II] Re: Solving the linear system of equations using PETSc BlockSparseMatrix

2022-08-30 Thread Masoud Ahmadi
Dear Bruno and Daniel,

Thanks for your replies.
I used linear_operator and then solve the problem like step-70. 
I guess there is no "Direct solver" for this situation, the one like we had 
for dealii BlockSparseMatrix.

Best regards,
Masoud


On Tuesday, 23 August 2022 at 16:11:12 UTC+1 d.arnd...@gmail.com wrote:

> Adding to what Bruno is saying,
>
> If you are not taking advantage of the block structure, you should be able 
> to treat the block matrix as "regular", i.e., non-block, matrix possibly by 
> copying it to a corresponding non-block type.
>
> Best,
> Daniel
>
> On Mon, Aug 22, 2022 at 10:51 AM Bruno Turcksin  
> wrote:
>
>> Hi,
>>
>> If you search for "block solver" here 
>> https://dealii.org/developer/doxygen/deal.II/Tutorial.html, you will see 
>> all the tutorials that use block solvers. I think that only deal.II's own 
>> solvers support BlockSparseMatrix directly.
>>
>> Best,
>>
>> Bruno
>>
>> On Monday, August 22, 2022 at 9:02:28 AM UTC-4 masou...@gmail.com wrote:
>>
>>> Dear All,
>>>
>>> The following system of equations:
>>> KQ=R
>>> where,
>>> [image: Screenshot from 2022-08-22 13-45-45.png]
>>> were solved using BlockSparseMatrix to form tangent matrix K. It was 
>>> solved by:
>>>
>>> SparseDirectUMFPACK A_direct; 
>>> A_direct.initialize(K); 
>>> A_direct.vmult(Q_stp, R);
>>>
>>> Now, I'm trying to run my code with MPI using PETSc/Trilinos, but the 
>>> solver does not except  PETSc/Trilinos BlockSparseMatrix. How do we solve 
>>> such a general system of equations? 
>>>
>> -- 
>>
> 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/9c70b7e9-08ed-4cd6-bfd7-7eefe5eb2159n%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/1fe4c5db-0e4d-4662-996c-c4363d6326adn%40googlegroups.com.


Re: [deal.II] Re: Solving the linear system of equations using PETSc BlockSparseMatrix

2022-08-23 Thread Masoud Ahmadi
Thanks for the reply.
I had seen that, they solve it for the "diagonal" blocks; I want a general 
method. My system of equations is not like any special cases in the 
Tutorials.
As I said, I solve the one without Trilinos/PETSc by:

SparseDirectUMFPACK A_direct; 
A_direct.initialize(K); 
A_direct.vmult(Q_stp, R);

I am looking for something similar.

On Tuesday, 23 August 2022 at 13:57:18 UTC+1 bruno.t...@gmail.com wrote:

> They do. Take for example step-70, the matrix is a 
> LA::MPI::BlockSparseMatrix 
> <https://www.dealii.org/9.3.3/doxygen/deal.II/namespaceLinearAlgebraDealII.html#a34f060e2c5e047fdc12c76d047c7c098>
>  
> which is a PETSc or a Trilinos BlockSpaceMatrix depending on how deal.II 
> was configured.
>
> Bruno
>
> Le mar. 23 août 2022 à 06:43, Masoud Ahmadi  a écrit :
>
>> Dear Bruno,
>>
>> Thanks for your reply.
>> I had seen those before, but, unfortunately none of those solve a general 
>> PETSc/Trilinos BlockSparseMatrix problem.
>>
>>
>> On Monday, 22 August 2022 at 15:51:03 UTC+1 bruno.t...@gmail.com wrote:
>>
>>> Hi,
>>>
>>> If you search for "block solver" here 
>>> https://dealii.org/developer/doxygen/deal.II/Tutorial.html, you will 
>>> see all the tutorials that use block solvers. I think that only deal.II's 
>>> own solvers support BlockSparseMatrix directly.
>>>
>>> Best,
>>>
>>> Bruno
>>>
>>> On Monday, August 22, 2022 at 9:02:28 AM UTC-4 masou...@gmail.com wrote:
>>>
>>>> Dear All,
>>>>
>>>> The following system of equations:
>>>> KQ=R
>>>> where,
>>>> [image: Screenshot from 2022-08-22 13-45-45.png]
>>>> were solved using BlockSparseMatrix to form tangent matrix K. It was 
>>>> solved by:
>>>>
>>>> SparseDirectUMFPACK A_direct; 
>>>> A_direct.initialize(K); 
>>>> A_direct.vmult(Q_stp, R);
>>>>
>>>> Now, I'm trying to run my code with MPI using PETSc/Trilinos, but the 
>>>> solver does not except  PETSc/Trilinos BlockSparseMatrix. How do we solve 
>>>> such a general system of equations? 
>>>>
>>> -- 
>> 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/vRkKqpMC21E/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/96e7565f-4e69-4bb9-8de8-ddcf4f3d4067n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/dealii/96e7565f-4e69-4bb9-8de8-ddcf4f3d4067n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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/4cb3ddef-efc4-4921-8fe7-b9e969a64d98n%40googlegroups.com.


[deal.II] Re: Solving the linear system of equations using PETSc BlockSparseMatrix

2022-08-23 Thread Masoud Ahmadi
Dear Bruno,

Thanks for your reply.
I had seen those before, but, unfortunately none of those solve a general 
PETSc/Trilinos BlockSparseMatrix problem.


On Monday, 22 August 2022 at 15:51:03 UTC+1 bruno.t...@gmail.com wrote:

> Hi,
>
> If you search for "block solver" here 
> https://dealii.org/developer/doxygen/deal.II/Tutorial.html, you will see 
> all the tutorials that use block solvers. I think that only deal.II's own 
> solvers support BlockSparseMatrix directly.
>
> Best,
>
> Bruno
>
> On Monday, August 22, 2022 at 9:02:28 AM UTC-4 masou...@gmail.com wrote:
>
>> Dear All,
>>
>> The following system of equations:
>> KQ=R
>> where,
>> [image: Screenshot from 2022-08-22 13-45-45.png]
>> were solved using BlockSparseMatrix to form tangent matrix K. It was 
>> solved by:
>>
>> SparseDirectUMFPACK A_direct; 
>> A_direct.initialize(K); 
>> A_direct.vmult(Q_stp, R);
>>
>> Now, I'm trying to run my code with MPI using PETSc/Trilinos, but the 
>> solver does not except  PETSc/Trilinos BlockSparseMatrix. How do we solve 
>> such a general system of equations? 
>>
>

-- 
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/96e7565f-4e69-4bb9-8de8-ddcf4f3d4067n%40googlegroups.com.


[deal.II] Solving the linear system of equations using PETSc BlockSparseMatrix

2022-08-22 Thread Masoud Ahmadi
Dear All,

The following system of equations:
KQ=R
where,
[image: Screenshot from 2022-08-22 13-45-45.png]
were solved using BlockSparseMatrix to form tangent matrix K. It was solved 
by:

SparseDirectUMFPACK A_direct; 
A_direct.initialize(K); 
A_direct.vmult(Q_stp, R);

Now, I'm trying to run my code with MPI using PETSc/Trilinos, but the 
solver does not except  PETSc/Trilinos BlockSparseMatrix. How do we solve 
such a general system of equations? 

-- 
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/10c07791-631f-450b-9864-dfd7e4c229c6n%40googlegroups.com.


Re: [deal.II] Error installing dealii by candi on Apple M1

2022-03-18 Thread Masoud Ahmadi
I removed this Master version, and install 9.3.3 version, it worked!
Many thanks Timo.
On Friday, 18 March 2022 at 13:46:01 UTC Masoud Ahmadi wrote:

> Thanks Timo.
> I removed homebrew entirely, then reinstall it and just run:
> brew install cmake open-mpi gcc
>
> Then I install the master version, this time the setup was completed; 
> however, when I tried to run step-1 example, this happened:
> [image: Screenshot 2022-03-18 at 12.30.12.png]
> On Wednesday, 16 March 2022 at 15:17:09 UTC Timo Heister wrote:
>
>> > # SCALAPACK_LIBRARIES = /opt/homebrew/lib/libscalapack.dylib;-lm;-
>>
>> It looks like you have a scalapack installation that got picked up and
>> caused the error. Can you do
>> cmake -D DEAL_II_WITH_SCALAPACK=OFF .
>> in the directory where you found the detailed.log? Follow that by
>> make install
>> (you can use -j to use more cores of course).
>>
>>
>> On Wed, Mar 16, 2022 at 9:42 AM Masoud Ahmadi  wrote:
>> >
>> > I had removed candi, so I had to reinstall it.
>> > But again got the same error.
>> > The requested log file is attached. Please see.
>> >
>> >
>> >
>> > On Tuesday, 15 March 2022 at 13:00:35 UTC Timo Heister wrote:
>> >>
>> >> Can you please post your 
>> /Users/masoud/dealii-candi/tmp/build/deal.II-master/detailed.log ?
>> >>
>> >> On Tue, Mar 15, 2022 at 7:18 AM Masoud Ahmadi  
>> wrote:
>> >>>
>> >>> Thanks Timo,
>> >>>
>> >>> I tried to switch to master, but again the same thing happened.
>> >>> So, now on the master branch of candi, same error.
>> >>> I attached the log file, please take a look.
>> >>>
>> >>>
>> >>> On Sunday, 13 March 2022 at 19:55:52 UTC Timo Heister wrote:
>> >>>>
>> >>>> What candi git branch are you on? You might need to switch to master 
>> to make things work for now.
>> >>>>
>> >>>> Can you post how you execute candi.sh including the first few pages 
>> of output?
>> >>>>
>> >>>> On Sun, Mar 13, 2022, 06:42 Masoud Ahmadi  
>> wrote:
>> >>>>>
>> >>>>> Dear Timo,
>> >>>>>
>> >>>>> No, I did not change anything; I did exactly what is explained in 
>> the following link, step by step:
>> >>>>> https://github.com/dealii/dealii/wiki/Apple-ARM-M1-OSX
>> >>>>>
>> >>>>> On Saturday, 12 March 2022 at 16:54:56 UTC Timo Heister wrote:
>> >>>>>>
>> >>>>>> Did you make any changes to candi.cfg? Can you also please post 
>> how you execute candi.sh (what arguments)?
>> >>>>>>
>> >>>>>> On Mon, Mar 7, 2022, 12:23 Masoud Ahmadi  
>> wrote:
>> >>>>>>>
>> >>>>>>> Hi,
>> >>>>>>>
>> >>>>>>> I am trying to install dealii on a apple ARM M1 OSX, using the 
>> following instructor:
>> >>>>>>> https://github.com/dealii/dealii/wiki/Apple-ARM-M1-OSX
>> >>>>>>>
>> >>>>>>> However, I get the following error:
>> >>>>>>>
>> >>>>>>>
>> >>>>>>> error: use of undeclared identifier 'H5Pset_dxpl_mpio'
>> >>>>>>> status = H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_INDEPENDENT);
>> >>>>>>> ^
>> >>>>>>> 
>> /Users/masoud/dealii-candi/tmp/unpack/deal.II-v9.3.3/source/lac/scalapack.cc:3242:63:
>>  
>> warning: unused parameter 'filename' [-Wunused-parameter]
>> >>>>>>> ScaLAPACKMatrix::load_parallel(const std::string 
>> &filename)
>> >>>>>>> ^
>> >>>>>>> 
>> /Users/masoud/dealii-candi/tmp/unpack/deal.II-v9.3.3/source/lac/scalapack.cc:2861:20:
>>  
>> error: use of undeclared identifier 'H5Pset_fapl_mpio'
>> >>>>>>> status = H5Pset_fapl_mpio(plist_id, tmp.grid->mpi_communicator, 
>> info);
>> >>>>>>> ^
>> >>>>>>> 
>> /Users/masoud/dealii-candi/tmp/build/deal.II-v9.3.3/source/lac/scalapack.inst:10:16:
>>  
>> note: in instantiation of member function 
>> 'dealii::ScaLAPACKMatrix::save_parallel' requested here
>> >>>>

Re: [deal.II] Error installing dealii by candi on Apple M1

2022-03-16 Thread Masoud Ahmadi
I had removed candi, so I had to reinstall it.
But again got the same error. 
The requested log file is attached. Please see.



On Tuesday, 15 March 2022 at 13:00:35 UTC Timo Heister wrote:

> Can you please post 
> your /Users/masoud/dealii-candi/tmp/build/deal.II-master/detailed.log ?
>
> On Tue, Mar 15, 2022 at 7:18 AM Masoud Ahmadi  wrote:
>
>> Thanks Timo,
>>
>> I tried to switch to master, but again the same thing happened.  
>> So, now on the master branch of candi, same error.
>> I attached the log file, please take a look.
>>
>>
>> On Sunday, 13 March 2022 at 19:55:52 UTC Timo Heister wrote:
>>
>>> What candi git branch are you on? You might need to switch to master to 
>>> make things work for now.
>>>
>>> Can you post how you execute candi.sh including the first few pages of 
>>> output?
>>>
>>> On Sun, Mar 13, 2022, 06:42 Masoud Ahmadi  wrote:
>>>
>>>> Dear Timo,
>>>>
>>>> No, I did not change anything; I did exactly what is explained in the 
>>>> following link, step by step:
>>>> https://github.com/dealii/dealii/wiki/Apple-ARM-M1-OSX
>>>>
>>>> On Saturday, 12 March 2022 at 16:54:56 UTC Timo Heister wrote:
>>>>
>>>>> Did you make any changes to candi.cfg? Can you also please post how 
>>>>> you execute candi.sh (what arguments)?
>>>>>
>>>>> On Mon, Mar 7, 2022, 12:23 Masoud Ahmadi  wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> I am trying to install dealii on a apple ARM M1 OSX, using the 
>>>>>> following instructor:
>>>>>> https://github.com/dealii/dealii/wiki/Apple-ARM-M1-OSX
>>>>>>
>>>>>> However, I get the following error:
>>>>>>
>>>>>>
>>>>>> error: use of undeclared identifier 'H5Pset_dxpl_mpio'
>>>>>>   status   = H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_INDEPENDENT);
>>>>>>  ^
>>>>>> /Users/masoud/dealii-candi/tmp/unpack/deal.II-v9.3.3/source/lac/scalapack.cc:3242:63:
>>>>>>  
>>>>>> warning: unused parameter 'filename' [-Wunused-parameter]
>>>>>> ScaLAPACKMatrix::load_parallel(const std::string 
>>>>>> &filename)
>>>>>>   ^
>>>>>> /Users/masoud/dealii-candi/tmp/unpack/deal.II-v9.3.3/source/lac/scalapack.cc:2861:20:
>>>>>>  
>>>>>> error: use of undeclared identifier 'H5Pset_fapl_mpio'
>>>>>>   status = H5Pset_fapl_mpio(plist_id, 
>>>>>> tmp.grid->mpi_communicator, info);
>>>>>>^
>>>>>> /Users/masoud/dealii-candi/tmp/build/deal.II-v9.3.3/source/lac/scalapack.inst:10:16:
>>>>>>  
>>>>>> note: in instantiation of member function 
>>>>>> 'dealii::ScaLAPACKMatrix::save_parallel' requested here
>>>>>> template class ScaLAPACKMatrix< double >;
>>>>>>^
>>>>>> /Users/masoud/dealii-candi/tmp/unpack/deal.II-v9.3.3/source/lac/scalapack.cc:2861:20:
>>>>>>  
>>>>>> error: use of undeclared identifier 'H5Pset_fapl_mpio'
>>>>>>   status = H5Pset_fapl_mpio(plist_id, 
>>>>>> tmp.grid->mpi_communicator, info);
>>>>>>^
>>>>>> /Users/masoud/dealii-candi/tmp/build/deal.II-v9.3.3/source/lac/scalapack.inst:20:16:
>>>>>>  
>>>>>> note: in instantiation of member function 
>>>>>> 'dealii::ScaLAPACKMatrix::save_parallel' requested here
>>>>>> template class ScaLAPACKMatrix< float >;
>>>>>>^
>>>>>> 1 warning and 3 errors generated.
>>>>>>
>>>>>>
>>>>>> [image: Screenshot 2022-03-07 at 17.11.39.png]
>>>>>> [image: Screenshot 2022-03-07 at 17.15.11.png]
>>>>>>
>>>>>> -- 
>>>>>> 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 
>>&g

Re: [deal.II] Error installing dealii by candi on Apple M1

2022-03-15 Thread Masoud Ahmadi
Thanks Timo,

I tried to switch to master, but again the same thing happened.  
So, now on the master branch of candi, same error.
I attached the log file, please take a look.


On Sunday, 13 March 2022 at 19:55:52 UTC Timo Heister wrote:

> What candi git branch are you on? You might need to switch to master to 
> make things work for now.
>
> Can you post how you execute candi.sh including the first few pages of 
> output?
>
> On Sun, Mar 13, 2022, 06:42 Masoud Ahmadi  wrote:
>
>> Dear Timo,
>>
>> No, I did not change anything; I did exactly what is explained in the 
>> following link, step by step:
>> https://github.com/dealii/dealii/wiki/Apple-ARM-M1-OSX
>>
>> On Saturday, 12 March 2022 at 16:54:56 UTC Timo Heister wrote:
>>
>>> Did you make any changes to candi.cfg? Can you also please post how you 
>>> execute candi.sh (what arguments)?
>>>
>>> On Mon, Mar 7, 2022, 12:23 Masoud Ahmadi  wrote:
>>>
>>>> Hi,
>>>>
>>>> I am trying to install dealii on a apple ARM M1 OSX, using the 
>>>> following instructor:
>>>> https://github.com/dealii/dealii/wiki/Apple-ARM-M1-OSX
>>>>
>>>> However, I get the following error:
>>>>
>>>>
>>>> error: use of undeclared identifier 'H5Pset_dxpl_mpio'
>>>>   status   = H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_INDEPENDENT);
>>>>  ^
>>>> /Users/masoud/dealii-candi/tmp/unpack/deal.II-v9.3.3/source/lac/scalapack.cc:3242:63:
>>>>  
>>>> warning: unused parameter 'filename' [-Wunused-parameter]
>>>> ScaLAPACKMatrix::load_parallel(const std::string &filename)
>>>>   ^
>>>> /Users/masoud/dealii-candi/tmp/unpack/deal.II-v9.3.3/source/lac/scalapack.cc:2861:20:
>>>>  
>>>> error: use of undeclared identifier 'H5Pset_fapl_mpio'
>>>>   status = H5Pset_fapl_mpio(plist_id, 
>>>> tmp.grid->mpi_communicator, info);
>>>>^
>>>> /Users/masoud/dealii-candi/tmp/build/deal.II-v9.3.3/source/lac/scalapack.inst:10:16:
>>>>  
>>>> note: in instantiation of member function 
>>>> 'dealii::ScaLAPACKMatrix::save_parallel' requested here
>>>> template class ScaLAPACKMatrix< double >;
>>>>^
>>>> /Users/masoud/dealii-candi/tmp/unpack/deal.II-v9.3.3/source/lac/scalapack.cc:2861:20:
>>>>  
>>>> error: use of undeclared identifier 'H5Pset_fapl_mpio'
>>>>   status = H5Pset_fapl_mpio(plist_id, 
>>>> tmp.grid->mpi_communicator, info);
>>>>^
>>>> /Users/masoud/dealii-candi/tmp/build/deal.II-v9.3.3/source/lac/scalapack.inst:20:16:
>>>>  
>>>> note: in instantiation of member function 
>>>> 'dealii::ScaLAPACKMatrix::save_parallel' requested here
>>>> template class ScaLAPACKMatrix< float >;
>>>>^
>>>> 1 warning and 3 errors generated.
>>>>
>>>>
>>>> [image: Screenshot 2022-03-07 at 17.11.39.png]
>>>> [image: Screenshot 2022-03-07 at 17.15.11.png]
>>>>
>>>> -- 
>>>> 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/5f96b566-3112-4dda-bb63-86e61b654156n%40googlegroups.com
>>>>  
>>>> <https://groups.google.com/d/msgid/dealii/5f96b566-3112-4dda-bb63-86e61b654156n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>> -- 
>> 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.
&g

Re: [deal.II] Error installing dealii by candi on Apple M1

2022-03-13 Thread Masoud Ahmadi
Dear Timo,

No, I did not change anything; I did exactly what is explained in the 
following link, step by step:
https://github.com/dealii/dealii/wiki/Apple-ARM-M1-OSX

On Saturday, 12 March 2022 at 16:54:56 UTC Timo Heister wrote:

> Did you make any changes to candi.cfg? Can you also please post how you 
> execute candi.sh (what arguments)?
>
> On Mon, Mar 7, 2022, 12:23 Masoud Ahmadi  wrote:
>
>> Hi,
>>
>> I am trying to install dealii on a apple ARM M1 OSX, using the following 
>> instructor:
>> https://github.com/dealii/dealii/wiki/Apple-ARM-M1-OSX
>>
>> However, I get the following error:
>>
>>
>> error: use of undeclared identifier 'H5Pset_dxpl_mpio'
>>   status   = H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_INDEPENDENT);
>>  ^
>> /Users/masoud/dealii-candi/tmp/unpack/deal.II-v9.3.3/source/lac/scalapack.cc:3242:63:
>>  
>> warning: unused parameter 'filename' [-Wunused-parameter]
>> ScaLAPACKMatrix::load_parallel(const std::string &filename)
>>   ^
>> /Users/masoud/dealii-candi/tmp/unpack/deal.II-v9.3.3/source/lac/scalapack.cc:2861:20:
>>  
>> error: use of undeclared identifier 'H5Pset_fapl_mpio'
>>   status = H5Pset_fapl_mpio(plist_id, tmp.grid->mpi_communicator, 
>> info);
>>^
>> /Users/masoud/dealii-candi/tmp/build/deal.II-v9.3.3/source/lac/scalapack.inst:10:16:
>>  
>> note: in instantiation of member function 
>> 'dealii::ScaLAPACKMatrix::save_parallel' requested here
>> template class ScaLAPACKMatrix< double >;
>>^
>> /Users/masoud/dealii-candi/tmp/unpack/deal.II-v9.3.3/source/lac/scalapack.cc:2861:20:
>>  
>> error: use of undeclared identifier 'H5Pset_fapl_mpio'
>>   status = H5Pset_fapl_mpio(plist_id, tmp.grid->mpi_communicator, 
>> info);
>>^
>> /Users/masoud/dealii-candi/tmp/build/deal.II-v9.3.3/source/lac/scalapack.inst:20:16:
>>  
>> note: in instantiation of member function 
>> 'dealii::ScaLAPACKMatrix::save_parallel' requested here
>> template class ScaLAPACKMatrix< float >;
>>^
>> 1 warning and 3 errors generated.
>>
>>
>> [image: Screenshot 2022-03-07 at 17.11.39.png]
>> [image: Screenshot 2022-03-07 at 17.15.11.png]
>>
>> -- 
>> 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/5f96b566-3112-4dda-bb63-86e61b654156n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/dealii/5f96b566-3112-4dda-bb63-86e61b654156n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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/957d0cc5-e3a8-4922-a770-794a3192a6a0n%40googlegroups.com.


Re: [deal.II] Wrong vertices at the boundary

2021-12-16 Thread Masoud Ahmadi
Thanks Praveen.
It was resolved.

On Thursday, 16 December 2021 at 13:31:13 UTC Praveen C wrote:

> There is a small error in this code.
>
>
> On 16-Dec-2021, at 5:43 PM, Masoud Ahmadi  wrote:
>
> for (const auto &cell : dof_handler.active_cell_iterators()){ 
> for (const auto &face : cell->face_iterators()){
> if (face->at_boundary()){
> for (const auto v : face->vertex_indices())
> *cout<vertex(v)<<" ";*
> cout< }
> }
> }
>
>
>
> cout<<*cell*->vertex(v)<<" “;
>
>
> should be
>
> cout<<*face*->vertex(v)<<" “;
>
>
> best
> praveen
>
>
>
>

-- 
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/d15aad58-5dc4-41cf-9ffa-d73f92a0bb85n%40googlegroups.com.


Re: [deal.II] Efficient Matrix-based Calculation

2021-10-20 Thread Masoud Ahmadi
Dear Prof. Bangerth,

Thanks for your answer. 
Indeed, I took the declaration of matrices out of the loop; but still, as I 
mentioned, the part that is substantially reducing the speed is the product 
between the matrices. 
As you mentioned, we expect this to be slower than the equivalent code in 
step-8; however, it is very slower than the same code that I wrote before 
in Matlab. 
My question is, I want to be sure that "FullMatrix" is the most efficient 
and fast way in dealii to evaluate such like matrix calculations (the 
products). Or should I be looking for alternatives?

Best regards

On Tuesday, 19 October 2021 at 19:24:11 UTC+1 Wolfgang Bangerth wrote:

>
> Masoud,
>
> > Here is a part of the tutorial code for example 8 to calculate stiffness 
> > matrix of an element:
> > Screenshot 2021-10-15 at 12.48.39.png
> > 
> > And here is my equivalent code for the same purpose with a matrix-based 
> viewpoint:
> > Screenshot 2021-10-15 at 23.12.13.png
> > 
> > it is based on the following formulation for a 3D elastic problem:
> > thumbnail_image.png
> > By "slow", I mean in comparison with the same code in tutorial (example 
> 8). I 
> > measured the lines of the code, and I am sure the difference is for the 
> > mentioned part of the code. To be more accurate: the operations on 
> matrices, 
> > as follow in the second image:
> > B[I].Tmmult(tmpM,D);
> > tmpM.mmult(BDB,B[J]);
>
> You could probably make the code substantially faster already if you moved 
> the 
> declaration of the B, tmpM, and BDB matrices out of the loop over the 
> quadrature points, and simply set them to zero inside the loop. Creating 
> these 
> variables requires allocating memory every time you do one iteration over 
> the 
> quadrature points, which is expensive.
>
> But in the end, compare what work you are doing in your loop with what the 
> equivalent code in step-8 is doing, and you shouldn't be surprised by your 
> observation. step-8 only does 2 (and if i==j, then 3) tensor contractions 
> for 
> each index i,j,q. You are allocating and releasing memory, and doing two 
> products between 6x3 and 3x3 matrices, plus a lot of index work. It does 
> not 
> surprise me that this is slow.
>
> 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/00c2608c-7489-4538-8bd7-09c989d844c4n%40googlegroups.com.


[deal.II] Efficient Matrix-based Calculation

2021-10-12 Thread Masoud Ahmadi

Dear all,

I'm trying to use a Matrix-based solution for a general 3D FE elastic 
problem (just like example-8). In that example the authors used a linear 
scaler solution for calculating the stiffness matrix of each element; but, 
due to some reasons I want to use a matrix-based solution so that the 
stiffness matrix of each element can be calculated as follows:
K_cell = B^T . D . B,
where B matrix follows from the differential operator for strain calculation 
and D is the usual elasticity matrix for 3D isotropic problems. The size of 
the B and D matrices are 6X3 and 6X6 respectively. I defined these matrices 
as "vector" of "FullMatrix" and try to do operate on them by 
FullMatrix operators as follows:
B[i].Tmmult(tmpMat,D);
tmpMat.mmult(BDB,B[j]);
and it works correctly; however, it works rather slowly.
My question is, is "FullMatrix" the most efficient and fast way in dealii 
to evaluate such like matrix calculations? Are there any alternatives?

Best regards,
Masoud




-- 
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/711e55f4-df0c-4673-8c29-b9cba6cc2185n%40googlegroups.com.