source: issm/trunk-jpl/src/c/Container/Constraints.cpp@ 12016

Last change on this file since 12016 was 12016, checked in by Eric.Larour, 13 years ago

Took out all specific parts of the code that were supposedly PARALLEL.

File size: 1.2 KB
Line 
1/*
2 * \file Constraints.c
3 * \brief: implementation of the Constraints class, derived from DataSet class
4 */
5
6/*Headers: {{{1*/
7#ifdef HAVE_CONFIG_H
8 #include <config.h>
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
23using namespace std;
24/*}}}*/
25
26/*Object constructors and destructor*/
27/*FUNCTION Constraints::Constraints(){{{1*/
28Constraints::Constraints(){
29 enum_type=ConstraintsEnum;
30 return;
31}
32/*}}}*/
33/*FUNCTION Constraints::~Constraints(){{{1*/
34Constraints::~Constraints(){
35 return;
36}
37/*}}}*/
38
39/*Numerics: */
40/*FUNCTION Constraints::NumberOfConstraints{{{1*/
41int Constraints::NumberOfConstraints(void){
42
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)*/
50 MPI_Reduce(&localconstraints,&numberofconstraints,1,MPI_INT,MPI_SUM,0,MPI_COMM_WORLD );
51 MPI_Bcast(&numberofconstraints,1,MPI_INT,0,MPI_COMM_WORLD);
52
53 return numberofconstraints;
54}
55/*}}}*/
Note: See TracBrowser for help on using the repository browser.