예제 #1
0
CoeffsBase::CoeffsBase(
  const std::string& label,
  const std::vector<std::string>& dimension_labels,
  const std::vector<unsigned int>& indices_shape,
  const bool use_iteration_counter):
  label_(label),
  data_label_(label),
  coeffs_type_(Generic),
  iteration_and_time_active_(use_iteration_counter),
  iteration_opt(0),
  time_md(-1.0),
  active(true),
  action_pntr_(NULL),
  vesbias_pntr_(NULL),
  ndimensions_(0),
  indices_shape_(0),
  ncoeffs_(0),
  coeffs_descriptions_(0),
  dimension_labels_(0),
  args_(0),
  basisf_(0),
  multicoeffs_(false),
  multicoeffs_args_(0),
  multicoeffs_basisf_(0),
  field_type_("type"),
  field_ndimensions_("ndimensions"),
  field_ncoeffs_total_("ncoeffs_total"),
  field_shape_prefix_("shape_"),
  field_time_("time"),
  field_iteration_("iteration"),
  output_fmt_("%30.16e")
{
  initializeIndices(indices_shape,dimension_labels);
  setAllCoeffsDescriptions();
}
예제 #2
0
CoeffsBase::CoeffsBase(
  const std::string& label,
  std::vector<std::vector<Value*> >& multicoeffs_args,
  std::vector<std::vector<BasisFunctions*> >& multicoeffs_basisf,
  const bool use_iteration_counter,
  const std::string& multicoeffs_label):
  label_(label),
  data_label_(label),
  coeffs_type_(MultiCoeffs_LinearBasisSet),
  iteration_and_time_active_(use_iteration_counter),
  iteration_opt(0),
  time_md(-1.0),
  active(true),
  action_pntr_(NULL),
  vesbias_pntr_(NULL),
  ndimensions_(0),
  indices_shape_(0),
  ncoeffs_(0),
  coeffs_descriptions_(0),
  dimension_labels_(0),
  args_(0),
  basisf_(0),
  multicoeffs_(true),
  multicoeffs_args_(multicoeffs_args),
  multicoeffs_basisf_(multicoeffs_basisf),
  field_type_("type"),
  field_ndimensions_("ndimensions"),
  field_ncoeffs_total_("ncoeffs_total"),
  field_shape_prefix_("shape_"),
  field_time_("time"),
  field_iteration_("iteration"),
  output_fmt_("%30.16e")
{
  plumed_massert(multicoeffs_args.size()==multicoeffs_basisf.size(),"Multi Coeffs: number of arguments vectors does not match number of basis functions vectors");
  unsigned int num_args = multicoeffs_args[0].size();
  unsigned int dim = num_args+1;
  std::vector<std::string> dimension_labels(dim);
  std::vector<unsigned int> indices_shape(dim);
  for(unsigned int i=0; i<num_args; i++) {
    std::string ip;
    Tools::convert(i+1,ip);
    dimension_labels[i] = "bf" + ip;
    indices_shape[i] = multicoeffs_basisf[0][i]->getNumberOfBasisFunctions();
  }
  indices_shape[dim-1] = multicoeffs_args.size();
  dimension_labels[dim-1] = multicoeffs_label;
  for(unsigned int k=0; k<multicoeffs_args.size(); k++) {
    plumed_massert(multicoeffs_args[k].size()==num_args && multicoeffs_basisf[k].size()==num_args,"Multi Coeffs: arguments and basis functions vectors for each bias should be of the same size");
    for(unsigned int i=0; i<num_args; i++) {
      plumed_massert(indices_shape[i]==multicoeffs_basisf[k][i]->getNumberOfBasisFunctions(),"Multi Coeffs: the coeffs shape for each bias should be identical");
    }
  }
  initializeIndices(indices_shape,dimension_labels);
  setupBasisFunctionsInfo();
}
예제 #3
0
			inline static
			Ptr
			create(std::shared_ptr<render::AbstractContext>	context,
					unsigned int							numParallels	= 10,
					unsigned int							numMeridians	= 0,
					bool									withNormals		= true)
			{
				numMeridians = numMeridians != 0 ? numMeridians : numParallels;

				auto geom = std::shared_ptr<SphereGeometry>(new SphereGeometry());

				geom->initializeVertices(context, numParallels, numMeridians, withNormals);
				geom->initializeIndices(context, numParallels, numMeridians);

				return geom;
			}
예제 #4
0
CoeffsBase::CoeffsBase(
  const std::string& label,
  std::vector<Value*>& args,
  std::vector<BasisFunctions*>& basisf,
  const bool use_iteration_counter):
  label_(label),
  data_label_(label),
  coeffs_type_(LinearBasisSet),
  iteration_and_time_active_(use_iteration_counter),
  iteration_opt(0),
  time_md(-1.0),
  active(true),
  action_pntr_(NULL),
  vesbias_pntr_(NULL),
  ndimensions_(0),
  indices_shape_(0),
  ncoeffs_(0),
  coeffs_descriptions_(0),
  dimension_labels_(0),
  args_(args),
  basisf_(basisf),
  multicoeffs_(false),
  multicoeffs_args_(0),
  multicoeffs_basisf_(0),
  field_type_("type"),
  field_ndimensions_("ndimensions"),
  field_ncoeffs_total_("ncoeffs_total"),
  field_shape_prefix_("shape_"),
  field_time_("time"),
  field_iteration_("iteration"),
  output_fmt_("%30.16e")
{
  plumed_massert(args_.size()==basisf_.size(),"CoeffsBase: number of arguments do not match number of basis functions");
  std::vector<std::string> dimension_labels(args_.size());
  std::vector<unsigned int> indices_shape(args_.size());
  for(unsigned int i=0; i<args_.size(); i++) {
    dimension_labels[i]=args_[i]->getName();
    indices_shape[i]=basisf_[i]->getNumberOfBasisFunctions();
  }
  initializeIndices(indices_shape,dimension_labels);
  setupBasisFunctionsInfo();
}