NORMA (1158464), страница 4

Файл №1158464 NORMA (Раздаточные материалы) 4 страницаNORMA (1158464) страница 42019-09-18СтудИзба
Просмтор этого файла доступен только зарегистрированным пользователям. Но у нас супер быстрая регистрация: достаточно только электронной почты!

Текст из файла (страница 4)

Newsquare: Square / AxiisK+RIGHT(3), L=50...80.

If the list of modifications has more than one element modifications declared in that list act on modificated domain in writing order (from the left to the right).

Besides rectangular domain declarations in NORMA there is a possibility of diagonal domain settings by the superposition of conditions on previously declared domain (rectangular or diagonal).

Diagonal domain is defined by conditions on indexes of some previously declared domain D. It consists of domain D points in which the conditions are true. E.g.

KL: ( (k=1..10) ; (l=1..10) ) . Diagonal: KL/ k=l.

set domain Diagonal consists of the points (k=1, l=1), (k=2, l=2), ...,(k=10, l=10).

Indexes on variables used in the notation of conditions on indexes can be either internal (from D domains set of indexes) or external (see 5.2.3.2).

The valid form of conditions on indexes defines statically the points of diagonal domain (it is also possible for rectangular domain). That’s rectangular and diagonal domain are static objects. They differ from conditional domain described below.

5.1.1.2. Declaration of conditional domain

declaration-of-conditional-domain :

name-conditional domain , name-conditional-domain : name-domain / condition-on-domain

Besides static domains in NORMA you can set conditional domain consists of the points from index space. Their number and coordinates can change depending on fulfilment or nonfulfilment of conditions on domain.

Here we describe how you can set conditional domain. Previously declared domain D is divided into two disjoint subdomains D1 and D2. The first subdomain consists of the points where the conditions on domain are true, the second one - where they are false. Besides D1 D2 = D, D1 D2 = .

E.g. set domains:

Domain: ( ( i=2..n) ) ; ( j=1..m ) ) .

Domain1,Domain2: Domain / x+y[ i-1, j ] - z[ j+1 ] > 0 .

This declaration defines division of initial domain Domain into domains Domain1 and Domain2 and

Domain1 Domain2 = Domain, Domain1 Domain2 = .

Domain1 consists of the points of Domain in which the condition x+y[i-1, j] - z[j +1] > 0 is true. Domain2 - where the condition is false.

Indexes of the variables used in the conditions notation can be either internal (from D domains set of indexes) or external (5.2.3.2).

Program fragment defining conditional domains Bf2PI and BfNot2PI, and their further division into smaller domains (first domain BfNot2PI is divided into two conditional domains Nodes and NotNodes, and then domain NotNodes is divided into two conditional domains DomainTrue, DomainFalse ) is given below :

DOMAIN PARAMETERS N=3, NV=3 .

Bnu : (Nu=0..2*N) . Bf : ( II=0..(2*N+1) * (2*NV+1 ) . BfNu : (Bf ; Nu) .

Bf2PI , BfNot2PI : BfNu / II=(2*N+1)*(2*NV+! ) AND NU=0 .

Nodes , NotNodes : BfNot2PI / ABS (BTNodes -BT ) < 0.0001 .

DomainTrue , DomainFalse : Nodes / ABS(BTNu - BTNodes ) < 0.0001 .

VARIABLE BT, BTNodes DEFINED ON Bf DOUBLE .

VARIABLE BTNu DEFINED ON Bnu DOUBLE .

5.1.2. Declaration of domains’ indexes

declaration-of-domain-indexes :

INDEX list-name-index

The order of the index space directions in domain’s declaration isn’t fixed (or fixed arbitrarily, that is the same for user ). If the order of index space directions is important (e.g. consistency of directions is needed for using the same variables on the same domains in the different parts) it may be set by declaration of domains’ indexes. The order of index space directions is the same as the order of index’s names enumeration in declaration INDEX ( from the left to the right ).

We consider call of part B from part A with variable X values communication from A to B. Variable X is defined on SquareInA domain:

PART A.

BEGIN

INDEX k,l .

SquareInA.: (AxisK: (k=1..5) ;AxisL: (l=1..10) ).

VARIABLE X DEFINED ON SquareInA.

COMPUTE B( X ON SquareInA).

END PART

PART B. X

BEGIN

INDEX i,j.

SquareInB : (AxisK: (i=1..5) ; AxisL: (j=1..10) ) .

VARIABLE X DEFINED ON SquareInB.

END PART

Declarations INDEX k,l and INDEX i,j make correspondence between indexes: i~k,j~l . In other words the values of X variable are considered in the one and the same way in both parts. If INDEX i,j declaration from part B is substituted to INDEX j,i the values on corresponding directions will be inconsistent: 5 10, 10 5.

5.1.3. Declaration of variables

declaration-of-scalar-variables :

VARIABLE list-name-scalar [ type ]

declaration-of-variables-on-domains :

VARIABLE list-name-variable-on-domain DEFINED ON name-unconditional-domain [ type ]

type :

{ REAL, INTEGER, DOUBLE }

Scalar variables and variables on domain are arithmetical variables. There is a unique name and the type of variable in the declaration corresponding to every arithmetical variable. The types of variables are REAL, INTEGER or DOUBLE (default REAL).

It is an example of scalar‘s declaration:

VARIABLE Alpha, X, H. VARIABLE IJK, Z INTEGER.

Every variable on domain is connected with the domain in the declaration. This domain defines index’s names, which can be used in index expressions in calls to this variable ( the order of index expressions isn’t important).There is no special declaration for indexes, they are introduced in domain’s declarations.

Square: (AxisK: (k=1..5) ; AxisL: (l=1..5) ).

VARIABLE First,Last DEFINED ON Square.

VARIABLE SingleK DEFINED ON AxisK DOUBLE.

VARIABLE SingleL DEFINED ON AxisL INTEGER.

Given declarations define variables First, Last on domain Square. It means that these variables can have corresponding indexes k and l in the index expressions. Variables SingleK and SingleL are defined on domains AxisK and AxisL. It means that they can have corresponding indexes k and l in the index expressions. In this call First[k-1,l+1] and First[l+1,k-1] are equivalent (5.1.2).

In call to variable on domain the rule of default indexes setting is performed: index expressions which coincide with index name may be omitted. E.g. notations First[k,l], First[k], First[l], First for variable First are equivalent.

If some index is set by constant (constant expression) you must declare which index direction this constant concerns to, e.g. First[k=5,l-1]. If you need to link two directions by some formula you must do it in explicit way, e.g. diagonal elements of the matrix First may be defined as First[k,l=k] or First[l=k] or First[k=l].

5.1.4. Declaration of domain parameters

declaration-of-domain-parameters :

DOMAIN PARAMETERS list-prescription

prescription :

name-domain-parameter = int-const

Range boundaries in domain’s declaration may be set by parameters of domain (in implicit way). The values of these parameters must be defined in the part, in the domain parameters declaration. E.g.

DOMAIN PARAMETERS M=3, J=90, DomainLeftBoundParameter=15.

Parameters of domain may be included into arithmetical expressions and constant expressions.

5.1.5. Declaration of input and output

declaration-of-input :

INPUT list-input-scalar

INPUT input-on-domain

input-scalar :

name-scalar [ attributes ]

input-on-domain :

list input-output-variable ON unconditional domain

input-output-variable :

name-variable-on-domain [ attributes ]

declaration-of-output :

OUTPUT list-output-scalar

OUTPUT output-on-domain

output-scalar :

name-scalar [ attributes ]

output-on-domain :

list- input-output-variable ON domain

attributes :

( list-attribute )

attribute :

STR( int-constant )

string

ORDER( list-name-index )

FILE = ' file-name '

ALL

format

format :

I int-constant

{ F,E,D } int-constant . int-constant

Declaration of input (output) variables means that all the variables mentioned in the list of input (output) are liable to input (output). E.g. declarations

B1 , B2 : B / Z<Eps.

INPUT Velocity ON A. OUTPUT Tau ON B1.

INPUT X, ALPHA.

are requests for input of scalar X, ALPHA values, value of Velocity in all the points of A domain and output Tau in all the points of B1 domain where condition Z<Eps is fulfilled.

The order of variables input (output) isn’t set, it is defined during the translation. Minimal piece of information which is input (output) as a whole is scalar or variable on domain. Attributes may control input (output) of these elements.

Attributes act on the variable declared before. E.g. declaration

INPUT R1,R2 (FILE ='myfile') ON Grid.

is a request for input of variables R2 values on Grid domain (in other words for all the index values of this domain) from file myfile.dat and R1 values from file norma.dat (default file name).

Attributes help to control the form of input and output data and bind data with input and output files:

STR(n) sets the skip of n-1 lines;

‘string’ set output of the textual constant string;

ORDER defines the order of index changing for input; the highest index is the first from the right, the lowest is the first from the left; for one value of every high index the low index has run over all their values ;

FILE sets the name of input or output files; the method of setting file name is defined during realization ( in general input file has a default name with .dat extension; when you set file name this extension may be omitted; if attribute FILE isn’t given input is carried out from file norma.dat and output to display screen );

ALL sets output variable’s name and its coordinates (index values) for every value of variable on domain.

format sets format for numerical values for input and output and corresponds to format specificators I, F, E, D in the FORTRAN language. There are default formats: E15.8 for variables of REAL type, D15.8 for variables of DOUBLE type and I5 for variables of INTEGER type.

For input variables only attributes of format and FILE type are allowed.

Here is an example of input variables declaration :

Характеристики

Список файлов учебной работы

Свежие статьи
Популярно сейчас
А знаете ли Вы, что из года в год задания практически не меняются? Математика, преподаваемая в учебных заведениях, никак не менялась минимум 30 лет. Найдите нужный учебный материал на СтудИзбе!
Ответы на популярные вопросы
Да! Наши авторы собирают и выкладывают те работы, которые сдаются в Вашем учебном заведении ежегодно и уже проверены преподавателями.
Да! У нас любой человек может выложить любую учебную работу и зарабатывать на её продажах! Но каждый учебный материал публикуется только после тщательной проверки администрацией.
Вернём деньги! А если быть более точными, то автору даётся немного времени на исправление, а если не исправит или выйдет время, то вернём деньги в полном объёме!
Да! На равне с готовыми студенческими работами у нас продаются услуги. Цены на услуги видны сразу, то есть Вам нужно только указать параметры и сразу можно оплачивать.
Отзывы студентов
Ставлю 10/10
Все нравится, очень удобный сайт, помогает в учебе. Кроме этого, можно заработать самому, выставляя готовые учебные материалы на продажу здесь. Рейтинги и отзывы на преподавателей очень помогают сориентироваться в начале нового семестра. Спасибо за такую функцию. Ставлю максимальную оценку.
Лучшая платформа для успешной сдачи сессии
Познакомился со СтудИзбой благодаря своему другу, очень нравится интерфейс, количество доступных файлов, цена, в общем, все прекрасно. Даже сам продаю какие-то свои работы.
Студизба ван лав ❤
Очень офигенный сайт для студентов. Много полезных учебных материалов. Пользуюсь студизбой с октября 2021 года. Серьёзных нареканий нет. Хотелось бы, что бы ввели подписочную модель и сделали материалы дешевле 300 рублей в рамках подписки бесплатными.
Отличный сайт
Лично меня всё устраивает - и покупка, и продажа; и цены, и возможность предпросмотра куска файла, и обилие бесплатных файлов (в подборках по авторам, читай, ВУЗам и факультетам). Есть определённые баги, но всё решаемо, да и администраторы реагируют в течение суток.
Маленький отзыв о большом помощнике!
Студизба спасает в те моменты, когда сроки горят, а работ накопилось достаточно. Довольно удобный сайт с простой навигацией и огромным количеством материалов.
Студ. Изба как крупнейший сборник работ для студентов
Тут дофига бывает всего полезного. Печально, что бывают предметы по которым даже одного бесплатного решения нет, но это скорее вопрос к студентам. В остальном всё здорово.
Спасательный островок
Если уже не успеваешь разобраться или застрял на каком-то задание поможет тебе быстро и недорого решить твою проблему.
Всё и так отлично
Всё очень удобно. Особенно круто, что есть система бонусов и можно выводить остатки денег. Очень много качественных бесплатных файлов.
Отзыв о системе "Студизба"
Отличная платформа для распространения работ, востребованных студентами. Хорошо налаженная и качественная работа сайта, огромная база заданий и аудитория.
Отличный помощник
Отличный сайт с кучей полезных файлов, позволяющий найти много методичек / учебников / отзывов о вузах и преподователях.
Отлично помогает студентам в любой момент для решения трудных и незамедлительных задач
Хотелось бы больше конкретной информации о преподавателях. А так в принципе хороший сайт, всегда им пользуюсь и ни разу не было желания прекратить. Хороший сайт для помощи студентам, удобный и приятный интерфейс. Из недостатков можно выделить только отсутствия небольшого количества файлов.
Спасибо за шикарный сайт
Великолепный сайт на котором студент за не большие деньги может найти помощь с дз, проектами курсовыми, лабораторными, а также узнать отзывы на преподавателей и бесплатно скачать пособия.
Популярные преподаватели
Добавляйте материалы
и зарабатывайте!
Продажи идут автоматически
6508
Авторов
на СтудИзбе
302
Средний доход
с одного платного файла
Обучение Подробнее