Last change
on this file since 13975 was 13975, checked in by Mathieu Morlighem, 12 years ago |
merged trunk-jpl and trunk for revision 13974
|
File size:
1.3 KB
|
Rev | Line | |
---|
[4217] | 1 | /*
|
---|
| 2 | * \file Constraints.c
|
---|
| 3 | * \brief: implementation of the Constraints class, derived from DataSet class
|
---|
| 4 | */
|
---|
| 5 |
|
---|
[12706] | 6 | /*Headers: {{{*/
|
---|
[4217] | 7 | #ifdef HAVE_CONFIG_H
|
---|
[9320] | 8 | #include <config.h>
|
---|
[4217] | 9 | #else
|
---|
| 10 | #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
|
---|
| 11 | #endif
|
---|
| 12 |
|
---|
| 13 | #include <vector>
|
---|
| 14 | #include <functional>
|
---|
| 15 | #include <algorithm>
|
---|
| 16 | #include <iostream>
|
---|
| 17 |
|
---|
| 18 | #include "./DataSet.h"
|
---|
| 19 | #include "../shared/shared.h"
|
---|
| 20 | #include "../include/include.h"
|
---|
| 21 | #include "../EnumDefinitions/EnumDefinitions.h"
|
---|
| 22 |
|
---|
| 23 | using namespace std;
|
---|
| 24 | /*}}}*/
|
---|
| 25 |
|
---|
| 26 | /*Object constructors and destructor*/
|
---|
[12706] | 27 | /*FUNCTION Constraints::Constraints(){{{*/
|
---|
[4217] | 28 | Constraints::Constraints(){
|
---|
[10522] | 29 | enum_type=ConstraintsEnum;
|
---|
[4217] | 30 | return;
|
---|
| 31 | }
|
---|
| 32 | /*}}}*/
|
---|
[12706] | 33 | /*FUNCTION Constraints::~Constraints(){{{*/
|
---|
[4217] | 34 | Constraints::~Constraints(){
|
---|
| 35 | return;
|
---|
| 36 | }
|
---|
| 37 | /*}}}*/
|
---|
| 38 |
|
---|
[4219] | 39 | /*Numerics: */
|
---|
[12706] | 40 | /*FUNCTION Constraints::NumberOfConstraints{{{*/
|
---|
[4220] | 41 | int Constraints::NumberOfConstraints(void){
|
---|
[4219] | 42 |
|
---|
[4220] | 43 | int localconstraints;
|
---|
| 44 | int numberofconstraints;
|
---|
| 45 |
|
---|
| 46 | /*Get number of local constraints*/
|
---|
| 47 | localconstraints=this->Size();
|
---|
| 48 |
|
---|
| 49 | /*figure out total number of constraints combining all the cpus (no clones here)*/
|
---|
[12330] | 50 | #ifdef _HAVE_MPI_
|
---|
[13975] | 51 | MPI_Reduce(&localconstraints,&numberofconstraints,1,MPI_INT,MPI_SUM,0,IssmComm::GetComm() );
|
---|
| 52 | MPI_Bcast(&numberofconstraints,1,MPI_INT,0,IssmComm::GetComm());
|
---|
[4220] | 53 | #else
|
---|
[12330] | 54 | numberofconstraints=localconstraints;
|
---|
[4220] | 55 | #endif
|
---|
| 56 |
|
---|
| 57 | return numberofconstraints;
|
---|
| 58 | }
|
---|
| 59 | /*}}}*/
|
---|
Note:
See
TracBrowser
for help on using the repository browser.