Commit 719fabf8 by Francois Gygi

remove dependency on Context

git-svn-id: http://qboxcode.org/svn/qb/trunk@1332 cba15fb0-1239-40c8-b417-11db7ca47a34
parent e6e71dd6
......@@ -15,7 +15,6 @@
// BasisMapping.C
//
////////////////////////////////////////////////////////////////////////////////
// $Id: BasisMapping.C,v 1.4 2008-09-08 15:56:18 fgygi Exp $
#include "Basis.h"
#include "Context.h"
......@@ -26,13 +25,10 @@
using namespace std;
////////////////////////////////////////////////////////////////////////////////
BasisMapping::BasisMapping (const Basis &basis) : ctxt_(basis.context()),
basis_(basis)
BasisMapping::BasisMapping (const Basis &basis) : basis_(basis)
{
assert(ctxt_.npcol() == 1);
nprocs_ = ctxt_.size();
myproc_ = ctxt_.myproc();
nprocs_ = basis_.npes();
myproc_ = basis_.mype();
np0_ = basis.np(0);
np1_ = basis.np(1);
......@@ -428,11 +424,11 @@ void BasisMapping::transpose_fwd(const complex<double> *zvec,
#if USE_MPI
int status = MPI_Alltoallv((double*)&sbuf[0],&scounts[0],&sdispl[0],
MPI_DOUBLE,(double*)&rbuf[0],&rcounts[0],&rdispl[0],MPI_DOUBLE,
ctxt_.comm());
basis_.comm());
if ( status != 0 )
{
cout << " BasisMapping: status = " << status << endl;
ctxt_.abort(2);
MPI_Abort(basis_.comm(),2);
}
#else
assert(sbuf.size()==rbuf.size());
......@@ -513,7 +509,7 @@ void BasisMapping::transpose_bwd(const complex<double> *ct,
#if USE_MPI
int status = MPI_Alltoallv((double*)&rbuf[0],&rcounts[0],&rdispl[0],
MPI_DOUBLE,(double*)&sbuf[0],&scounts[0],&sdispl[0],MPI_DOUBLE,
ctxt_.comm());
basis_.comm());
assert ( status == 0 );
#else
assert(sbuf.size()==rbuf.size());
......
......@@ -15,7 +15,6 @@
// BasisMapping.h
//
////////////////////////////////////////////////////////////////////////////////
// $Id: BasisMapping.h,v 1.4 2008-09-08 15:56:18 fgygi Exp $
#ifndef BASISMAPPING_H
#define BASISMAPPING_H
......@@ -24,13 +23,11 @@
#include <vector>
class Basis;
class Context;
class BasisMapping
{
private:
const Context& ctxt_;
const Basis& basis_;
int nprocs_, myproc_;
......@@ -58,8 +55,6 @@ class BasisMapping
int nvec(void) const { return nvec_; }
int zvec_size(void) const { return nvec_ * np2_; }
const Context& context(void) const { return ctxt_; }
// map a function c(G) to zvec_
void vector_to_zvec(const std::complex<double> *c,
std::complex<double> *zvec);
......
......@@ -15,7 +15,6 @@
// MLWFTransform.C
//
////////////////////////////////////////////////////////////////////////////////
// $Id: MLWFTransform.C,v 1.6 2008-09-08 15:56:18 fgygi Exp $
#include <iostream>
#include <iomanip>
......
......@@ -15,7 +15,6 @@
// MLWFTransform.h
//
////////////////////////////////////////////////////////////////////////////////
// $Id: MLWFTransform.h,v 1.5 2008-09-08 15:56:18 fgygi Exp $
#ifndef MLWFTRANSFORM_H
#define MLWFTRANSFORM_H
......@@ -28,6 +27,8 @@ class DoubleMatrix;
#include "D3vector.h"
#include "BasisMapping.h"
class Context;
class MLWFTransform
{
private:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment