23 initialize( label, length, length, boundaries );
30 int size1 = (
int) boundaries.size( );
32 initialize( label, size1, size1, &(boundaries[0]) );
49 if( size1 < length ) size1 =
length;
50 if( size1 < 0 ) size1 = 0;
58 if (
this != &group ) {
74 int iMin = 0, iMid, iMax = (
int)
mBoundaries.size( ), iMaxM1 = iMax - 1;
76 if( iMax == 0 )
return( -3 );
78 if( encloseOutOfRange )
return( 0 );
82 if( encloseOutOfRange )
return( iMax - 2 );
86 iMid = ( iMin + iMax ) >> 1;
87 if( iMid == iMin )
break;
94 if( iMin == iMaxM1 ) iMin--;
105 std::cout <<
"GROUP: label = '" <<
mLabel <<
"': length = " << nbs << std::endl;
106 if( outline )
return;
107 for(
int ib = 0; ib < nbs; ib++ ) {
110 if( ( ( ib + 1 ) % valuesPerLine ) == 0 ) std::cout << std::endl;
112 if( nbs % valuesPerLine ) std::cout << std::endl;
120 GIDI_settings_groups_from_bdfls::GIDI_settings_groups_from_bdfls( std::string
const &fileName ) {
127 GIDI_settings_groups_from_bdfls::GIDI_settings_groups_from_bdfls(
char const *fileName ) {
134 GIDI_settings_groups_from_bdfls::GIDI_settings_groups_from_bdfls( cbdfls_file
const *bdfls ) {
136 initialize2( bdfls );
146 if( ( bdfls = cbdflsOpen( fileName, &Error ) ) == NULL )
throw Error;
147 initialize2( bdfls );
148 cbdflsRelease( bdfls );
153 void GIDI_settings_groups_from_bdfls::initialize2( cbdfls_file
const *bdfls ) {
157 std::string label(
"" );
160 ng = cbdflsGIDs( (cbdfls_file *) bdfls, &gids );
161 for(
int ig = 0; ig < ng; ++ig ) {
162 ngbs = cbdflsGetGroup( (cbdfls_file *) bdfls, gids[ig], &boundaries );
163 sprintf( cLabel,
"LLNL_gid_%.3d", gids[ig] );
171 GIDI_settings_groups_from_bdfls::~GIDI_settings_groups_from_bdfls( ) {
179 std::string label(
"" );
182 sprintf( cLabel,
"LLNL_gid_%.3d", gid );
184 for(
int ig = 0; ig < (
int) mGroups.size( ); ++ig ) {
185 if( mGroups[ig].isLabel( label ) )
return( mGroups[ig] );
192 std::vector<std::string> GIDI_settings_groups_from_bdfls::getLabels(
void )
const {
194 int size = (
int) mGroups.size( );
195 std::vector<std::string> labels( size );
197 for(
int if1 = 0; if1 < size; ++if1 ) labels[if1] = mGroups[if1].getLabel( );
203 std::vector<int> GIDI_settings_groups_from_bdfls::getGIDs(
void )
const {
205 int size = (
int) mGroups.size( );
206 std::vector<int> fids( size );
209 for(
int if1 = 0; if1 < size; ++if1 ) {
210 fids[if1] = (
int) strtol( &(mGroups[if1].getLabel( ).c_str( )[9]), &
e, 10 );
219 int ngs = (
int) mGroups.size( );
221 std::cout <<
"BDFLS GROUPs: number of groups = " << ngs << std::endl;
222 for(
int if1 = 0; if1 < ngs ; ++if1 ) mGroups[if1].
print( outline, valuesPerLine );