Commit a547037e authored by Thomas Witkowski's avatar Thomas Witkowski
Browse files

New source code structure for operators.

parent 52b71d1f
......@@ -120,6 +120,10 @@ $(SOURCE_DIR)/FileWriter.h $(SOURCE_DIR)/FileWriter.hh $(SOURCE_DIR)/FileWriter.
$(SOURCE_DIR)/ElementFileWriter.h $(SOURCE_DIR)/ElementFileWriter.cc \
$(SOURCE_DIR)/ElInfo.cc \
$(SOURCE_DIR)/ElInfoStack.h $(SOURCE_DIR)/ElInfoStack.cc \
$(SOURCE_DIR)/OperatorTerm.h $(SOURCE_DIR)/OperatorTerm.cc \
$(SOURCE_DIR)/ZeroOrderTerm.h $(SOURCE_DIR)/ZeroOrderTerm.cc \
$(SOURCE_DIR)/FirstOrderTerm.h $(SOURCE_DIR)/FirstOrderTerm.cc \
$(SOURCE_DIR)/SecondOrderTerm.h $(SOURCE_DIR)/SecondOrderTerm.cc \
$(SOURCE_DIR)/Operator.h $(SOURCE_DIR)/Operator.cc \
$(SOURCE_DIR)/Mesh.cc \
$(SOURCE_DIR)/MeshStructure.h $(SOURCE_DIR)/MeshStructure.cc \
......
......@@ -154,9 +154,13 @@ am__libamdis_la_SOURCES_DIST = $(SOURCE_DIR)/parallel/StdMpi.h \
$(SOURCE_DIR)/FileWriter.cc $(SOURCE_DIR)/ElementFileWriter.h \
$(SOURCE_DIR)/ElementFileWriter.cc $(SOURCE_DIR)/ElInfo.cc \
$(SOURCE_DIR)/ElInfoStack.h $(SOURCE_DIR)/ElInfoStack.cc \
$(SOURCE_DIR)/Operator.h $(SOURCE_DIR)/Operator.cc \
$(SOURCE_DIR)/Mesh.cc $(SOURCE_DIR)/MeshStructure.h \
$(SOURCE_DIR)/MeshStructure.cc \
$(SOURCE_DIR)/OperatorTerm.h $(SOURCE_DIR)/OperatorTerm.cc \
$(SOURCE_DIR)/ZeroOrderTerm.h $(SOURCE_DIR)/ZeroOrderTerm.cc \
$(SOURCE_DIR)/FirstOrderTerm.h $(SOURCE_DIR)/FirstOrderTerm.cc \
$(SOURCE_DIR)/SecondOrderTerm.h \
$(SOURCE_DIR)/SecondOrderTerm.cc $(SOURCE_DIR)/Operator.h \
$(SOURCE_DIR)/Operator.cc $(SOURCE_DIR)/Mesh.cc \
$(SOURCE_DIR)/MeshStructure.h $(SOURCE_DIR)/MeshStructure.cc \
$(SOURCE_DIR)/MeshStructure_ED.h $(SOURCE_DIR)/AMDiS.h \
$(SOURCE_DIR)/AdaptStationary.h \
$(SOURCE_DIR)/AdaptStationary.cc \
......@@ -271,7 +275,9 @@ am_libamdis_la_OBJECTS = $(am__objects_2) libamdis_la-DOFIndexed.lo \
libamdis_la-BoundaryManager.lo libamdis_la-DirichletBC.lo \
libamdis_la-RobinBC.lo libamdis_la-FileWriter.lo \
libamdis_la-ElementFileWriter.lo libamdis_la-ElInfo.lo \
libamdis_la-ElInfoStack.lo libamdis_la-Operator.lo \
libamdis_la-ElInfoStack.lo libamdis_la-OperatorTerm.lo \
libamdis_la-ZeroOrderTerm.lo libamdis_la-FirstOrderTerm.lo \
libamdis_la-SecondOrderTerm.lo libamdis_la-Operator.lo \
libamdis_la-Mesh.lo libamdis_la-MeshStructure.lo \
libamdis_la-AdaptStationary.lo \
libamdis_la-AdaptInstationary.lo libamdis_la-DOFVector.lo \
......@@ -541,6 +547,10 @@ $(SOURCE_DIR)/FileWriter.h $(SOURCE_DIR)/FileWriter.hh $(SOURCE_DIR)/FileWriter.
$(SOURCE_DIR)/ElementFileWriter.h $(SOURCE_DIR)/ElementFileWriter.cc \
$(SOURCE_DIR)/ElInfo.cc \
$(SOURCE_DIR)/ElInfoStack.h $(SOURCE_DIR)/ElInfoStack.cc \
$(SOURCE_DIR)/OperatorTerm.h $(SOURCE_DIR)/OperatorTerm.cc \
$(SOURCE_DIR)/ZeroOrderTerm.h $(SOURCE_DIR)/ZeroOrderTerm.cc \
$(SOURCE_DIR)/FirstOrderTerm.h $(SOURCE_DIR)/FirstOrderTerm.cc \
$(SOURCE_DIR)/SecondOrderTerm.h $(SOURCE_DIR)/SecondOrderTerm.cc \
$(SOURCE_DIR)/Operator.h $(SOURCE_DIR)/Operator.cc \
$(SOURCE_DIR)/Mesh.cc \
$(SOURCE_DIR)/MeshStructure.h $(SOURCE_DIR)/MeshStructure.cc \
......@@ -772,6 +782,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libamdis_la-FileWriter.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libamdis_la-FiniteElemSpace.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libamdis_la-FirstOrderAssembler.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libamdis_la-FirstOrderTerm.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libamdis_la-FixVec.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libamdis_la-GNUPlotWriter.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libamdis_la-Global.Plo@am__quote@
......@@ -789,6 +800,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libamdis_la-MpiHelper.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libamdis_la-NonLinUpdater.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libamdis_la-Operator.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libamdis_la-OperatorTerm.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libamdis_la-ParMetisPartitioner.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libamdis_la-ParallelDomainBase.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libamdis_la-ParallelDomainDbg.Plo@am__quote@
......@@ -820,6 +832,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libamdis_la-RobinBC.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libamdis_la-ScalableQuadrature.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libamdis_la-SecondOrderAssembler.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libamdis_la-SecondOrderTerm.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libamdis_la-StandardProblemIteration.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libamdis_la-StdMpi.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libamdis_la-SubAssembler.Plo@am__quote@
......@@ -835,6 +848,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libamdis_la-VertexVector.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libamdis_la-VtkWriter.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libamdis_la-ZeroOrderAssembler.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libamdis_la-ZeroOrderTerm.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcompositeFEM_la-CFE_Integration.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcompositeFEM_la-CFE_NormAndErrorFcts.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcompositeFEM_la-CompositeFEMMethods.Plo@am__quote@
......@@ -1202,6 +1216,34 @@ libamdis_la-ElInfoStack.lo: $(SOURCE_DIR)/ElInfoStack.cc
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libamdis_la_CXXFLAGS) $(CXXFLAGS) -c -o libamdis_la-ElInfoStack.lo `test -f '$(SOURCE_DIR)/ElInfoStack.cc' || echo '$(srcdir)/'`$(SOURCE_DIR)/ElInfoStack.cc
libamdis_la-OperatorTerm.lo: $(SOURCE_DIR)/OperatorTerm.cc
@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libamdis_la_CXXFLAGS) $(CXXFLAGS) -MT libamdis_la-OperatorTerm.lo -MD -MP -MF "$(DEPDIR)/libamdis_la-OperatorTerm.Tpo" -c -o libamdis_la-OperatorTerm.lo `test -f '$(SOURCE_DIR)/OperatorTerm.cc' || echo '$(srcdir)/'`$(SOURCE_DIR)/OperatorTerm.cc; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libamdis_la-OperatorTerm.Tpo" "$(DEPDIR)/libamdis_la-OperatorTerm.Plo"; else rm -f "$(DEPDIR)/libamdis_la-OperatorTerm.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(SOURCE_DIR)/OperatorTerm.cc' object='libamdis_la-OperatorTerm.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libamdis_la_CXXFLAGS) $(CXXFLAGS) -c -o libamdis_la-OperatorTerm.lo `test -f '$(SOURCE_DIR)/OperatorTerm.cc' || echo '$(srcdir)/'`$(SOURCE_DIR)/OperatorTerm.cc
libamdis_la-ZeroOrderTerm.lo: $(SOURCE_DIR)/ZeroOrderTerm.cc
@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libamdis_la_CXXFLAGS) $(CXXFLAGS) -MT libamdis_la-ZeroOrderTerm.lo -MD -MP -MF "$(DEPDIR)/libamdis_la-ZeroOrderTerm.Tpo" -c -o libamdis_la-ZeroOrderTerm.lo `test -f '$(SOURCE_DIR)/ZeroOrderTerm.cc' || echo '$(srcdir)/'`$(SOURCE_DIR)/ZeroOrderTerm.cc; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libamdis_la-ZeroOrderTerm.Tpo" "$(DEPDIR)/libamdis_la-ZeroOrderTerm.Plo"; else rm -f "$(DEPDIR)/libamdis_la-ZeroOrderTerm.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(SOURCE_DIR)/ZeroOrderTerm.cc' object='libamdis_la-ZeroOrderTerm.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libamdis_la_CXXFLAGS) $(CXXFLAGS) -c -o libamdis_la-ZeroOrderTerm.lo `test -f '$(SOURCE_DIR)/ZeroOrderTerm.cc' || echo '$(srcdir)/'`$(SOURCE_DIR)/ZeroOrderTerm.cc
libamdis_la-FirstOrderTerm.lo: $(SOURCE_DIR)/FirstOrderTerm.cc
@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libamdis_la_CXXFLAGS) $(CXXFLAGS) -MT libamdis_la-FirstOrderTerm.lo -MD -MP -MF "$(DEPDIR)/libamdis_la-FirstOrderTerm.Tpo" -c -o libamdis_la-FirstOrderTerm.lo `test -f '$(SOURCE_DIR)/FirstOrderTerm.cc' || echo '$(srcdir)/'`$(SOURCE_DIR)/FirstOrderTerm.cc; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libamdis_la-FirstOrderTerm.Tpo" "$(DEPDIR)/libamdis_la-FirstOrderTerm.Plo"; else rm -f "$(DEPDIR)/libamdis_la-FirstOrderTerm.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(SOURCE_DIR)/FirstOrderTerm.cc' object='libamdis_la-FirstOrderTerm.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libamdis_la_CXXFLAGS) $(CXXFLAGS) -c -o libamdis_la-FirstOrderTerm.lo `test -f '$(SOURCE_DIR)/FirstOrderTerm.cc' || echo '$(srcdir)/'`$(SOURCE_DIR)/FirstOrderTerm.cc
libamdis_la-SecondOrderTerm.lo: $(SOURCE_DIR)/SecondOrderTerm.cc
@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libamdis_la_CXXFLAGS) $(CXXFLAGS) -MT libamdis_la-SecondOrderTerm.lo -MD -MP -MF "$(DEPDIR)/libamdis_la-SecondOrderTerm.Tpo" -c -o libamdis_la-SecondOrderTerm.lo `test -f '$(SOURCE_DIR)/SecondOrderTerm.cc' || echo '$(srcdir)/'`$(SOURCE_DIR)/SecondOrderTerm.cc; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libamdis_la-SecondOrderTerm.Tpo" "$(DEPDIR)/libamdis_la-SecondOrderTerm.Plo"; else rm -f "$(DEPDIR)/libamdis_la-SecondOrderTerm.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(SOURCE_DIR)/SecondOrderTerm.cc' object='libamdis_la-SecondOrderTerm.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libamdis_la_CXXFLAGS) $(CXXFLAGS) -c -o libamdis_la-SecondOrderTerm.lo `test -f '$(SOURCE_DIR)/SecondOrderTerm.cc' || echo '$(srcdir)/'`$(SOURCE_DIR)/SecondOrderTerm.cc
libamdis_la-Operator.lo: $(SOURCE_DIR)/Operator.cc
@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libamdis_la_CXXFLAGS) $(CXXFLAGS) -MT libamdis_la-Operator.lo -MD -MP -MF "$(DEPDIR)/libamdis_la-Operator.Tpo" -c -o libamdis_la-Operator.lo `test -f '$(SOURCE_DIR)/Operator.cc' || echo '$(srcdir)/'`$(SOURCE_DIR)/Operator.cc; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libamdis_la-Operator.Tpo" "$(DEPDIR)/libamdis_la-Operator.Plo"; else rm -f "$(DEPDIR)/libamdis_la-Operator.Tpo"; exit 1; fi
......
......@@ -35,6 +35,7 @@
#include "Estimator.h"
#include "FileWriter.h"
#include "FiniteElemSpace.h"
#include "FirstOrderTerm.h"
#include "FixVec.h"
#include "Flag.h"
#include "Global.h"
......@@ -57,6 +58,7 @@
#include "NonLinUpdater.h"
#include "OEMSolver.h"
#include "Operator.h"
#include "OperatorTerm.h"
#include "Parameters.h"
#include "Parametric.h"
#include "PartitionElementData.h"
......@@ -71,6 +73,7 @@
#include "ProblemInterpolScal.h"
#include "ProblemNonLin.h"
#include "ProblemStatBase.h"
#include "SecondOrderTerm.h"
#include "StandardProblemIteration.h"
#include "Projection.h"
#include "QPsiPhi.h"
......@@ -92,6 +95,7 @@
#include "Triangle.h"
#include "ValueWriter.h"
#include "VtkWriter.h"
#include "ZeroOrderTerm.h"
#if HAVE_PARALLEL_DOMAIN_AMDIS
#include "parallel/InteriorBoundary.h"
......
#include "FirstOrderTerm.h"
#include "DOFVector.h"
namespace AMDiS {
// =========== VecAtQP_FOT ==========
VecAtQP_FOT::VecAtQP_FOT(DOFVectorBase<double> *dv,
AbstractFunction<double, double> *af,
WorldVector<double> *wv)
: FirstOrderTerm(af->getDegree()), vec(dv), f(af), b(wv)
{
TEST_EXIT(dv)("No vector!\n");
auxFeSpaces.insert(dv->getFESpace());
}
VecAtQP_FOT::VecAtQP_FOT(DOFVectorBase<double> *dv,
AbstractFunction<double, double> *af,
int bIdx)
: FirstOrderTerm(af->getDegree()), vec(dv), f(af)
{
TEST_EXIT(dv)("No vector!\n");
bOne = bIdx;
auxFeSpaces.insert(dv->getFESpace());
}
void VecAtQP_FOT::initElement(const ElInfo* elInfo,
SubAssembler* subAssembler,
Quadrature *quad)
{
vecAtQPs = getVectorAtQPs(vec, elInfo, subAssembler, quad);
}
void VecAtQP_FOT::getLb(const ElInfo *elInfo, int nPoints,
VectorOfFixVecs<DimVec<double> >& Lb) const
{
const DimVec<WorldVector<double> > &Lambda = elInfo->getGrdLambda();
if (bOne > -1) {
for (int iq = 0; iq < nPoints; iq++)
lb_one(Lambda, Lb[iq], (*f)(vecAtQPs[iq]));
} else if (b) {
for (int iq = 0; iq < nPoints; iq++)
lb(Lambda, *b, Lb[iq], (*f)(vecAtQPs[iq]));
} else {
for (int iq = 0; iq < nPoints; iq++)
l1(Lambda, Lb[iq], (*f)(vecAtQPs[iq]));
}
}
void VecAtQP_FOT::eval(int nPoints,
const double *uhAtQP,
const WorldVector<double> *grdUhAtQP,
const WorldMatrix<double> *D2UhAtQP,
double *result,
double fac)
{
int dow = Global::getGeo(WORLD);
if (grdUhAtQP) {
for (int iq = 0; iq < nPoints; iq++) {
double factor = (*f)(vecAtQPs[iq]);
double resultQP = 0.0;
for (int i = 0; i < dow; i++)
resultQP += grdUhAtQP[iq][i];
result[iq] += fac * factor * resultQP;
}
}
}
// =========== CoordsAtQP_FOT ===========
void CoordsAtQP_FOT::initElement(const ElInfo* elInfo,
SubAssembler* subAssembler,
Quadrature *quad)
{
coordsAtQPs = subAssembler->getCoordsAtQPs(elInfo, quad);
}
void CoordsAtQP_FOT::getLb(const ElInfo *elInfo, int nPoints,
VectorOfFixVecs<DimVec<double> >& Lb) const
{
const DimVec<WorldVector<double> > &Lambda = elInfo->getGrdLambda();
for (int iq = 0; iq < nPoints; iq++)
l1(Lambda, Lb[iq], (*g)(coordsAtQPs[iq]));
}
void CoordsAtQP_FOT::eval(int nPoints,
const double *uhAtQP,
const WorldVector<double> *grdUhAtQP,
const WorldMatrix<double> *D2UhAtQP,
double *result,
double f)
{
int dow = Global::getGeo(WORLD);
if (grdUhAtQP) {
for (int iq = 0; iq < nPoints; iq++) {
double factor = (*g)(coordsAtQPs[iq]);
double resultQP = 0.0;
for (int i = 0; i < dow; i++)
resultQP += grdUhAtQP[iq][i];
result[iq] += f * factor * resultQP;
}
}
}
// ========== VecCoordsAtQP_FOT ==========
void VecCoordsAtQP_FOT::initElement(const ElInfo* elInfo,
SubAssembler* subAssembler,
Quadrature *quad)
{
coordsAtQPs = subAssembler->getCoordsAtQPs(elInfo, quad);
}
void VecCoordsAtQP_FOT::getLb(const ElInfo *elInfo, int nPoints,
VectorOfFixVecs<DimVec<double> >& Lb) const
{
const DimVec<WorldVector<double> > &Lambda = elInfo->getGrdLambda();
for (int iq = 0; iq < nPoints; iq++)
lb(Lambda, b, Lb[iq], (*g)(coordsAtQPs[iq]));
}
void VecCoordsAtQP_FOT::eval(int nPoints,
const double *uhAtQP,
const WorldVector<double> *grdUhAtQP,
const WorldMatrix<double> *D2UhAtQP,
double *result,
double f)
{
int dow = Global::getGeo(WORLD);
if (grdUhAtQP) {
for (int iq = 0; iq < nPoints; iq++) {
double factor = (*g)(coordsAtQPs[iq]);
double resultQP = 0.0;
for (int i = 0; i < dow; i++)
resultQP += grdUhAtQP[iq][i];
result[iq] += f * factor * resultQP;
}
}
}
// ========== VectorGradient_FOT ==========
VectorGradient_FOT::VectorGradient_FOT(DOFVectorBase<double> *dv,
AbstractFunction<WorldVector<double>, WorldVector<double> > *af)
: FirstOrderTerm(af->getDegree()), vec(dv), f(af)
{
TEST_EXIT(dv)("No vector!\n");
auxFeSpaces.insert(dv->getFESpace());
}
void VectorGradient_FOT::initElement(const ElInfo* elInfo,
SubAssembler* subAssembler,
Quadrature *quad)
{
gradAtQPs = getGradientsAtQPs(vec, elInfo, subAssembler, quad);
}
void VectorGradient_FOT::getLb(const ElInfo *elInfo, int nPoints,
VectorOfFixVecs<DimVec<double> >& Lb) const
{
const DimVec<WorldVector<double> > &Lambda = elInfo->getGrdLambda();
if (f) {
for (int iq = 0; iq < nPoints; iq++)
lb(Lambda, (*f)(gradAtQPs[iq]), Lb[iq], 1.0);
} else {
for (int iq = 0; iq < nPoints; iq++)
lb(Lambda, gradAtQPs[iq], Lb[iq], 1.0);
}
}
void VectorGradient_FOT::eval(int nPoints,
const double *uhAtQP,
const WorldVector<double> *grdUhAtQP,
const WorldMatrix<double> *D2UhAtQP,
double *result,
double factor)
{
if (grdUhAtQP) {
if (f) {
for (int iq = 0; iq < nPoints; iq++) {
WorldVector<double> b = (*f)(gradAtQPs[iq]);
result[iq] += b * grdUhAtQP[iq] * factor;
}
} else {
for (int iq = 0; iq < nPoints; iq++)
result[iq] += gradAtQPs[iq] * grdUhAtQP[iq] * factor;
}
}
}
// =========== VectorFct_FOT ==========
VectorFct_FOT::VectorFct_FOT(DOFVectorBase<double> *dv,
AbstractFunction<WorldVector<double>, double> *fct)
: FirstOrderTerm(fct->getDegree()), vec(dv), vecFct(fct)
{
TEST_EXIT(dv)("No vector!\n");
auxFeSpaces.insert(dv->getFESpace());
}
void VectorFct_FOT::initElement(const ElInfo* elInfo,
SubAssembler* subAssembler,
Quadrature *quad)
{
vecAtQPs = getVectorAtQPs(vec, elInfo, subAssembler, quad);
}
void VectorFct_FOT::getLb(const ElInfo *elInfo, int nPoints,
VectorOfFixVecs<DimVec<double> >& Lb) const
{
const DimVec<WorldVector<double> > &Lambda = elInfo->getGrdLambda();
for (int iq = 0; iq < nPoints; iq++)
lb(Lambda, (*vecFct)(vecAtQPs[iq]), Lb[iq], 1.0);
}
void VectorFct_FOT::eval(int nPoints,
const double *uhAtQP,
const WorldVector<double> *grdUhAtQP,
const WorldMatrix<double> *D2UhAtQP,
double *result,
double factor)
{
if (grdUhAtQP) {
for (int iq = 0; iq < nPoints; iq++) {
WorldVector<double> b = (*vecFct)(vecAtQPs[iq]);
result[iq] += b * grdUhAtQP[iq] * factor;
}
}
}
// =========== VecFctAtQP_FOT ==========
void VecFctAtQP_FOT::initElement(const ElInfo* elInfo,
SubAssembler* subAssembler,
Quadrature *quad)
{
coordsAtQPs = subAssembler->getCoordsAtQPs(elInfo, quad);
}
void VecFctAtQP_FOT::getLb(const ElInfo *elInfo, int nPoints,
VectorOfFixVecs<DimVec<double> >& Lb) const
{
const DimVec<WorldVector<double> > &Lambda = elInfo->getGrdLambda();
for (int iq = 0; iq < nPoints; iq++)
lb(Lambda, (*g)(coordsAtQPs[iq]), Lb[iq], 1.0);
}
void VecFctAtQP_FOT::eval(int nPoints,
const double *uhAtQP,
const WorldVector<double> *grdUhAtQP,
const WorldMatrix<double> *D2UhAtQP,
double *result,
double f)
{
int dow = Global::getGeo(WORLD);
if (grdUhAtQP) {
for (int iq = 0; iq < nPoints; iq++) {
double resultQP = 0.0;
const WorldVector<double> &b = (*g)(coordsAtQPs[iq]);
for (int i = 0; i < dow; i++)
resultQP += b[i] * grdUhAtQP[iq][i];
result[iq] += f * resultQP;
}
}
}
// =========== VecGrad_FOT ===========
VecGrad_FOT::VecGrad_FOT(DOFVectorBase<double> *dv1, DOFVectorBase<double> *dv2,
BinaryAbstractFunction<WorldVector<double>, double, WorldVector<double> > *fct)
: FirstOrderTerm(fct->getDegree()), vec1(dv1), vec2(dv2), vecFct(fct)
{
TEST_EXIT(dv1)("No first vector!\n");
TEST_EXIT(dv2)("No second vector!\n");
auxFeSpaces.insert(dv1->getFESpace());
auxFeSpaces.insert(dv2->getFESpace());
}
void VecGrad_FOT::initElement(const ElInfo* elInfo,
SubAssembler* subAssembler,
Quadrature *quad)
{
vecAtQPs = getVectorAtQPs(vec1, elInfo, subAssembler, quad);
gradAtQPs = getGradientsAtQPs(vec2, elInfo, subAssembler, quad);
}
void VecGrad_FOT::initElement(const ElInfo* smallElInfo,
const ElInfo* largeElInfo,
SubAssembler* subAssembler,
Quadrature *quad)
{
vecAtQPs = getVectorAtQPs(vec1, smallElInfo, largeElInfo, subAssembler, quad);
gradAtQPs = getGradientsAtQPs(vec2, smallElInfo, largeElInfo, subAssembler, quad);
}
void VecGrad_FOT::getLb(const ElInfo *elInfo, int nPoints,
VectorOfFixVecs<DimVec<double> >& Lb) const {
const DimVec<WorldVector<double> > &Lambda = elInfo->getGrdLambda();
for (int iq = 0; iq < nPoints; iq++)
lb(Lambda, (*vecFct)(vecAtQPs[iq], gradAtQPs[iq]), Lb[iq], 1.0);
}
void VecGrad_FOT::eval(int nPoints,
const double *uhAtQP,
const WorldVector<double> *grdUhAtQP,
const WorldMatrix<double> *D2UhAtQP,
double *result,
double factor)
{
if (grdUhAtQP) {
for (int iq = 0; iq < nPoints; iq++) {
WorldVector<double> b = (*vecFct)(vecAtQPs[iq], gradAtQPs[iq]);
result[iq] += b * grdUhAtQP[iq] * factor;
}
}
}
// =========== FctGrad2_FOT ===========
void FctGrad2_FOT::initElement(const ElInfo* elInfo,
SubAssembler* subAssembler,
Quadrature *quad)
{
grad1AtQPs = subAssembler->getGradientsAtQPs(vec1, elInfo, quad);
grad2AtQPs = subAssembler->getGradientsAtQPs(vec2, elInfo, quad);
}
void FctGrad2_FOT::getLb(const ElInfo *elInfo, int nPoints,
VectorOfFixVecs<DimVec<double> >& Lb) const
{
const DimVec<WorldVector<double> > &Lambda = elInfo->getGrdLambda();
for (int iq = 0; iq < nPoints; iq++)
lb(Lambda, (*vecFct)(grad1AtQPs[iq], grad2AtQPs[iq]), Lb[iq], 1.0);
}
void FctGrad2_FOT::eval(int nPoints,
const double *uhAtQP,
const WorldVector<double> *grdUhAtQP,
const WorldMatrix<double> *D2UhAtQP,
double *result,
double factor)
{
if (grdUhAtQP) {
for (int iq = 0; iq < nPoints; iq++) {
WorldVector<double> b = (*vecFct)(grad1AtQPs[iq], grad2AtQPs[iq]);
result[iq] += b * grdUhAtQP[iq] * factor;
}
}
}
// ========== Vec2AndGradAtQP_FOT ==========
Vec2AndGradAtQP_FOT::Vec2AndGradAtQP_FOT(DOFVectorBase<double> *dv1,
DOFVectorBase<double> *dv2,
TertiaryAbstractFunction<double, double, double, WorldVector<double> > *f_, WorldVector<double> *b_)
: FirstOrderTerm(f_->getDegree()),
vec1(dv1),
vec2(dv2),
f(f_),
b(b_)
{
auxFeSpaces.insert(dv1->getFESpace());
auxFeSpaces.insert(dv2->getFESpace());
}
void Vec2AndGradAtQP_FOT::initElement(const ElInfo* elInfo,
SubAssembler* subAssembler,
Quadrature *quad)
{
vec1AtQPs = subAssembler->getVectorAtQPs(vec1, elInfo, quad);
vec2AtQPs = subAssembler->getVectorAtQPs(vec2, elInfo, quad);
gradAtQPs1 = getGradientsAtQPs(vec1, elInfo, subAssembler, quad);
}
void Vec2AndGradAtQP_FOT::getLb(const ElInfo *elInfo, int nPoints, VectorOfFixVecs<DimVec<double> >& Lb) const {
const DimVec<WorldVector<double> > &Lambda = elInfo->getGrdLambda();
for (int iq = 0; iq < nPoints; iq++) {
if (b)
lb(Lambda, *b, Lb[iq], (*f)(vec1AtQPs[iq], vec2AtQPs[iq],gradAtQPs1[iq]));
else
l1(Lambda, Lb[iq], (*f)(vec1AtQPs[iq], vec2AtQPs[iq], gradAtQPs1[iq]));
}
}
void Vec2AndGradAtQP_FOT::eval(int nPoints,
const double *uhAtQP,
const WorldVector<double> *grdUhAtQP,
const WorldMatrix<double> *D2UhAtQP,
double *result,
double fac)
{
if (grdUhAtQP)
for (int iq = 0; iq < nPoints; iq++)
result[iq] += fac *
(*f)(vec1AtQPs[iq], vec2AtQPs[iq], gradAtQPs1[iq]) *
((*b) * grdUhAtQP[iq]);
}
// ========== FctVecAtQP_FOT ==========
FctVecAtQP_FOT::FctVecAtQP_FOT(DOFVectorBase<double> *dv,
BinaryAbstractFunction<double, WorldVector<double>, double> *f_,
WorldVector<double> *b_)
: FirstOrderTerm(f_->getDegree()), vec(dv), f(f_), b(b_)
{
auxFeSpaces.insert(dv->getFESpace());
}
void FctVecAtQP_FOT::initElement(const ElInfo* elInfo,
SubAssembler* subAssembler,
Quadrature *quad)
{
vecAtQPs = subAssembler->getVectorAtQPs(vec, elInfo, quad);
coordsAtQPs = subAssembler->getCoordsAtQPs(elInfo, quad);
}
void FctVecAtQP_FOT::getLb(const ElInfo *elInfo, int nPoints,
VectorOfFixVecs<DimVec<double> >& Lb) const
{
const DimVec<WorldVector<double> > &Lambda = elInfo->getGrdLambda();
for (int iq = 0; iq < nPoints; iq++) {
if (b)
lb(Lambda, *b, Lb[iq], (*f)(coordsAtQPs[iq], vecAtQPs[iq]));
else
l1(Lambda, Lb[iq], (*f)(coordsAtQPs[iq], vecAtQPs[iq]));