Skip to content
Snippets Groups Projects
Commit 28b722b7 authored by Nicolas Marsic's avatar Nicolas Marsic
Browse files

Auto mapping part 1

parent 44f2054e
No related branches found
No related tags found
No related merge requests found
...@@ -12,11 +12,11 @@ LocalFunctionSpace::~LocalFunctionSpace(void){ ...@@ -12,11 +12,11 @@ LocalFunctionSpace::~LocalFunctionSpace(void){
void LocalFunctionSpace::selectTransform(int form){ void LocalFunctionSpace::selectTransform(int form){
switch(form){ switch(form){
case 0: case 0:
transform = jac::map; transform = LocalFunctionSpace::form0;
break; break;
case 1: case 1:
transform = jac::grad; transform = LocalFunctionSpace::form1;
break; break;
case 2: case 2:
...@@ -28,7 +28,7 @@ void LocalFunctionSpace::selectTransform(int form){ ...@@ -28,7 +28,7 @@ void LocalFunctionSpace::selectTransform(int form){
break; break;
default: default:
throw Exception ("Unknow %d-form", from); throw Exception ("Unknow %d-form", form);
break; break;
} }
} }
...@@ -25,7 +25,10 @@ class LocalFunctionSpace{ ...@@ -25,7 +25,10 @@ class LocalFunctionSpace{
int type; int type;
Jacobian* jac; Jacobian* jac;
JacMethod transform; fullVector<double> (*transform)(const Jacobian&,
double,
double,
double);
public: public:
//! Deletes this LocalFunctionSpace //! Deletes this LocalFunctionSpace
...@@ -61,7 +64,24 @@ class LocalFunctionSpace{ ...@@ -61,7 +64,24 @@ class LocalFunctionSpace{
//! @param form The @em type of the Basis used //! @param form The @em type of the Basis used
void selectTransform(int form); void selectTransform(int form);
//! Mapping of 0-form
//! @param jac The Jacobian to use
//! @param u,v,w The @em reference coordinate to map
//! @return Returns The mapped coordinate in the @em physical space
static fullVector<double> form0(const Jacobian& jac,
double u,
double v,
double w);
//! Mapping of 1-form
//! @param jac The Jacobian to use
//! @param u,v,w The @em reference coordinate to map
//! @return Returns The mapped coordinate in the @em physical space
static fullVector<double> form1(const Jacobian& jac,
double u,
double v,
double w);
}; };
////////////////////// //////////////////////
...@@ -79,4 +99,19 @@ inline int LocalFunctionSpace::getSize(void) const{ ...@@ -79,4 +99,19 @@ inline int LocalFunctionSpace::getSize(void) const{
inline int LocalFunctionSpace::getType(void) const{ inline int LocalFunctionSpace::getType(void) const{
return type; return type;
} }
inline fullVector<double> LocalFunctionSpace::form0(const Jacobian& jac,
double u,
double v,
double w){
return jac.map(u, v);
}
inline fullVector<double> LocalFunctionSpace::form1(const Jacobian& jac,
double u,
double v,
double w){
return jac.grad(u, v);
}
#endif #endif
...@@ -10,7 +10,10 @@ LocalFunctionSpaceScalar::LocalFunctionSpaceScalar(const Basis& basis){ ...@@ -10,7 +10,10 @@ LocalFunctionSpaceScalar::LocalFunctionSpaceScalar(const Basis& basis){
this->scalar = true; this->scalar = true;
this->size = b.getSize(); this->size = b.getSize();
this->type = b.getType();
this->basis = &(b.getBasis()); this->basis = &(b.getBasis());
selectTransform(type);
} }
LocalFunctionSpaceScalar::~LocalFunctionSpaceScalar(void){ LocalFunctionSpaceScalar::~LocalFunctionSpaceScalar(void){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment