Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:ttadano/alamode into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
ttadano committed Feb 1, 2018
2 parents 18cfabf + 515255c commit 5b59699
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 82 deletions.
23 changes: 23 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
# Ver. 1.0.2 (2018-1-29)

## New

- Phonon band connection by eigenvector similarity (``BCONNECT`` tag)
- New option to turn on/off the symmetrization of Born effective charge (``BORNSYM`` tag).

## Changes

- Improve the performance of the "suggest" mode for hexagonal systems
- Use \<unorderd_set\> instead of \<set\> for better performance

## Fix

- Fix a bug in the symmetrization of the Born effective charge


# Ver. 1.0.1 (2017-11-21)

## Fix
- Fixed a minor issue in the previous version


# Ver. 1.0.0 (2017-11-21)

## New
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![License][license-image]][license-url]
[![Doc status][docs-image]][docs-url]

### Version 1.0.0
### Version 1.0.2
![alt ALAMODE](./docs/img/alamode.png)


Expand Down
84 changes: 6 additions & 78 deletions alm/interaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -412,11 +412,8 @@ void Interaction::search_interactions(std::vector<int> **interaction_list_out,
int ikd, jkd;

double cutoff_tmp;
std::set<IntList> *interacting_atom_pairs;
std::vector<int> intlist;

memory->allocate(interacting_atom_pairs, maxorder);

for (order = 0; order < maxorder; ++order) {
for (i = 0; i < natmin; ++i) {
interaction_list_out[order][i].clear();
Expand Down Expand Up @@ -451,8 +448,6 @@ void Interaction::search_interactions(std::vector<int> **interaction_list_out,

for (order = 0; order < maxorder; ++order) {

interacting_atom_pairs[order].clear();

std::cout << std::endl << " ***" << str_order[order] << "***" << std::endl;

for (i = 0; i < natmin; ++i) {
Expand All @@ -465,11 +460,11 @@ void Interaction::search_interactions(std::vector<int> **interaction_list_out,
iat = symmetry->map_p2s[i][0];

intlist.clear();
for (std::vector<int>::const_iterator it = interaction_list_out[order][i].begin();
for (auto it = interaction_list_out[order][i].begin();
it != interaction_list_out[order][i].end(); ++it) {
intlist.push_back((*it));
}
std::sort(intlist.begin(), intlist.end()); // Necessarily to sort here
std::sort(intlist.begin(), intlist.end());

// write atoms inside the cutoff radius
int id = 0;
Expand All @@ -493,44 +488,10 @@ void Interaction::search_interactions(std::vector<int> **interaction_list_out,
std::cout << std::endl << std::endl;
std::cout << " Number of total interaction pairs = "
<< interaction_list_out[order][i].size() << std::endl << std::endl;

int *intarr;
memory->allocate(intarr, order + 2);

if (intlist.size() > 0) {
if (order == 0) {
for (unsigned int ielem = 0; ielem < intlist.size(); ++ielem) {
intarr[0] = iat;
intarr[1] = intlist[ielem];
insort(2, intarr);

interacting_atom_pairs[0].insert(IntList(2, intarr));
}
} else if (order > 0) {
CombinationWithRepetition<int> g(intlist.begin(), intlist.end(), order + 1);
do {
std::vector<int> data = g.now();
intarr[0] = iat;
intarr[1] = data[0];
for (unsigned int isize = 1; isize < data.size(); ++isize) {
intarr[isize + 1] = data[isize];
}
if (!is_incutoff(order + 2, intarr, order)) continue;

insort(order + 2, intarr);
interacting_atom_pairs[order].insert(IntList(order + 2, intarr));

} while (g.next());
}
}
intlist.clear();
memory->deallocate(intarr);
}
}

std::cout << std::endl;

memory->deallocate(interacting_atom_pairs);
}

bool Interaction::is_incutoff(const int n,
Expand Down Expand Up @@ -752,8 +713,8 @@ void Interaction::calc_mindist_clusters(std::vector<int> **interaction_pair_in,

// List of 2-body interaction pairs
intlist.clear();
for (std::vector<int>::const_iterator it = interaction_pair_in[order][i].begin();
it != interaction_pair_in[order][i].end(); ++it) {
for (auto it = interaction_pair_in[order][i].cbegin();
it != interaction_pair_in[order][i].cend(); ++it) {
intlist.push_back((*it));
}
std::sort(intlist.begin(), intlist.end()); // Need to sort here
Expand Down Expand Up @@ -840,8 +801,8 @@ void Interaction::calc_mindist_clusters(std::vector<int> **interaction_pair_in,

// Loop over the cell images of atom 'jat' and add to the list
// as a candidate for the minimum distance cluster
for (std::vector<DistInfo>::const_iterator it = distance_image[iat][jat].begin();
it != distance_image[iat][jat].end(); ++it) {
for (auto it = distance_image[iat][jat].cbegin();
it != distance_image[iat][jat].cend(); ++it) {
if (exist[(*it).cell]) {
if (rc_tmp < 0.0 || (*it).dist <= rc_tmp) {
cell_vector.push_back((*it).cell);
Expand Down Expand Up @@ -930,42 +891,9 @@ void Interaction::calc_mindist_clusters(std::vector<int> **interaction_pair_in,
mindist_cluster_out[order][i].insert(MinimumDistanceCluster(data_now,
comb_cell_atom_center,
distmax));

}
}
memory->deallocate(list_now);

/*
std::sort(distance_list.begin(), distance_list.end(), MinDistList::compare_sum_distance);
comb_cell_min.clear();
sum_dist_min = 0.0;
for (j = 0; j < distance_list[0].dist.size(); ++j) {
sum_dist_min += distance_list[0].dist[j];
}
for (j = 0; j < distance_list.size(); ++j) {
sum_dist = 0.0;
for (k = 0; k < distance_list[j].dist.size(); ++k) {
sum_dist += distance_list[j].dist[k];
}
// In the following, only pairs having minimum sum of distances
// are stored. However, we found that this treatment didn't
// return a reliable value of phonon linewidth.
if (std::abs(sum_dist - sum_dist_min) < eps6) {
comb_cell_min.push_back(distance_list[j].cell);
} else {
break;
}
// Therefore, we consider all duplicate pairs
//comb_cell_min.push_back(distance_list[j].cell);
}
// mindist_cluster_out[order][i].insert(MinimumDistanceCluster(data, comb_cell_min));
*/


}
}
}
Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
# The short X.Y version.
version = '1.0'
# The full version, including alpha/beta/rc tags.
release = '1.0.0'
release = '1.0.2'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
32 changes: 31 additions & 1 deletion docs/source/input/inputanphon.rst
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ List of input variables

=== =======================================================
0 Symmetry operations won’t be saved in “SYMM_INFO_PRIM”

1 Symmetry operations will be saved in “SYMM_INFO_PRIM”
=== =======================================================

Expand Down Expand Up @@ -157,6 +156,18 @@ List of input variables

````

* BORNSYM-tag = 0 | 1

=== =================================================================
0 Do not symmetrize Born effective charges
1 Symmetrize Born effective charges by using point group symmetry
=== =================================================================

:Default: 0
:Type: Integer

````

* TMIN, TMAX, DT-tags : Temperature range and its stride in units of Kelvin

:Default: ``TMIN = 0``, ``TMAX = 1000``, ``DT = 10``
Expand Down Expand Up @@ -193,6 +204,25 @@ List of input variables

````

* BCONNECT-tag = 0 | 1 | 2

=== ===================================================================================
0 | Phonon band is saved without change (sorted in order of energy)

1 | Phonon band is connected by using the similarity of eigenvectors.

2 | Same as ``BCONNECT=1``. In addition, information of the connectivity is
| saved as ``PREFIX.connection``.
=== ===================================================================================

:Default: 0
:Type: Integer
:Description: The algorithm for connecting a band structure is described here_.

.. _here : https://www.slideshare.net/TakeshiNishimatsu/two-efficient-algorithms-for-drawing-accurate-and-beautiful-phonon-dispersion

````

* CLASSICAL-tag = 0 | 1

=== =======================================================
Expand Down
2 changes: 1 addition & 1 deletion include/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@

#include <string>

static const std::string ALAMODE_VERSION = "1.0.0";
static const std::string ALAMODE_VERSION = "1.0.2";

0 comments on commit 5b59699

Please sign in to comment.