mirror of https://github.com/phonopy/phono3py.git
Minor refactoring of C part
This commit is contained in:
parent
f40823fe0a
commit
e5f5231d92
|
@ -36,12 +36,12 @@
|
|||
#include "lapack_wrapper.h"
|
||||
#include "phonoc_array.h"
|
||||
|
||||
#include "bzgrid.h"
|
||||
#include "collision_matrix.h"
|
||||
#include "fc3.h"
|
||||
#include "interaction.h"
|
||||
#include "imag_self_energy_with_g.h"
|
||||
#include "isotope.h"
|
||||
#include "bzgrid.h"
|
||||
#include "pp_collision.h"
|
||||
#include "real_self_energy.h"
|
||||
#include "grgrid.h"
|
||||
|
|
15
c/triplet.c
15
c/triplet.c
|
@ -34,7 +34,6 @@
|
|||
/* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */
|
||||
/* POSSIBILITY OF SUCH DAMAGE. */
|
||||
|
||||
#include "bzgrid.h"
|
||||
#include "grgrid.h"
|
||||
#include "triplet.h"
|
||||
#include "triplet_iw.h"
|
||||
|
@ -231,13 +230,7 @@ static long get_triplets_reciprocal_mesh_at_q(long *map_triplets,
|
|||
GRGCONST long (*rotations)[3][3],
|
||||
const long swappable)
|
||||
{
|
||||
MatLONG *rot_real;
|
||||
long i, num_ir;
|
||||
|
||||
rot_real = bzg_alloc_MatLONG(num_rot);
|
||||
for (i = 0; i < num_rot; i++) {
|
||||
bzg_copy_matrix_l3(rot_real->mat[i], rotations[i]);
|
||||
}
|
||||
long num_ir;
|
||||
|
||||
num_ir = tpk_get_ir_triplets_at_q(map_triplets,
|
||||
map_q,
|
||||
|
@ -245,10 +238,8 @@ static long get_triplets_reciprocal_mesh_at_q(long *map_triplets,
|
|||
grid_point,
|
||||
mesh,
|
||||
is_time_reversal,
|
||||
rot_real,
|
||||
rotations,
|
||||
num_rot,
|
||||
swappable);
|
||||
|
||||
bzg_free_MatLONG(rot_real);
|
||||
|
||||
return num_ir;
|
||||
}
|
||||
|
|
|
@ -200,13 +200,20 @@ long tpk_get_ir_triplets_at_q(long *map_triplets,
|
|||
const long grid_point,
|
||||
const long mesh[3],
|
||||
const long is_time_reversal,
|
||||
const MatLONG * rotations,
|
||||
GRGCONST long (*rotations)[3][3],
|
||||
const long num_rot,
|
||||
const long swappable)
|
||||
{
|
||||
long num_ir;
|
||||
MatLONG *rot_reciprocal;
|
||||
long i, num_ir;
|
||||
MatLONG *rot_real, *rot_reciprocal;
|
||||
|
||||
rot_real = bzg_alloc_MatLONG(num_rot);
|
||||
for (i = 0; i < num_rot; i++) {
|
||||
bzg_copy_matrix_l3(rot_real->mat[i], rotations[i]);
|
||||
}
|
||||
rot_reciprocal = bzg_get_point_group_reciprocal(rot_real, is_time_reversal);
|
||||
bzg_free_MatLONG(rot_real);
|
||||
|
||||
rot_reciprocal = bzg_get_point_group_reciprocal(rotations, is_time_reversal);
|
||||
num_ir = get_ir_triplets_at_q(map_triplets,
|
||||
map_q,
|
||||
grid_address,
|
||||
|
@ -215,6 +222,7 @@ long tpk_get_ir_triplets_at_q(long *map_triplets,
|
|||
rot_reciprocal,
|
||||
swappable);
|
||||
bzg_free_MatLONG(rot_reciprocal);
|
||||
|
||||
return num_ir;
|
||||
}
|
||||
|
||||
|
|
|
@ -37,7 +37,6 @@
|
|||
#ifndef __triplet_kpoint_H__
|
||||
#define __triplet_kpoint_H__
|
||||
|
||||
#include "bzgrid.h"
|
||||
#include "grgrid.h"
|
||||
|
||||
long tpk_get_ir_triplets_at_q(long *map_triplets,
|
||||
|
@ -46,7 +45,8 @@ long tpk_get_ir_triplets_at_q(long *map_triplets,
|
|||
const long grid_point,
|
||||
const long mesh[3],
|
||||
const long is_time_reversal,
|
||||
const MatLONG * rotations,
|
||||
GRGCONST long (*rotations)[3][3],
|
||||
const long num_rot,
|
||||
const long swappable);
|
||||
long tpk_get_BZ_triplets_at_q(long (*triplets)[3],
|
||||
const long grid_point,
|
||||
|
|
Loading…
Reference in New Issue