Skip to content

Commit bf4db65

Browse files
authored
Merge pull request #72 from streeve/cabana_group_init
Cabana: SF group initialization
2 parents 67cbf5a + 6398e01 commit bf4db65

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/libnnp/version.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#ifndef VERSION_H
1818
#define VERSION_H
1919

20-
#define NNP_VERSION "2.0.0"
20+
#define NNP_VERSION "2.0.2"
2121
#define NNP_GIT_REV ""
2222
#define NNP_GIT_REV_SHORT ""
2323
#define NNP_GIT_BRANCH ""

src/libnnpif/CabanaMD/ElementCabana_impl.h

+5-1
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ void ElementCabana::setupSymmetryFunctionGroups( t_SF SF,
311311
h_t_int h_numSFGperElem,
312312
int maxSFperElem )
313313
{
314-
int num_group = h_numSFperElem.extent( 0 ) * 2;
314+
int num_group = h_numSFperElem.extent( 0 );
315315
h_t_int h_numGR( "RadialCounter", num_group );
316316
h_t_int h_numGA( "AngularCounter", num_group );
317317
int SFindex;
@@ -366,12 +366,16 @@ void ElementCabana::setupSymmetryFunctionGroups( t_SF SF,
366366
if ( SF( attype, SFindex, 1 ) == 2 )
367367
{
368368
SFGmemberlist( attype, l, 0 ) = SFindex;
369+
if ( l >= (int)h_numGR.extent( 0 ) )
370+
Kokkos::resize( h_numGR, l+1 );
369371
h_numGR( l ) = 1;
370372
SFGmemberlist( attype, l, maxSFperElem )++;
371373
}
372374
else if ( SF( attype, SFindex, 1 ) == 3 )
373375
{
374376
SFGmemberlist( attype, l, 0 ) = SFindex;
377+
if ( l >= (int)h_numGA.extent( 0 ) )
378+
Kokkos::resize( h_numGA, l+1 );
375379
h_numGA( l ) = 1;
376380
SFGmemberlist( attype, l, maxSFperElem )++;
377381
}

0 commit comments

Comments
 (0)