当前位置: 首页>>代码示例>>C++>>正文


C++ FCS::run方法代码示例

本文整理汇总了C++中FCS::run方法的典型用法代码示例。如果您正苦于以下问题:C++ FCS::run方法的具体用法?C++ FCS::run怎么用?C++ FCS::run使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FCS的用法示例。


在下文中一共展示了FCS::run方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: fcs_run

/**
 * run the solver method
 */
FCSResult fcs_run(FCS handle, fcs_int local_particles,
  fcs_float *positions, fcs_float *charges, fcs_float *field, fcs_float *potentials)
{
  const char *fnc_name = "fcs_run";
  FCSResult result;

  CHECK_HANDLE_RETURN_RESULT(handle, fnc_name);

  if (local_particles < 0)
    return fcs_result_create(FCS_ERROR_WRONG_ARGUMENT, fnc_name, "number of local particles must be non negative");

  if (fcs_get_values_changed(handle))
  {
    result = fcs_tune(handle, local_particles, positions, charges);
    if (result != FCS_RESULT_SUCCESS) return result;
  }

  if (!fcs_init_check(handle) || !fcs_run_check(handle))
    return fcs_result_create(FCS_ERROR_MISSING_ELEMENT, fnc_name, "not all needed data has been inserted into the given handle");

  if (handle->run == NULL)
    return fcs_result_create(FCS_ERROR_NOT_IMPLEMENTED, fnc_name, "Running solver method '%s' not implemented", fcs_get_method_name(handle));

  return handle->run(handle, local_particles, positions, charges, field, potentials);
}
开发者ID:fweik,项目名称:scafacos,代码行数:28,代码来源:FCSInterface.c

示例2: fcs_run

/**
 * run the solver method
 */
FCSResult fcs_run(FCS handle, fcs_int local_particles,
  fcs_float *positions, fcs_float *charges, fcs_float *field, fcs_float *potentials)
{
  FCSResult result;

  CHECK_HANDLE_RETURN_RESULT(handle, __func__);

  if (local_particles < 0)
    return fcs_result_create(FCS_ERROR_WRONG_ARGUMENT, __func__, "number of local particles must be non negative");

  if (fcs_get_values_changed(handle))
  {
    result = fcs_tune(handle, local_particles, positions, charges);
    if (result != FCS_RESULT_SUCCESS) return result;
  }

  if (!fcs_init_check(handle) || !fcs_run_check(handle))
    return fcs_result_create(FCS_ERROR_MISSING_ELEMENT, __func__, "not all needed data has been inserted into the given handle");

  if (handle->run == NULL)
    return fcs_result_create(FCS_ERROR_NOT_IMPLEMENTED, __func__, "Running solver method '%s' not implemented", fcs_get_method_name(handle));

  fcs_float original_box_origin[3] = { handle->box_origin[0], handle->box_origin[1], handle->box_origin[2] };

  if (handle->shift_positions)
  {
    fcs_shift_positions(local_particles, positions, original_box_origin);
    handle->box_origin[0] = handle->box_origin[1] = handle->box_origin[2] = 0;
  }

  result = handle->run(handle, local_particles, positions, charges, field, potentials);

  if (handle->shift_positions)
  {
    fcs_unshift_positions(local_particles, positions, original_box_origin);
    handle->box_origin[0] = original_box_origin[0];
    handle->box_origin[1] = original_box_origin[1];
    handle->box_origin[2] = original_box_origin[2];
  }

  return result;
}
开发者ID:,项目名称:,代码行数:45,代码来源:


注:本文中的FCS::run方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。