QMCPACK
XMLParticleParser Class Reference
+ Inheritance diagram for XMLParticleParser:
+ Collaboration diagram for XMLParticleParser:

Public Member Functions

 XMLParticleParser (Particle_t &aptcl)
 constructor More...
 
bool readXML (xmlNodePtr cur)
 process xmlnode <particleset/> which contains everything about the particle set to initialize More...
 
bool reset (xmlNodePtr cur)
 reset the properties of a particle set More...
 

Private Types

using Particle_t = ParticleSet
 
using ParticleIndex = Particle_t::ParticleIndex
 
using ParticleScalar = Particle_t::ParticleScalar
 
using ParticlePos = Particle_t::ParticlePos
 
using ParticleTensor = Particle_t::ParticleTensor
 

Private Member Functions

void getPtclAttrib (xmlNodePtr cur, int in_offset, int copy_size, int out_offset)
 read the data of a particle attribute More...
 
void checkGrouping (int nat, const std::vector< int > &nat_group) const
 

Private Attributes

Particle_tref_
 
AttribListType ref_AttribList
 

Additional Inherited Members

- Public Types inherited from ParticleTags
enum  {
  PA_IndexType = 0, PA_ScalarType, PA_StringType, PA_PositionType,
  PA_TensorType, PA_UnkownType
}
 enumeraton for datatypes for particle attributes More...
 
- Static Public Attributes inherited from ParticleTags
static std::string null_tag = "null"
 type names of particle attributes, e.g., posArray More...
 
static std::string indextype_tag = "indexArray"
 the datatype tag for the index-type attribute More...
 
static std::string scalartype_tag = "scalarArray"
 the datatype tag for the scalar-type attribute More...
 
static std::string stringtype_tag = "stringArray"
 the datatype tag for the string-type attribute More...
 
static std::string postype_tag = "posArray"
 the datatype tag for the pos-type attribute More...
 
static std::string gradtype_tag = "gradArray"
 the datatype tag for the gradient-type attribute More...
 
static std::string laptype_tag = "lapArray"
 the datatype tag for the laplacian-type attribute More...
 
static std::string tensortype_tag = "tensorArray"
 the datatype tag for the tensor-type attribute More...
 
static std::string xmoltype_tag = "xmolArray"
 the datatype tag for the xmol-type attribute More...
 
static std::string position_tag = "position"
 names of particle attributes, e.g., position More...
 
static std::string spins_tag = "spins"
 the name for spins attribute More...
 
static std::string id_tag = "id"
 the name for id attribute More...
 
static std::string ionid_tag = "ionid"
 the name for ionid attribute More...
 
static std::string trajectory_tag = "trajectory"
 the name for trajectory attribute More...
 
static std::string force_tag = "f"
 the name for force attribute More...
 
static std::string velocity_tag = "v"
 the name for velocity attribute More...
 
static std::string energy_tag = "e"
 the name for energy attribute More...
 
static std::string sumbc_tag = "sumbc"
 the name for sumbc (accumulative boundary crossings) attribute More...
 
static std::string root_tag = "particleset"
 xml element names More...
 
static std::string attrib_tag = "attrib"
 the name of particle attribute node More...
 
static std::string name_tag = "name"
 the attribute name of name More...
 
static std::string datatype_tag = "datatype"
 the attribute name of datatype More...
 
static std::string condition_tag = "condition"
 the attribute name of condition More...
 
static std::string size_tag = "size"
 the attribute name of size More...
 
static std::string format_tag = "format"
 the attribute name of format More...
 
static std::string role_tag = "role"
 the attribute name of role More...
 

Detailed Description

Definition at line 94 of file XMLParticleIO.h.

Member Typedef Documentation

◆ Particle_t

using Particle_t = ParticleSet
private

Definition at line 96 of file XMLParticleIO.h.

◆ ParticleIndex

Definition at line 97 of file XMLParticleIO.h.

◆ ParticlePos

Definition at line 99 of file XMLParticleIO.h.

◆ ParticleScalar

Definition at line 98 of file XMLParticleIO.h.

◆ ParticleTensor

Definition at line 100 of file XMLParticleIO.h.

Constructor & Destructor Documentation

◆ XMLParticleParser()

constructor

Parameters
aptclthe particleset to be initialized

Definition at line 80 of file XMLParticleIO.cpp.

References ParticleSet::createAttributeList(), XMLParticleParser::ref_, and XMLParticleParser::ref_AttribList.

80  : ref_(aptcl)
81 {
82  //add ref particle attributes
84 }
void createAttributeList(ATList &AttribList)
add attributes to list for IO
Definition: ParticleSet.h:531

Member Function Documentation

◆ checkGrouping()

void checkGrouping ( int  nat,
const std::vector< int > &  nat_group 
) const
private

Definition at line 352 of file XMLParticleIO.cpp.

References app_debug, SpeciesSet::getSpeciesName(), ParticleSet::getSpeciesSet(), and XMLParticleParser::ref_.

Referenced by XMLParticleParser::readXML().

353 {
354  app_debug() << "There are " << nat << " particles in " << nat_group.size() << " species containing:" << std::endl;
355  for (int ig = 0; ig < nat_group.size(); ig++)
356  {
357  const auto& group_species_name = ref_.getSpeciesSet().getSpeciesName(ig);
358  if (nat_group[ig] == 0)
359  throw UniformCommunicateError("Element '" + group_species_name + "' was provided but never referenced.");
360  app_debug() << " " << nat_group[ig] << " '" << group_species_name << "'" << std::endl;
361  }
362 
363  if (std::accumulate(nat_group.begin(), nat_group.end(), 0) != nat)
364  throw UniformCommunicateError(
365  "The total number of particles doesn't match the sum of the particle counts of all the species.");
366 }
#define app_debug
Definition: OutputManager.h:75
const std::string & getSpeciesName(int index) const
Definition: SpeciesSet.h:142
SpeciesSet & getSpeciesSet()
retrun the SpeciesSet of this particle set
Definition: ParticleSet.h:231

◆ getPtclAttrib()

void getPtclAttrib ( xmlNodePtr  cur,
int  in_offset,
int  copy_size,
int  out_offset 
)
private

read the data of a particle attribute

Parameters
curthe xmlnode
in_offsetthe location offset to read from XML element node body.
copy_sizethe number of particle attributes to be read
out_offsetthe current local count to which copy_size particle attributes are added.

Definition at line 433 of file XMLParticleIO.cpp.

References OhmmsAttributeSet::add(), qmcplusplus::app_error(), ParticleTags::condition_tag, ParticleTags::datatype_tag, AttribListType::getAttribType(), AttribListType::getAttribute(), ParticleTags::ionid_tag, ParticleTags::PA_IndexType, ParticleTags::PA_PositionType, ParticleTags::PA_ScalarType, ParticleTags::PA_TensorType, OhmmsAttributeSet::put(), and XMLParticleParser::ref_AttribList.

Referenced by XMLParticleParser::readXML().

434 {
435  std::string oname, otype;
436  int utype = 0;
437  int size_in = 0;
438  OhmmsAttributeSet pAttrib;
439  pAttrib.add(otype, datatype_tag); //datatype
440  pAttrib.add(oname, "name"); //name
441  pAttrib.add(utype, condition_tag); //condition
442  pAttrib.add(size_in, "size"); //size
443  pAttrib.put(cur);
444  if (oname.empty() || otype.empty())
445  {
446  app_error() << " Missing attrib/@name or attrib/@datatype " << std::endl;
447  app_error() << R"( <attrib name="aname" datatype="atype"/>)" << std::endl;
448  return;
449  }
450  int t_id = ref_AttribList.getAttribType(otype);
451 
452  if (oname == ionid_tag)
453  throw UniformCommunicateError("'ionid' should not be parsed by getPtclAttrib.");
454  else
455  {
456  //very permissive in that a unregistered attribute will be created and stored by ParticleSet
457  //cloning is not going to work
458  if (t_id == PA_IndexType)
459  {
461  ParticleAttribXmlNode<ParticleIndex> a(*obj, static_cast<PosUnit>(utype));
462  a.put(cur, in_offset, copy_size, out_offset);
463  }
464  else if (t_id == PA_ScalarType)
465  {
467  ParticleAttribXmlNode<ParticleScalar> a(*obj, static_cast<PosUnit>(utype));
468  a.put(cur, in_offset, copy_size, out_offset);
469  }
470  else if (t_id == PA_PositionType)
471  {
473  ParticleAttribXmlNode<ParticlePos> a(*obj, static_cast<PosUnit>(utype));
474  a.put(cur, in_offset, copy_size, out_offset);
475  }
476  else if (t_id == PA_TensorType)
477  {
479  ParticleAttribXmlNode<ParticleTensor> a(*obj, static_cast<PosUnit>(utype));
480  a.put(cur, in_offset, copy_size, out_offset);
481  }
482  }
483 }
Particle_t::ParticleIndex ParticleIndex
Definition: XMLParticleIO.h:97
ParticleLayout::SingleParticlePos SingleParticlePos
Definition: Configuration.h:87
ParticleLayout::Tensor_t Tensor_t
Definition: Configuration.h:88
bool put(xmlNodePtr cur)
assign attributes to the set
Definition: AttributeSet.h:55
std::ostream & app_error()
Definition: OutputManager.h:67
static std::string condition_tag
the attribute name of condition
Definition: ParticleTags.h:124
int getAttribType(const std::string &tname)
return a type id: one of the enum values
Definition: XMLParticleIO.h:71
ParticleAttrib< AT > * getAttribute(const std::string &tname, const std::string &oname)
generic get function attribute function
Definition: XMLParticleIO.h:79
class to handle a set of attributes of an xmlNode
Definition: AttributeSet.h:24
Particle_t::ParticlePos ParticlePos
Definition: XMLParticleIO.h:99
static std::string ionid_tag
the name for ionid attribute
Definition: ParticleTags.h:93
static std::string datatype_tag
the attribute name of datatype
Definition: ParticleTags.h:122
void add(PDT &aparam, const std::string &aname, std::vector< PDT > candidate_values={}, TagStatus status=TagStatus::OPTIONAL)
add a new attribute
Definition: AttributeSet.h:42
Particle_t::ParticleTensor ParticleTensor
Particle_t::ParticleScalar ParticleScalar
Definition: XMLParticleIO.h:98

◆ readXML()

bool readXML ( xmlNodePtr  cur)

process xmlnode <particleset/> which contains everything about the particle set to initialize

Parameters
curthe xmlnode to work on

Definition at line 90 of file XMLParticleIO.cpp.

References OhmmsAttributeSet::add(), app_debug, qmcplusplus::app_log(), ParticleSet::applyBC(), ParticleTags::attrib_tag, XMLParticleParser::checkGrouping(), ParticleSet::convert2Cart(), ParticleSet::create(), ParticleSet::createSK(), ParticleTags::datatype_tag, ParticleSet::getLattice(), XMLParticleParser::getPtclAttrib(), ParticleSet::getSpeciesSet(), ParticleSet::getTotalNum(), getXMLAttributeValue(), ParticleTags::ionid_tag, qmcplusplus::Lattice, qmcplusplus::makeUniformRandom(), processChildren(), OhmmsAttributeSet::put(), putContent(), ParticleSet::R, XMLParticleParser::ref_, ParticleSet::resetGroups(), ParticleSet::setMapStorageToInput(), ParticleSet::setName(), qmcplusplus::setSpeciesProperty(), ParticleAttrib< T, Alloc >::setUnit(), ParticleSet::spins, and ParticleTags::stringtype_tag.

Referenced by qmcplusplus::create_CN_particlesets(), qmcplusplus::parse_electron_ion_pbc_z(), ParticleSetPool::put(), qmcplusplus::test_C_diamond(), qmcplusplus::TEST_CASE(), qmcplusplus::test_EtOH_mw(), and qmcplusplus::test_HCN().

91 {
92  ReportEngine PRE("XMLParticleParser", "readXML");
93 
94  if (ref_.getTotalNum())
95  throw UniformCommunicateError("The ParticleSet object to load XML input was not empty. Report a bug!");
96 
97  SpeciesSet& tspecies(ref_.getSpeciesSet());
98  if (tspecies.size() != 0)
99  throw UniformCommunicateError("The SpeciesSet object to load XML input was not empty. Report a bug!");
100 
101  // the total number of particles, once it is set non-zero, always check against it.
102  int nat = 0;
103  // the number of particles by group, once it is constructed, always check against it.
104  std::vector<int> nat_group;
105 
106  std::string pname("none");
107  std::string randomizeR("no");
108  OhmmsAttributeSet pAttrib;
109  pAttrib.add(randomizeR, "random");
110  pAttrib.add(nat, "size");
111  pAttrib.add(pname, "name");
112  pAttrib.put(cur);
113 
114  ref_.setName(pname.c_str());
115 
116  if (nat != 0)
117  {
118  app_debug() << "Set the total size " << nat
119  << " by the 'size' attribute found in 'particleset' XML element node named '" << pname << "'."
120  << std::endl;
121  }
122 
123  bool ionid_found = false;
124  { // parse all the 'group's to obtain or verify the total number of particles
125  //total count of the particles to be created
126  int ntot = 0;
127  int num_non_zero_group = 0;
128  bool group_found = false;
129 
130  processChildren(cur, [&](const std::string& cname, const xmlNodePtr element) {
131  if (cname == "atom")
132  throw UniformCommunicateError("XML element node atom is no more supported");
133  else if (cname.find("ell") < cname.size()) //accept UnitCell, unitcell, supercell
134  throw UniformCommunicateError("Constructing cell inside particleset is illegal!");
135  else if (cname == "group")
136  {
137  group_found = true;
138  std::string sname = getXMLAttributeValue(element, "name");
139  if (sname.empty())
140  throw UniformCommunicateError("'group' element node must include a name attribute!");
141  else
142  {
143  const int sid = tspecies.addSpecies(sname);
144  setSpeciesProperty(tspecies, sid, element);
145  }
146 
147  int nat_per_group = 0;
148  OhmmsAttributeSet gAttrib;
149  gAttrib.add(nat_per_group, "size");
150  gAttrib.put(element);
151 
152  nat_group.push_back(nat_per_group);
153  ntot += nat_per_group;
154  if (nat_per_group > 0)
155  num_non_zero_group++;
156  }
157  else if (cname == attrib_tag && getXMLAttributeValue(element, "name") == ionid_tag)
158  ionid_found = true;
159  });
160 
161  if (!group_found)
162  throw UniformCommunicateError("No 'group' XML element node was found. Check XML input!");
163 
164  if (nat != 0 && ntot != 0 && nat != ntot)
165  {
166  std::ostringstream msg;
167  msg << "The total number of particles deterimined previously was " << nat
168  << "but the sum of the sizes from all the 'group' XML element nodes is " << ntot
169  << ". Please check the 'particleset' XML element node!" << std::endl;
170  throw UniformCommunicateError(msg.str());
171  }
172 
173  if (nat == 0 && ntot != 0)
174  {
175  nat = ntot;
176  app_debug() << "Set the total size " << nat << " by the sum of the 'size's on all the 'group' XML element nodes."
177  << std::endl;
178  }
179 
180  if (ntot > 0 && num_non_zero_group != nat_group.size())
181  throw UniformCommunicateError("Some 'group' XML element node doesn't contain a 'size' attribute! 'size = 0' is not allowed in the input. Make appropriate adjustments to the input or converter.");
182  }
183 
184  { // parse all the 'attrib's to obtain or verify the total number of particles
185  processChildren(cur, [&](const std::string& cname, const xmlNodePtr element) {
186  if (cname == attrib_tag)
187  {
188  std::string sname = getXMLAttributeValue(element, "name");
189  if (sname.empty())
190  throw UniformCommunicateError("'" + ParticleTags::attrib_tag +
191  "' XML element node must include a name attribute!");
192 
193  int size_att = 0;
194  OhmmsAttributeSet aAttrib;
195  aAttrib.add(size_att, "size");
196  aAttrib.put(element);
197 
198  if (nat != 0 && size_att != 0 && nat != size_att)
199  {
200  std::ostringstream msg;
201  msg << "The total number of particles deterimined previously was " << nat
202  << " but the 'size' atttribute found on the '" << ParticleTags::attrib_tag
203  << "' XML element nodes named '" << sname << "' is " << size_att
204  << ". Please check the 'particleset' XML element node!" << std::endl;
205  throw UniformCommunicateError(msg.str());
206  }
207 
208  if (nat == 0 && size_att != 0)
209  {
210  nat = size_att;
211  app_debug() << "Set the total size " << nat << " by the 'size' on the '" << ParticleTags::attrib_tag
212  << "' XML element node named '" << sname << "'." << std::endl;
213  }
214  }
215  });
216  }
217 
218  if (nat == 0)
219  throw UniformCommunicateError("Failed in figuring out the total number of particles. Check XML input!");
220 
221  if (ionid_found)
222  { // parse ionid and construct input order to stored order
223  std::vector<int> map_storage_to_input(nat);
224  processChildren(cur, [&](const std::string& cname, const xmlNodePtr element) {
225  if (cname == attrib_tag && getXMLAttributeValue(element, "name") == ionid_tag)
226  {
227  std::string datatype = getXMLAttributeValue(element, datatype_tag);
228  if (datatype != stringtype_tag)
229  throw UniformCommunicateError("'ionid' only supports datatype=\"" + stringtype_tag + "\"");
230  std::vector<std::string> d_in(nat);
231  putContent(d_in, element);
232  bool input_ungrouped = false;
233  int storage_index = 0;
234  for (int ig = 0; ig < nat_group.size(); ig++)
235  {
236  const auto& group_species_name = tspecies.getSpeciesName(ig);
237  int count_group_size = 0;
238  for (int iat = 0; iat < nat; iat++)
239  {
240  const int element_index = tspecies.findSpecies(d_in[iat]);
241  if (element_index == tspecies.size())
242  throw UniformCommunicateError("Element " + d_in[iat] +
243  " doesn't match any species from 'group' XML element nodes.");
244  if (element_index == ig)
245  {
246  if (iat != storage_index)
247  input_ungrouped = true;
248  count_group_size++;
249  map_storage_to_input[storage_index++] = iat;
250  }
251  }
252 
253  if (count_group_size == 0)
254  throw UniformCommunicateError("Element '" + group_species_name + "' not found in 'ionid'.");
255 
256  if (nat_group[ig] == 0)
257  nat_group[ig] = count_group_size;
258  else if (nat_group[ig] != count_group_size)
259  {
260  std::ostringstream msg;
261  msg << "The number of particles of element '" << group_species_name << "' from 'group' XML elment node was "
262  << nat_group[ig] << " but 'ionid' contains " << count_group_size << " entries." << std::endl;
263  throw UniformCommunicateError(msg.str());
264  }
265  }
266 
267  if (input_ungrouped)
268  {
269  app_log() << " Input particle set is not grouped by species. Remapping particle position indices "
270  "internally."
271  << std::endl;
272  app_debug() << " Species : input particle index -> internal particle index" << std::endl;
273  for (int new_idx = 0; new_idx < map_storage_to_input.size(); new_idx++)
274  {
275  int old_idx = map_storage_to_input[new_idx];
276  if (new_idx != old_idx)
277  {
278  app_debug() << " " << d_in[old_idx] << " : " << old_idx << " -> " << new_idx << std::endl;
279  }
280  }
281  }
282  }
283  });
284 
285  checkGrouping(nat, nat_group);
286  ref_.create(nat_group);
287  // save map_storage_to_input
288  ref_.setMapStorageToInput(map_storage_to_input);
289 
290  for (int iat = 0; iat < nat; iat++)
291  {
292  processChildren(cur, [&](const std::string& cname, const xmlNodePtr element) {
293  if (cname == attrib_tag && getXMLAttributeValue(element, "name") != ionid_tag)
294  getPtclAttrib(element, map_storage_to_input[iat], 1, iat);
295  });
296  }
297  }
298  else
299  {
300  // fix old input with positions outside 'group'
301  if (nat_group.size() == 1 && nat_group[0] == 0)
302  nat_group[0] = nat;
303 
304  checkGrouping(nat, nat_group);
305  ref_.create(nat_group);
306 
307  // obtain 'attrib' inside 'group'
308  size_t start = 0;
309  size_t ig = 0;
310  processChildren(cur, [&](const std::string& cname, const xmlNodePtr child) {
311  if (cname == "group")
312  {
313  processChildren(child, [&](const std::string& cname, const xmlNodePtr element) {
314  if (cname == attrib_tag)
315  getPtclAttrib(element, 0, nat_group[ig], start);
316  });
317  start += nat_group[ig];
318  ig++;
319  }
320  else if (cname == attrib_tag)
321  {
322  if (nat_group.size() > 1)
323  throw UniformCommunicateError("An 'attrib' XML element node was found outside 'group'"
324  " without XML element node named 'ionid'."
325  " Cannot map particles to more than one species. Check XML input!");
326  getPtclAttrib(child, 0, nat, 0);
327  }
328  });
329  }
330 
331  if (ref_.getLattice().SuperCellEnum)
332  {
333  if (randomizeR == "yes")
334  {
339  ref_.spins *= 2 * M_PI;
340  }
341  else // put them [0,1) in the cell
342  ref_.applyBC(ref_.R);
343  }
344 
345  //this sets Mass, Z
346  ref_.resetGroups();
347  ref_.createSK();
348 
349  return true;
350 }
static std::string attrib_tag
the name of particle attribute node
Definition: ParticleTags.h:118
void makeUniformRandom(ParticleAttrib< TinyVector< T, D >> &a)
void setName(const std::string &aname)
Definition: ParticleSet.h:237
void checkGrouping(int nat, const std::vector< int > &nat_group) const
ParticleScalar spins
internal spin variables for dynamical spin calculations
Definition: ParticleSet.h:81
#define app_debug
Definition: OutputManager.h:75
size_t getTotalNum() const
Definition: ParticleSet.h:493
std::ostream & app_log()
Definition: OutputManager.h:65
bool put(xmlNodePtr cur)
assign attributes to the set
Definition: AttributeSet.h:55
void applyBC(const ParticlePos &pin, ParticlePos &pout)
class to handle a set of attributes of an xmlNode
Definition: AttributeSet.h:24
void convert2Cart(const ParticlePos &pin, ParticlePos &pout)
ParticlePos R
Position.
Definition: ParticleSet.h:79
static std::string ionid_tag
the name for ionid attribute
Definition: ParticleTags.h:93
std::string getXMLAttributeValue(const xmlNodePtr cur, const std::string_view name)
get the value string for attribute name if name is unfound in cur you get an empty string back this i...
void getPtclAttrib(xmlNodePtr cur, int in_offset, int copy_size, int out_offset)
read the data of a particle attribute
static std::string datatype_tag
the attribute name of datatype
Definition: ParticleTags.h:122
SpeciesSet & getSpeciesSet()
retrun the SpeciesSet of this particle set
Definition: ParticleSet.h:231
void create(const std::vector< int > &agroup)
create grouped particles
void setMapStorageToInput(const std::vector< int > &mapping)
Definition: ParticleSet.h:563
bool putContent(T &a, xmlNodePtr cur)
replaces a&#39;s value with the first "element" in the "string" returned by XMLNodeString{cur}.
Definition: libxmldefs.h:88
void processChildren(const xmlNodePtr cur, const F &functor)
process through all the children of an XML element F is a lambda or functor void F/[](const std::stri...
Definition: libxmldefs.h:175
static std::string stringtype_tag
the datatype tag for the string-type attribute
Definition: ParticleTags.h:61
const auto & getLattice() const
Definition: ParticleSet.h:251
void createSK()
create Structure Factor with PBCs
void setSpeciesProperty(SpeciesSet &tspecies, int sid, xmlNodePtr cur)
set the property of a SpeciesSet
void add(PDT &aparam, const std::string &aname, std::vector< PDT > candidate_values={}, TagStatus status=TagStatus::OPTIONAL)
add a new attribute
Definition: AttributeSet.h:42

◆ reset()

bool reset ( xmlNodePtr  cur)

reset the properties of a particle set

process xmlnode to reset the properties of a particle set

Parameters
curcurrent node
Returns
true, if successful

This resets or adds new attributes to a particle set. It cannot modify the size of the particle set.

Definition at line 375 of file XMLParticleIO.cpp.

References OhmmsAttributeSet::add(), ParticleSet::getSpeciesSet(), OhmmsAttributeSet::put(), XMLParticleParser::ref_, and qmcplusplus::setSpeciesProperty().

376 {
377  ReportEngine PRE("XMLParticleParser", "reset");
378  SpeciesSet& tspecies(ref_.getSpeciesSet());
379  cur = cur->xmlChildrenNode;
380  while (cur != NULL)
381  {
382  std::string cname((const char*)cur->name);
383  if (cname == "group")
384  {
385  std::string sname;
386  OhmmsAttributeSet gAttrib;
387  gAttrib.add(sname, "name");
388  gAttrib.put(cur);
389  if (sname.size())
390  {
391  int sid = tspecies.addSpecies(sname);
392  setSpeciesProperty(tspecies, sid, cur);
393  }
394  }
395  cur = cur->next;
396  }
397  // //@todo Will add a member function to ParticleSet to handle these
398  // int massind=tspecies.addAttribute("mass");
399  // for(int iat=0; iat<ref_.getTotalNum(); iat++)
400  // ref_.Mass[iat]=tspecies(massind,ref_.GroupID[iat]);
401  //
402  // int qind=tspecies.addAttribute("charge");
403  // for(int iat=0; iat<ref_.getTotalNum(); iat++)
404  // ref_.Z[iat]=tspecies(qind,ref_.GroupID[iat]);
405  //
406  return true;
407 }
bool put(xmlNodePtr cur)
assign attributes to the set
Definition: AttributeSet.h:55
class to handle a set of attributes of an xmlNode
Definition: AttributeSet.h:24
SpeciesSet & getSpeciesSet()
retrun the SpeciesSet of this particle set
Definition: ParticleSet.h:231
void setSpeciesProperty(SpeciesSet &tspecies, int sid, xmlNodePtr cur)
set the property of a SpeciesSet
void add(PDT &aparam, const std::string &aname, std::vector< PDT > candidate_values={}, TagStatus status=TagStatus::OPTIONAL)
add a new attribute
Definition: AttributeSet.h:42

Member Data Documentation

◆ ref_

◆ ref_AttribList

AttribListType ref_AttribList
private

The documentation for this class was generated from the following files: