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

** Post-processing: Huge cleaning

 -- Using PView
 -- Removing Writer for FEMSolution and ElementSolution (layer for PView)
 -- Adapting System
 -- Interpolator simplified (left until PView can handel arbitrary basis)

** Mesh: new method
 -- Can access all the coordinates of the vertices
 -- Used by Interpolator

** Simulations: Huge Cleaning
 -- Intializing by SmallFem for all simulations
 -- Merging all Projections into on code
 -- Use of FEMSolutions and ElementSolutions
 -- Rewriting ShowFunctionSpace to use only FEMSolution
 -- Convergence Tests done again (see further)

** Assembler: Removing SystemShowFunctionSpace
 -- Done in Simulation

** FunctionSpace:
 -- Changing interface in BasisLagrange
 -- Cyclic permutations reactivated in ReferenceSpace (see further)

** WARNING: Without cyclic permutation TetEdgeBasis does NOT converge !!
 -- Works in 2D
 -- Works with TetNodalBasis
 -- Fails with TetEdgeBasis
 -- ShowFunctionSpace shows weird thing for some Tets
 -- Implementation or math error ????

** Convergence Tests WITH cyclic permutation
 -- Works everywhere (line, tri, quad, tet)
parent 73c924c0
No related branches found
No related tags found
No related merge requests found
...@@ -153,14 +153,17 @@ project(const MElement& element, ...@@ -153,14 +153,17 @@ project(const MElement& element,
return newCoef; return newCoef;
} }
vector<fullVector<double> > BasisLagrange:: std::vector<double> BasisLagrange::
project(const MElement& element, project(const MElement& element,
const std::vector<double>& coef, const std::vector<double>& coef,
const FunctionSpaceVector& fSpace){ const FunctionSpaceVector& fSpace){
// Init New Coefs // // Init New Coefs //
const size_t size = lPoint->size1(); const size_t size = lPoint->size1();
vector<fullVector<double> > newCoef(size); const size_t dim = lPoint->size2();
vector<double> newCoef(size * 3);
fullVector<double> tmp(3);
// Interpolation at Lagrange Points // // Interpolation at Lagrange Points //
for(size_t i = 0; i < size; i++){ for(size_t i = 0; i < size; i++){
...@@ -181,9 +184,12 @@ project(const MElement& element, ...@@ -181,9 +184,12 @@ project(const MElement& element,
else else
uvw(2) = 0; uvw(2) = 0;
newCoef[i] = fSpace.interpolateInRefSpace(element, tmp = fSpace.interpolateInRefSpace(element,
coef, coef,
uvw); uvw);
newCoef[i * 3 + 0] = tmp(0);
newCoef[i * 3 + 1] = tmp(1);
newCoef[i * 3 + 2] = tmp(2);
} }
// Return ; // Return ;
......
...@@ -66,7 +66,7 @@ class BasisLagrange: public BasisLocal{ ...@@ -66,7 +66,7 @@ class BasisLagrange: public BasisLocal{
const std::vector<double>& coef, const std::vector<double>& coef,
const FunctionSpaceScalar& fSpace); const FunctionSpaceScalar& fSpace);
std::vector<fullVector<double> > std::vector<double>
project(const MElement& element, project(const MElement& element,
const std::vector<double>& coef, const std::vector<double>& coef,
const FunctionSpaceVector& fSpace); const FunctionSpaceVector& fSpace);
...@@ -114,11 +114,20 @@ class BasisLagrange: public BasisLocal{ ...@@ -114,11 +114,20 @@ class BasisLagrange: public BasisLocal{
@fn BasisLagrange::project(const MElement&, const std::vector<double>&, const FunctionSpaceVector&) @fn BasisLagrange::project(const MElement&, const std::vector<double>&, const FunctionSpaceVector&)
@param element A MElement @param element A MElement
@param coef A vector of coefficient associated @param coef A vector of coefficient associated to the given Element
to the given Element @param fSpace The (vectorial) Function Space of the given Coefficients
@param fSpace The (vectorial) Function Space
of the given Coefficients
@return Projects the given Coefficients in this BasisLagrange @return Projects the given Coefficients in this BasisLagrange
The returned vector has a size three times bigger than coef,
since we need three coefficients with a Lagrange basis,
when we project a vectorial basis on it (one per direction).
The Lagranges coefficients corresponding to the ith entry of coef
are located, in the returned vector, at the index i * 3,
with the following padding:
@li index i * 3 + 0 is the projected coefficient for direction x
@li index i * 3 + 1 is the projected coefficient for direction y
@li index i * 3 + 2 is the projected coefficient for direction z
*/ */
////////////////////// //////////////////////
......
...@@ -202,7 +202,7 @@ isCyclicPermutation(const vector<size_t>& pTest, ...@@ -202,7 +202,7 @@ isCyclicPermutation(const vector<size_t>& pTest,
// Triplet to return // Triplet to return
triplet tri; triplet tri;
/*
// If no Face, we have no Cyclic Permutation // If no Face, we have no Cyclic Permutation
if(!refFaceNodeIdx.size()){ if(!refFaceNodeIdx.size()){
tri.first = false; tri.first = false;
...@@ -240,11 +240,12 @@ isCyclicPermutation(const vector<size_t>& pTest, ...@@ -240,11 +240,12 @@ isCyclicPermutation(const vector<size_t>& pTest,
// Test if we have a face cyclic permutation // Test if we have a face cyclic permutation
size_t isCyclic = isFacePermutation(refNode, testNode); size_t isCyclic = isFacePermutation(refNode, testNode);
*/
// Test if we have the same connectivity // Test if we have the same connectivity
bool isSameConnectivity = isSameEdge(pTest, pRef); bool isSameConnectivity = isSameEdge(pTest, pRef);
if(isSameConnectivity){ if(isCyclic && isSameConnectivity){
//if(isSameConnectivity){
tri.first = true; tri.first = true;
tri.second = getRefIndexPermutation(pRef, pTest); tri.second = getRefIndexPermutation(pRef, pTest);
tri.third = getReverseIndexPermutation(pRef, pTest); tri.third = getReverseIndexPermutation(pRef, pTest);
...@@ -258,7 +259,7 @@ isCyclicPermutation(const vector<size_t>& pTest, ...@@ -258,7 +259,7 @@ isCyclicPermutation(const vector<size_t>& pTest,
return tri; return tri;
} }
/*
size_t ReferenceSpace::findCorrespondingFace(const vector<size_t>& face, size_t ReferenceSpace::findCorrespondingFace(const vector<size_t>& face,
const vector<size_t>& node) const{ const vector<size_t>& node) const{
// Init Stuff // // Init Stuff //
...@@ -347,7 +348,7 @@ bool ReferenceSpace::isFacePermutation(const vector<size_t>& refNode, ...@@ -347,7 +348,7 @@ bool ReferenceSpace::isFacePermutation(const vector<size_t>& refNode,
return match; return match;
} }
*/
bool ReferenceSpace::isSameEdge(const std::vector<size_t>& pTest, bool ReferenceSpace::isSameEdge(const std::vector<size_t>& pTest,
const std::vector<size_t>& pRef) const{ const std::vector<size_t>& pRef) const{
// Set of Reference Edges // Set of Reference Edges
......
...@@ -148,7 +148,7 @@ class ReferenceSpace{ ...@@ -148,7 +148,7 @@ class ReferenceSpace{
triplet isCyclicPermutation(const std::vector<size_t>& pTest, triplet isCyclicPermutation(const std::vector<size_t>& pTest,
const std::vector<size_t>& pRef) const; const std::vector<size_t>& pRef) const;
/*
size_t findCorrespondingFace(const std::vector<size_t>& face, size_t findCorrespondingFace(const std::vector<size_t>& face,
const std::vector<size_t>& node) const; const std::vector<size_t>& node) const;
...@@ -157,7 +157,7 @@ class ReferenceSpace{ ...@@ -157,7 +157,7 @@ class ReferenceSpace{
static bool isFacePermutation(const std::vector<size_t>& refNode, static bool isFacePermutation(const std::vector<size_t>& refNode,
const std::vector<size_t>& testNode); const std::vector<size_t>& testNode);
*/
bool isSameEdge(const std::vector<size_t>& pTest, bool isSameEdge(const std::vector<size_t>& pTest,
const std::vector<size_t>& pRef) const; const std::vector<size_t>& pRef) const;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment