mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-24 21:10:33 +05:00
materials in 2D
This commit is contained in:
parent
5e1d9a3c39
commit
105111f5c9
@ -908,7 +908,7 @@ namespace netgen
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
void SplineGeometry2d :: GetMaterial( const int domnr, char* & material )
|
void SplineGeometry2d :: GetMaterial (int domnr, char* & material )
|
||||||
{
|
{
|
||||||
if ( materials.Size() >= domnr)
|
if ( materials.Size() >= domnr)
|
||||||
material = materials[domnr-1];
|
material = materials[domnr-1];
|
||||||
@ -916,6 +916,24 @@ namespace netgen
|
|||||||
material = 0;
|
material = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SplineGeometry2d :: SetMaterial (int domnr, const string & material)
|
||||||
|
{
|
||||||
|
int oldsize = materials.Size();
|
||||||
|
if (domnr > materials.Size()) materials.SetSize (domnr);
|
||||||
|
for (int i = oldsize; i < domnr; i++)
|
||||||
|
materials[i] = nullptr;
|
||||||
|
|
||||||
|
if (domnr >= 1) // && domnr <= materials.Size())
|
||||||
|
{
|
||||||
|
delete materials[domnr-1];
|
||||||
|
materials[domnr-1] = new char[material.size()+1];
|
||||||
|
strcpy(materials[domnr-1], material.c_str());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
throw NgException ("material index out of range");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
double SplineGeometry2d :: GetDomainMaxh( const int domnr )
|
double SplineGeometry2d :: GetDomainMaxh( const int domnr )
|
||||||
{
|
{
|
||||||
|
@ -159,7 +159,8 @@ namespace netgen
|
|||||||
void CopyEdgeMesh (int from, int to, Mesh & mesh2d, Point3dTree & searchtree);
|
void CopyEdgeMesh (int from, int to, Mesh & mesh2d, Point3dTree & searchtree);
|
||||||
|
|
||||||
|
|
||||||
void GetMaterial( const int domnr, char* & material );
|
void GetMaterial (int domnr, char* & material );
|
||||||
|
void SetMaterial (int domnr, const string & material);
|
||||||
|
|
||||||
double GetDomainMaxh ( const int domnr );
|
double GetDomainMaxh ( const int domnr );
|
||||||
bool GetDomainQuadMeshing ( int domnr )
|
bool GetDomainQuadMeshing ( int domnr )
|
||||||
|
@ -123,6 +123,11 @@ DLL_HEADER void ExportGeom2d()
|
|||||||
// seg->copyfrom = -1;
|
// seg->copyfrom = -1;
|
||||||
// self.AppendSegment(seg);
|
// self.AppendSegment(seg);
|
||||||
// }))//, (bp::arg("self"), bp::arg("point_index1"), bp::arg("point_index2"), bp::arg("point_index3"), bp::arg("leftdomain") = 1, bp::arg("rightdomain") = 0 ) )
|
// }))//, (bp::arg("self"), bp::arg("point_index1"), bp::arg("point_index2"), bp::arg("point_index3"), bp::arg("leftdomain") = 1, bp::arg("rightdomain") = 0 ) )
|
||||||
|
|
||||||
|
|
||||||
|
.def("SetMaterial", &SplineGeometry2d::SetMaterial)
|
||||||
|
|
||||||
|
|
||||||
.def("PlotData", FunctionPointer([](SplineGeometry2d &self)
|
.def("PlotData", FunctionPointer([](SplineGeometry2d &self)
|
||||||
{
|
{
|
||||||
Box<2> box(self.GetBoundingBox());
|
Box<2> box(self.GetBoundingBox());
|
||||||
|
Loading…
Reference in New Issue
Block a user