61 , m_nodes_coordinates(nodesCoordinates)
68 bool isInside(
const Face& face)
72 if (isInside(m_nodes_coordinates[node]))
82 const Real3 m_lower_left, m_upper_right;
91 : m_nodes_coordinates(nodesCoordinates),
92 m_distance(distance) { }
94 bool operator()(
const Face & faceA,
const Face & faceB)
107 const Real m_distance;
114 typedef std::pair<Integer,Integer> IntPair;
115 bool operator()(
const IntPair & a,
const IntPair &
b)
const {
116 if (a.first ==
b.first)
117 return a.second <
b.second;
119 return a.first <
b.first;
121 static IntPair order(
const IntPair &
p) {
122 if (
p.first >
p.second)
123 return IntPair(
p.second,
p.first);
129 static void surfaceSetup(std::map<NodeComparator::IntPair, Integer > & edges,
FaceGroup group,
IGeometry * geometry) {
130 typedef NodeComparator::IntPair IntPair;
131 Real3 normal(0.,0.,0.);
137 const IntPair
p = NodeComparator::order(IntPair(nodes[i].localId(),nodes[(i+1)%
nnodes].localId()));
145 void operator()(
const NodeComparator::IntPair &
p) {
149 mapNodes[
p.first] = mapNodes[
p.second] = newRef();
151 mapNodes[
p.first] = mapNodes[
p.second];
153 mapNodes[
p.second] = mapNodes[
p.first];
155 allRefs[mapNodes[
p.second]-1] = allRefs[mapNodes[
p.first]-1];
162 refSet.insert(*allRefs[i]);
167 std::vector<std::shared_ptr<Integer> > allRefs;
168 typedef std::map<Integer,Integer> MapNodes;
173 allRefs.push_back(std::shared_ptr<Integer>(
new Integer(
ref)));
179 static void exchange_items(
IMesh * mesh,
184 if (mesh ==
NULL) traceMng->
fatal() <<
"Incompatible Mesh type";
194 exchanger->addSender(
isd);
195 exchanger->initializeCommunicationsMessages();
197 for(
Integer i=0, ns=exchanger->nbSender(); i<ns; ++i)
207 exchanger->processExchange();
209 for(
Integer i=0, ns=exchanger->nbReceiver(); i<ns; ++i )
216 mesh->
modifier()->endUpdate(
true,
false);
219 Timer migrationTimer;
220 Timer corefinementTimer;
269 m_internal->corefinementTimer.
start();
270 m_internal->migrationTimer.
start();
272 pinfo() <<
"Surface infos berfore migration "
273 << m_master_group.
name() <<
"(" << m_master_group.
size() <<
") and "
274 << m_slave_group.
name() <<
"(" << m_slave_group.
size() <<
")";
282 const VariableNodeReal3 & nodesCoordinates = PRIMARYMESH_CAST(mesh())->nodesCoordinates();
330 const Integer nbSubDomain = subDomain()->nbSubDomain();
342#ifndef NO_USER_WARNING
343#warning "optimisations possibles"
346 if (
i_sub_domain == subDomain()->subDomainId())
continue;
352 Cell boundaryCell =
iface->boundaryCell();
353 if (boundaryCell.
null())
354 fatal() <<
"Non boundary face used in co-refinement";
366 Cell boundaryCell =
iface->boundaryCell();
367 if (boundaryCell.
null())
368 fatal() <<
"Non boundary face used in co-refinement";
379 << m_master_group.
name() <<
"(" << m_master_group.
size() <<
") and "
380 << m_slave_group.
name() <<
"(" << m_slave_group.
size() <<
")";
382 m_internal->migrationTimer.
stop();
392 typedef Internal::NodeComparator::IntPair IntPair;
403 else if (i->second > 2)
404 fatal() <<
"Not manifold slave surface";
405 if (addEdges.connexCount() > 1)
406 fatal() <<
"Slave surface is not connex";
413 else if (i->second > 2)
414 fatal() <<
"Not manifold master surface";
415 if (addEdges.connexCount() > 1)
416 fatal() <<
"Master surface is not connex";
454#ifndef NO_USER_WARNING
455#warning "utiliser un destroySurface ???"
517 ARCANE_ASSERT((faceA.
isOwn()),(
"Non local facevoid"));
530 for(FaceFaceContactList::iterator i = m_contacts.begin(); i != m_contacts.end(); ++i)
562 for(
Integer i=0;i<nbSubDomain;++i)
567 recv_messages.push_back(std::shared_ptr<SerializeMessage>(message));
574 for(
Integer i=0;i<nbSubDomain;++i)
583 sbuf.setMode(ISerializer::ModeReserve);
584 sbuf.reserveInteger(2);
588 sbuf.allocateBuffer();
595 for(FaceFaceContactList::iterator i = m_contacts.begin(); i != m_contacts.end(); ++i)
628 std::shared_ptr<SerializeMessage> & message = *i;
630 ARCANE_ASSERT((
origDomainId != subDomain()->subDomainId()),(
"Local to local sent"));
645 ARCANE_ASSERT((faceB.
isOwn()),(
"Not local information recieved"));
666 ARCANE_ASSERT((faceB.
isOwn()),(
"Non local voidface"));
680 m_internal->corefinementTimer.
stop();
683 times[0] = m_internal->corefinementTimer.
totalTime();
684 times[1] = m_internal->migrationTimer.
totalTime();
686 info() <<
"Corefinement timers : all=" << times[0] <<
" migration=" << times[1] <<
" #domains=" <<
parallel_mng->commSize();