Commit c78abf6a authored by niklas.baumgarten's avatar niklas.baumgarten
Browse files

renamed EllipticAssemble to LagrangeEllipticAssemble

parent d81a54f2
#ifndef _DGLAPLACE_H_
#define _DGLAPLACE_H_
#include "EllipticAssemble.hpp"
#include "LagrangeEllipticAssemble.hpp"
#include "discretization/DGDiscretization.hpp"
#include "discretization/DGUtils.h"
class DGEllipticAssemble : public EllipticAssemble, public DGUtils {
class DGEllipticAssemble : public LagrangeEllipticAssemble, public DGUtils {
public:
DGDiscretization *disc;
......@@ -14,7 +14,7 @@ public:
int sign = 1;
DGEllipticAssemble(IDiscretization *disc, StochasticEllipticProblem *problem)
: EllipticAssemble(disc, problem) {
: LagrangeEllipticAssemble(disc, problem) {
this->disc = dynamic_cast<DGDiscretization *>(disc);
config.get("penalty", penalty);
config.get("sign", sign);
......
#include "EllipticAssemble.hpp"
#include "LagrangeEllipticAssemble.hpp"
void EllipticAssemble::Initialize(Vector &u) const {
void LagrangeEllipticAssemble::Initialize(Vector &u) const {
u.ClearDirichletFlags();
for (cell c = u.cells(); c != u.cells_end(); ++c) {
RowBndValues u_c(u, c);
......@@ -21,7 +21,7 @@ void EllipticAssemble::Initialize(Vector &u) const {
DirichletConsistent(u);
}
void EllipticAssemble::Residual(const cell &c, const Vector &u, Vector &r) const {
void LagrangeEllipticAssemble::Residual(const cell &c, const Vector &u, Vector &r) const {
ScalarElement elem(*disc, u, c);
RowBndValues r_c(r, c);
for (int q = 0; q < elem.nQ(); ++q) {
......@@ -54,7 +54,7 @@ void EllipticAssemble::Residual(const cell &c, const Vector &u, Vector &r) const
}
}
void EllipticAssemble::Jacobi(const cell &c, const Vector &u, Matrix &A) const {
void LagrangeEllipticAssemble::Jacobi(const cell &c, const Vector &u, Matrix &A) const {
ScalarElement E(*disc, u, c);
RowEntries A_c(A, E);
for (int q = 0; q < E.nQ(); ++q) {
......@@ -70,7 +70,7 @@ void EllipticAssemble::Jacobi(const cell &c, const Vector &u, Matrix &A) const {
}
}
double EllipticAssemble::Energy(const Vector &u) const {
double LagrangeEllipticAssemble::Energy(const Vector &u) const {
double energy = 0.0;
for (cell c = u.cells(); c != u.cells_end(); ++c) {
auto *elem = createElement(c, u);
......@@ -85,7 +85,7 @@ double EllipticAssemble::Energy(const Vector &u) const {
return sqrt(PPM->Sum(energy));
}
double EllipticAssemble::EnergyError(const Vector &u) const {
double LagrangeEllipticAssemble::EnergyError(const Vector &u) const {
double err = 0.0;
for (cell c = u.cells(); c != u.cells_end(); ++c) {
auto *elem = createElement(c, u);
......@@ -102,7 +102,7 @@ double EllipticAssemble::EnergyError(const Vector &u) const {
return sqrt(PPM->Sum(err));
}
double EllipticAssemble::L2(const Vector &u) const {
double LagrangeEllipticAssemble::L2(const Vector &u) const {
double l2 = 0.0;
for (cell c = u.cells(); c != u.cells_end(); ++c) {
auto *elem = createElement(c, u);
......@@ -116,7 +116,7 @@ double EllipticAssemble::L2(const Vector &u) const {
return sqrt(PPM->Sum(l2));
}
double EllipticAssemble::L2Error(const Vector &u) const {
double LagrangeEllipticAssemble::L2Error(const Vector &u) const {
double err = 0.0;
for (cell c = u.cells(); c != u.cells_end(); ++c) {
auto *elem = createElement(c, u);
......@@ -131,7 +131,7 @@ double EllipticAssemble::L2Error(const Vector &u) const {
return sqrt(PPM->Sum(err));
}
double EllipticAssemble::H1(const Vector &u) const {
double LagrangeEllipticAssemble::H1(const Vector &u) const {
double err = 0.0;
for (cell c = u.cells(); c != u.cells_end(); ++c) {
auto *elem = createElement(c, u);
......@@ -146,7 +146,7 @@ double EllipticAssemble::H1(const Vector &u) const {
return sqrt(PPM->Sum(err));
}
double EllipticAssemble::L2CellAverageError(const Vector &u) const {
double LagrangeEllipticAssemble::L2CellAverageError(const Vector &u) const {
double err = 0;
for (cell c = u.cells(); c != u.cells_end(); ++c) {
auto *elem = createElement(c, u);
......@@ -164,7 +164,7 @@ double EllipticAssemble::L2CellAverageError(const Vector &u) const {
return sqrt(PPM->Sum(err));
}
double EllipticAssemble::MaxError(const Vector &u) const {
double LagrangeEllipticAssemble::MaxError(const Vector &u) const {
double err = 0;
for (cell c = u.cells(); c != u.cells_end(); ++c) {
auto *elem = createElement(c, u);
......@@ -177,7 +177,7 @@ double EllipticAssemble::MaxError(const Vector &u) const {
return PPM->Max(err);
}
double EllipticAssemble::FluxError(const Vector &u) const {
double LagrangeEllipticAssemble::FluxError(const Vector &u) const {
double flux_error = 0;
for (cell c = u.cells(); c != u.cells_end(); ++c) {
BFParts bnd(u.GetMesh(), c);
......@@ -208,7 +208,7 @@ double EllipticAssemble::FluxError(const Vector &u) const {
return sqrt(PPM->Sum(flux_error));
}
double EllipticAssemble::FaceError(const Vector &u) const {
double LagrangeEllipticAssemble::FaceError(const Vector &u) const {
double face_error = 0;
for (cell c = u.cells(); c != u.cells_end(); ++c) {
for (int face = 0; face < c.Faces(); ++face) {
......@@ -225,7 +225,7 @@ double EllipticAssemble::FaceError(const Vector &u) const {
return sqrt(PPM->Sum(face_error));
}
std::pair<double, double> EllipticAssemble::InflowOutflow(const Vector &u) const {
std::pair<double, double> LagrangeEllipticAssemble::InflowOutflow(const Vector &u) const {
double inflow = 0;
double outflow = 0;
for (cell c = u.cells(); c != u.cells_end(); ++c) {
......@@ -248,7 +248,7 @@ std::pair<double, double> EllipticAssemble::InflowOutflow(const Vector &u) const
}
std::pair<double,
double> EllipticAssemble::PrescribedInflowOutflow(const Vector &u) const {
double> LagrangeEllipticAssemble::PrescribedInflowOutflow(const Vector &u) const {
double inflow = 0;
double outflow = 0;
for (cell c = u.cells(); c != u.cells_end(); ++c) {
......@@ -270,7 +270,7 @@ std::pair<double,
return {PPM->Sum(inflow), PPM->Sum(outflow)};
}
std::pair<double, double> EllipticAssemble::OutflowLeftRight(const Vector &u) const {
std::pair<double, double> LagrangeEllipticAssemble::OutflowLeftRight(const Vector &u) const {
double outflowLeft = 0;
double outflowRight = 0;
for (cell c = u.cells(); c != u.cells_end(); ++c) {
......@@ -292,7 +292,7 @@ std::pair<double, double> EllipticAssemble::OutflowLeftRight(const Vector &u) co
return {PPM->Sum(outflowLeft), PPM->Sum(outflowRight)};
}
double EllipticAssemble::GoalFunctional(const Vector &u) const {
double LagrangeEllipticAssemble::GoalFunctional(const Vector &u) const {
double goal = 0;
for (cell c = u.cells(); c != u.cells_end(); ++c) {
BFParts bnd(u.GetMesh(), c);
......@@ -315,13 +315,13 @@ double EllipticAssemble::GoalFunctional(const Vector &u) const {
return PPM->Sum(goal);
}
void EllipticAssemble::SetExactSolution(Vector &u_ex) const {
void LagrangeEllipticAssemble::SetExactSolution(Vector &u_ex) const {
for (row r = u_ex.rows(); r != u_ex.rows_end(); ++r) {
u_ex(r, 0) = problem->Solution(r());
}
}
void EllipticAssemble::SetFlux(const Vector &u, Vector &flux) {
void LagrangeEllipticAssemble::SetFlux(const Vector &u, Vector &flux) {
for (cell c = u.cells(); c != u.cells_end(); ++c) {
auto *elem = createElement(c, u);
VectorField F = zero;
......@@ -340,7 +340,7 @@ void EllipticAssemble::SetFlux(const Vector &u, Vector &flux) {
}
}
void EllipticAssemble::AssembleTransfer(TransferMatrix &TM) const {
void LagrangeEllipticAssemble::AssembleTransfer(TransferMatrix &TM) const {
TM = 0;
const matrixgraph &cg = TM.CoarseMatrixGraph();
for (cell c = cg.cells(); c != cg.cells_end(); ++c) {
......
......@@ -6,15 +6,15 @@
#include "elements/Elements.h"
#include "IEllipticAssemble.hpp"
class EllipticAssemble : public IEllipticAssemble {
class LagrangeEllipticAssemble : public IEllipticAssemble {
public:
IDiscretization *disc;
StochasticEllipticProblem *problem;
EllipticAssemble(IDiscretization *disc, StochasticEllipticProblem *problem)
LagrangeEllipticAssemble(IDiscretization *disc, StochasticEllipticProblem *problem)
: disc(disc), problem(problem) {}
const char *Name() const override { return "Lagrange Finite Elements"; }
const char *Name() const override { return "LagrangeEllipticAssemble"; }
void PrintInfo(const Vector &u) const override {
int verbose = 1;
......
#ifndef _MIXED_H_
#define _MIXED_H_
#include "EllipticAssemble.hpp"
#include "LagrangeEllipticAssemble.hpp"
class MixedEllipticAssemble : public EllipticAssemble {
class MixedEllipticAssemble : public LagrangeEllipticAssemble {
public:
MixedEllipticAssemble(IDiscretization *disc, StochasticEllipticProblem *problem) :
EllipticAssemble(disc, problem) {};
LagrangeEllipticAssemble(disc, problem) {};
const char *Name() const override { return "Mixed Finite Elements"; }
......
......@@ -175,7 +175,7 @@ shared_ptr<IAssemble> MainProgram::createAssemble() {
if (ellipticProblem != nullptr) {
if (modelName == "LagrangeFEM")
return std::make_shared<EllipticAssemble>(disc.get(), ellipticProblem.get());
return std::make_shared<LagrangeEllipticAssemble>(disc.get(), ellipticProblem.get());
if (modelName == "MixedFEM")
return std::make_shared<MixedEllipticAssemble>(disc.get(),
ellipticProblem.get());
......
#ifndef MLMC_MLMCMAIN_H
#define MLMC_MLMCMAIN_H
#include"assemble/EllipticAssemble.hpp"
#include"assemble/LagrangeEllipticAssemble.hpp"
#include"assemble/MixedEllipticAssemble.hpp"
#include"assemble/DGEllipticAssemble.hpp"
#include"assemble/HybridEllipticAssemble.hpp"
......
......@@ -2,7 +2,7 @@
#define MLMC_MONTECARLOELLIPTIC_H
#include "MonteCarlo.hpp"
#include "assemble/EllipticAssemble.hpp"
#include "assemble/LagrangeEllipticAssemble.hpp"
class MonteCarloElliptic : public MonteCarlo {
......@@ -19,7 +19,7 @@ protected:
Vector &solution) override;
public:
EllipticAssemble *assemble;
LagrangeEllipticAssemble *assemble;
MatrixGraphs cellMatrixGraphs;
MatrixGraphs solMatrixGraphs;
......@@ -34,7 +34,7 @@ public:
bool onlyFineLevel,
Meshes *meshes,
StochasticField *stochFields,
EllipticAssemble *assemble) :
LagrangeEllipticAssemble *assemble) :
MonteCarlo(l, dM, onlyFineLevel, meshes, stochFields),
assemble(assemble),
cellMatrixGraphs(MatrixGraphs(*meshes, dof("cell", 3))),
......
......@@ -14,7 +14,7 @@ void MultilevelMonteCarlo::initializeMapMonteCarlo() {
}
MonteCarlo *MultilevelMonteCarlo::createMonteCarlo(int l, int dM, bool onlyFineLevel) {
auto ellipticAssemble = dynamic_cast<EllipticAssemble *>(assemble);
auto ellipticAssemble = dynamic_cast<LagrangeEllipticAssemble *>(assemble);
auto transportAssemble = dynamic_cast<DGTransportAssemble *>(assemble);
if (ellipticAssemble != nullptr)
return new MonteCarloElliptic(l, dM, onlyFineLevel, meshes,
......
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