mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-24 21:10:33 +05:00
proper terms
This commit is contained in:
parent
ac45a5f736
commit
3b5c346e63
@ -1284,7 +1284,7 @@ namespace ngcore
|
||||
|
||||
/// bubble sort array
|
||||
template <class T, class S>
|
||||
inline void BubbleSort (FlatArray<T> data, FlatArray<S> slave)
|
||||
inline void BubbleSort (FlatArray<T> data, FlatArray<S> index)
|
||||
{
|
||||
for (size_t i = 0; i < data.Size(); i++)
|
||||
for (size_t j = i+1; j < data.Size(); j++)
|
||||
@ -1294,9 +1294,9 @@ namespace ngcore
|
||||
data[i] = data[j];
|
||||
data[j] = hv;
|
||||
|
||||
S hvs = slave[i];
|
||||
slave[i] = slave[j];
|
||||
slave[j] = hvs;
|
||||
S hvs = index[i];
|
||||
index[i] = index[j];
|
||||
index[j] = hvs;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -730,7 +730,7 @@ namespace netgen
|
||||
|
||||
/// bubble sort array
|
||||
template <class T, class S>
|
||||
inline void BubbleSort (NgFlatArray<T> & data, NgFlatArray<S> & slave)
|
||||
inline void BubbleSort (NgFlatArray<T> & data, NgFlatArray<S> & index)
|
||||
{
|
||||
for (int i = 0; i < data.Size(); i++)
|
||||
for (int j = i+1; j < data.Size(); j++)
|
||||
@ -740,16 +740,16 @@ namespace netgen
|
||||
data[i] = data[j];
|
||||
data[j] = hv;
|
||||
|
||||
S hvs = slave[i];
|
||||
slave[i] = slave[j];
|
||||
slave[j] = hvs;
|
||||
S hvs = index[i];
|
||||
index[i] = index[j];
|
||||
index[j] = hvs;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template <class T, class S>
|
||||
void QuickSortRec (NgFlatArray<T> & data,
|
||||
NgFlatArray<S> & slave,
|
||||
NgFlatArray<S> & index,
|
||||
int left, int right)
|
||||
{
|
||||
int i = left;
|
||||
@ -764,20 +764,20 @@ namespace netgen
|
||||
if (i <= j)
|
||||
{
|
||||
ngcore::Swap (data[i], data[j]);
|
||||
ngcore::Swap (slave[i], slave[j]);
|
||||
ngcore::Swap (index[i], index[j]);
|
||||
i++; j--;
|
||||
}
|
||||
}
|
||||
while (i <= j);
|
||||
if (left < j) QuickSortRec (data, slave, left, j);
|
||||
if (i < right) QuickSortRec (data, slave, i, right);
|
||||
if (left < j) QuickSortRec (data, index, left, j);
|
||||
if (i < right) QuickSortRec (data, index, i, right);
|
||||
}
|
||||
|
||||
template <class T, class S>
|
||||
void QuickSort (NgFlatArray<T> & data, NgFlatArray<S> & slave)
|
||||
void QuickSort (NgFlatArray<T> & data, NgFlatArray<S> & index)
|
||||
{
|
||||
if (data.Size() > 1)
|
||||
QuickSortRec (data, slave, 0, data.Size()-1);
|
||||
QuickSortRec (data, index, 0, data.Size()-1);
|
||||
}
|
||||
|
||||
|
||||
|
@ -154,7 +154,7 @@ namespace netgen
|
||||
break;
|
||||
|
||||
case 7:
|
||||
// NodeID, X, Y, Z, Type (0=Reg 1=PMaster 2=PSlave 3=CPMaster 4=CPSlave), PID:
|
||||
// NodeID, X, Y, Z, Type (0=Reg 1=PMaster 2=PMinion 3=CPMaster 4=CPMinion), PID:
|
||||
{
|
||||
cout << "read nodes" << endl;
|
||||
for(int i=0; i<nnodes; i++)
|
||||
@ -175,7 +175,7 @@ namespace netgen
|
||||
break;
|
||||
|
||||
case 9:
|
||||
// MasterNodeID, SlaveNodeID, TranslCode (1=dS1 2=dS2 3=dS1+dS2)
|
||||
// MasterNodeID, MinionNodeID, TranslCode (1=dS1 2=dS2 3=dS1+dS2)
|
||||
for(int i=0; i<nperiodicmasternodes; i++)
|
||||
{
|
||||
for(int j=0; j<2; j++)
|
||||
@ -191,7 +191,7 @@ namespace netgen
|
||||
break;
|
||||
|
||||
case 11:
|
||||
// MasterNodeID, 3-SlaveNodeID's, 3-TranslCodes (1=dS1 2=dS2 3=dS1+dS2)
|
||||
// MasterNodeID, 3-MinionNodeID's, 3-TranslCodes (1=dS1 2=dS2 3=dS1+dS2)
|
||||
for(int i=0; i<ncornerperiodicmasternodes; i++)
|
||||
{
|
||||
for(int j=0; j<4; j++)
|
||||
@ -208,7 +208,7 @@ namespace netgen
|
||||
break;
|
||||
|
||||
case 13:
|
||||
//MasterNodeID, 7-SlaveNodeID's, TranslCodes
|
||||
//MasterNodeID, 7-MinionNodeID's, TranslCodes
|
||||
for(int i=0; i<ncubicperiodicmasternodes; i++)
|
||||
{
|
||||
for(int j=0; j<8; j++)
|
||||
@ -220,7 +220,7 @@ namespace netgen
|
||||
break;
|
||||
|
||||
case 14:
|
||||
// EdgeID, NodeID0, NodeID1, Type (0=Reg 1=PMaster 2=PSlave 3=CPMaster 4=CPSlave), PID
|
||||
// EdgeID, NodeID0, NodeID1, Type (0=Reg 1=PMaster 2=PMinion 3=CPMaster 4=CPMinion), PID
|
||||
cout << "read edges" << endl;
|
||||
// nullstarted = false;
|
||||
segmentdata.SetSize(nedges);
|
||||
@ -243,7 +243,7 @@ namespace netgen
|
||||
break;
|
||||
|
||||
case 16:
|
||||
// MasterEdgeID, SlaveEdgeID, TranslCode (1=dS1 2=dS2 3=dS1+dS2)
|
||||
// MasterEdgeID, MinionEdgeID, TranslCode (1=dS1 2=dS2 3=dS1+dS2)
|
||||
for(int i=0; i<nperiodicmasteredges; i++)
|
||||
in >> dummyint >> dummyint >> dummyint;
|
||||
break;
|
||||
@ -254,7 +254,7 @@ namespace netgen
|
||||
break;
|
||||
|
||||
case 18:
|
||||
// MasterEdgeID, 3 SlaveEdgeID's, 3 TranslCode (1=dS1 2=dS2 3=dS1+dS2)
|
||||
// MasterEdgeID, 3 MinionEdgeID's, 3 TranslCode (1=dS1 2=dS2 3=dS1+dS2)
|
||||
for(int i=0; i<ncornerperiodicmasteredges; i++)
|
||||
{
|
||||
in >> dummyint;
|
||||
@ -266,7 +266,7 @@ namespace netgen
|
||||
break;
|
||||
|
||||
case 19:
|
||||
// FaceID, EdgeID0, EdgeID1, EdgeID2, FaceType (0=Reg 1=PMaster 2=PSlave), PID
|
||||
// FaceID, EdgeID0, EdgeID1, EdgeID2, FaceType (0=Reg 1=PMaster 2=PMinion), PID
|
||||
{
|
||||
//Segment seg;
|
||||
int segnum_ng[3];
|
||||
@ -343,7 +343,7 @@ namespace netgen
|
||||
break;
|
||||
|
||||
case 21:
|
||||
// MasterFaceID, SlaveFaceID, TranslCode (1=dS1 2=dS2)
|
||||
// MasterFaceID, MinionFaceID, TranslCode (1=dS1 2=dS2)
|
||||
{
|
||||
Vec<3> randomvec(-1.32834,3.82399,0.5429151);
|
||||
int maxtransl = -1;
|
||||
|
@ -158,25 +158,25 @@ void WriteAbaqusFormat (const Mesh & mesh,
|
||||
|
||||
cout << "masternode = " << masternode << " = "
|
||||
<< mesh.Point(masternode) << endl;
|
||||
NgArray<int> slaves(3);
|
||||
NgArray<int> minions(3);
|
||||
for (i = 1; i <= 3; i++)
|
||||
{
|
||||
mesh.GetIdentifications().GetPairs (i, pairs);
|
||||
for (j = 1; j <= pairs.Size(); j++)
|
||||
{
|
||||
if (pairs.Get(j).I1() == masternode)
|
||||
slaves.Elem(i) = pairs.Get(j).I2();
|
||||
minions.Elem(i) = pairs.Get(j).I2();
|
||||
}
|
||||
cout << "slave(" << i << ") = " << slaves.Get(i)
|
||||
<< " = " << mesh.Point(slaves.Get(i)) << endl;
|
||||
cout << "minion(" << i << ") = " << minions.Get(i)
|
||||
<< " = " << mesh.Point(minions.Get(i)) << endl;
|
||||
}
|
||||
|
||||
|
||||
outfile << "**\n"
|
||||
<< "*NSET,NSET=CTENODS\n"
|
||||
<< slaves.Get(1) << ", "
|
||||
<< slaves.Get(2) << ", "
|
||||
<< slaves.Get(3) << endl;
|
||||
<< minions.Get(1) << ", "
|
||||
<< minions.Get(2) << ", "
|
||||
<< minions.Get(3) << endl;
|
||||
|
||||
|
||||
outfile << "**\n"
|
||||
@ -190,7 +190,7 @@ void WriteAbaqusFormat (const Mesh & mesh,
|
||||
<< "*BOUNDARY, OP=NEW\n";
|
||||
for (j = 1; j <= 3; j++)
|
||||
{
|
||||
Vec3d v(mesh.Point(masternode), mesh.Point(slaves.Get(j)));
|
||||
Vec3d v(mesh.Point(masternode), mesh.Point(minions.Get(j)));
|
||||
double vlen = v.Length();
|
||||
int dir = 0;
|
||||
if (fabs (v.X()) > 0.9 * vlen) dir = 2;
|
||||
@ -198,7 +198,7 @@ void WriteAbaqusFormat (const Mesh & mesh,
|
||||
if (fabs (v.Z()) > 0.9 * vlen) dir = 1;
|
||||
if (!dir)
|
||||
cout << "ERROR: Problem with rigid body constraints" << endl;
|
||||
outfile << slaves.Get(j) << ", " << dir << ",, 0.\n";
|
||||
outfile << minions.Get(j) << ", " << dir << ",, 0.\n";
|
||||
}
|
||||
|
||||
outfile << "**\n"
|
||||
@ -223,7 +223,7 @@ void WriteAbaqusFormat (const Mesh & mesh,
|
||||
mpc << "4" << "\n";
|
||||
mpc << pairs.Get(j).I2() << "," << k << ", -1.0, ";
|
||||
mpc << pairs.Get(j).I1() << "," << k << ", 1.0, ";
|
||||
mpc << slaves.Get(i) << "," << k << ", 1.0, ";
|
||||
mpc << minions.Get(i) << "," << k << ", 1.0, ";
|
||||
mpc << masternode << "," << k << ", -1.0 \n";
|
||||
}
|
||||
}
|
||||
|
@ -144,11 +144,11 @@ void WriteFEAPFormat (const Mesh & mesh,
|
||||
|
||||
// BEGIN CONTACT OUTPUT
|
||||
/*
|
||||
int masterindex, slaveindex;
|
||||
int masterindex, minionindex;
|
||||
cout << "Master Surface index = ";
|
||||
cin >> masterindex;
|
||||
cout << "Slave Surface index = ";
|
||||
cin >> slaveindex;
|
||||
cout << "Minion Surface index = ";
|
||||
cin >> minionindex;
|
||||
|
||||
|
||||
// CONTACT SURFACE 1
|
||||
@ -196,7 +196,7 @@ void WriteFEAPFormat (const Mesh & mesh,
|
||||
Element2d sel = mesh.SurfaceElement(i);
|
||||
if (invertsurf)
|
||||
sel.Invert();
|
||||
if (mesh.GetFaceDescriptor(sel.GetIndex ()).BCProperty() == slaveindex)
|
||||
if (mesh.GetFaceDescriptor(sel.GetIndex ()).BCProperty() == minionindex)
|
||||
{
|
||||
zz++;
|
||||
outfile.width(14);
|
||||
|
@ -427,7 +427,7 @@ namespace netgen
|
||||
<< numedges << " "
|
||||
<< numnodes << endl << endl;
|
||||
|
||||
outfile << "// NodeID, X, Y, Z, Type (0=Reg 1=PMaster 2=PSlave 3=CPMaster 4=CPSlave), "<< uidpid <<":\n" \
|
||||
outfile << "// NodeID, X, Y, Z, Type (0=Reg 1=PMaster 2=PMinion 3=CPMaster 4=CPMinion), "<< uidpid <<":\n" \
|
||||
<< "// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n";
|
||||
|
||||
|
||||
@ -515,7 +515,7 @@ namespace netgen
|
||||
<< "// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" \
|
||||
<< n2 << "\n" \
|
||||
<< "\n" \
|
||||
<< "// MasterNodeID, SlaveNodeID, TranslCode (1=dS1 2=dS2 3=dS1+dS2):\n" \
|
||||
<< "// MasterNodeID, MinionNodeID, TranslCode (1=dS1 2=dS2 3=dS1+dS2):\n" \
|
||||
<< "// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n";
|
||||
for(int i=0; i<id_groups.Size(); i++)
|
||||
{
|
||||
@ -538,7 +538,7 @@ namespace netgen
|
||||
<< "// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" \
|
||||
<< n4 << "\n" \
|
||||
<< "\n" \
|
||||
<< "// MasterNodeID, 3-SlaveNodeID's, 3-TranslCodes (1=dS1 2=dS2 3=dS1+dS2):\n" \
|
||||
<< "// MasterNodeID, 3-MinionNodeID's, 3-TranslCodes (1=dS1 2=dS2 3=dS1+dS2):\n" \
|
||||
<< "// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n";
|
||||
|
||||
|
||||
@ -565,7 +565,7 @@ namespace netgen
|
||||
<< "// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" \
|
||||
<< n8 << "\n" \
|
||||
<< "\n" \
|
||||
<< "// MasterNodeID, 7-SlaveNodeID's, TranslCodes:\n" \
|
||||
<< "// MasterNodeID, 7-MinionNodeID's, TranslCodes:\n" \
|
||||
<< "// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n";
|
||||
for(int i=0; i<id_groups.Size(); i++)
|
||||
{
|
||||
@ -586,7 +586,7 @@ namespace netgen
|
||||
|
||||
|
||||
|
||||
outfile << "// EdgeID, NodeID0, NodeID1, Type (0=Reg 1=PMaster 2=PSlave 3=CPMaster 4=CPSlave), "<<uidpid<<":\n" \
|
||||
outfile << "// EdgeID, NodeID0, NodeID1, Type (0=Reg 1=PMaster 2=PMinion 3=CPMaster 4=CPMinion), "<<uidpid<<":\n" \
|
||||
<< "// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n";
|
||||
|
||||
|
||||
@ -760,7 +760,7 @@ namespace netgen
|
||||
<< "// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"\
|
||||
<< n2 << "\n" \
|
||||
<< "\n"\
|
||||
<< "// MasterEdgeID, SlaveEdgeID, TranslCode (1=dS1 2=dS2 3=dS1+dS2):\n"\
|
||||
<< "// MasterEdgeID, MinionEdgeID, TranslCode (1=dS1 2=dS2 3=dS1+dS2):\n"\
|
||||
<< "// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n";
|
||||
for(int i=0; i<id_groups.Size(); i++)
|
||||
{
|
||||
@ -782,7 +782,7 @@ namespace netgen
|
||||
<< "// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"\
|
||||
<< n4 << "\n" \
|
||||
<< "\n"\
|
||||
<< "// MasterEdgeID, 3 SlaveEdgeID's, 3 TranslCode (1=dS1 2=dS2 3=dS1+dS2):\n"\
|
||||
<< "// MasterEdgeID, 3 MinionEdgeID's, 3 TranslCode (1=dS1 2=dS2 3=dS1+dS2):\n"\
|
||||
<< "// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n";
|
||||
for(int i=0; i<id_groups.Size(); i++)
|
||||
{
|
||||
@ -801,7 +801,7 @@ namespace netgen
|
||||
outfile << endl;
|
||||
|
||||
|
||||
outfile << "// FaceID, EdgeID0, EdgeID1, EdgeID2, FaceType (0=Reg 1=PMaster 2=PSlave), "<<uidpid<<":\n" \
|
||||
outfile << "// FaceID, EdgeID0, EdgeID1, EdgeID2, FaceType (0=Reg 1=PMaster 2=PMinion), "<<uidpid<<":\n" \
|
||||
<< "// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n";
|
||||
|
||||
|
||||
@ -921,7 +921,7 @@ namespace netgen
|
||||
<< "// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"\
|
||||
<< n2 << "\n" \
|
||||
<< "\n"\
|
||||
<< "// MasterFaceID, SlaveFaceID, TranslCode (1=dS1 2=dS2):\n"\
|
||||
<< "// MasterFaceID, MinionFaceID, TranslCode (1=dS1 2=dS2):\n"\
|
||||
<< "// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n";
|
||||
for(int i=0; i<id_groups.Size(); i++)
|
||||
{
|
||||
|
@ -322,7 +322,7 @@ namespace netgen
|
||||
colours_sorted.SetSize(all_colours.Size()+1);
|
||||
faces_sorted = 0;
|
||||
|
||||
// Slave NgArray to identify the colours the faces were assigned to,
|
||||
// Index NgArray to identify the colours the faces were assigned to,
|
||||
// after the bubble sort routine to sort the automatic boundary
|
||||
// identifiers according to the number of surface mesh elements
|
||||
// of a given colour
|
||||
|
@ -26,7 +26,7 @@ namespace netgen
|
||||
- Use colour index 0 (zero) for all faces with no colour defined
|
||||
- Calculate the number of faces of the surface mesh for each colour
|
||||
- Sort the number of surface elements in ascending order, with the
|
||||
colour indices as a slave
|
||||
colour indices as a index
|
||||
- Use the indices of the sorted array as the BC property number
|
||||
|
||||
Example: If there are 3 colours, present in the mesh and the number
|
||||
|
@ -798,7 +798,7 @@ namespace netgen
|
||||
|
||||
|
||||
|
||||
// slaves receive the mesh from the master
|
||||
// workers receive the mesh from the master
|
||||
void Mesh :: ReceiveParallelMesh ( )
|
||||
{
|
||||
int timer = NgProfiler::CreateTimer ("ReceiveParallelMesh");
|
||||
@ -1058,7 +1058,7 @@ namespace netgen
|
||||
|
||||
|
||||
|
||||
// distribute the mesh to the slave processors
|
||||
// distribute the mesh to the worker processors
|
||||
// call it only for the master !
|
||||
void Mesh :: Distribute ()
|
||||
{
|
||||
@ -1358,7 +1358,7 @@ namespace netgen
|
||||
|
||||
|
||||
|
||||
// distribute the mesh to the slave processors
|
||||
// distribute the mesh to the worker processors
|
||||
// call it only for the master !
|
||||
void Mesh :: Distribute (NgArray<int> & volume_weights , NgArray<int> & surface_weights, NgArray<int> & segment_weights)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user