44 type(basis_vectors_t),
public :: basis
58 procedure affine_coordinates_constructor
64 type(namespace_t),
intent(in) :: namespace
65 integer,
intent(in) :: dim
66 real(real64),
intent(in) :: basis_vectors(1:dim, 1:dim)
67 class(affine_coordinates_t),
pointer :: affine
74 affine%local_basis = .false.
76 affine%orthogonal = affine%basis%orthogonal
83 type(affine_coordinates_t),
intent(inout) :: this_out
84 type(affine_coordinates_t),
intent(in) :: this_in
88 this_out%dim = this_in%dim
89 this_out%local_basis = this_in%local_basis
90 this_out%basis = this_in%basis
97 class(affine_coordinates_t),
target,
intent(in) :: this
98 real(real64),
intent(in) :: chi(:)
99 real(real64) :: xx(1:this%dim)
103 xx(:) = this%basis%to_cartesian(chi(:))
109 class(affine_coordinates_t),
target,
intent(in) :: this
110 real(real64),
intent(in) :: xx(:)
111 real(real64) :: chi(1:this%dim)
115 chi(:) = this%basis%from_cartesian(xx(:))
120 real(real64) function affine_coordinates_det_jac(this, xx, chi) result(jdet)
121 class(affine_coordinates_t),
intent(in) :: this
122 real(real64),
intent(in) :: xx(:)
123 real(real64),
intent(in) :: chi(:)
125 real(real64) :: jac(1:this%dim, 1:this%dim)
129 jac(1:this%dim, 1:this%dim) = this%basis%vectors(1:this%dim,1:this%dim)
136 class(affine_coordinates_t),
intent(in) :: this
137 integer,
optional,
intent(in) :: iunit
138 type(namespace_t),
optional,
intent(in) :: namespace
140 integer :: idir1, idir2
144 write(message(1),
'(a)')
' Using affine coordinates'
145 write(message(2),
'(a)')
' Basis vectors [', trim(units_abbrev(units_out%length)),
']:'
146 call messages_info(2, iunit=iunit, namespace=namespace)
147 do idir1 = 1, this%dim
148 write(message(2),
'(4x,a,99(f8.3,a))')
'(', &
149 (units_from_atomic(units_out%length, this%basis%vectors(idir2, idir1)), idir2 = 1, this%dim - 1), &
150 units_from_atomic(units_out%length, this%basis%vectors(this%dim, idir1)),
')'
151 call messages_info(1, iunit=iunit, namespace=namespace)
160 integer,
intent(in) :: idir
164 select case (this%dim)
168 ds = norm2(dcross_product(this%basis%vectors(1:3, 2), this%basis%vectors(1:3, 3)))
170 ds = norm2(dcross_product(this%basis%vectors(1:3, 3), this%basis%vectors(1:3, 1)))
172 ds = norm2(dcross_product(this%basis%vectors(1:3, 1), this%basis%vectors(1:3, 2)))
178 ds = this%basis%vectors(1, 1)*this%basis%vectors(2, 2) - this%basis%vectors(2, 1)*this%basis%vectors(1, 2)
194#include "affine_coordinates_inc.F90"
197#include "complex.F90"
198#include "affine_coordinates_inc.F90"
Note that lalg_determinant and lalg_inverse are just wrappers over the same routine.
pure subroutine zaffine_coordinates_vector_from_cartesian(this, xx, vv, src)
subroutine affine_coordinates_write_info(this, iunit, namespace)
pure subroutine zaffine_coordinates_covector_to_cartesian(this, xx, cv, src)
pure real(real64) function, dimension(1:this%dim) affine_coordinates_to_cartesian(this, chi)
pure subroutine daffine_coordinates_vector_from_cartesian(this, xx, vv, src)
class(affine_coordinates_t) function, pointer affine_coordinates_constructor(namespace, dim, basis_vectors)
subroutine, public affine_coordinates_copy(this_out, this_in)
pure real(real64) function, dimension(1:this%dim) affine_coordinates_from_cartesian(this, xx)
real(real64) function affine_coordinates_surface_element(this, idir)
pure subroutine daffine_coordinates_covector_to_cartesian(this, xx, cv, src)
real(real64) function affine_coordinates_det_jac(this, xx, chi)
This module is intended to contain "only mathematical" functions and procedures.
brief This module defines the class unit_t which is used by the unit_systems_oct_m module.
This module defines the unit system, used for input and output.
Vectors defining a basis in a vector space. This class provides methods to convert vector coordinates...
abstract class to describe coordinate systems