28 template<
typename EntityT >
32 template<
typename EntityT >
33 class msbGrid ::
Block
62 const std :: vector< Entity > &
vEnt()
const
65 std :: vector< Entity > &
vEnt()
69 {
return vEnt_.size(); }
72 {
return ( vEnt_.size() == 0 ); }
80 const int putId(
const int &Id0 = 1)
83 for (
unsigned int iEnt = 0; iEnt <
size(); ++iEnt ) {
84 if ( !vEnt_ [ iEnt ].
mark() ) {
85 vEnt_ [ iEnt ].Id() = Id1;
93 const int entId(
const int &Id0 = 1)
96 for (
int iEnt = 0; iEnt < vEnt_.size(); ++iEnt ) {
97 if ( !vEnt_ [ iEnt ].marked() ) {
98 vEnt_ [ iEnt ].Id() = Id1;
107 {
return ( Id_ != 0 ); }
122 { vEnt_.push_back(ent0); }
124 void add(
const std :: vector< Entity > &vEnt0)
126 for (
int iEnt = 0; iEnt < vEnt0.size(); ++iEnt ) {
136 std :: vector< Entity > vEnt0;
138 for (
int iEnt = 0; iEnt < vEnt_.size(); ++iEnt ) {
139 if ( !vEnt_ [ iEnt ].
mark() ) {
140 vEnt0.push_back(vEnt_ [ iEnt ]);
145 for (
int iEnt = 0; iEnt < vEnt0.size(); ++iEnt ) {
146 vEnt_.push_back(vEnt0 [ iEnt ]);
155 assert(dx.size() ==
dim);
157 for (
int iEnt = 0; iEnt < vEnt_.size(); ++iEnt ) {
158 vEnt_ [ iEnt ].translate(dx);
162 template<
typename Po
intT >
165 for (
unsigned int iEnt = 0; iEnt < vEnt_.size(); ++iEnt ) {
166 vEnt_ [ iEnt ].rotate(_angle, mc);
172 for (
int iEnt = 0; iEnt < vEnt_.size(); ++iEnt ) {
173 vEnt_ [ iEnt ].rotate( _angle, vEnt_ [ iEnt ].pos() );
177 void infos(
const std :: string &name0 =
"")
179 std :: cout <<
"# block " << name0 <<
" ";
181 std :: cout <<
": size = " <<
size()
183 <<
" , mark = " << mark_
184 <<
" , declination = " << declination_ <<
"\n";
186 for (
int iEnt = 0; iEnt < vEnt_.size(); ++iEnt ) {
187 vEnt_ [ iEnt ].infos();
196 #ifndef _POINTS_BLOCK_HH_
197 #define _POINTS_BLOCK_HH_
222 marker_.symbol =
"'o'";
224 marker_.edgeColor =
Black;
225 marker_.faceColor =
White;
235 this->marker_.symbol = value;
237 for (
int iEnt = 0; iEnt < this->
size(); ++iEnt ) {
238 this->
vEnt() [ iEnt ].marker().symbol = this->marker_.symbol;
244 this->marker_.size = value;
246 for (
int iEnt = 0; iEnt < this->
size(); ++iEnt ) {
247 this->
vEnt() [ iEnt ].marker().size = this->marker_.size;
253 this->marker_.edgeColor = value;
255 for (
int iEnt = 0; iEnt < this->
size(); ++iEnt ) {
256 this->
vEnt() [ iEnt ].marker().edgeColor = this->marker_.edgeColor;
262 this->marker_.faceColor = value;
264 for (
int iEnt = 0; iEnt < this->
size(); ++iEnt ) {
265 this->
vEnt() [ iEnt ].marker().faceColor = this->marker_.faceColor;
270 ,
const double &mSize
271 ,
const Color &mEdgeColor
272 ,
const Color &mFaceColor)
288 for (
int ip = 0; ip <
size(); ++ip ) {
289 if ( !this->
vEnt() [ ip ].mark() ) {
290 this->
vEnt() [ ip ].cl() = cl0;
298 #ifndef _EDGES_BLOCK_HH_
299 #define _EDGES_BLOCK_HH_
330 for (
int iEnt = 0; iEnt < this->
size(); ++iEnt ) {
338 #ifndef _CELLS_BLOCK_HH_
339 #define _CELLS_BLOCK_HH_
343 template<
typename CellT >
347 template<
typename CellT >
373 for (
int iEnt = 0; iEnt < this->
size(); ++iEnt ) {
383 #ifndef _POINTS_MULTI_BLOCK_HH_
384 #define _POINTS_MULTI_BLOCK_HH_
388 class PointsMultiBlock;
394 typedef std :: vector< msbGrid :: PointsBlock >
ParentT;
413 ( * this ).resize( inData_->blockNumber() );
419 template<
typename StepperT >
422 for (
int iStep = 0; iStep < stepper.iStepMax(); ++iStep ) {
423 if ( !stepper.otherStep() ) {
427 #if VERBOSE_LEVEL >= 1
428 std :: cout <<
"## step = " << ( iStep + 1 ) <<
"\n";
435 template<
typename StepperT >
438 Scalar distRef = inData_->dr() / sqrt(2.0);
440 std :: vector< PointsBlock > mpscNew;
441 stepper.otherStep() =
false;
443 for (
int Ind = 0; Ind < size(); ++Ind ) {
444 if ( stepper.newStep() [ Ind ] ) {
445 Point ptRef( ( *
this ) [ Ind ].vEnt() [ 0 ] );
448 mpscNew.push_back(ps);
449 stepper.newStep() [ Ind ] =
update_(mpscNew, Jnd, Ind);
451 ( * this ) [ Ind ].add(mpscNew [ Jnd - 1 ]);
453 if ( stepper.newStep() [ Ind ] == true ) {
454 stepper.otherStep() =
true;
461 stepper.firstStep() =
false;
462 return stepper.otherStep();
465 template<
typename StepperT >
468 Scalar distRef = inData_->dr() / sqrt(2.0);
470 std :: vector< PointsBlock > mpscNew;
472 stepper.otherStep() =
false;
474 for (
int iBl1 = 0; iBl1 < inData_->blockNumber(); ++iBl1 ) {
475 if ( stepper.newStep() [ iBl1 ] ) {
476 const Point ptRef(inData_->blockCenter() [ iBl1 ].first, inData_->blockCenter() [ iBl1 ].second);
479 mpscNew.push_back(ps);
480 stepper.newStep() [ iBl1 ] =
update2_(mpscNew, jBl1, iBl1);
481 ( * this ) [ iBl1 ].add(mpscNew [ jBl1 ]);
484 if ( stepper.newStep() [ iBl1 ] == true ) {
485 stepper.otherStep() =
true;
492 stepper.firstStep() =
false;
493 return stepper.otherStep();
496 const bool update_(std :: vector< PointsBlock > &mpscNew,
const int &Jnd,
const int &Ind)
498 for (
int iBl1 = 0; iBl1 < size(); ++iBl1 ) {
508 mpscNew [ Jnd ].cleanUp();
509 return ( mpscNew [ Jnd ].size() != 0 );
512 const bool update2_(std :: vector< PointsBlock > &mpscNew,
const int &Jnd,
const int &Ind)
518 for (
int iBl1 = 0; iBl1 < size(); ++iBl1 ) {
524 mpscNew [ Jnd ].cleanUp();
525 return ( mpscNew [ Jnd ].size() != 0 );