/[escript]/trunk/ripley/src/RipleyDomain.cpp
ViewVC logotype

Annotation of /trunk/ripley/src/RipleyDomain.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3733 - (hide annotations)
Fri Dec 9 04:02:56 2011 UTC (7 years, 9 months ago) by caltinay
Original Path: branches/ripleygmg_from_3668/ripley/src/RipleyDomain.cpp
File size: 26501 byte(s)
escript on ripley tests pass. However, returning 0 for number of point elements
and DOF id's are bogus.

1 caltinay 3670
2     /*******************************************************
3     *
4     * Copyright (c) 2003-2011 by University of Queensland
5     * Earth Systems Science Computational Center (ESSCC)
6     * http://www.uq.edu.au/esscc
7     *
8     * Primary Business: Queensland, Australia
9     * Licensed under the Open Software License version 3.0
10     * http://www.opensource.org/licenses/osl-3.0.php
11     *
12     *******************************************************/
13    
14     #include <ripley/RipleyDomain.h>
15     #include <escript/DataFactory.h>
16 caltinay 3691 #include <escript/FunctionSpaceFactory.h>
17     #include <pasowrap/SystemMatrixAdapter.h>
18     #include <pasowrap/TransportProblemAdapter.h>
19 caltinay 3670
20     #include <iomanip>
21    
22     using namespace std;
23 caltinay 3691 using paso::SystemMatrixAdapter;
24     using paso::TransportProblemAdapter;
25 caltinay 3670
26     namespace ripley {
27    
28 caltinay 3691 escript::Domain_ptr RipleyDomain::loadMesh(const string& filename)
29 caltinay 3670 {
30 caltinay 3691 throw RipleyException("loadMesh() not implemented");
31 caltinay 3670 }
32    
33 caltinay 3691 escript::Domain_ptr RipleyDomain::readMesh(const string& filename)
34 caltinay 3670 {
35 caltinay 3691 throw RipleyException("readMesh() not implemented");
36 caltinay 3670 }
37    
38 caltinay 3691 RipleyDomain::RipleyDomain(dim_t dim) :
39     m_numDim(dim),
40     m_status(0)
41 caltinay 3670 {
42 caltinay 3691 m_mpiInfo = Esys_MPIInfo_alloc(MPI_COMM_WORLD);
43 caltinay 3670 }
44    
45 caltinay 3691 RipleyDomain::~RipleyDomain()
46 caltinay 3670 {
47 caltinay 3691 Esys_MPIInfo_free(m_mpiInfo);
48 caltinay 3670 }
49    
50 caltinay 3691 bool RipleyDomain::isValidFunctionSpaceType(int fsType) const
51 caltinay 3670 {
52 caltinay 3691 switch (fsType) {
53 caltinay 3670 case DegreesOfFreedom:
54     case ReducedDegreesOfFreedom:
55     case Nodes:
56     case ReducedNodes:
57     case Elements:
58     case ReducedElements:
59     case FaceElements:
60     case ReducedFaceElements:
61     case Points:
62 caltinay 3691 return true;
63     default:
64 caltinay 3670 break;
65     }
66 caltinay 3691 return false;
67 caltinay 3670 }
68    
69 caltinay 3691 string RipleyDomain::functionSpaceTypeAsString(int fsType) const
70 caltinay 3670 {
71 caltinay 3691 switch (fsType) {
72     case DegreesOfFreedom: return "Ripley_DegreesOfFreedom";
73     case ReducedDegreesOfFreedom: return "Ripley_ReducedDegreesOfFreedom";
74     case Nodes: return "Ripley_Nodes";
75     case ReducedNodes: return "Ripley_Reduced_Nodes";
76     case Elements: return "Ripley_Elements";
77     case ReducedElements: return "Ripley_Reduced_Elements";
78     case FaceElements: return "Ripley_Face_Elements";
79     case ReducedFaceElements: return "Ripley_Reduced_Face_Elements";
80     case Points: return "Ripley_Points";
81     default:
82 caltinay 3670 break;
83     }
84 caltinay 3691 return "Invalid function space type code";
85 caltinay 3670 }
86    
87 caltinay 3691 pair<int,int> RipleyDomain::getDataShape(int fsType) const
88 caltinay 3670 {
89 caltinay 3691 const int ptsPerSample = (m_numDim==2 ? 4 : 8);
90     switch (fsType) {
91 caltinay 3670 case Nodes:
92 caltinay 3713 case ReducedNodes:
93 caltinay 3670 case DegreesOfFreedom:
94 caltinay 3722 case ReducedDegreesOfFreedom:
95 caltinay 3691 return pair<int,int>(1, getNumNodes());
96 caltinay 3670 case Elements:
97 caltinay 3691 return pair<int,int>(ptsPerSample, getNumElements());
98 caltinay 3670 case FaceElements:
99 caltinay 3691 return pair<int,int>(ptsPerSample/2, getNumFaceElements());
100 caltinay 3711 case ReducedElements:
101     return pair<int,int>(1, getNumElements());
102     case ReducedFaceElements:
103     return pair<int,int>(1, getNumFaceElements());
104 caltinay 3697 case Points:
105 caltinay 3733 return pair<int,int>(1, 0); //FIXME: dirac
106 caltinay 3670 default:
107     break;
108     }
109    
110 caltinay 3691 stringstream msg;
111 caltinay 3702 msg << "getDataShape(): Unsupported function space type "
112     << functionSpaceTypeAsString(fsType) << " for " << getDescription();
113 caltinay 3691 throw RipleyException(msg.str());
114 caltinay 3670 }
115    
116 caltinay 3691 string RipleyDomain::showTagNames() const
117 caltinay 3670 {
118 caltinay 3691 stringstream ret;
119     TagMap::const_iterator it;
120     for (it=m_tagMap.begin(); it!=m_tagMap.end(); it++) {
121     if (it!=m_tagMap.begin()) ret << ", ";
122     ret << it->first;
123 caltinay 3670 }
124 caltinay 3691 return ret.str();
125 caltinay 3670 }
126    
127     bool RipleyDomain::commonFunctionSpace(const vector<int>& fs, int& resultcode) const
128     {
129 caltinay 3691 /*
130     The idea is to use equivalence classes (i.e. types which can be
131     interpolated back and forth):
132 caltinay 3670 class 1: DOF <-> Nodes
133     class 2: ReducedDOF <-> ReducedNodes
134     class 3: Points
135     class 4: Elements
136     class 5: ReducedElements
137     class 6: FaceElements
138     class 7: ReducedFaceElements
139     class 8: ContactElementZero <-> ContactElementOne
140     class 9: ReducedContactElementZero <-> ReducedContactElementOne
141    
142 caltinay 3691 There is also a set of lines. Interpolation is possible down a line but not
143     between lines.
144     class 1 and 2 belong to all lines so aren't considered.
145 caltinay 3670 line 0: class 3
146     line 1: class 4,5
147     line 2: class 6,7
148     line 3: class 8,9
149    
150     For classes with multiple members (eg class 2) we have vars to record if
151     there is at least one instance. e.g. hasnodes is true if we have at least
152     one instance of Nodes.
153     */
154     if (fs.empty())
155     return false;
156     vector<int> hasclass(10);
157     vector<int> hasline(4);
158     bool hasnodes=false;
159     bool hasrednodes=false;
160     for (int i=0;i<fs.size();++i) {
161     switch (fs[i]) {
162     case Nodes: hasnodes=true; // no break is deliberate
163     case DegreesOfFreedom:
164     hasclass[1]=1;
165     break;
166     case ReducedNodes: hasrednodes=true; // no break is deliberate
167     case ReducedDegreesOfFreedom:
168     hasclass[2]=1;
169     break;
170     case Points:
171     hasline[0]=1;
172     hasclass[3]=1;
173     break;
174     case Elements:
175     hasclass[4]=1;
176     hasline[1]=1;
177     break;
178     case ReducedElements:
179     hasclass[5]=1;
180     hasline[1]=1;
181     break;
182     case FaceElements:
183     hasclass[6]=1;
184     hasline[2]=1;
185     break;
186     case ReducedFaceElements:
187     hasclass[7]=1;
188     hasline[2]=1;
189     break;
190     default:
191     return false;
192     }
193     }
194     int totlines=hasline[0]+hasline[1]+hasline[2]+hasline[3];
195    
196     // fail if we have more than one leaf group
197     // = there are at least two branches we can't interpolate between
198     if (totlines>1)
199     return false;
200     else if (totlines==1) {
201     // we have points
202 caltinay 3691 if (hasline[0]==1)
203 caltinay 3670 resultcode=Points;
204 caltinay 3691 else if (hasline[1]==1) {
205     if (hasclass[5]==1)
206 caltinay 3670 resultcode=ReducedElements;
207 caltinay 3691 else
208 caltinay 3670 resultcode=Elements;
209     } else if (hasline[2]==1) {
210 caltinay 3691 if (hasclass[7]==1)
211 caltinay 3670 resultcode=ReducedFaceElements;
212 caltinay 3691 else
213 caltinay 3670 resultcode=FaceElements;
214 caltinay 3691 } else
215     throw RipleyException("Internal Ripley Error!");
216 caltinay 3670 } else { // totlines==0
217 caltinay 3691 if (hasclass[2]==1)
218 caltinay 3670 // something from class 2
219     resultcode=(hasrednodes ? ReducedNodes : ReducedDegreesOfFreedom);
220 caltinay 3691 else // something from class 1
221 caltinay 3670 resultcode=(hasnodes ? Nodes : DegreesOfFreedom);
222     }
223     return true;
224     }
225    
226 caltinay 3732 bool RipleyDomain::probeInterpolationOnDomain(int fsType_source,
227     int fsType_target) const
228     {
229     if (fsType_target != Nodes &&
230     fsType_target != ReducedNodes &&
231     fsType_target != ReducedDegreesOfFreedom &&
232     fsType_target != DegreesOfFreedom &&
233     fsType_target != Elements &&
234     fsType_target != ReducedElements &&
235     fsType_target != FaceElements &&
236     fsType_target != ReducedFaceElements &&
237     fsType_target != Points) {
238     stringstream msg;
239     msg << "probeInterpolationOnDomain(): Invalid functionspace type "
240     << fsType_target;
241     throw RipleyException(msg.str());
242     }
243    
244     switch (fsType_source) {
245     case Nodes:
246     case DegreesOfFreedom:
247     return true;
248     case ReducedNodes:
249     case ReducedDegreesOfFreedom:
250     return (fsType_target != Nodes &&
251     fsType_target != DegreesOfFreedom);
252     case Elements:
253     return (fsType_target==Elements ||
254     fsType_target==ReducedElements);
255     case ReducedElements:
256     return (fsType_target==ReducedElements);
257     case FaceElements:
258     return (fsType_target==FaceElements ||
259     fsType_target==ReducedFaceElements);
260     case ReducedFaceElements:
261     return (fsType_target==ReducedFaceElements);
262     case Points:
263     return (fsType_target==Points);
264    
265     default: {
266     stringstream msg;
267     msg << "probeInterpolationOnDomain(): Invalid functionspace type "
268     << fsType_source;
269     throw RipleyException(msg.str());
270     }
271     }
272     }
273    
274 caltinay 3701 void RipleyDomain::interpolateOnDomain(escript::Data& target,
275     const escript::Data& in) const
276     {
277     const RipleyDomain& inDomain=dynamic_cast<const RipleyDomain&>(*(in.getFunctionSpace().getDomain()));
278     const RipleyDomain& targetDomain=dynamic_cast<const RipleyDomain&>(*(target.getFunctionSpace().getDomain()));
279     if (inDomain != *this)
280     throw RipleyException("Illegal domain of interpolant");
281     if (targetDomain != *this)
282     throw RipleyException("Illegal domain of interpolation target");
283    
284     stringstream msg;
285     msg << "interpolateOnDomain() not implemented for function space "
286     << functionSpaceTypeAsString(in.getFunctionSpace().getTypeCode())
287     << " -> "
288     << functionSpaceTypeAsString(target.getFunctionSpace().getTypeCode());
289    
290     switch (in.getFunctionSpace().getTypeCode()) {
291     case Nodes:
292 caltinay 3722 case ReducedNodes:
293 caltinay 3701 case DegreesOfFreedom:
294 caltinay 3722 case ReducedDegreesOfFreedom:
295 caltinay 3701 switch (target.getFunctionSpace().getTypeCode()) {
296 caltinay 3722 case Nodes:
297     case ReducedNodes:
298 caltinay 3701 case DegreesOfFreedom:
299 caltinay 3722 case ReducedDegreesOfFreedom:
300     // FIXME
301     copyNodalData(target, *const_cast<escript::Data*>(&in));
302 caltinay 3701 break;
303    
304     case Elements:
305 caltinay 3711 interpolateNodesOnElements(target, *const_cast<escript::Data*>(&in), false);
306 caltinay 3701 break;
307    
308 caltinay 3711 case ReducedElements:
309     interpolateNodesOnElements(target, *const_cast<escript::Data*>(&in), true);
310     break;
311    
312 caltinay 3701 case FaceElements:
313 caltinay 3711 interpolateNodesOnFaces(target, *const_cast<escript::Data*>(&in), false);
314 caltinay 3701 break;
315    
316 caltinay 3711 case ReducedFaceElements:
317     interpolateNodesOnFaces(target, *const_cast<escript::Data*>(&in), true);
318     break;
319    
320 caltinay 3701 default:
321     throw RipleyException(msg.str());
322     }
323     break;
324     default:
325     throw RipleyException(msg.str());
326     }
327     }
328    
329 caltinay 3691 escript::Data RipleyDomain::getX() const
330 caltinay 3670 {
331 caltinay 3691 return escript::continuousFunction(*this).getX();
332     }
333    
334     escript::Data RipleyDomain::getNormal() const
335     {
336     return escript::functionOnBoundary(*this).getNormal();
337     }
338    
339     escript::Data RipleyDomain::getSize() const
340     {
341     return escript::function(*this).getSize();
342     }
343    
344     void RipleyDomain::setToX(escript::Data& arg) const
345     {
346     const RipleyDomain& argDomain=dynamic_cast<const RipleyDomain&>(
347     *(arg.getFunctionSpace().getDomain()));
348     if (argDomain != *this)
349     throw RipleyException("setToX: Illegal domain of data point locations");
350     if (!arg.isExpanded())
351     throw RipleyException("setToX: Expanded Data object expected");
352    
353     if (arg.getFunctionSpace().getTypeCode()==Nodes) {
354     assembleCoordinates(arg);
355     } else {
356     // interpolate the result
357     escript::Data contData=escript::Vector(0., escript::continuousFunction(*this), true);
358     assembleCoordinates(contData);
359     interpolateOnDomain(arg, contData);
360 caltinay 3670 }
361 caltinay 3691 }
362 caltinay 3670
363 caltinay 3691 bool RipleyDomain::isCellOriented(int fsType) const
364     {
365     switch(fsType) {
366 caltinay 3670 case Nodes:
367     case DegreesOfFreedom:
368     case ReducedDegreesOfFreedom:
369 caltinay 3691 return false;
370 caltinay 3670 case Elements:
371 caltinay 3691 case FaceElements:
372     case Points:
373 caltinay 3670 case ReducedElements:
374     case ReducedFaceElements:
375 caltinay 3691 return true;
376 caltinay 3670 default:
377 caltinay 3691 break;
378 caltinay 3670 }
379 caltinay 3691 stringstream msg;
380 caltinay 3722 msg << "isCellOriented(): Illegal function space type " << fsType << " on " << getDescription();
381 caltinay 3691 throw RipleyException(msg.str());
382 caltinay 3670 }
383    
384 caltinay 3722 bool RipleyDomain::canTag(int fsType) const
385     {
386     switch(fsType) {
387     case Nodes:
388     case Elements:
389     case ReducedElements:
390     case FaceElements:
391     case ReducedFaceElements:
392     return true;
393     case DegreesOfFreedom:
394     case ReducedDegreesOfFreedom:
395     case Points:
396     return false;
397     default:
398     break;
399     }
400     stringstream msg;
401     msg << "canTag(): Illegal function space type " << fsType << " on " << getDescription();
402     throw RipleyException(msg.str());
403     }
404    
405     void RipleyDomain::setTags(const int fsType, const int newTag, const escript::Data& cMask) const
406     {
407     IndexVector* target=NULL;
408     dim_t num=0;
409    
410     switch(fsType) {
411     case Nodes:
412     num=getNumNodes();
413     target=&m_nodeTags;
414     break;
415     case Elements:
416     case ReducedElements:
417     num=getNumElements();
418     target=&m_elementTags;
419     break;
420     case FaceElements:
421     case ReducedFaceElements:
422     num=getNumFaceElements();
423     target=&m_faceTags;
424     break;
425     default: {
426     stringstream msg;
427     msg << "setTags(): not implemented for " << functionSpaceTypeAsString(fsType);
428     throw RipleyException(msg.str());
429     }
430     }
431     if (target->size() != num) {
432     target->assign(num, -1);
433     }
434    
435     escript::Data& mask=*const_cast<escript::Data*>(&cMask);
436     #pragma omp parallel for
437     for (index_t i=0; i<num; i++) {
438     if (mask.getSampleDataRO(i)[0] > 0) {
439     (*target)[i]=newTag;
440     }
441     }
442     updateTagsInUse(fsType);
443     }
444    
445     int RipleyDomain::getTagFromSampleNo(int fsType, int sampleNo) const
446     {
447     switch(fsType) {
448     case Nodes:
449     if (m_nodeTags.size() > sampleNo)
450     return m_nodeTags[sampleNo];
451     break;
452     case Elements:
453     case ReducedElements:
454     if (m_elementTags.size() > sampleNo)
455     return m_elementTags[sampleNo];
456     break;
457     case FaceElements:
458     case ReducedFaceElements:
459     if (m_faceTags.size() > sampleNo)
460     return m_faceTags[sampleNo];
461     break;
462     default: {
463     stringstream msg;
464     msg << "getTagFromSampleNo(): not implemented for " << functionSpaceTypeAsString(fsType);
465     throw RipleyException(msg.str());
466     }
467     }
468     return -1;
469     }
470    
471     int RipleyDomain::getNumberOfTagsInUse(int fsType) const
472     {
473     switch(fsType) {
474     case Nodes:
475     return m_nodeTagsInUse.size();
476     case Elements:
477     case ReducedElements:
478     return m_elementTagsInUse.size();
479     case FaceElements:
480     case ReducedFaceElements:
481     return m_faceTagsInUse.size();
482     default: {
483     stringstream msg;
484     msg << "getNumberOfTagsInUse(): not implemented for " << functionSpaceTypeAsString(fsType);
485     throw RipleyException(msg.str());
486     }
487     }
488     }
489    
490     const int* RipleyDomain::borrowListOfTagsInUse(int fsType) const
491     {
492     switch(fsType) {
493     case Nodes:
494     return &m_nodeTagsInUse[0];
495     case Elements:
496     case ReducedElements:
497     return &m_elementTagsInUse[0];
498     case FaceElements:
499     case ReducedFaceElements:
500     return &m_faceTagsInUse[0];
501     default: {
502     stringstream msg;
503     msg << "borrowListOfTagsInUse(): not implemented for " << functionSpaceTypeAsString(fsType);
504     throw RipleyException(msg.str());
505     }
506     }
507     }
508    
509 caltinay 3691 void RipleyDomain::Print_Mesh_Info(const bool full) const
510 caltinay 3670 {
511 caltinay 3691 cout << "Print_Mesh_Info for " << getDescription() << " running on CPU "
512     << m_mpiInfo->rank << ". MPI size: " << m_mpiInfo->size << endl;
513     cout << "Number of dimensions: " << m_numDim << endl;
514 caltinay 3670
515 caltinay 3691 // write tags
516     if (m_tagMap.size() > 0) {
517     cout << "Tags:" << endl;
518     TagMap::const_iterator it;
519     for (it=m_tagMap.begin(); it!=m_tagMap.end(); it++) {
520     cout << " " << setw(5) << it->second << " "
521     << it->first << endl;
522     }
523 caltinay 3670 }
524     }
525    
526     int RipleyDomain::getSystemMatrixTypeId(const int solver,
527     const int preconditioner, const int package, const bool symmetry) const
528     {
529 caltinay 3691 return SystemMatrixAdapter::getSystemMatrixTypeId(solver, preconditioner,
530     package, symmetry, m_mpiInfo);
531 caltinay 3670 }
532    
533     int RipleyDomain::getTransportTypeId(const int solver, const int preconditioner,
534     const int package, const bool symmetry) const
535     {
536 caltinay 3691 return TransportProblemAdapter::getTransportTypeId(solver, preconditioner,
537     package, symmetry, m_mpiInfo);
538 caltinay 3670 }
539    
540 caltinay 3691 escript::ASM_ptr RipleyDomain::newSystemMatrix(const int row_blocksize,
541     const escript::FunctionSpace& row_functionspace,
542     const int column_blocksize,
543     const escript::FunctionSpace& column_functionspace,
544     const int type) const
545 caltinay 3670 {
546 caltinay 3691 bool reduceRowOrder=false;
547     bool reduceColOrder=false;
548     // is the domain right?
549     const RipleyDomain& row_domain=dynamic_cast<const RipleyDomain&>(*(row_functionspace.getDomain()));
550     if (row_domain!=*this)
551     throw RipleyException("Domain of row function space does not match the domain of matrix generator");
552     const RipleyDomain& col_domain=dynamic_cast<const RipleyDomain&>(*(column_functionspace.getDomain()));
553     if (col_domain!=*this)
554     throw RipleyException("Domain of column function space does not match the domain of matrix generator");
555     // is the function space type right?
556     if (row_functionspace.getTypeCode()==ReducedDegreesOfFreedom)
557     reduceRowOrder=true;
558     else if (row_functionspace.getTypeCode()!=DegreesOfFreedom)
559     throw RipleyException("Illegal function space type for system matrix rows");
560     if (column_functionspace.getTypeCode()==ReducedDegreesOfFreedom)
561     reduceColOrder=true;
562     else if (column_functionspace.getTypeCode()!=DegreesOfFreedom)
563     throw RipleyException("Illegal function space type for system matrix columns");
564    
565     // generate matrix
566     Paso_SystemMatrixPattern* pattern=getPattern(reduceRowOrder, reduceColOrder);
567     Paso_SystemMatrix* matrix = Paso_SystemMatrix_alloc(type, pattern,
568     row_blocksize, column_blocksize, FALSE);
569     paso::checkPasoError();
570     Paso_SystemMatrixPattern_free(pattern);
571     escript::ASM_ptr sma(new SystemMatrixAdapter(matrix, row_blocksize,
572     row_functionspace, column_blocksize, column_functionspace));
573     return sma;
574 caltinay 3670 }
575    
576 caltinay 3697 void RipleyDomain::setNewX(const escript::Data& arg)
577     {
578     throw RipleyException("setNewX(): Operation not supported");
579     }
580    
581 caltinay 3722 //protected
582     void RipleyDomain::copyNodalData(escript::Data& out, escript::Data& in) const
583     {
584     const dim_t numComp = in.getDataPointSize();
585     #pragma omp parallel for
586     for (index_t i=0; i<in.getNumSamples(); i++) {
587     const double* src = in.getSampleDataRO(i);
588     copy(src, src+numComp, out.getSampleDataRW(i));
589     }
590     }
591    
592     //protected
593     void RipleyDomain::updateTagsInUse(int fsType) const
594     {
595     IndexVector* tagsInUse=NULL;
596     const IndexVector* tags=NULL;
597     switch(fsType) {
598     case Nodes:
599     tags=&m_nodeTags;
600     tagsInUse=&m_nodeTagsInUse;
601     break;
602     case Elements:
603     case ReducedElements:
604     tags=&m_elementTags;
605     tagsInUse=&m_elementTagsInUse;
606     break;
607     case FaceElements:
608     case ReducedFaceElements:
609     tags=&m_faceTags;
610     tagsInUse=&m_faceTagsInUse;
611     break;
612     default:
613     return;
614     }
615    
616     // gather global unique tag values from tags into tagsInUse
617     tagsInUse->clear();
618     index_t lastFoundValue = INDEX_T_MIN, minFoundValue, local_minFoundValue;
619    
620     while (true) {
621     // find smallest value bigger than lastFoundValue
622     minFoundValue = INDEX_T_MAX;
623     #pragma omp parallel private(local_minFoundValue)
624     {
625     local_minFoundValue = minFoundValue;
626     #pragma omp for schedule(static) nowait
627     for (size_t i = 0; i < tags->size(); i++) {
628     const index_t v = (*tags)[i];
629     if ((v > lastFoundValue) && (v < local_minFoundValue))
630     local_minFoundValue = v;
631     }
632     #pragma omp critical
633     {
634     if (local_minFoundValue < minFoundValue)
635     minFoundValue = local_minFoundValue;
636     }
637     }
638     #ifdef ESYS_MPI
639     local_minFoundValue = minFoundValue;
640     MPI_Allreduce(&local_minFoundValue, &minFoundValue, 1, MPI_INT, MPI_MIN, m_mpiInfo->comm);
641     #endif
642     // if we found a new value add it to the tagsInUse vector
643    
644     if (minFoundValue < INDEX_T_MAX) {
645     tagsInUse->push_back(minFoundValue);
646     lastFoundValue = minFoundValue;
647     } else
648     break;
649     }
650     }
651    
652 caltinay 3691 //
653     // the methods that follow have to be implemented by the subclasses
654     //
655    
656     string RipleyDomain::getDescription() const
657 caltinay 3670 {
658 caltinay 3691 throw RipleyException("getDescription() not implemented");
659 caltinay 3670 }
660    
661 caltinay 3691 bool RipleyDomain::operator==(const AbstractDomain& other) const
662 caltinay 3670 {
663 caltinay 3691 throw RipleyException("operator==() not implemented");
664 caltinay 3670 }
665    
666 caltinay 3691 void RipleyDomain::write(const string& filename) const
667 caltinay 3670 {
668 caltinay 3691 throw RipleyException("write() not implemented");
669 caltinay 3670 }
670    
671 caltinay 3691 void RipleyDomain::dump(const string& filename) const
672 caltinay 3670 {
673 caltinay 3691 throw RipleyException("dump() not implemented");
674 caltinay 3670 }
675    
676 caltinay 3691 const int* RipleyDomain::borrowSampleReferenceIDs(int fsType) const
677     {
678     throw RipleyException("borrowSampleReferenceIDs() not implemented");
679     }
680 caltinay 3670
681 caltinay 3691 void RipleyDomain::interpolateACross(escript::Data& target, const escript::Data& source) const
682 caltinay 3670 {
683 caltinay 3691 throw RipleyException("interpolateACross() not implemented");
684 caltinay 3670 }
685    
686 caltinay 3691 bool RipleyDomain::probeInterpolationACross(int fsType_source,
687     const escript::AbstractDomain&, int fsType_target) const
688 caltinay 3670 {
689 caltinay 3691 throw RipleyException("probeInterpolationACross() not implemented");
690 caltinay 3670 }
691    
692 caltinay 3691 void RipleyDomain::setToNormal(escript::Data& normal) const
693 caltinay 3670 {
694 caltinay 3691 throw RipleyException("setToNormal() not implemented");
695 caltinay 3670 }
696    
697 caltinay 3691 void RipleyDomain::setToSize(escript::Data& size) const
698 caltinay 3670 {
699 caltinay 3691 throw RipleyException("setToSize() not implemented");
700 caltinay 3670 }
701    
702 caltinay 3691 void RipleyDomain::setToGradient(escript::Data& grad, const escript::Data& arg) const
703 caltinay 3670 {
704 caltinay 3691 throw RipleyException("setToGradient() not implemented");
705 caltinay 3670 }
706    
707 caltinay 3691 void RipleyDomain::setToIntegrals(vector<double>& integrals, const escript::Data& arg) const
708 caltinay 3670 {
709 caltinay 3691 throw RipleyException("setToIntegrals() not implemented");
710 caltinay 3670 }
711    
712 caltinay 3691 bool RipleyDomain::ownSample(int fsType, index_t id) const
713 caltinay 3670 {
714 caltinay 3691 throw RipleyException("ownSample() not implemented");
715 caltinay 3670 }
716    
717 caltinay 3691 void RipleyDomain::addPDEToSystem(
718     escript::AbstractSystemMatrix& mat, escript::Data& rhs,
719     const escript::Data& A, const escript::Data& B, const escript::Data& C,
720     const escript::Data& D, const escript::Data& X, const escript::Data& Y,
721     const escript::Data& d, const escript::Data& y,
722     const escript::Data& d_contact, const escript::Data& y_contact,
723     const escript::Data& d_dirac,const escript::Data& y_dirac) const
724     {
725     throw RipleyException("addPDEToSystem() not implemented");
726     }
727 caltinay 3670
728 caltinay 3691 void RipleyDomain::addPDEToLumpedSystem(escript::Data& mat,
729     const escript::Data& D, const escript::Data& d,
730     const escript::Data& d_dirac, const bool useHRZ) const
731     {
732     throw RipleyException("addPDEToLumpedSystem() not implemented");
733 caltinay 3670 }
734    
735 caltinay 3691 void RipleyDomain::addPDEToRHS(escript::Data& rhs, const escript::Data& X,
736     const escript::Data& Y, const escript::Data& y,
737     const escript::Data& y_contact, const escript::Data& y_dirac) const
738 caltinay 3670 {
739 caltinay 3691 throw RipleyException("addPDEToRHS() not implemented");
740 caltinay 3670 }
741    
742 caltinay 3691 void RipleyDomain::addPDEToTransportProblem(
743     escript::AbstractTransportProblem& tp,
744     escript::Data& source, const escript::Data& M,
745     const escript::Data& A, const escript::Data& B, const escript::Data& C,
746     const escript::Data& D, const escript::Data& X, const escript::Data& Y,
747     const escript::Data& d, const escript::Data& y,
748     const escript::Data& d_contact, const escript::Data& y_contact,
749     const escript::Data& d_dirac, const escript::Data& y_dirac) const
750 caltinay 3670 {
751 caltinay 3691 throw RipleyException("addPDEToTransportProblem() not implemented");
752 caltinay 3670 }
753    
754 caltinay 3691 escript::ATP_ptr RipleyDomain::newTransportProblem(const bool useBackwardEuler,
755     const int blocksize, const escript::FunctionSpace& functionspace,
756     const int type) const
757 caltinay 3670 {
758 caltinay 3691 throw RipleyException("newTransportProblem() not implemented");
759 caltinay 3670 }
760    
761 caltinay 3691 Paso_SystemMatrixPattern* RipleyDomain::getPattern(bool reducedRowOrder,
762     bool reducedColOrder) const
763 caltinay 3670 {
764 caltinay 3691 throw RipleyException("getPattern() not implemented");
765 caltinay 3670 }
766    
767 caltinay 3691 dim_t RipleyDomain::getNumDataPointsGlobal() const
768 caltinay 3670 {
769 caltinay 3691 throw RipleyException("getNumDataPointsGlobal() not implemented");
770 caltinay 3670 }
771    
772 caltinay 3697 IndexVector RipleyDomain::getNumNodesPerDim() const
773     {
774     throw RipleyException("getNumNodesPerDim() not implemented");
775     }
776    
777     IndexVector RipleyDomain::getNumElementsPerDim() const
778     {
779     throw RipleyException("getNumElementsPerDim() not implemented");
780     }
781    
782     IndexVector RipleyDomain::getNumFacesPerBoundary() const
783     {
784     throw RipleyException("getNumFacesPerBoundary() not implemented");
785     }
786    
787     IndexVector RipleyDomain::getNodeDistribution() const
788     {
789     throw RipleyException("getNodeDistribution() not implemented");
790     }
791    
792     pair<double,double> RipleyDomain::getFirstCoordAndSpacing(dim_t dim) const
793     {
794     throw RipleyException("getFirstCoordAndSpacing() not implemented");
795     }
796    
797 caltinay 3691 dim_t RipleyDomain::getNumFaceElements() const
798 caltinay 3670 {
799 caltinay 3691 throw RipleyException("getNumFaceElements() not implemented");
800 caltinay 3670 }
801    
802 caltinay 3691 dim_t RipleyDomain::getNumElements() const
803 caltinay 3670 {
804 caltinay 3691 throw RipleyException("getNumElements() not implemented");
805 caltinay 3670 }
806    
807 caltinay 3691 dim_t RipleyDomain::getNumNodes() const
808 caltinay 3670 {
809 caltinay 3691 throw RipleyException("getNumNodes() not implemented");
810 caltinay 3670 }
811    
812 caltinay 3691 void RipleyDomain::assembleCoordinates(escript::Data& arg) const
813 caltinay 3670 {
814 caltinay 3691 throw RipleyException("assembleCoordinates() not implemented");
815 caltinay 3670 }
816    
817 caltinay 3711 void RipleyDomain::interpolateNodesOnElements(escript::Data& out, escript::Data& in, bool reduced) const
818 caltinay 3701 {
819     throw RipleyException("interpolateNodesOnElements() not implemented");
820     }
821 caltinay 3691
822 caltinay 3711 void RipleyDomain::interpolateNodesOnFaces(escript::Data& out, escript::Data& in, bool reduced) const
823 caltinay 3701 {
824     throw RipleyException("interpolateNodesOnFaces() not implemented");
825     }
826    
827    
828 caltinay 3670 } // end of namespace ripley
829    

  ViewVC Help
Powered by ViewVC 1.1.26