I am trying to calculate the L2 norm of the error of a solution. In particular, I have a vector of the solution u_omega and a FeSystem with two fes.
I am interested in computing the L2 norm of the error related to the first fe using integrate_difference function. (Note here u_omega is not a blocked vector, however, it has two solutions stacked together in one vector). Can I extract the solution of the first part from u_omega?
Thank you in advance for your help.
Best,
Najwa
The additional argument weight
allows to evaluate weighted norms. The weight function may be scalar,
establishing a spatially variable weight in the domain for all
components equally. This may be used, for instance, to only integrate
over parts of the domain. The weight function may also be vector-valued,
with as many components as the finite element: Then, different
components get different weights. A typical application is when the
error with respect to only one or a subset of the solution variables is
to be computed, in which case the other components would have weight
values equal to zero. The ComponentSelectFunction
class is particularly useful for this purpose as it provides such a
"mask" weight. The weight function is expected to be positive, but
negative values are not filtered. The default value of this function, a
null pointer, is interpreted as "no weighting function", i.e., weight=1
in the whole domain for all vector components uniformly. Best, Daniel |
--
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/9741338e-2a31-418b-815d-277a5d7cb573n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/c2544a5b-16b0-4d3d-8ccc-22e77ccf3038n%40googlegroups.com.
Il giorno 21 lug 2023, alle ore 22:05, Najwa Alshehri <najwaa...@gmail.com> ha scritto:
Dear Daniel, your answer makes sense, Finally it worked.
To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/697c9d76-0969-4c32-bd57-58371d02c21dn%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 a topic in the Google Groups "deal.II User Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dealii/DqH2auneWaY/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/dd5f93f8-fb58-45c6-9ab2-91ef6c5bdf56n%40googlegroups.com.
Dear team,
I want to express my gratitude for the support you have provided thus far. I would like to provide you with an update on the current situation and seek your assistance regarding a couple of issues.
Firstly, I have successfully implemented the missing function `VectorFunctionFromScalarFunctionObject::gradient()` in my project. Although it appears to be functioning correctly, the execution speed is extremely slow. In fact, it took until the next working day to obtain the results for only two cycles of refinement. Based on the response from @Wolfgang, it seems that the issue lies with the FeFieldFunction.
Allow me to provide some context. I have a reference solution serialized on a fine mesh. In my current code, my objective is to deserialize this solution and utilize it as the exact solution. To achieve this, I have employed the FeFieldFunction. Now, I have two scenarios in which I need to utilize the FeFieldFunction.
The first scenario involves directly using the FeFieldFunction when my computed solution consists of a single component. In this case, I have successfully calculated the L2 and H1 norms of the error using the `integrate_difference` and `compute_global_error` functions. The calculations proceeded smoothly, and the execution speed was reasonable.
However, the second scenario involves using the FeFieldFunction when the computed solution consists of two components. My objective is to calculate the error for the first component only. To accomplish this, I employed the new VectorFunctionFromScalarFunctionObject class locally. Unfortunately, the computation of the L2 norm in this case was considerably slow and the H1 norm was very slow.
Given the current situation, I have two questions that I hope you can assist me with, as you have done in the past:
1. Regarding my specific project, is there an alternative method, other than the FeFieldFunction, to save the deserialized solution as a function and utilize it as the exact solution? It is crucial that the solution be saved in the first component of a vector with two components.
2. In a more general sense, how can I test this function to determine if the sluggishness is solely attributable to the FeFieldFunction? Additionally, I would like to verify whether the function is functioning correctly or not, to be able to send it in a pull request to the dealii git repository.
Your guidance and expertise in resolving these issues would be greatly appreciated.
Thank you once again for your continued support.
Best regards,
Najwa