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

Method GetCoordinates

fem/python_fem.cpp:106–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104 virtual double EvaluateXYZ (double x, double y, double z) const = 0;
105
106 py::list GetCoordinates(const BaseMappedIntegrationPoint &bip ) {
107 double x[3]{0};
108 int dim = bip.GetTransformation().SpaceDim();
109 const DimMappedIntegrationPoint<1,double> *ip1;
110 const DimMappedIntegrationPoint<2,double> *ip2;
111 const DimMappedIntegrationPoint<3,double> *ip3;
112 switch(dim) {
113
114 case 1:
115 ip1 = static_cast<const DimMappedIntegrationPoint<1,double>*>(&bip);
116 x[0] = ip1->GetPoint()[0];
117 break;
118 case 2:
119 ip2 = static_cast<const DimMappedIntegrationPoint<2,double>*>(&bip);
120 x[0] = ip2->GetPoint()[0];
121 x[1] = ip2->GetPoint()[1];
122 break;
123 case 3:
124 ip3 = static_cast<const DimMappedIntegrationPoint<3,double>*>(&bip);
125 x[0] = ip3->GetPoint()[0];
126 x[1] = ip3->GetPoint()[1];
127 x[2] = ip3->GetPoint()[2];
128 break;
129 default:
130 break;
131 }
132 py::list list;
133 int i;
134 for(i=0; i<dim; i++)
135 list.append(py::float_(x[i]));
136 for(i=0; i<3; i++)
137 list.append(py::float_(0.0));
138 return list;
139 }
140};
141
142typedef CoefficientFunction CF;

Callers 1

EvaluateMethod · 0.80

Calls 2

GetTransformationMethod · 0.80
SpaceDimMethod · 0.45

Tested by

no test coverage detected