Commit 0a2a795c authored by Fabian's avatar Fabian
Browse files

TODO: FOUND ERROR IN FEBasis (currently temporary dirty fix working ONLY mesh 2d)

parent 3a8d91af
......@@ -14,7 +14,7 @@
//#include <eth_base/timer.hpp>
// BETL2 includes ---------------------------------------------------------------------
//#include <cmdl_parser/cmdl_parser.hpp>
#include <cmdl_parser/cmdl_parser.hpp>
#include <gmsh_input/gmsh_input.hpp>
//#include <gmsh_input/grid_elements_identifier.hpp>
#include <grid/grid_creator.hpp>
......@@ -40,7 +40,7 @@
//#include "../Testing/ExFEBasis.hpp"
/*
template<class FE_SPACE, class GRIDVIEW>
void info(const FE_SPACE& fe_space, const GRIDVIEW& gv) {
......@@ -55,15 +55,15 @@ void info(const FE_SPACE& fe_space, const GRIDVIEW& gv) {
}
std::cout << "No. of DoFs=" << fe_space.numDofs() << '\n';
}
*/
int main(int argc, char* argv[]) {
// Initializing the grid (input taken from command line)
// const std::string basename = betl2::parseCommandLine(argc, argv);
const std::string basename = betl2::parseCommandLine(argc, argv);
// const std::string basename = "../Examples/RefinedMeshes/squareTria_4";
const std::string basename = "../Examples/TestCase0/square";
// const std::string basename = "../Examples/TestCase0/square";
typedef betl2::input::gmsh::Input input_t;
typedef betl2::input::InputInterface<input_t> inpInterface_t;
input_t input(basename);
......@@ -88,7 +88,7 @@ int main(int argc, char* argv[]) {
// setTagMapper(gridView);
/////// Testing TestFEBasis
betl2::fe::TestFEBasis<gridFactory_t> febasis(gridFactory);
betl2::fe::ex::FEBasis<gridFactory_t> febasis(gridFactory);
/*
int i = -1;
......@@ -129,8 +129,11 @@ int main(int argc, char* argv[]) {
}
*/
for(auto& e : gridView.template entities<gridTraits_t::dimMesh>()) {
febasis.setMult(e, 1);
for(auto& e : gridView.template entities<0>()) {
if( e.refElType() == eth::base::RefElType::QUAD)
febasis.setMult(e, 13);
else
febasis.setMult(e, 1);
}
//std::cout << gridTraits_t::dimMesh << '\n' << gridTraits_t::dimWorld << '\n';
......@@ -146,7 +149,7 @@ int main(int argc, char* argv[]) {
// typedef betl2::fe::FEBasis<betl2::fe::Linear,
// betl2::fe::FEBasisType::Lagrange> febasis_t;
typedef betl2::fe::ex::DofHandler<
betl2::fe::TestFEBasis<gridFactory_t>,
betl2::fe::ex::FEBasis<gridFactory_t>,
// febasis_t, betl2::fe::FESContinuity::Continuous,
gridFactory_t> DH_t;
DH_t dh;
......@@ -162,7 +165,7 @@ int main(int argc, char* argv[]) {
// Get FESpace
const auto& fe_space = dh.fespace();
// Print info
// info(fe_space, gridView);
info(fe_space, gridView);
// std::cout << "\n\n";
// info(boundary_fes, gridView);
......
......@@ -101,7 +101,7 @@ namespace betl2 {
//! Type of eth::grid::IndexSet
typedef eth::grid::IndexSet<gridTraits_t , typename viewTraits_t::indexSet_t>
indexSet_t;
typedef std::array<std::vector<unsigned>, gridTraits_t::dimMesh+1> set_t;
typedef std::array<std::vector<unsigned>, gridTraits_t::dimMesh+2> set_t;
/*! Constructor
......@@ -119,6 +119,8 @@ namespace betl2 {
const decltype( gridView_ )&,
set_t&> static_iterate;
static_iterate()( gridView_, multiplicities_);
std::get<3>(multiplicities_).resize(indexSet_->size(eth::base::RefElType::QUAD));
}
//! @attention needed for interpolation (set to Lagrange)
......@@ -135,7 +137,10 @@ namespace betl2 {
template< int CODIM >
void setMult(const eth::grid::Entity<gridTraits_t, CODIM>& ent,
const size_type mult) {
multiplicities_[CODIM].at(gridView_.indexSet().index(ent)) = mult;
if( ent.refElType() == eth::base::RefElType::QUAD)
multiplicities_[3].at(gridView_.indexSet().index(ent)) = mult;
else
multiplicities_[CODIM].at(gridView_.indexSet().index(ent)) = mult;
}
......@@ -146,7 +151,10 @@ namespace betl2 {
*/
template< int CODIM >
size_type multiplicity(const eth::grid::Entity<gridTraits_t, CODIM>& ent) const {
return multiplicities_[CODIM].at(gridView_.indexSet().index(ent));
if( ent.refElType() == eth::base::RefElType::QUAD)
return multiplicities_[3].at(gridView_.indexSet().index(ent));
else
return multiplicities_[CODIM].at(gridView_.indexSet().index(ent));
}
/*! @return total number of degrees of freedom for an element.
......@@ -158,7 +166,11 @@ namespace betl2 {
size_type numDofs(const eth::grid::Entity<gridTraits_t,0>& elem) const
{
// Get degrees of freedom for this element (without its subentities)
size_type dofs = multiplicities_[0].at( gridView_.indexSet().index(elem) );
size_type dofs = 0;
if( elem.refElType() == eth::base::RefElType::QUAD)
dofs += multiplicities_[3].at(gridView_.indexSet().index(elem));
else
dofs += multiplicities_[0].at( gridView_.indexSet().index(elem) );
// Retrieve all degrees of freedom of the subentities of this element
typedef betl2::utils::static_iterate< gridTraits_t::dimMesh-1,
......
Supports Markdown
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