This file is indexed.

/usr/include/votca/csg/bead.h is in libvotca-csg2-dev 1.2.4-2.1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
/* 
 * Copyright 2009-2011 The VOTCA Development Team (http://www.votca.org)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */

#ifndef _bead_H
#define	_bead_H

#include <string>
#include <votca/tools/types.h>
#include <votca/tools/vec.h>
#include <votca/tools/property.h>
#include <assert.h>
#include "beadtype.h"
#include "topologyitem.h"

namespace votca { namespace csg {
using namespace votca::tools;

using namespace std;
class Molecule;

/**
    \brief information about a bead
 
    The Bead class describes an atom or a coarse grained bead. It stores information like the id, the name, the mass, the
    charge and the residue it belongs to. The coordinates are stored in the configuration class.

    \todo change resnr to pointer
    \todo make sure bead belongs to topology
*/
class Bead : public TopologyItem
{
public:   

    /**
     * destructor
     */
    virtual ~Bead() {}

    /**
     * get the id of the bead
     *
     * \return bead id
     */
    const int &getId() const { return _id; }
    
    /**
     * get bead name
     * \return bead name
     */
    const string &getName() const { return _name; }
    
    /**
     * get the bead type
     * \return bead type object
     */
    const BeadType *getType() const { return _type; }

    /**
     * get the residu number of the bead
     * \return residue id
     */
    const int &getResnr() const { return _resnr; }

    /**
     * get the mass of the bead
     * \return bead mass
     */
    const double &getM() const { return _m; }

    /**
     * get the charge of the bead
     * \return bead charge
     */
    const double &getQ() const { return _q; }
    
    /**
     * set the mass of the bead
     * \param m bead mass
     */
    void setM(const double &m) { _m=m; }

    /**
     * set the charge of the bead
     * \param q bead charge
     */
    void setQ(const double &q) { _q=q; }

    /**
     * \brief get the symmetry of the bead
     *
     * Returns the number of unique axis of the bead, it can be
     * 1 for a spherical bead
     * 3 for an ellipsoidal bead
     * 2 (currently not used), could be disk like particle
     *
     * \return bead symmetry
     */
    byte_t getSymmetry() const { return _symmetry; }

    /**
     * set the position of the bead
     * \param r bead position
     */
    void setPos(const vec &r);

    /**
     * get the position of the bead
     * \return bead position
     */
    const vec &getPos() const;

    /**
     * set the velocity of the bead
     * @param r bead velocity
     */
    void setVel(const vec &r);

    /**
     * get the velocity of the bead
     * \return bead velocity
     */
    const vec &getVel() const;
    
    /**
     * \brief set first orientation (normal vector) vector of bead
     *
     * see getU for details
     *
     * @param u bead orientation u
     */
    void setU(const vec &u);

    /**
     * \brief get first orientation (normal vector) vector of bead
     *
     * Non-spherical beads (symmetry 3) have a internal coordinates system and the
     * axes are denoted as u, v and w. Currently the non-spherical mapping is hardcoded and
     * the axis u is calculated by the eigenvector with the lowest eigenvector of
     * the mapped beads and has the meaning of a normal vector if the reference beads
     * have a disc like shape. The sign of the normal vector is determined in combination
     * with the vectors v and w to build up a right handed (??) coordinate system.
     *
     * \return bead orientation u
     */
    const vec &getU() const;

    /**
     * \brief set second orientation vector of bead
     *
     * see getV for details
     *
     * @param v bead orientation v
     */
    void setV(const vec &v);

    /**
     * \brief get second orientation vector of bead
     *
     * Non-spherical beads (symmetry 3) have a internal coordinates system and the
     * axes are denoted as u, v and w. Currently the non-spherical mapping is hardcoded and
     * the axis v is the vector which connects first and second reference atom
     * in the mapping (only orthogonal component to u).
     *
     * \return bead orientation u
     */
    const vec &getV() const;

    /**
     * \brief set third orientation vector of bead
     *
     * see getW for details
     *
     * @param w bead orientation w
     */
    void setW(const vec &w);

    /**
     * \brief get third orientation vector of bead
     *
     * Non-spherical beads (symmetry 3) have a internal coordinates system and the
     * axes are denoted as u, v and w. Currently the non-spherical mapping is hardcoded and
     * the axis w is orthogonal to u and v.
     *
     * \return bead orientation w
     */
    const vec &getW() const;
        
    /**
     * direct access (read/write) to the position of the bead
     * \return reference to position 
     */
    vec &Pos() { return _pos; }

    /**
     * direct access (read/write) to the velocity of the bead
     * \return reference to velocity
     */
    vec &Vel() { return _vel; }

    /**
     * direct access (read/write) to orientation u of the bead
     * \return reference to u
     */
    vec &U() { return _u; }

    /**
     * direct access (read/write) to the orientation v of the bead
     * \return reference to v
     */
    vec &V() { return _v; }

    /**
     * direct access (read/write) to the orientation w of the bead
     * \return reference to w
     */
    vec &W() { return _w; }

    /**
     * direct access (read/write) to the force of the bead
     * \return reference to force
     */
    vec &F() { return _f; }
 
    /**
     * set force acting on bead
     * @param F force
     */
    void setF(const vec &F);

    /**
     * \brief get the force acting on the bead
     *
     * Forces have to be provided by the trajectory. If beads are mapped, forces
     * of coarse-grained beads are also calculated.
     *
     * \return force on bead
     */
    const vec &getF() const;

    /** does this configuration store positions? */
    bool HasPos() {return _bPos; }
    
    /** does this configuration store velocities? */
    bool HasVel() {return _bVel; }
    
    /** does this configuration store forces? */
    bool HasF() {return _bF; }
    
    /** does this configuration store u-orientations? */
    bool HasU() {return _bU; }
    
    /** does this configuration store v-orientations? */
    bool HasV() {return _bV; }
    
    /** does this configuration store w-orientations? */
    bool HasW() {return _bW; }
        
    /** dos the bead store a position */
    void HasPos(bool b);

    /** dos the bead store a velocity */
    void HasVel(bool b);
    
    /** dos the bead store a force */
    void HasF(bool b);

    /** doe the bead store an orientation u */
    void HasU(bool b);

    /** doe the bead store an orientation v */
    void HasV(bool b);

    /** doe the bead store an orientation w */
    void HasW(bool b);
    
    /**
     * molecule the bead belongs to
     * \return Molecule object
     */
    Molecule *getMolecule() { return _mol; }

    /**
     * If it is a mapped beads, returns te bead id the cg bead was created from
     * \return vector of bead ids of reference atoms
     */
    vector<int> &ParentBeads() { return _parent_beads; };

    /**
     * \brief Function to add arbitrary user data to bead
     *
     * The user can attach pointers to own created objects to beads. Currently
     * the user has to take care about deletion of the objects at the end.
     *
     * \todo change this to shared_pointer
     *
     * \param userdata userdata
     */
    template<typename T>
    void setUserData(T *userdata) { _userdata = (void*)userdata; }

    /**
     * get userdata attached to bead
     * @return pointer to userdata
     */
    template<typename T>
    T *getUserData() { return (T *)_userdata; }

    /**
     * \brief Additional options of bead
     *
     * The options object stores additional options which can be attached to
     * the bead. For mapped beads, it contains all the values which were specified
     * in the xml mapping file. This allows to at user defined options to the xml
     * which are automatically read in on creation of the coare-grained bead.
     *
     * \return Property object containing options
     */
    Property &Options() { return *_options; }

    /**
     * update pointer to options object of bead
     * \param options pointer to options object of bead
     */
    void setOptions(Property &options) { _options = &options; }

protected:
    int _id;
    vector<int> _parent_beads;
    BeadType *_type;
    Molecule *_mol;
    
    // TODO: this is so far a pointer. this should change! each bead should have own options.
    Property *_options;

    byte_t _symmetry;
    string _name;
    
    int _resnr;
    
    double _m;
    double _q;
    
    vec _pos, _vel, _f, _u, _v, _w, _eigenvec1, _eigenvec2,_eigenvec3;
    double _val1,_val2,_val3;
    
    bool _bPos;
    bool _bVel;
    bool _bU;
    bool _bV;
    bool _bW;
    bool _bF;
    bool _b1,_b2,_b3;
    
    /// constructur
    Bead(Topology *owner, int id, BeadType *type, byte_t symmetry, string name, int resnr, double m, double q)
        : TopologyItem(owner), _id(id), _type(type), _symmetry(symmetry), _name(name), _resnr(resnr), _m(m), _q(q)
    {_bPos=false;
    _bVel=false;
    _bU=false;
    _bV=false;
    _bW=false;
    _bF=false;
    _b1=false;
    _b2=false;
    _b3=false;}

    void *_userdata;
    
    friend class Topology;

    friend class Molecule;
};

inline void Bead::setPos(const vec &r)
{
    _bPos=true;
    _pos = r;
}

inline const vec &Bead::getPos() const
{
    assert(_bPos);
    return _pos;
}

inline void Bead::setVel(const vec &r)
{
   _bVel=true;
   _vel = r;
}

inline const vec &Bead::getVel() const
{
    assert(_bVel);
    return _vel;
}

inline void Bead::setU(const vec &u)
{
    _bU=true;
    _u = u;
}

inline const vec &Bead::getU() const
{
    assert(_bU);
    return _u;
}

inline void Bead::setV(const vec &v)
{
    _bV=true;
    _v = v;
}

inline const vec &Bead::getV() const
{
    assert(_bV);
    return _v;
}

inline void Bead::setW(const vec &w)
{
    _bW=true;
    _w = w;
}

inline const vec &Bead::getW() const
{
    assert(_bW);
    return _w;
}

inline void Bead::setF(const vec &F)
{
    _bF=true;
    _f = F;
}

inline const vec &Bead::getF() const
{
    assert(_bF);
    return _f;
}

inline void Bead::HasPos(bool b)
{
    _bPos=b;
}

inline void Bead::HasVel(bool b)
{
    _bVel=b;
}

inline void Bead::HasF(bool b)
{
    _bF=b;
}

inline void Bead::HasU(bool b)
{
    _bU=b;
}

inline void Bead::HasV(bool b)
{
    _bV=b;
}

inline void Bead::HasW(bool b)
{
    _bW=b;
}

}}

#endif	/* _beadinfo_H */