Octopus
|
The Helmholtz decomposition is intended to contain "only mathematical" functions and procedures to compute the Helmholtz decomposition of a generic field. More...
The Helmholtz decomposition is intended to contain "only mathematical" functions and procedures to compute the Helmholtz decomposition of a generic field.
Given a generic vector field F, it is possibile to define a curl-free component div(phi) and a divergence free component curl(A) such that \( \mathbf{F} = -div(phi) + curl(A) \), where
\[ \phi = \frac{1}{4\pi} \left( \int \frac{\nabla \cdot \mathbf{F}}{|\mathbf{r} - \mathbf{r_1}|} \,dr_1 - \oint \mathbf{n} \cdot \frac{\mathbf{F}}{|\mathbf{r} - \mathbf{r_1}|} \,dS_1 \right) \]
\[\mathbf{A} = \frac{1}{4\pi} \left( \int \frac{\nabla \times \mathbf{F}}{|\mathbf{r} - \mathbf{r_1}|} \,dr_1 - \oint \mathbf{n} \times \frac{\mathbf{F}}{|\mathbf{r} - \mathbf{r_1}|} \,dS_1 \right) \]
We start from a field defined on the system grid, i.e. the grid used for the Maxwell simulation.
If the user asks to compute the vector potential A or the scalar potential phi, then they are computed on the system grid. All the points up to system_gridnp will have physical meaning
If the user asks to compute the transverse or the longitudinal field, then they are computed on the system grid. However, the points the points contained in a layer of the width of the stencil between the innermost layer of points and last row of points in the grid will be set to zero. This is a visual representation for stencil = 2: 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 1 1 1 1 0 0 0 1 1 1 1 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 To understand this, one has to remember that when we get the scalar or vector potential, we know the solution only up to system_gridnp. When we take the final divergence or curl, also the points from system_gridnp+1 to system_gridnp_part matter (due to the way in which the finite differences are computed). Since potentials are set to zero in this non-physical region, there might be spikes at the border. Therefore, we set to zero the points of the fields in the aforementioned mask, so that we do not have spikes
In the equations above, there are two integrals, the volume one (always computed) and the surface one. The surface integral is important when the total field is significantly different from zero at the boundaries of the box
Data Types | |
type | helmholtz_decomposition_t |
Functions/Subroutines | |
subroutine | helmholtz_decomposition_init (this, namespace, sys_grid, system_mc, space) |
Initialize Helmholtz decomposition object. More... | |
subroutine | get_indices_from_mask (np, mask, indices) |
subroutine | helmholtz_finalize (this) |
subroutine | helmholtz_visualize_boxes (this, namespace, space) |
Visualise boxes for use in Helmholtz Decomposition. More... | |
subroutine | zapply_inner_stencil_mask (this, field) |
subroutine | zsubtract_average_from_inner_stencil (this, field) |
subroutine | zget_vector_potential (this, namespace, vector_potential, total_field, trans_field, apply_boundary) |
subroutine | zget_trans_field (this, namespace, transverse_field, total_field, vector_potential, apply_boundary) |
subroutine | zcompute_surface_correction_trans_field (this, namespace, field, surface_correction) |
subroutine | zget_scalar_potential (this, namespace, scalar_potential, total_field, apply_boundary) |
subroutine | zget_long_field (this, namespace, longitudinal_field, total_field, scalar_potential, apply_boundary) |
subroutine | zcompute_surface_correction_long_field (this, namespace, field, surface_correction) |
subroutine | dapply_inner_stencil_mask (this, field) |
subroutine | dsubtract_average_from_inner_stencil (this, field) |
subroutine | dget_vector_potential (this, namespace, vector_potential, total_field, trans_field, apply_boundary) |
subroutine | dget_trans_field (this, namespace, transverse_field, total_field, vector_potential, apply_boundary) |
subroutine | dcompute_surface_correction_trans_field (this, namespace, field, surface_correction) |
subroutine | dget_scalar_potential (this, namespace, scalar_potential, total_field, apply_boundary) |
subroutine | dget_long_field (this, namespace, longitudinal_field, total_field, scalar_potential, apply_boundary) |
subroutine | dcompute_surface_correction_long_field (this, namespace, field, surface_correction) |
|
private |
Initialize Helmholtz decomposition object.
[in,out] | this | Helmholtz decomposition type to initialize |
[in] | sys_grid | Grid of the system calling Helmholtz |
[in] | system_mc | MultiCommunicator of the system calling Helmholtz |
[in] | space | Space of the system calling Helmholtz |
Definition at line 225 of file helmholtz_decomposition.F90.
|
private |
Definition at line 335 of file helmholtz_decomposition.F90.
|
private |
Definition at line 354 of file helmholtz_decomposition.F90.
|
private |
Visualise boxes for use in Helmholtz Decomposition.
Definition at line 367 of file helmholtz_decomposition.F90.
|
private |
Definition at line 480 of file helmholtz_decomposition.F90.
|
private |
Definition at line 497 of file helmholtz_decomposition.F90.
|
private |
[in,out] | this | Helmholtz object |
[out] | vector_potential | Vector potential obtained from the total_field. The field will be defined on the grid of the Helmholtz type (thisgrid), UP UNTIL THISGRIDNP vector_potential(1:thisgridnp_part, 1:thisgridboxdim) |
[in,out] | total_field | Total field to decompose. To ensure the correct behaviour this field must be correctly defined on the grid of the system that calls Helmholtz (sys_gr), UP UNTIL SYS_GRNP_PART total_field(1:sys_grnp_part, 1:sys_grboxdim) |
[in,out] | trans_field | Total field to decompose. To ensure the correct behaviour this field must be correctly defined on the grid of the system that calls Helmholtz (sys_gr), UP UNTIL SYS_GRNP_PART total_field(1:sys_grnp_part, 1:sys_grboxdim) |
[in] | apply_boundary | Should the curl apply boundary conditions? |
Definition at line 526 of file helmholtz_decomposition.F90.
|
private |
[in,out] | this | Helmholtz object |
[out] | transverse_field | Transverse field obtained from the total_field. It will be defined on the inner_grid of the Helmholtz type (thisinner_grid), UP UNTIL INNER_GRNP transverse_field(1:thisinner_gridnp_part, 1:thisinner_gridboxdim) |
[in,out] | total_field | Total field to decompose. To ensure the correct behaviour this field must be correctly defined on the grid of the system that calls Helmholtz (sys_gr), UP UNTIL SYS_GRNP_PART total_field(1:sys_grnp_part, 1:sys_grboxdim) |
[in,out] | vector_potential | Vector potential from which trans field whould be computed |
[in] | apply_boundary | Should the curl apply boundary conditions? |
Definition at line 690 of file helmholtz_decomposition.F90.
|
private |
[in] | this | Helmholtz object |
Definition at line 735 of file helmholtz_decomposition.F90.
|
private |
[in,out] | this | Helmholtz object |
[out] | scalar_potential | Vector potential obtained from the total_field. It will be defined on the grid of the Helmholtz type (thisgrid), UP UNTIL THISGRIDNP: scalar_potential(1:thisgridnp_part) |
[in,out] | total_field | Total field to decompose. To ensure the correct behaviour this field must be correctly defined on the grid of the system that calls Helmholtz (sys_gr), UP UNTIL SYS_GRNP_PART: total_field(1:sys_grnp_part, 1:sys_grboxdim) |
[in] | apply_boundary | Should the divergence apply boundary conditions? |
Definition at line 785 of file helmholtz_decomposition.F90.
|
private |
[in,out] | this | Helmholtz object |
[out] | longitudinal_field | Transverse field obtained from the total_field. It will be defined on the inner_grid of the Helmholtz type (thisinner_grid), UP UNTIL INNER_GRNP longitudinal_field(1:thisinner_gridnp_part, 1:thisinner_gridboxdim) |
[in,out] | total_field | Total field to decompose. To ensure the correct behaviour this field must be correctly defined on the grid of the system that calls Helmholtz (sys_gr) UP UNTIL SYS_GRNP_PART total_field(1:sys_grnp_part, 1:sys_grboxdim) |
[in,out] | scalar_potential | Scalar potential from which long field whould be computed |
[in] | apply_boundary | Should the divergence apply boundary conditions? |
Definition at line 833 of file helmholtz_decomposition.F90.
|
private |
[in] | this | Helmholtz object |
[in] | field | (1:thissys_gridnp, 1:thissys_gridboxdim) |
[out] | surface_correction | (1:thissys_gridnp) |
Definition at line 880 of file helmholtz_decomposition.F90.
|
private |
Definition at line 1004 of file helmholtz_decomposition.F90.
|
private |
Definition at line 1021 of file helmholtz_decomposition.F90.
|
private |
[in,out] | this | Helmholtz object |
[out] | vector_potential | Vector potential obtained from the total_field. The field will be defined on the grid of the Helmholtz type (thisgrid), UP UNTIL THISGRIDNP vector_potential(1:thisgridnp_part, 1:thisgridboxdim) |
[in,out] | total_field | Total field to decompose. To ensure the correct behaviour this field must be correctly defined on the grid of the system that calls Helmholtz (sys_gr), UP UNTIL SYS_GRNP_PART total_field(1:sys_grnp_part, 1:sys_grboxdim) |
[in,out] | trans_field | Total field to decompose. To ensure the correct behaviour this field must be correctly defined on the grid of the system that calls Helmholtz (sys_gr), UP UNTIL SYS_GRNP_PART total_field(1:sys_grnp_part, 1:sys_grboxdim) |
[in] | apply_boundary | Should the curl apply boundary conditions? |
Definition at line 1050 of file helmholtz_decomposition.F90.
|
private |
[in,out] | this | Helmholtz object |
[out] | transverse_field | Transverse field obtained from the total_field. It will be defined on the inner_grid of the Helmholtz type (thisinner_grid), UP UNTIL INNER_GRNP transverse_field(1:thisinner_gridnp_part, 1:thisinner_gridboxdim) |
[in,out] | total_field | Total field to decompose. To ensure the correct behaviour this field must be correctly defined on the grid of the system that calls Helmholtz (sys_gr), UP UNTIL SYS_GRNP_PART total_field(1:sys_grnp_part, 1:sys_grboxdim) |
[in,out] | vector_potential | Vector potential from which trans field whould be computed |
[in] | apply_boundary | Should the curl apply boundary conditions? |
Definition at line 1214 of file helmholtz_decomposition.F90.
|
private |
[in] | this | Helmholtz object |
Definition at line 1259 of file helmholtz_decomposition.F90.
|
private |
[in,out] | this | Helmholtz object |
[out] | scalar_potential | Vector potential obtained from the total_field. It will be defined on the grid of the Helmholtz type (thisgrid), UP UNTIL THISGRIDNP: scalar_potential(1:thisgridnp_part) |
[in,out] | total_field | Total field to decompose. To ensure the correct behaviour this field must be correctly defined on the grid of the system that calls Helmholtz (sys_gr), UP UNTIL SYS_GRNP_PART: total_field(1:sys_grnp_part, 1:sys_grboxdim) |
[in] | apply_boundary | Should the divergence apply boundary conditions? |
Definition at line 1309 of file helmholtz_decomposition.F90.
|
private |
[in,out] | this | Helmholtz object |
[out] | longitudinal_field | Transverse field obtained from the total_field. It will be defined on the inner_grid of the Helmholtz type (thisinner_grid), UP UNTIL INNER_GRNP longitudinal_field(1:thisinner_gridnp_part, 1:thisinner_gridboxdim) |
[in,out] | total_field | Total field to decompose. To ensure the correct behaviour this field must be correctly defined on the grid of the system that calls Helmholtz (sys_gr) UP UNTIL SYS_GRNP_PART total_field(1:sys_grnp_part, 1:sys_grboxdim) |
[in,out] | scalar_potential | Scalar potential from which long field whould be computed |
[in] | apply_boundary | Should the divergence apply boundary conditions? |
Definition at line 1357 of file helmholtz_decomposition.F90.
|
private |
[in] | this | Helmholtz object |
[in] | field | (1:thissys_gridnp, 1:thissys_gridboxdim) |
[out] | surface_correction | (1:thissys_gridnp) |
Definition at line 1404 of file helmholtz_decomposition.F90.