MCPcopy Create free account
hub / github.com/NGSolve/ngsolve / MatrixFESpace

Method MatrixFESpace

comp/fespace.cpp:4049–4103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4047
4048
4049 MatrixFESpace ::
4050 MatrixFESpace (shared_ptr<FESpace> space, int avdim, const Flags & flags,
4051 bool checkflags)
4052 : CompoundFESpace (space->GetMeshAccess(), flags), vdim(avdim)
4053 {
4054 order = space->GetOrder();
4055 symmetric = flags.GetDefineFlag("symmetric");
4056 deviatoric = flags.GetDefineFlag("deviatoric");
4057 skewsymmetric = flags.GetDefineFlag("skewsymmetric");
4058 dgjumps = space->UsesDGCoupling();
4059
4060 if (deviatoric && !symmetric) throw Exception ("non-symmetric and deviatoric not supported");
4061 if (symmetric && skewsymmetric) throw Exception ("symmetric and skewsymmetric - not much would remain");
4062 int dim = symmetric ? vdim*(vdim+1)/2 : sqr(vdim);
4063 if (skewsymmetric) dim = vdim*(vdim-1)/2;
4064
4065 if (deviatoric && !skewsymmetric) dim--;
4066 for (int i = 0; i < dim; i++)
4067 AddSpace (space);
4068
4069 for (auto vb : { VOL, BND, BBND, BBBND })
4070 {
4071 if (auto eval = spaces[0] -> GetEvaluator(vb))
4072 {
4073 if (symmetric)
4074 {
4075 if (deviatoric)
4076 evaluator[vb] = make_shared<SymDevMatrixDifferentialOperator> (eval, vdim);
4077 else
4078 evaluator[vb] = make_shared<SymMatrixDifferentialOperator> (eval, vdim);
4079 }
4080 else if (skewsymmetric)
4081 evaluator[vb] = make_shared<SkewMatrixDifferentialOperator> (eval, vdim);
4082 else
4083 evaluator[vb] = make_shared<MatrixDifferentialOperator> (eval, vdim);
4084 }
4085
4086 if (auto fluxeval = spaces[0] -> GetFluxEvaluator(vb))
4087 {
4088 if (!symmetric && !skewsymmetric && !deviatoric)
4089 flux_evaluator[vb] = make_shared<MatrixDifferentialOperator> (fluxeval, vdim);
4090 }
4091 }
4092
4093 auto additional = spaces[0]->GetAdditionalEvaluators();
4094 if (!symmetric && !skewsymmetric && !deviatoric)
4095 for (int i = 0; i < additional.Size(); i++)
4096 additional_evaluators.Set (additional.GetName(i),
4097 make_shared<MatrixDifferentialOperator>(additional[i], vdim));
4098
4099 type = string((symmetric) ? "Sym" : "") + string((skewsymmetric) ? "Skew" : "") + (deviatoric ? "Dev" : "") + "Matrix" + (*this)[0]->type;
4100
4101 for (VorB vb : {VOL, BND, BBND, BBBND})
4102 definedon[vb] = space->DefinedOn(vb);
4103 }
4104
4105 string MatrixFESpace :: GetClassName () const
4106 {

Callers

nothing calls this directly

Calls 7

GetMeshAccessMethod · 0.80
GetOrderMethod · 0.45
SizeMethod · 0.45
SetMethod · 0.45
GetNameMethod · 0.45
DefinedOnMethod · 0.45

Tested by

no test coverage detected