示例#1
0
文件: ASMs3DLag.C 项目: OPM/IFEM
bool ASMs3DLag::updateCoords (const Vector& displ)
{
  if (shareFE) return true;

  if (displ.size() != 3*coord.size())
  {
    std::cerr <<" *** ASMs3DLag::updateCoords: Invalid dimension "
	      << displ.size() <<" on displ, should be "
	      << 3*coord.size() << std::endl;
    return false;
  }

  const double* u = displ.ptr();
  for (size_t inod = 0; inod < myCoord.size(); inod++, u += 3)
    myCoord[inod] += RealArray(u,u+3);

  return true;
}
示例#2
0
文件: BugsHelper.c 项目: cran/BRugs
int do_RealArray(char *cmd, char *tmpdir, int cmdno) {
  int length, outlength, res=0;
#ifdef DEBUG
  int i;
#endif
  double *out;
  read_input_real(tmpdir, &out, &outlength, cmdno);
  length = strlen(cmd);
#ifdef DEBUG
  printf("%s: arglength=%d\n", cmd, outlength);
  for (i=0; i<outlength; ++i) printf("%lf ",out[i]);
  printf("\n");
#endif
  RealArray(&cmd, &length, out, &outlength, &res);
  write_output_real(tmpdir, out, outlength, cmdno);
  free(out);
  return res;
}